/* ============================================================
   Serica Jones — artist site
   Warm + handmade gallery aesthetic
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600;1,700&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Great+Vibes&display=swap");

:root {
  /* Type */
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --script: "Great Vibes", cursive;

  /* Warm paper palette */
  /* Slightly warmer/darker than pure white so white mats pop */
  /* Warm cream w/ a touch of orange (avoid pink) */
  --paper: #f6f0e4;
  --paper-deep: #efe4d3;
  --paper-soft: #ffffff;
  --ink: #1a1612;
  --ink-soft: #463c33;
  --ink-mute: #837767;

  /* Painterly accents — orange-forward */
  --terra: #e07a3c;
  --terra-deep: #c85a1c;
  --ochre: #f09048;
  --amber: #d68028;
  --sage: #6b7d5e;

  /* Layout gutter */
  --page-pad-x: 64px;

  /* Navbar fill by route (gallery vs paper via main.js); open mobile sheet stays --paper-soft */
  --nav-bg: var(--paper);

  /* Images: subtract from viewport (nav + vertical breathing). Second line prefers 100svh on mobile when supported. */
  --img-vmargin: clamp(148px, 22vmin, 200px);

  /* Content starts below fixed .site-nav (logo + pills can exceed 72px) */
  --nav-clear: 112px;

  /* Transition default colors (overridden per stroke pair) */
  --transition-stroke-1: #c46a3f;
  --transition-stroke-2: #1a1612;
  --transition-art-scale: 1.55;

  font: 16px/1.55 var(--sans);
  color: var(--ink-soft);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  /* Hash / in-page jumps land below fixed nav */
  scroll-padding-top: var(--nav-clear);
  /* Reserve gutter so stripes using 100vw (footer + sections) don’t widen past layout */
  scrollbar-gutter: stable;
  overflow-x: hidden;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100vh;
}

body {
  overflow-x: hidden;
  background: var(--paper);
}

/* Persistent paper-grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 0.42  0 0 0 0 0.34  0 0 0 0 0.25  0 0 0 0.25 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/></svg>");
  background-size: 240px 240px;
  opacity: 0.35;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 1;
}

/* Bring real content above the grain */
#app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  max-width: 100%;
}
#app-shell > .section.active {
  flex: 1 0 auto;
  width: 100%;
}
#app-shell > .site-foot {
  position: relative;
  isolation: isolate;
  flex-shrink: 0;
  margin-top: auto;
  max-width: 1280px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--page-pad-x);
  padding-right: var(--page-pad-x);
  box-sizing: border-box;
}
/* Full-bleed footer band — tinted per route via body[data-section] (aligned with sections + nav) */
#app-shell > .site-foot::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-width: 100dvw;
  z-index: -1;
  background: var(--paper);
  pointer-events: none;
}

#app-shell,
.site-nav,
.transition-svg,
.transition-brush-follow-html,
.lightbox {
  position: relative;
  z-index: 2;
}

/* ---------- Transition layers (fixed, always on top) ----------------- */
.transition-svg {
  position: fixed;
  inset: 0;
  z-index: 10001;
  pointer-events: none;
  overflow: visible;
}
.transition-svg svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: scale(var(--transition-art-scale));
  transform-origin: center center;
}
.transition-page { position: relative; z-index: 2; }
.transition-brush-follow-html {
  position: fixed;
  inset: 0;
  z-index: 10003;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
}
.transition-brush-follow-html img {
  position: absolute;
  left: 0; top: 0;
  display: block;
  height: auto;
  filter: drop-shadow(0 8px 22px rgba(26,22,18,0.45));
  will-change: left, top;
}

/* =====================================================================
   NAV
   ===================================================================== */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 26px var(--page-pad-x);
  z-index: 9990;
  pointer-events: none;
  /* Opaque bar — matches section (--nav-bg from main.js: gallery tint vs paper) */
  background: var(--nav-bg);
}
.site-nav > * { pointer-events: auto; }

.nav-mark {
  font-family: var(--script);
  font-style: normal;
  font-size: 26px;
  color: var(--ink);
  cursor: pointer;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1;
  margin-top: -2px;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 6px;
}
.site-nav .nav-toggle {
  background: transparent;
  border: none;
  padding: 10px;
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}
.site-nav .nav-toggle:focus-visible {
  outline: 2px solid rgba(224, 122, 60, 0.35);
  outline-offset: 3px;
}
.site-nav button {
  background: none;
  border: none;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  gap: 5px;
  align-items: baseline;
  transition: color 0.2s;
  position: relative;
}
.site-nav .nav-toggle { display: none; }
.nav-toggle-menu,
.nav-toggle-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-toggle-close { display: none; }
body.menu-open .nav-toggle-menu { display: none; }
body.menu-open .nav-toggle-close { display: inline-flex; }
.site-nav button:hover { color: var(--ink); }
.site-nav button.active { color: var(--ink); }
.site-nav button.active::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 4px;
  height: 2px;
  background: var(--terra);
  border-radius: 1px;
}

