/* Field Guide concept for Mia van Wyk.
   The page ground is sampled from her own canvases (the cool gesso grey of
   "The Sacred in the Ordinary"), so the paintings sit on it like plates. */
:root {
  --ground: #d3d3ce;      /* gesso: page */
  --ground-deep: #c3c3be; /* gesso in shadow: panels, viewer */
  --paper: #e4e4df;       /* lightest wash, used sparingly */
  --ink: #23241f;         /* graphite */
  --ink-soft: #4f514a;    /* pencil */
  --rule: #a9aaa3;
  --malachite: #1c5a4b;   /* sunbird green: links, "for sale" */
  --disa: #9c2f2a;        /* disa red: only for sold marks */

  --serif: "IM Fell English", "Iowan Old Style", Georgia, serif;
  --sans: "Albert Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1360px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  font-feature-settings: "kern", "liga";
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--malachite); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--malachite); outline-offset: 3px; }
button { font: inherit; color: inherit; }
i, em { font-style: italic; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 30; }
.skip:focus { left: 8px; }

.ghost {
  background: none; border: 1px solid var(--rule); border-radius: 2px;
  padding: 6px 14px; font: 500 14px/1.4 var(--sans); cursor: pointer; color: var(--ink);
}
.ghost:hover { border-color: var(--ink); }
.ghost:disabled { opacity: .35; cursor: default; }

/* ---------- masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  padding: 14px var(--gutter);
  background: color-mix(in srgb, var(--ground) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid transparent;
}
.masthead.scrolled { border-bottom-color: var(--rule); }
.wordmark { font: 400 24px/1 var(--serif); color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.masthead nav { display: flex; gap: clamp(12px, 2vw, 28px); flex-wrap: wrap; justify-content: flex-end; }
.masthead nav a { color: var(--ink-soft); text-decoration: none; font-size: 15px; }
.masthead nav a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- hero ---------- */
.hero {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--gutter); align-items: end;
  padding: clamp(24px, 6vh, 72px) var(--gutter) clamp(48px, 10vh, 110px);
  min-height: min(calc(100svh - 56px), 980px);
}
.hero-text { padding-bottom: min(8vh, 80px); }
.hero h1 {
  font: 400 clamp(64px, 10.5vw, 168px)/.86 var(--serif);
  letter-spacing: -.02em; margin: 0 0 .25em;
}
.lede { font: italic 400 clamp(21px, 2vw, 28px)/1.35 var(--serif); max-width: 22ch; margin: 0 0 1.2em; }
.hero-meta { color: var(--ink-soft); margin: 0; font-size: 15px; }

.hero-plate { margin: 0; justify-self: center; }
.hero-plate img { max-height: min(78svh, 820px); width: auto; }
.hero-plate figcaption, .plate figcaption { font-size: 14px; color: var(--ink-soft); margin-top: 12px; line-height: 1.45; }
.hero-plate figcaption i, .plate .t { font-family: var(--serif); font-size: 18px; color: var(--ink); }

.plate-btn { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; }

/* ---------- section heads ---------- */
.section-head { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--gutter); align-items: end; }
.section-head h2, .about h2, .contact h2 { font: 400 clamp(40px, 5.4vw, 80px)/.95 var(--serif); letter-spacing: -.015em; margin: 0; }
.section-head p { margin: 0; max-width: 46ch; color: var(--ink-soft); }

/* ---------- exhibition strip ---------- */
.exhibition { padding: clamp(56px, 10vh, 120px) 0; border-top: 1px solid var(--rule); }
.strip-wrap { margin-top: clamp(32px, 5vh, 56px); }
.strip {
  list-style: none; margin: 0; padding: 0 var(--gutter) 8px;
  display: flex; gap: clamp(28px, 4vw, 64px); align-items: flex-end;
  overflow-x: auto; scroll-snap-type: x proximity; scroll-padding: 0 var(--gutter);
  scrollbar-width: thin; scrollbar-color: var(--rule) transparent;
}
.strip li { flex: none; scroll-snap-align: start; }
.strip .plate img { height: clamp(260px, 52vh, 500px); width: auto; }
.strip .plate figcaption { max-width: 32ch; }
.strip-controls { display: flex; gap: 8px; padding: 20px var(--gutter) 0; max-width: var(--max); margin: 0 auto; }

