/* Colours taken from the paintings: rice-paper ivory, ink, the terracotta of
   the orange dress, and the jade green of the meadows. */
:root {
  --paper: #f6f1e7;
  --paper-deep: #efe7d8;
  --ink: #2b2620;
  --muted: #6e6457;
  --line: #ddd2bf;
  --accent: #b4532a;
  --jade: #3e6a58;
  --night: #1c1a17;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --max: 1280px;
  --on-paper: #fffdf9;      /* inputs and mats */
  --body-text: #463f36;
  --grain-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.42 0 0 0 0 0.34 0 0 0 0 0.24 0 0 0 0.6 -0.24'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* "Exhibition" mode: the same page by gallery lamplight. */
:root[data-theme="dark"] {
  --paper: #161412;
  --paper-deep: #1d1a17;
  --ink: #efe8dc;
  --muted: #a89d8c;
  --line: #34302a;
  --accent: #dc8f66;
  --jade: #86bda5;
  --on-paper: #211e1a;
  --body-text: #cfc6b8;
  --grain-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.9 0 0 0 0 0.8 0 0 0 0 0.65 0 0 0 0.35 -0.15'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background-color: var(--paper);
  /* A faint paper grain (SVG noise, about 1 KB). Sits behind everything, never over the paintings. */
  background-image: var(--grain-img);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 50; }
.skip:focus { left: 1rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 2rem;
  padding: 1rem var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.brand { font-family: var(--serif); font-style: italic; font-size: 1.9rem; text-decoration: none; line-height: 1; }
.theme-toggle {
  display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  border: 1px solid var(--line); background: var(--paper); color: var(--muted); transition: color .2s, border-color .2s;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.nav { display: flex; gap: 2rem; margin-left: auto; }
.nav + .theme-toggle { margin-left: -.75rem; }
.nav a { text-decoration: none; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); transition: color .2s; }
.nav a:hover { color: var(--ink); }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--paper); }
.lang button {
  border: 0; background: none; padding: .3rem .8rem; border-radius: 999px;
  font-size: .75rem; letter-spacing: .1em; font-weight: 500; color: var(--muted);
  transition: background .25s, color .25s;
}
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* Hero */
.hero {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: center;
  padding: clamp(2.5rem, 7vw, 6rem) var(--gutter) clamp(4rem, 9vw, 8rem);
}
.eyebrow { font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); margin: 0 0 1.5rem; font-weight: 400; }
.hero h1 { font-size: clamp(2.6rem, 5.6vw, 4.9rem); font-weight: 400; }
.lead { color: var(--muted); max-width: 32rem; margin: 1.75rem 0 2.5rem; font-size: 1.1rem; }
.button {
  display: inline-flex; align-items: center; gap: .75rem;
  padding: .95rem 1.8rem; border: 1px solid var(--ink); border-radius: 999px;
  text-decoration: none; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 400;
  transition: background .3s, color .3s;
}
.button::after { content: "→"; transition: transform .3s; }
.button:hover { background: var(--ink); color: var(--paper); }
.button:hover::after { transform: translateX(4px); }
.hero-art { margin: 0; }
.hero-frame {
  display: block; width: 100%; padding: clamp(.75rem, 1.6vw, 1.25rem); border: 0;
  background: #fbf8f2; box-shadow: 0 1px 2px rgba(43,38,32,.08), 0 30px 60px -25px rgba(43,38,32,.35);
  transform: rotate(1.2deg); transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.hero-frame:hover { transform: rotate(0deg) scale(1.01); }
.hero-frame img { width: 100%; max-height: 64vh; object-fit: cover; background: var(--paper-deep); opacity: 0; transition: opacity .8s; }
.hero-frame img.loaded { opacity: 1; }
.hero-art figcaption { margin-top: 1.4rem; font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--muted); text-align: right; }

/* Section headings */
.section-head { text-align: center; max-width: 40rem; margin: 0 auto 2.5rem; }
.section-head h2, .about h2, .contact h2 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); font-weight: 400; }
.section-head p { color: var(--muted); margin: .75rem 0 0; }
.section-head h2::after, .contact h2::after {
  content: ""; display: block; width: 3rem; height: 1px; background: var(--accent); margin: 1.25rem auto 0;
}