/* Gallery tan bar: ink-mute + nav-num fade read mushy on #d1b399 — use ink ramp */
body[data-section="gallery"]:not(.menu-open) .site-nav .nav-mark,
body[data-section="gallery"]:not(.menu-open) .site-nav .nav-mark .nav-mark-glyph {
  color: var(--ink);
}
body[data-section="gallery"]:not(.menu-open) .site-nav .nav-toggle {
  color: var(--ink);
}
body[data-section="gallery"]:not(.menu-open) .site-nav ul button {
  color: rgba(26, 22, 18, 0.78);
}
body[data-section="gallery"]:not(.menu-open) .site-nav ul button:hover,
body[data-section="gallery"]:not(.menu-open) .site-nav ul button.active {
  color: var(--ink);
}
body[data-section="gallery"]:not(.menu-open) .site-nav .nav-num {
  color: rgba(26, 22, 18, 0.8);
  opacity: 1;
}
body[data-section="gallery"]:not(.menu-open) .site-nav button.active::after {
  background: var(--terra-deep);
}

/* Colored routes (resume / contact / writing): light nav on --nav-bg. See main.js */
body[data-section="writing"]:not(.menu-open) .site-nav button.active::after {
  background: var(--ink);
}
body[data-section="contact"]:not(.menu-open) .site-nav .nav-mark,
body[data-section="resume"]:not(.menu-open) .site-nav .nav-mark,
body[data-section="writing"]:not(.menu-open) .site-nav .nav-mark,
body[data-section="contact"]:not(.menu-open) .site-nav .nav-mark .nav-mark-glyph,
body[data-section="resume"]:not(.menu-open) .site-nav .nav-mark .nav-mark-glyph,
body[data-section="writing"]:not(.menu-open) .site-nav .nav-mark .nav-mark-glyph {
  color: var(--paper-soft);
}
body[data-section="contact"]:not(.menu-open) .site-nav .nav-toggle,
body[data-section="resume"]:not(.menu-open) .site-nav .nav-toggle,
body[data-section="writing"]:not(.menu-open) .site-nav .nav-toggle {
  color: var(--paper-soft);
}
body[data-section="contact"]:not(.menu-open) .site-nav ul button,
body[data-section="resume"]:not(.menu-open) .site-nav ul button,
body[data-section="writing"]:not(.menu-open) .site-nav ul button {
  color: rgba(246, 240, 228, 0.62);
}
body[data-section="contact"]:not(.menu-open) .site-nav ul button:hover,
body[data-section="contact"]:not(.menu-open) .site-nav ul button.active,
body[data-section="resume"]:not(.menu-open) .site-nav ul button:hover,
body[data-section="resume"]:not(.menu-open) .site-nav ul button.active,
body[data-section="writing"]:not(.menu-open) .site-nav ul button:hover,
body[data-section="writing"]:not(.menu-open) .site-nav ul button.active {
  color: var(--paper-soft);
}
body[data-section="contact"]:not(.menu-open) .site-nav .nav-num,
body[data-section="resume"]:not(.menu-open) .site-nav .nav-num,
body[data-section="writing"]:not(.menu-open) .site-nav .nav-num {
  color: rgba(246, 240, 228, 0.75);
}

/* Serif/weight/italic aligned with home headline accent; color unchanged from original nav pills */
.nav-num {
  font-family: var(--serif);
  font-weight: 700;
  font-style: italic;
  font-size: 19px;
  letter-spacing: -0.015em;
  color: var(--ink-mute);
  opacity: 0.7;
}

.site-menu { display: none; }

/* =====================================================================
   SHARED
   ===================================================================== */
.section {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--nav-clear) var(--page-pad-x) 90px;
  min-height: 100vh;
  display: none;
}
.section.active {
  display: block;
}

/* About is short — center it vertically */
.section-about.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.section-head {
  display: grid;
  grid-template-columns: clamp(52px, 7.5vmin, 72px) 1fr;
  gap: 18px;
  align-items: baseline;
  margin-bottom: 64px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(26,22,18,0.12);
}
.head-num {
  font-family: var(--script);
  font-style: normal;
  font-size: clamp(28px, 3.75vmin, 44px);
  color: var(--terra);
  letter-spacing: 0.02em;
  padding-top: 4px;
}
.head-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(48px, 6vw, 84px);
  color: var(--ink);
  line-height: 0.95;
  letter-spacing: -0.01em;
}
.head-title em {
  font-style: italic;
  color: var(--terra-deep);
}
.head-sub {
  grid-column: 2;
  margin-top: 18px;
  max-width: 540px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: var(--ink-soft);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 26px;
  border: none;
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, color 0.2s;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper-soft);
}
.btn-primary:hover {
  background: var(--terra-deep);
  transform: translateY(-2px);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(26,22,18,0.25);
}
.btn-ghost:hover { border-color: var(--ink); background: rgba(26,22,18,0.04); }
.btn-sm { padding: 10px 18px; font-size: 13px; }
.arrow { display: inline-block; transition: transform 0.2s; }
.btn:hover .arrow { transform: translateX(4px); }

/* meta key/value */
.meta-k {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.meta-v {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink);
}
.meta-v a { color: var(--terra-deep); text-decoration: underline; text-underline-offset: 3px; }

/* =====================================================================
   HOME
   ===================================================================== */
.section-home {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 80px);
  align-items: center;
  padding-top: var(--nav-clear);
  padding-bottom: 80px;
  min-height: 100vh;
}
.section-home.active {
  display: grid;
}
.home-grid {
  display: flex;
  flex-direction: column;
  gap: clamp(18px, 3vh, 36px);
  /* Keep copy from swallowing the whole viewport on small screens */
  max-height: calc(100vh - var(--img-vmargin));
  max-height: calc(min(100vh, 100svh) - var(--img-vmargin));
}

.home-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 10px;
}
.home-eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--terra);
  box-shadow: 0 0 0 4px rgba(196,106,63,0.18);
}
.home-eyebrow .muted { color: var(--ink-mute); }