.plate { margin: 0; }
.plate .m { display: block; }
.status { display: inline-block; margin-top: 2px; font-size: 13px; }
.status.available { color: var(--malachite); }
.status.sold { color: var(--ink-soft); }
.status.available::before, .status.sold::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 6px; vertical-align: 1px; background: currentColor;
}
.status.sold::before { background: var(--disa); }

/* ---------- field guide ---------- */
.guide { padding: clamp(56px, 10vh, 120px) 0; border-top: 1px solid var(--rule); }
.guide-grid {
  max-width: var(--max); margin: clamp(32px, 5vh, 56px) auto 0; padding: 0 var(--gutter);
  display: grid; grid-template-columns: minmax(200px, 3fr) minmax(0, 9fr); gap: var(--gutter);
}
.kinds { position: sticky; top: 76px; align-self: start; }
.kinds ul { list-style: none; margin: 0 0 24px; padding: 0; }
.kinds button {
  display: flex; width: 100%; align-items: baseline; justify-content: space-between; gap: 12px;
  background: none; border: 0; padding: 5px 0; cursor: pointer; text-align: left;
  font: 400 clamp(22px, 2vw, 30px)/1.15 var(--serif); color: var(--ink-soft);
}
.kinds button .n { font: 400 14px/1 var(--sans); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.kinds button:hover { color: var(--ink); }
.kinds button[aria-pressed="true"] { color: var(--ink); font-style: italic; }
.kinds button[aria-pressed="true"] .n { color: var(--ink); }
.only-available { display: flex; gap: 8px; align-items: center; font-size: 15px; cursor: pointer; }
.only-available input { accent-color: var(--malachite); width: 16px; height: 16px; }

.kind-note { margin: 0 0 24px; color: var(--ink-soft); max-width: 60ch; min-height: 1.6em; }
.plates { list-style: none; margin: 0; padding: 0; columns: 3 220px; column-gap: clamp(20px, 3vw, 44px); }
.plates li { break-inside: avoid; margin: 0 0 clamp(28px, 4vw, 48px); }
.plates .plate img { width: 100%; }
.plates .empty { columns: 1; color: var(--ink-soft); }

.index { max-width: var(--max); margin: clamp(48px, 8vh, 96px) auto 0; padding: 0 var(--gutter); }
.index summary {
  cursor: pointer; font: 400 clamp(26px, 2.6vw, 36px)/1.2 var(--serif);
  list-style: none; display: inline-flex; gap: 12px; align-items: baseline;
}
.index summary::-webkit-details-marker { display: none; }
.index summary::after { content: "+"; font-family: var(--sans); font-size: 22px; color: var(--ink-soft); }
.index[open] summary::after { content: "\2212"; }
.index-body { columns: 4 200px; column-gap: 40px; margin-top: 28px; font-size: 15px; line-height: 1.5; }
.index-body h3 { font: 400 26px/1 var(--serif); margin: 14px 0 6px; break-after: avoid; }
.index-body ul { list-style: none; padding: 0; margin: 0 0 8px; }
.index-body li { break-inside: avoid; display: flex; justify-content: space-between; gap: 10px; }
.index-body li::before { content: none; }
.index-body button { background: none; border: 0; padding: 1px 0; cursor: pointer; text-align: left; color: var(--ink); }
.index-body button:hover { text-decoration: underline; }
.index-body .y { color: var(--ink-soft); font-variant-numeric: tabular-nums; flex: none; }

/* ---------- statement ---------- */
.words { padding: clamp(72px, 14vh, 160px) var(--gutter); background: var(--paper); }
.words blockquote { max-width: 760px; margin: 0 auto; }
.words .first { font: 400 clamp(32px, 4.2vw, 58px)/1.08 var(--serif); margin: 0 0 1em; letter-spacing: -.01em; }
.words .rest p { font: 400 clamp(19px, 1.6vw, 22px)/1.6 var(--serif); margin: 0 0 1em; max-width: 60ch; }
.words footer { margin-top: 2em; color: var(--ink-soft); font-size: 15px; }

/* ---------- about ---------- */
.about {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(72px, 12vh, 140px) var(--gutter);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--gutter) var(--gutter);
}
.about-photo img { width: 100%; }
.about-text h2 { margin-bottom: .5em; }
.about-text p { max-width: 62ch; margin: 0 0 1em; }
.press { margin: 32px 0 0; display: grid; grid-template-columns: 120px 1fr; gap: 20px; align-items: center; }
.press figcaption { color: var(--ink-soft); font-size: 15px; }
.cv { grid-column: 1 / -1; border-top: 1px solid var(--rule); padding-top: 40px; }
.cv h3 { font: 400 30px/1.1 var(--serif); margin: 0 0 20px; }
.cv h3 + p { max-width: 62ch; }
.cv-list { list-style: none; margin: 0 0 48px; padding: 0; columns: 2 420px; column-gap: var(--gutter); }
.cv-list li { break-inside: avoid; display: grid; grid-template-columns: 4.2em 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid color-mix(in srgb, var(--rule) 55%, transparent); font-size: 15px; line-height: 1.45; }
.cv-list .yr { font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.cv-list .ttl { font-family: var(--serif); font-size: 18px; }
.cv-list .solo { color: var(--malachite); font-size: 13px; margin-left: 6px; }
.cv-list .where { color: var(--ink-soft); display: block; }

/* ---------- contact ---------- */
.contact { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) clamp(56px, 10vh, 120px); }
.contact::before { content: ""; display: block; border-top: 1px solid var(--rule); margin-bottom: clamp(56px, 10vh, 120px); }
.contact h2 { margin-bottom: .4em; }
.contact > p { max-width: 52ch; }
.contact-lines { font: 400 clamp(24px, 3vw, 40px)/1.3 var(--serif); }
.contact-lines a { color: var(--ink); }
.contact-lines a:hover { color: var(--malachite); }
.social { display: flex; gap: 24px; }
.commission-note { color: var(--ink-soft); }