/* Gallery */
.gallery { max-width: var(--max); margin: 0 auto; padding: clamp(3rem, 7vw, 6rem) var(--gutter); border-top: 1px solid var(--line); }
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-bottom: 3rem; }
.filters button {
  border: 1px solid var(--line); background: none; padding: .45rem 1.1rem; border-radius: 999px;
  font-size: .85rem; color: var(--muted); transition: all .25s;
}
.filters button:hover { border-color: var(--ink); color: var(--ink); }
.filters .count { opacity: .6; margin-left: .25em; font-variant-numeric: tabular-nums; }
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.grid { list-style: none; margin: 0; padding: 0; columns: 3 320px; column-gap: clamp(1.25rem, 2.5vw, 2.5rem); }
.grid li { break-inside: avoid; margin-bottom: clamp(1.75rem, 3vw, 3rem); }
.grid li[hidden] { display: none; }
.card { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; }
.card-frame { position: relative; overflow: hidden; background: var(--ph, var(--paper-deep)); box-shadow: 0 18px 40px -28px rgba(43,38,32,.55); }
.card-frame img { width: 100%; transition: transform 1.2s cubic-bezier(.2,.7,.2,1), opacity .8s; opacity: 0; }
.card-frame img.loaded { opacity: 1; }
.card:hover .card-frame img { transform: scale(1.035); }
.card-frame::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(28,26,23,.35), transparent 45%);
  opacity: 0; transition: opacity .5s;
}
.card:hover .card-frame::after { opacity: 1; }
.card-title { display: block; font-family: var(--serif); font-size: 1.45rem; margin-top: 1rem; line-height: 1.2; }
.card-sold { color: var(--accent); }
.card-meta { display: block; font-size: .82rem; color: var(--muted); margin-top: .2rem; letter-spacing: .02em; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* About */
.about {
  background-color: var(--paper-deep);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2rem, 6vw, 6rem); align-items: center;
  padding: clamp(4rem, 9vw, 8rem) max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
}
.about-art img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; box-shadow: 0 30px 60px -30px rgba(43,38,32,.5); }
.about-text h2 { margin-bottom: 1.75rem; }
.about-text p { margin: 0 0 1.2rem; color: var(--body-text); }
.about blockquote {
  margin: 2.25rem 0 0; padding-left: 1.5rem; border-left: 1px solid var(--accent);
  font-family: var(--serif); font-style: italic; font-size: 1.55rem; line-height: 1.4; color: var(--ink);
}
.about blockquote:empty { display: none; }