.home-title {
  font-family: var(--serif);
  font-weight: 500;
  /* Allow title to shrink on short viewports */
  font-size: min(clamp(52px, 7.5vw, 112px), 12vh);
  line-height: 0.92;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.home-title .line { display: block; }
.home-title .italic { font-style: italic; padding-left: 0.6em; }
.home-title .accent { color: var(--terra-deep); font-style: italic; }

.home-lede {
  font-family: var(--serif);
  font-size: min(22px, 2.8vh);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: min(520px, 100%);
}

.home-cta { display: flex; gap: 14px; }

.home-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  padding-top: 28px;
  border-top: 1px solid rgba(26,22,18,0.12);
}
.home-meta .meta-v { font-size: 14px; line-height: 1.4; }

/* Right side — painted accent / featured swatch */
.home-accent {
  position: relative;
  /* Fits visible viewport (svh avoids mobile toolbar inflation of 100vh) */
  height: clamp(420px, calc(100vh - 208px), 620px);
  height: clamp(420px, calc(min(100vh, 100svh) - 192px), 620px);
  align-self: center;
  display: flex;
  justify-content: center;
  max-height: calc(100vh - var(--img-vmargin));
  max-height: calc(min(100vh, 100svh) - var(--img-vmargin));
}
.paper-swatch {
  position: relative;
  display: flex;
  flex-direction: column;
  transform-origin: center center;
  /* Keep the frame's proportions consistent while it scales */
  height: 100%;
  width: auto;
  aspect-ratio: 11 / 14;
  max-width: min(100%, calc(100vw - 2 * var(--page-pad-x)));
  margin: 0 auto;
  background: var(--paper-soft);
  border: 1px solid rgba(26, 22, 18, 0.08);
  padding: 18px 18px 64px;
  box-shadow:
    0 26px 70px -22px rgba(0, 0, 0, 0.48),
    0 10px 22px rgba(0, 0, 0, 0.22);
  transform: rotate(-1.5deg);
}
.paper-swatch::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: var(--paper-soft);
  z-index: 2;
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='8' preserveAspectRatio='none'><filter id='t'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' seed='5'/><feDisplacementMap in='SourceGraphic' scale='4'/></filter><rect width='100' height='8' fill='black' filter='url(%23t)'/></svg>");
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='8' preserveAspectRatio='none'><filter id='t'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' seed='5'/><feDisplacementMap in='SourceGraphic' scale='4'/></filter><rect width='100' height='8' fill='black' filter='url(%23t)'/></svg>");
}
.paper-swatch.tilted { transform: rotate(2deg); }
.swatch-img {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  object-fit: cover;
  display: block;
}
.swatch-tag {
  position: absolute;
  bottom: 22px; left: 24px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.home-footer {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid rgba(26,22,18,0.12);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.footer-divider {
  flex: 1;
  height: 1px;
  background: rgba(26,22,18,0.12);
  margin: 0 24px;
}

/* =====================================================================
   GALLERY
   ===================================================================== */
.section-gallery {
  position: relative;
  isolation: isolate;
  background: transparent;
  color: var(--ink);
  padding-top: 160px;
  padding-bottom: 120px;
  /* Break out of the 1280px section cap — gallery fills the full viewport */
  max-width: none;
  padding-left: 64px;
  padding-right: 64px;
}
/* Full-viewport tint — .section is max-width centered; fill side gutters too */
.section-gallery::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-width: 100dvw;
  background: #d1b399;
  z-index: 0;
}
.section-gallery > * {
  position: relative;
  z-index: 1;
}
.section-gallery .section-head {
  border-bottom-color: rgba(26, 22, 18, 0.15);
}
.section-gallery .head-title,
.section-gallery .head-sub {
  color: var(--ink);
}
.section-gallery .head-num {
  color: var(--terra-deep);
}
/* ── Gallery grid — masonry via JS row-span ───────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 8px;
  grid-auto-flow: row dense;
  column-gap: 18px;
  row-gap: 0;
}

.piece {
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
  padding-bottom: 18px;
  transition: transform 0.35s cubic-bezier(.2,.7,.2,1);
}
.piece:hover { transform: translateY(-4px); }
.piece:hover .piece-frame {
  box-shadow:
    0 28px 60px -22px rgba(26,22,18,.5),
    0 8px 18px rgba(26,22,18,.12);
}

/* Wide pieces span 2 columns */
.piece-featured { grid-column: span 2; }

.piece-frame {
  position: relative;
  background: var(--paper-soft);
  padding: 10px;
  overflow: hidden;
  box-shadow:
    0 18px 36px -20px rgba(26,22,18,.35),
    0 4px 10px rgba(26,22,18,.07);
}
.piece-frame img {
  width: 100%;
  height: auto;
  display: block;
  filter: contrast(1.02) saturate(1.04);
}

/* Decorative tape corners */
.piece-tape {
  position: absolute;
  width: 46px;
  height: 14px;
  background: rgba(232,215,178,.7);
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
  pointer-events: none;
  z-index: 2;
}
.piece-tape-tl { top: -6px; left: -10px; transform: rotate(-22deg); }
.piece-tape-br { bottom: -6px; right: -10px; transform: rotate(-22deg); }

.piece-caption {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 4px;
}
.piece-num {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--terra-deep);
  text-transform: uppercase;
}
.piece-title {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: 18px;
  line-height: 1.2;
  color: var(--ink);
  margin: 0;
}
.piece-meta {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-soft);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.dot-sep { opacity: 0.5; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(26,22,18,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9995;
  padding: 40px;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  background: var(--paper-soft);
  /* Extra top padding gives the close button its own space (no overlap on art) */
  padding: 56px 40px 40px;
  max-width: 1200px;
  max-width: min(1200px, calc(100vw - 48px));
  max-height: 90vh;
  max-height: min(90vh, 90svh);
  overflow: auto;
  position: relative;
}
.lb-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 36px; height: 36px;
  background: var(--paper-soft);
  border: 1px solid rgba(26,22,18,0.18);
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.16),
    0 2px 6px rgba(0, 0, 0, 0.12);
}
.lb-frame img { width: 100%; height: auto; display: block; }
.lb-caption {
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
}
.lb-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.lb-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 44px;
  color: var(--ink);
  line-height: 1;
}
.lb-blurb {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.lb-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
  padding-top: 24px;
  border-top: 1px solid rgba(26,22,18,0.1);
}