.concept { padding: 24px var(--gutter) 40px; color: var(--ink-soft); font-size: 14px; max-width: var(--max); margin: 0 auto; }

/* ---------- viewer ---------- */
.viewer {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--ground-deep); color: var(--ink);
}
.viewer::backdrop { background: var(--ground-deep); }
.viewer[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.viewer-stage { display: grid; place-items: center; padding: clamp(16px, 4vh, 48px) var(--gutter) 0; min-height: 0; }
.viewer-stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.viewer-bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding: 18px var(--gutter) 22px; flex-wrap: wrap; }
.viewer-caption p { margin: 0; }
.v-title { font: 400 26px/1.2 var(--serif); }
.v-meta { color: var(--ink-soft); font-size: 15px; }
.v-act { margin-top: 6px !important; font-size: 15px; }
.viewer-nav { display: flex; gap: 8px; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .masthead { flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 12px; padding-bottom: 10px; }
  .masthead nav { justify-content: flex-start; gap: 4px 16px; }
  .masthead nav a { font-size: 14px; }
  .hero, .section-head, .about { grid-template-columns: 1fr; }
  .hero { min-height: 0; align-items: start; }
  .hero-text { padding-bottom: 0; }
  .hero-plate img { max-height: min(70svh, 640px); }
  .section-head { gap: 16px; }
  .guide-grid { grid-template-columns: 1fr; }
  .kinds { position: static; }
  .kinds ul { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 16px; }
  .kinds button { width: auto; font-size: 22px; }
  .plates { columns: 2 140px; }
  .press { grid-template-columns: 90px 1fr; }
}
@media (max-width: 420px) {
  body { font-size: 16px; }
  .masthead nav a:nth-child(3) { display: none; }
}