/* Contact */
.contact { text-align: center; max-width: 46rem; margin: 0 auto; padding: clamp(4rem, 9vw, 8rem) var(--gutter); }
.contact-text { color: var(--muted); margin: 1.5rem auto 2.75rem; max-width: 34rem; }
.contact-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 2rem 4rem; }
.contact-links > div { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.label { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.contact-links a { font-family: var(--serif); font-size: 1.5rem; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .35s; }
.contact-links a:hover { background-size: 100% 1px; }
.contact-links a[hidden], .contact-links[hidden], .or-direct[hidden] { display: none; }

/* Contact form */
.contact-form { display: grid; gap: 1rem; text-align: left; max-width: 36rem; margin: 0 auto 3rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.contact-form label { display: grid; gap: .35rem; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.contact-form input, .contact-form textarea {
  font: 300 1rem/1.5 var(--sans); color: var(--ink); background: var(--on-paper);
  border: 1px solid var(--line); border-radius: 10px; padding: .75rem .9rem; width: 100%;
  text-transform: none; letter-spacing: 0; transition: border-color .2s;
}
.contact-form textarea { resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); }
.contact-form .button { justify-self: center; background: transparent; cursor: pointer; }
.contact-form .button:hover { background: var(--ink); color: var(--paper); }
.contact-form .button:disabled { opacity: .6; cursor: progress; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { text-align: center; margin: 0; min-height: 1.5em; font-size: .95rem; }
.form-status.ok { color: var(--jade); }
.form-status.err { color: #a33a2a; }
.or-direct { display: block; margin-bottom: 1.25rem; }

.site-footer { border-top: 1px solid var(--line); padding: 2rem var(--gutter); text-align: center; font-size: .8rem; color: var(--muted); }
.site-footer p { margin: 0; }
.noscript { text-align: center; color: var(--muted); }

/* Lightbox */
.lightbox {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--night); color: #efe8dc;
  transition: background-color .6s ease;   /* the backdrop takes a tint of each painting */
}
.lightbox::backdrop { background: var(--night); }
.lightbox[open] { animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; } }
.lb-inner { position: relative; height: 100%; display: grid; grid-template-columns: 1fr minmax(18rem, 24rem); }
.lb-stage {
  display: flex; align-items: center; justify-content: center; padding: clamp(1rem, 4vw, 3.5rem); min-height: 0;
  container-type: size; overflow: hidden; --mat: 0px; --bw: 0px;
}
.lb-art {
  --fx: calc(2 * (var(--mat) + var(--bw)));   /* room taken by a preview frame */
  position: relative; display: block; line-height: 0; cursor: zoom-in;
  padding: var(--mat); border: var(--bw) solid transparent;
  box-shadow: 0 30px 80px rgba(0,0,0,.5); transition: transform .45s cubic-bezier(.2,.7,.2,1), opacity .3s;
  transform-origin: var(--ox, 50%) var(--oy, 50%);
}
.lb-art img { display: block; width: auto; height: auto; max-width: calc(100cqw - var(--fx)); max-height: calc(100cqh - var(--fx)); user-select: none; -webkit-user-drag: none; }
.lb-art.swapping { opacity: 0; }
.lb-stage.zoomed .lb-art { transform: scale(2.2); cursor: zoom-out; transition: transform .45s cubic-bezier(.2,.7,.2,1); }
.lb-stage.zoomed .lb-art.tracking { transition: none; }
.lb-stage.framed { --mat: clamp(10px, 2.6cqmin, 30px); --bw: clamp(7px, 1.6cqmin, 18px); }
.lb-stage.framed .lb-art { background: #f6f2ea; }
.lb-stage.framed.oak .lb-art { border-color: #c79c66; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15), 0 30px 80px rgba(0,0,0,.5); }
.lb-stage.framed.walnut .lb-art { border-color: #4b3426; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35), 0 30px 80px rgba(0,0,0,.55); }
.lb-stage.framed .lb-art img { box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.lb-info { display: flex; flex-direction: column; justify-content: center; padding: 3rem 2.5rem; border-left: 1px solid rgba(255,255,255,.08); overflow-y: auto; }
.lb-count { font-size: .75rem; letter-spacing: .2em; color: #a89d8c; margin: 0 0 1rem; }
.lb-info h3 { font-size: clamp(2rem, 3vw, 2.6rem); font-weight: 400; color: #fff; }
.lb-meta { color: #c98a63; font-size: .88rem; margin: .75rem 0 1.5rem; }
.lb-desc { color: #d6cdbf; margin: 0; }
.lb-price { margin: 1.25rem 0 0; font-family: var(--serif); font-size: 1.5rem; color: #fff; }
.lb-price.sold { font-family: var(--sans); font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: #c98a63; }
.lb-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.75rem; }
.lb-ask, .lb-share {
  display: inline-flex; align-items: center; padding: .7rem 1.3rem; border-radius: 999px;
  font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; transition: background .25s, color .25s;
}
.lb-ask { background: #efe8dc; color: var(--night); }
.lb-ask:hover { background: #fff; }
.lb-share { background: none; border: 1px solid rgba(255,255,255,.25); color: #efe8dc; }
.lb-share:hover { border-color: rgba(255,255,255,.6); }
.lb-tools { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
.lb-tool {
  background: none; border: 0; padding: .35rem .15rem; color: #a89d8c; font-size: .8rem; letter-spacing: .04em;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.25); margin-right: .9rem;
}
.lb-tool:hover, .lb-tool[aria-pressed="true"] { color: #fff; }
.lb-tool[hidden] { display: none; }
.lb-nav { display: flex; gap: .75rem; margin-top: 2.5rem; }
.lb-btn, .lb-close {
  width: 3rem; height: 3rem; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: none; color: #fff;
  font-size: 1.2rem; display: grid; place-items: center; transition: background .25s, border-color .25s;
}
.lb-btn:hover, .lb-close:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.6); }
.lb-close { position: absolute; top: 1.25rem; right: 1.25rem; font-size: 1.6rem; }

/* Responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 32rem; margin: 0 auto; width: 100%; }
  .hero-frame img { max-height: 60vh; }
  .about { grid-template-columns: 1fr; }
  .about-art { max-width: 26rem; }
  .lb-inner { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .lb-info { border-left: 0; border-top: 1px solid rgba(255,255,255,.08); padding: 1.25rem 1.5rem 1.75rem; justify-content: flex-start; max-height: 42vh; }
  .lb-info h3 { font-size: 1.7rem; }
  .lb-meta { margin: .4rem 0 .8rem; }
  .lb-nav { margin-top: 1.25rem; }
  .lb-actions { margin-top: 1rem; }
  .lb-tools { margin-top: .5rem; }
  .lb-price { margin-top: .75rem; font-size: 1.25rem; }
  .lb-close { background: rgba(28,26,23,.6); }
}
@media (max-width: 640px) {
  .site-header { gap: 1rem; flex-wrap: wrap; padding-top: .75rem; padding-bottom: .75rem; }
  .brand { font-size: 1.6rem; }
  .nav + .theme-toggle { margin-left: auto; }
  .lang { margin-left: 0; }
  .nav { order: 3; width: 100%; margin: 0; justify-content: space-between; gap: 1rem; }
  .grid { columns: 1; }
  .form-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
  .card-frame img, .hero-frame img { opacity: 1; }
}