/* =====================================================================
   ABOUT
   ===================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 80px;
  align-items: start;
}
.about-portrait { display: flex; flex-direction: column; align-items: center; }
.about-portrait .paper-swatch {
  padding: 14px 14px 56px;
  overflow: hidden;
  margin: 0 auto;
  width: min(520px, 100%);
  height: auto;
  /* Cap by viewport height without breaking aspect ratio */
  max-height: min(600px, calc(min(100vh, 100svh) - 180px));
}
.about-portrait .swatch-tag {
  left: 20px;
  right: 20px;
  bottom: 18px;
  line-height: 1.35;
}
.about-portrait .swatch-img {
  width: 100%;
  object-fit: cover;
  object-position: center top;
}
.caption-mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
  text-transform: uppercase;
  text-align: center;
}
.about-copy {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
  max-width: 56ch;
}
.about-lede {
  font-family: var(--serif);
  font-size: 26px;
  font-style: italic;
  line-height: 1.4;
  color: var(--ink);
}
.about-copy p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 100%;
}
.pull-quote {
  font-family: var(--serif);
  font-size: 24px;
  font-style: italic;
  line-height: 1.4;
  color: var(--ink);
  padding: 32px 0 32px 36px;
  margin-top: 16px;
  border-left: 3px solid var(--terra);
  position: relative;
}
.quote-mark {
  position: absolute;
  top: 0; left: 8px;
  font-size: 80px;
  line-height: 1;
  color: var(--terra);
  font-family: var(--serif);
}
.quote-attr {
  display: block;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--ink-mute);
  font-style: normal;
}
.quote-attr cite {
  font-style: italic;
}

/* =====================================================================
   RESUME
   ===================================================================== */
.cv-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  border-bottom: 1px solid rgba(26,22,18,0.12);
}
.cv-tabs button {
  background: none;
  border: none;
  padding: 14px 22px;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink-mute);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}
.cv-tabs button:hover { color: var(--ink); }
.cv-tabs button.active {
  color: var(--ink);
  border-bottom-color: var(--terra);
  font-weight: 500;
}

.cv-list-head {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terra);
  padding: 8px 0 14px;
}

.cv-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 32px;
  padding: 20px 0;
  border-top: 1px solid rgba(26,22,18,0.1);
}
.cv-row.upcoming { background: rgba(196,106,63,0.04); padding-left: 12px; padding-right: 12px; border-radius: 4px; }
.cv-year {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}
.cv-title {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
  font-weight: 500;
  margin-bottom: 4px;
}
.cv-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terra-deep);
  background: rgba(196,106,63,0.15);
  padding: 3px 8px;
  border-radius: 3px;
  margin-left: 12px;
  vertical-align: middle;
}
.cv-where {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-soft);
}
.cv-download { margin-top: 40px; }
.cv-pane { display: none; }
.cv-pane.active { display: block; }

/* Sage field, light type (Resume); full-bleed like gallery */
.section-resume {
  position: relative;
  isolation: isolate;
  background: transparent;
  color: rgba(246, 240, 228, 0.92);
}
.section-resume::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-width: 100dvw;
  background: var(--sage);
  z-index: 0;
}
.section-resume > * {
  position: relative;
  z-index: 1;
}
.section-resume .section-head {
  border-bottom-color: rgba(246, 240, 228, 0.22);
}
.section-resume .head-num { color: var(--ochre); }
.section-resume .head-title { color: var(--paper-soft); }
.section-resume .head-title em { color: var(--ochre); }
.section-resume .head-sub { color: rgba(246, 240, 228, 0.78); }
.section-resume .cv-tabs {
  border-bottom-color: rgba(246, 240, 228, 0.2);
}
.section-resume .cv-tabs button {
  color: rgba(246, 240, 228, 0.55);
}
.section-resume .cv-tabs button:hover { color: var(--paper-soft); }
.section-resume .cv-tabs button.active {
  color: var(--paper-soft);
  border-bottom-color: var(--ochre);
}
.section-resume .cv-list-head { color: var(--ochre); }
.section-resume .cv-row {
  border-top-color: rgba(246, 240, 228, 0.16);
}
.section-resume .cv-row.upcoming {
  background: rgba(255, 255, 255, 0.1);
}
.section-resume .cv-year { color: rgba(246, 240, 228, 0.55); }
.section-resume .cv-title { color: var(--paper-soft); }
.section-resume .cv-tag {
  color: var(--paper-soft);
  background: rgba(224, 122, 60, 0.4);
}
.section-resume .cv-where { color: rgba(246, 240, 228, 0.82); }
.section-resume .cv-download .btn-ghost {
  border-color: rgba(246, 240, 228, 0.4);
  color: var(--paper-soft);
}
.section-resume .cv-download .btn-ghost:hover {
  border-color: var(--paper-soft);
  background: rgba(255, 255, 255, 0.08);
}

/* =====================================================================
   WRITING
   ===================================================================== */
.posts {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.post {
  padding: 36px 0;
  border-top: 1px solid rgba(26,22,18,0.12);
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  align-items: start;
  cursor: pointer;
  transition: padding-left 0.3s;
}
.post:hover { padding-left: 16px; }
.post:hover .post-title { color: var(--terra-deep); }
.post-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.post-tag { color: var(--terra); }
.post-date, .post-read { color: var(--ink-mute); }
.post-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 32px;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 14px;
  transition: color 0.2s;
  max-width: 24ch;
}
.post-excerpt {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 60ch;
  margin-bottom: 14px;
}
.post-link {
  background: none;
  border: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 0;
}

/* Ink-mute field + cream type (nav matches main.js writing route) */
.section-writing {
  position: relative;
  isolation: isolate;
  background: transparent;
  color: rgba(246, 240, 228, 0.9);
}
.section-writing::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-width: 100dvw;
  background: var(--ink-mute);
  z-index: 0;
}
.section-writing > * {
  position: relative;
  z-index: 1;
}
.section-writing .section-head {
  border-bottom-color: rgba(246, 240, 228, 0.32);
}
.section-writing .head-num {
  color: rgba(255, 255, 255, 0.98);
}
.section-writing .head-title {
  color: rgba(255, 255, 255, 0.98);
}
/* Warm accent on dusty field */
.section-writing .head-title em {
  color: var(--ochre);
}
.section-writing .head-sub {
  color: rgba(255, 250, 242, 0.88);
}
.section-writing .post {
  border-top-color: rgba(255, 255, 255, 0.28);
}
.section-writing .post-meta {
  color: rgba(255, 250, 242, 0.72);
}
.section-writing .post-tag {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
  letter-spacing: 0.12em;
}
.section-writing .post-date,
.section-writing .post-read {
  color: rgba(255, 250, 242, 0.7);
}
.section-writing .post-title {
  color: rgba(255, 255, 255, 0.98);
}
.section-writing .post:hover .post-title {
  color: #ffffff;
}
.section-writing .post-excerpt {
  color: rgba(255, 250, 242, 0.9);
}
.section-writing .post-link {
  color: rgba(255, 255, 255, 0.96);
}
.section-writing .post-link:hover {
  color: #ffffff;
}

/* =====================================================================
   CONTACT
   ===================================================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 80px;
  align-items: start;
}
.contact-aside {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 32px 32px;
  background: var(--paper-soft);
  border-left: 3px solid var(--terra);
}
.contact-artwork {
  margin-top: 24px;
  padding-top: 28px;
  border-top: 1px solid rgba(26, 22, 18, 0.1);
}
.contact-artwork img {
  width: 100%;
  height: auto;
  display: block;
  box-shadow: 0 12px 28px -12px rgba(0, 0, 0, 0.46);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.contact-form label span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.contact-form input,
.contact-form textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(26,22,18,0.25);
  padding: 12px 2px;
  font-family: var(--serif);
  font-size: 19px;
  color: var(--ink);
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
.contact-form input:focus,
.contact-form textarea:focus { border-bottom-color: var(--terra); }

.subject-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.subject-pills button {
  background: transparent;
  border: 1px solid rgba(26,22,18,0.2);
  border-radius: 30px;
  padding: 8px 16px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s;
}
.subject-pills button:hover { border-color: var(--ink); color: var(--ink); }
.subject-pills button.active {
  background: var(--ink);
  color: var(--paper-soft);
  border-color: var(--ink);
}

.contact-form .btn-primary { align-self: flex-start; margin-top: 12px; }

/* Dark band — ink field, light type (Contact only); full-bleed like gallery */
.section-contact {
  position: relative;
  isolation: isolate;
  background: transparent;
  color: rgba(246, 240, 228, 0.92);
}
.section-contact::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-width: 100dvw;
  background: var(--ink);
  z-index: 0;
}
.section-contact > * {
  position: relative;
  z-index: 1;
}
.section-contact .section-head {
  border-bottom-color: rgba(246, 240, 228, 0.22);
}
.section-contact .head-num { color: var(--ochre); }
.section-contact .head-title { color: var(--paper-soft); }
.section-contact .head-title em { color: var(--ochre); }

.section-contact .contact-aside {
  background: rgba(255, 255, 255, 0.06);
  border-left-color: var(--ochre);
  box-shadow: inset 0 0 0 1px rgba(246, 240, 228, 0.1);
}
.section-contact .meta-k { color: rgba(246, 240, 228, 0.52); }
.section-contact .meta-v { color: rgba(246, 240, 228, 0.9); }
.section-contact .meta-v a {
  color: var(--ochre);
}
.section-contact .meta-v a:hover { color: var(--paper-soft); }
.section-contact .contact-artwork {
  border-top-color: rgba(246, 240, 228, 0.15);
}

.section-contact .contact-form label span { color: rgba(246, 240, 228, 0.55); }
.section-contact .contact-form input,
.section-contact .contact-form textarea {
  color: var(--paper-soft);
  border-bottom-color: rgba(246, 240, 228, 0.35);
}
.section-contact .contact-form input::placeholder,
.section-contact .contact-form textarea::placeholder {
  color: rgba(246, 240, 228, 0.42);
}
.section-contact .contact-form input:focus,
.section-contact .contact-form textarea:focus {
  border-bottom-color: var(--ochre);
}

.section-contact .subject-pills button {
  border-color: rgba(246, 240, 228, 0.32);
  color: rgba(246, 240, 228, 0.82);
}
.section-contact .subject-pills button:hover {
  border-color: var(--paper-soft);
  color: var(--paper-soft);
}
.section-contact .subject-pills button.active {
  background: var(--paper-soft);
  color: var(--ink);
  border-color: var(--paper-soft);
}

.section-contact .contact-form .btn-primary {
  background: var(--paper-soft);
  color: var(--ink);
}
.section-contact .contact-form .btn-primary:hover {
  background: var(--ochre);
  color: var(--ink);
}

.section-contact .form-sent {
  background: rgba(240, 144, 72, 0.15);
}
.section-contact .form-sent h4 { color: var(--paper-soft); }
.section-contact .form-sent p { color: rgba(246, 240, 228, 0.82); }
.section-contact .form-sent .btn-ghost {
  border-color: rgba(246, 240, 228, 0.4);
  color: var(--paper-soft);
}
.section-contact .form-sent .btn-ghost:hover {
  border-color: var(--paper-soft);
  background: rgba(255, 255, 255, 0.08);
}

.section-contact .caption-mono { color: rgba(246, 240, 228, 0.55); }

.form-sent {
  text-align: center;
  padding: 60px 30px;
  background: rgba(196,106,63,0.06);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.sent-mark {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--terra);
  color: var(--paper-soft);
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.form-sent h4 {
  font-family: var(--serif);
  font-size: 28px;
  font-style: italic;
  font-weight: 500;
  color: var(--ink);
}
.form-sent p {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 42ch;
  line-height: 1.5;
}

.site-foot {
  margin-top: 80px;
  padding: 32px 0;
  border-top: 1px solid rgba(26,22,18,0.12);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  row-gap: 16px;
  column-gap: 20px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* Stacks / wraps cleanly when horizontal space runs out */
@media (max-width: 680px) {
  .site-foot {
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }
}

/* Matches .nav-mark (top-left name) */
.foot-mark {
  font-family: var(--script);
  font-style: normal;
  font-size: 26px;
  line-height: 1;
  color: var(--ink);
  letter-spacing: 0.01em;
  text-transform: none;
}
.site-foot-byline {
  text-transform: none;
  letter-spacing: 0.05em;
  color: inherit;
}
.foot-credit {
  font-weight: 500;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(26, 22, 18, 0.35);
  transition: color 0.2s, text-decoration-color 0.2s;
}
.foot-credit:hover {
  color: var(--ink-soft);
  text-decoration-color: var(--terra);
}

/* Footer field + type per route (data-section set in main.js) */
body[data-section="gallery"] #app-shell > .site-foot::before {
  background: #d1b399;
}
body[data-section="gallery"] #app-shell > .site-foot {
  border-top-color: rgba(26, 22, 18, 0.15);
  color: rgba(26, 22, 18, 0.7);
}
body[data-section="gallery"] #app-shell > .site-foot .foot-mark {
  color: var(--ink);
}
body[data-section="gallery"] #app-shell > .site-foot .foot-credit {
  text-decoration-color: rgba(26, 22, 18, 0.35);
}
body[data-section="gallery"] #app-shell > .site-foot .foot-credit:hover {
  color: var(--terra-deep);
  text-decoration-color: var(--terra-deep);
}

body[data-section="resume"] #app-shell > .site-foot::before {
  background: var(--sage);
}
body[data-section="resume"] #app-shell > .site-foot {
  border-top-color: rgba(246, 240, 228, 0.22);
  color: rgba(246, 240, 228, 0.55);
}
body[data-section="resume"] #app-shell > .site-foot .foot-mark {
  color: var(--paper-soft);
}
body[data-section="resume"] #app-shell > .site-foot .foot-credit {
  text-decoration-color: rgba(246, 240, 228, 0.45);
}
body[data-section="resume"] #app-shell > .site-foot .foot-credit:hover {
  color: var(--paper-soft);
  text-decoration-color: rgba(246, 240, 228, 0.9);
}

body[data-section="writing"] #app-shell > .site-foot::before {
  background: var(--ink-mute);
}
body[data-section="writing"] #app-shell > .site-foot {
  border-top-color: rgba(255, 250, 242, 0.28);
  color: rgba(255, 250, 242, 0.68);
}
body[data-section="writing"] #app-shell > .site-foot .foot-mark {
  color: rgba(255, 255, 255, 0.98);
}
body[data-section="writing"] #app-shell > .site-foot .foot-credit {
  text-decoration-color: rgba(255, 250, 242, 0.45);
}
body[data-section="writing"] #app-shell > .site-foot .foot-credit:hover {
  color: #ffffff;
  text-decoration-color: rgba(255, 255, 255, 0.9);
}

body[data-section="contact"] #app-shell > .site-foot::before {
  background: var(--ink);
}
body[data-section="contact"] #app-shell > .site-foot {
  border-top-color: rgba(246, 240, 228, 0.2);
  color: rgba(246, 240, 228, 0.52);
}
body[data-section="contact"] #app-shell > .site-foot .foot-mark {
  color: var(--paper-soft);
}
body[data-section="contact"] #app-shell > .site-foot .foot-credit {
  text-decoration-color: rgba(246, 240, 228, 0.45);
}
body[data-section="contact"] #app-shell > .site-foot .foot-credit:hover {
  color: var(--paper-soft);
  text-decoration-color: rgba(246, 240, 228, 0.85);
}

/* =====================================================================
   PREVIEW EFFECT CLASSES (driven by Tweaks toggles)
   ===================================================================== */
.preview-vignette .paper-swatch,
.preview-vignette .about-portrait .paper-swatch {
  box-shadow:
    0 26px 70px -22px rgba(0, 0, 0, 0.48),
    0 10px 22px rgba(0, 0, 0, 0.22),
    inset 0 0 70px rgba(0, 0, 0, 0.22);
}

.preview-blur .paper-swatch .swatch-img,
.preview-blur .about-portrait .swatch-img,
.preview-blur .contact-artwork img {
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at center, black 50%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 80% at center, black 50%, transparent 100%);
}

.preview-desaturate .paper-swatch .swatch-img,
.preview-desaturate .about-portrait .swatch-img,
.preview-desaturate .contact-artwork img {
  filter: contrast(1.02) saturate(0.35);
}

.preview-grain .paper-swatch::after,
.preview-grain .about-portrait .paper-swatch::after,
.preview-grain .contact-artwork::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' seed='2'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.2 0'/></filter><rect width='100%25' height='100%25' filter='url(%23g)'/></svg>");
  background-size: 180px 180px;
  mix-blend-mode: multiply;
  opacity: 0.6;
}
.preview-grain .paper-swatch,
.preview-grain .about-portrait .paper-swatch,
.preview-grain .contact-artwork {
  position: relative;
}

.preview-fade .paper-swatch .swatch-img,
.preview-fade .about-portrait .swatch-img,
.preview-fade .contact-artwork img {
  opacity: 0.55;
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1024px) {
  :root {
    --page-pad-x: 24px;
    /* Narrow viewports — a bit less vertical overhead so images reclaim space */
    --img-vmargin: clamp(136px, 26vmin, 192px);
    /* Taller strip: script name + toggle; clamp leaves headroom when the bar wraps */
    --nav-clear: clamp(104px, 34vmin, 136px);
  }
  .section { padding: var(--nav-clear) var(--page-pad-x) 80px; }
  .site-nav { padding: 18px var(--page-pad-x); }
  /* Open sheet + bar read as one white surface on every route (including gallery) */
  body.menu-open .site-nav {
    background: var(--paper-soft);
  }
  body.menu-open[data-section="contact"] .site-nav .nav-mark,
  body.menu-open[data-section="resume"] .site-nav .nav-mark,
  body.menu-open[data-section="writing"] .site-nav .nav-mark,
  body.menu-open[data-section="contact"] .site-nav .nav-mark .nav-mark-glyph,
  body.menu-open[data-section="resume"] .site-nav .nav-mark .nav-mark-glyph,
  body.menu-open[data-section="writing"] .site-nav .nav-mark .nav-mark-glyph {
    color: var(--ink);
  }
  body.menu-open[data-section="contact"] .site-nav .nav-toggle,
  body.menu-open[data-section="resume"] .site-nav .nav-toggle,
  body.menu-open[data-section="writing"] .site-nav .nav-toggle {
    color: var(--ink);
  }
  .home-accent {
    height: clamp(240px, calc(100vh - 232px), 460px);
    height: clamp(240px, calc(min(100vh, 100svh) - 212px), 460px);
    max-height: calc(100vh - var(--img-vmargin));
    max-height: calc(min(100vh, 100svh) - var(--img-vmargin));
    justify-content: center;
  }
  .section-home .paper-swatch { margin: 0 auto; }
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  /* Leave room for the tilt + shadow so it doesn't clip */
  .about-portrait .paper-swatch {
    height: clamp(220px, min(420px, 52vmin), 420px);
    width: min(420px, calc(100% - 2 * var(--page-pad-x)));
    margin: 0 auto;
    transform-origin: center center;
  }
  .about-portrait .paper-swatch.tilted { transform: rotate(2deg); }
  .about-copy { margin: 0 auto; }
  .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .post { grid-template-columns: 1fr; gap: 14px; }
  .form-row { grid-template-columns: 1fr; }
  .lightbox-inner {
    grid-template-columns: 1fr;
    padding: 56px 24px 24px;
    max-width: min(1200px, calc(100vw - 24px));
    max-height: min(90vh, 90svh);
    max-height: min(90vh, 90svh, calc(100dvh - 32px));
  }
  .home-meta { grid-template-columns: 1fr; gap: 16px; }
  .site-nav .nav-num { display: none; }
  .section-head { grid-template-columns: clamp(44px, 12vmin, 58px) 1fr; gap: 14px; }
  .head-num {
    font-size: clamp(24px, 5.6vmin, 36px);
    padding-top: 2px;
  }

  /* Mobile nav becomes an off-canvas drawer */
  .site-nav .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .site-nav ul { display: none; } /* desktop bar list hidden on mobile */
  /* Serica stays on the fixed bar when open; sheet logo duplicates it — hide but keep layout */
  body.menu-open .site-menu-logo { visibility: hidden; pointer-events: none; }

  .site-menu {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 9985; /* below .site-nav (9990) */
    pointer-events: none;
  }
  .site-menu-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(26, 22, 18, 0.42);
    border: none;
    opacity: 0;
    transition: opacity 0.16s ease;
    pointer-events: none;
  }
  .site-menu-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: var(--paper-soft);
    color: var(--ink);
    border-bottom: 1px solid rgba(26, 22, 18, 0.12);
    box-shadow: 0 26px 70px -42px rgba(0, 0, 0, 0.55);
    transform: translateY(-102%);
    transition: transform 0.22s cubic-bezier(.2,.7,.2,1);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    /* Navbar sits above via z-index; sheet content starts at top */
    padding: 0;
    gap: 0;
    overflow: auto;
  }
  .site-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Match the fixed nav's mobile padding so the logo doesn't "jump" */
    padding: 18px var(--page-pad-x);
    border-bottom: 1px solid rgba(26, 22, 18, 0.12);
  }
  .site-menu-logo {
    font-family: var(--script);
    font-style: normal;
    font-size: 26px;
    letter-spacing: 0.01em;
    color: var(--ink);
  }
  .site-menu-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: center;
    align-items: stretch;
    gap: 14px;
    padding: 18px var(--page-pad-x) 32px;
    margin: 0;
    width: 100%;
  }
  .site-menu-links > li {
    width: 100%;
  }
  /* Full-width rows: numbers in a fixed left column (stacked flush); titles at true horizontal center of the sheet */
  .site-menu-links button {
    width: 100%;
    max-width: none;
    display: block;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 16px var(--page-pad-x);
    cursor: pointer;
    color: var(--ink);
    font: inherit;
    text-align: left;
    position: relative;
    -webkit-tap-highlight-color: transparent;
  }
  .site-menu-links .site-menu-link {
    position: relative;
    display: block;
    width: 100%;
    min-height: clamp(44px, 11vmin, 56px);
  }
  .site-menu-links .site-menu-num {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3.1rem;
    text-align: right;
    padding-right: 0.6rem;
    box-sizing: content-box;
    font-family: var(--serif);
    font-weight: 700;
    font-style: italic;
    font-size: clamp(17px, 4.8vw, 22px);
    letter-spacing: -0.015em;
    line-height: 1;
    opacity: 0.88;
    pointer-events: none;
  }
  .site-menu-links .site-menu-label {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: max-content;
    max-width: calc(100% - 5rem);
    text-align: center;
    font-family: var(--serif);
    font-weight: 500;
    font-style: normal;
    font-size: clamp(28px, 8vw, 42px);
    line-height: 1.05;
    letter-spacing: -0.01em;
    text-transform: capitalize;
    pointer-events: none;
  }
  .site-menu-links button:active { transform: translateY(1px); }
  .site-menu-links li + li { border-top: none; }

  body.menu-open .site-menu { pointer-events: auto; }
  body.menu-open .site-menu-backdrop { opacity: 1; pointer-events: auto; }
  body.menu-open .site-menu-panel { transform: translateY(0); pointer-events: auto; }

  /* Keep navbar fixed in place while menu opens */
  .site-nav { transition: none; }
}

/* Gallery responsive — wide screens (min-width, ascending) */
@media (min-width: 1600px) {
  .gallery-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (min-width: 2000px) {
  .gallery-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (min-width: 2500px) {
  .gallery-grid { grid-template-columns: repeat(7, 1fr); }
}
@media (min-width: 3000px) {
  .gallery-grid { grid-template-columns: repeat(8, 1fr); }
}

/* Gallery responsive — narrow screens (max-width, descending) */
@media (max-width: 768px) {
  .section-gallery { padding-left: 24px; padding-right: 24px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); column-gap: 14px; }
}
@media (max-width: 480px) {
  .section-gallery { padding-left: 16px; padding-right: 16px; }
  .gallery-grid { grid-template-columns: 1fr; column-gap: 12px; }
  .piece-featured { grid-column: span 1; }
}

@media (max-width: 768px) {
  /* Home switches to a column layout only at true mobile widths */
  .section-home { grid-template-columns: 1fr; gap: 48px; justify-items: center; }
  .home-grid { align-items: center; text-align: center; }
  .home-cta { justify-content: center; flex-wrap: wrap; }
  .home-lede { margin-left: auto; margin-right: auto; }
  /*
    Swatch rides width (not stretched parent height) so −1.5deg tilt stays visually centered:
    gutter ≈ rotated AABB slack on a tall 11∶14 rect — pad + viewport terms, capped in px/ch.
    max-height limits tall phones so the card doesn’t dominate above-the-fold copy.
  */
  .home-accent {
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-block: clamp(6px, 2vmin, 16px);
  }
  .section-home .paper-swatch {
    margin: 0 auto;
    height: auto;
    width: min(
      340px,
      calc(100vw - 2 * var(--page-pad-x) - clamp(28px, 6vw + 2vmin, 52px))
    );
    max-width: none;
    max-height: min(
      420px,
      calc(100svh - var(--nav-clear) - clamp(220px, 58svmin, 340px))
    );
    aspect-ratio: 11 / 14;
    transform: rotate(-1.5deg);
    transform-origin: center center;
  }

  /* About portrait follows the same width-driven scaling as Home */
  .section-about .paper-swatch {
    margin: 0 auto;
    height: auto;
    width: min(
      340px,
      calc(100vw - 2 * var(--page-pad-x) - clamp(28px, 6vw + 2vmin, 52px))
    );
    max-width: none;
    max-height: min(
      420px,
      calc(100svh - var(--nav-clear) - clamp(260px, 60svmin, 380px))
    );
    aspect-ratio: 11 / 14;
    transform-origin: center center;
  }
}

