/* styles.css — warm cel-shaded, nature-scrapbook design system
   for a Locomotive-style long-scroll page */

/* ============ palettes ============ */
:root {
  --display: "Archivo", system-ui, sans-serif;
  --cond: "Oswald", system-ui, sans-serif;
  --body: "Newsreader", Georgia, serif;
  --mono: "JetBrains Mono", monospace;
  --stretch: 125%;

  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 84px);

  /* neon hero defaults (overridden per palette) */
  --neon-bg-a:    #4f1d1d;
  --neon-bg-b:    #2a0e0e;
  --neon-sage:    #d8e87f;
  --neon-mustard: #ecdb53;
  --neon-rose:    #e08f95;
  --neon-line:    #f3e7a0;
}

/* Justice — exact palette, oxblood text everywhere, 60-30-8-2 distribution */
:root, [data-palette="justice"] {
  --ink:     #622626;   /* TEXT — the one rule (darkest) */
  --paper:   #eaeeca;   /* 60% primary — pale sage base */
  --paper-2: #d6e0a6;   /* 30% secondary — sage panels / light-on-dark ink */
  --p1:      #9e555a;   /* 8% accent — dusty rose */
  --p2:      #622626;   /* oxblood — strong fills, footer, borders */
  --p3:      #d4cb63;   /* 2% highlight — mustard pop */
  --sky-a:   #eef1d8;
  --sky-b:   #e1e8be;
  --hill-1:  #c7d390;   /* sage */
  --hill-2:  #aeba6c;
  --hill-3:  #9e555a;   /* rose */
  --hill-4:  #622626;   /* oxblood */
  /* neon hero */
  --neon-bg-a:    #4f1d1d;
  --neon-bg-b:    #2a0e0e;
  --neon-sage:    #d8e87f;
  --neon-mustard: #ecdb53;
  --neon-rose:    #e08f95;
  --neon-line:    #f3e7a0;
}

/* Meadow — sage + clay + ochre on warm cream */
[data-palette="meadow"] {
  --paper:   #ece3cd;
  --paper-2: #f4eeda;
  --ink:     #2d3325;
  --p1:      #5f7c4e;   /* sage */
  --p2:      #c0673c;   /* clay */
  --p3:      #d6a03c;   /* ochre */
  --sky-a:   #f3ecd6;
  --sky-b:   #e7ddc0;
  --hill-1:  #b9c191;
  --hill-2:  #8aa46a;
  --hill-3:  #5f7c4e;
  --hill-4:  #41603d;
}
[data-palette="orchard"] {
  --paper:   #eddfcd;
  --paper-2: #f6ecd9;
  --ink:     #3a2a21;
  --p1:      #b5532e;   /* terracotta */
  --p2:      #7d8a47;   /* olive */
  --p3:      #d99a3c;   /* mustard */
  --sky-a:   #f6ead3;
  --sky-b:   #ecd8b8;
  --hill-1:  #e0b27e;
  --hill-2:  #cf8a52;
  --hill-3:  #b5532e;
  --hill-4:  #8a3f27;
}
[data-palette="pine"] {
  --paper:   #e7e1cb;
  --paper-2: #f1ecd6;
  --ink:     #16322a;
  --p1:      #1f7d60;   /* forest */
  --p2:      #c0552f;   /* rust */
  --p3:      #c89a4e;   /* gold */
  --sky-a:   #eee7cf;
  --sky-b:   #dfe2c4;
  --hill-1:  #a9c2a0;
  --hill-2:  #5fa07d;
  --hill-3:  #1f7d60;
  --hill-4:  #154f3e;
}

/* ============ base ============ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--paper); }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
::selection { background: var(--p1); color: var(--paper-2); }

/* paper grain */
body.grain::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 4; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* ============ smooth-scroll wrap (progressive enhancement) ============ */
#scroll-wrap {
  position: relative; width: 100%;
}
#scroll-wrap.smooth {
  position: fixed; top: 0; left: 0;
  will-change: transform;
  backface-visibility: hidden;
}

/* reveals: visible by default (no-JS safe); hidden only once Loco is live */
html.loco-ready [data-reveal]:not(.in) {
  opacity: 0;
  transform: translateY(28px);
}
[data-reveal] {
  transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1);
}
@media (prefers-reduced-motion: reduce) {
  html.loco-ready [data-reveal]:not(.in) { opacity: 1; transform: none; }
  [data-reveal] { transition: none; }
}

/* ============ shared type ============ */
.eyebrow {
  font-family: var(--cond); font-weight: 500;
  text-transform: uppercase; letter-spacing: .26em;
  font-size: clamp(12px, 1vw, 14px); color: var(--p2);
}
.display {
  font-family: var(--display); font-weight: 800; font-stretch: var(--stretch);
  text-transform: uppercase; letter-spacing: -.01em; line-height: .92;
  color: var(--ink);
}
.section-title {
  font-family: var(--display); font-weight: 800; font-stretch: var(--stretch);
  text-transform: uppercase; letter-spacing: -.01em; line-height: .95;
  font-size: clamp(40px, 7vw, 104px); margin: 0;
}
.lead {
  font-family: var(--body); font-size: clamp(18px, 1.6vw, 23px);
  line-height: 1.5; max-width: 46ch; color: var(--ink); opacity: .9;
}

/* cel-shaded surface mixin */
.cel {
  background: var(--paper-2);
  border: 1.6px solid color-mix(in oklab, var(--ink) 80%, transparent);
  border-radius: 16px;
  box-shadow:
    6px 7px 0 -1px color-mix(in oklab, var(--ink) 12%, transparent),
    0 22px 34px -26px color-mix(in oklab, var(--ink) 90%, transparent);
}

/* ============ nav ============ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(14px, 1.8vw, 22px) var(--gutter);
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav .brand {
  font-family: var(--display); font-weight: 800; font-stretch: 100%;
  text-transform: uppercase; letter-spacing: .015em;
  font-size: clamp(13px, 1.3vw, 18px); color: var(--ink);
  background: none; border: 0; cursor: pointer; padding: 0;
  white-space: nowrap; flex-shrink: 0;
}
.nav-links { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px clamp(13px, 1.5vw, 26px); }
.nav-links a {
  font-family: var(--cond); font-weight: 500; text-transform: uppercase;
  letter-spacing: .14em; font-size: clamp(12px, 1vw, 14px);
  color: var(--ink); opacity: .62; text-decoration: none; cursor: pointer;
  position: relative; padding: 4px 0; transition: opacity .25s;
}
.nav-links a:hover { opacity: 1; }
.nav-links a.on { opacity: 1; }
.nav-links a.on::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--p2); border-radius: 2px;
}
@media (max-width: 720px) {
  .nav-links a:not(.cta) { display: none; }
}
/* nav sits over the dark neon hero — go light until scrolled past it */
:root.hero-top .nav .brand,
:root.hero-top .nav-links a { color: var(--neon-line); }
:root.hero-top .nav-links a.on::after { background: var(--neon-line); box-shadow: 0 0 8px var(--neon-line); }

/* ============ hero — hanging lights ============ */
.hero {
  position: relative; height: 100vh; min-height: 600px;
  overflow: hidden;
  background:
    radial-gradient(120% 70% at 50% -8%, #3a1e16 0%, transparent 55%),
    radial-gradient(70% 50% at 76% 26%, color-mix(in oklab, var(--neon-mustard) 16%, transparent) 0%, transparent 55%),
    radial-gradient(60% 46% at 18% 70%, color-mix(in oklab, #e8b54e 12%, transparent) 0%, transparent 55%),
    linear-gradient(178deg, #1d110e 0%, #160d0c 52%, #0c130f 100%);
}

/* out-of-focus background bulbs (bokeh) */
.hero-bokeh { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.bokeh {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, #fff1c8 0%, rgba(233,178,74,.55) 48%, transparent 72%);
  filter: blur(7px); opacity: .5;
  animation: bokeh-glow 7s ease-in-out infinite;
}

/* strung wires + hanging bulbs */
.hero-lights { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.hero-wire {
  position: absolute; left: -4%; right: -4%; top: var(--wy, 60px); height: var(--bow, 60px);
  border-top: 1.5px solid rgba(247,224,150,.28);
  border-radius: 50%;
  -webkit-mask-image: linear-gradient(to bottom, #000 0 2px, transparent 2px);
          mask-image: linear-gradient(to bottom, #000 0 2px, transparent 2px);
}
.bulb {
  position: absolute; top: -1px; left: var(--x); width: 2px; height: var(--len);
  transform-origin: top center;
  animation: sway var(--sway, 6s) ease-in-out var(--d, 0s) infinite alternate;
}
.bulb::before { /* string */
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 1px; height: 100%;
  background: linear-gradient(to bottom, rgba(247,224,150,.05), rgba(247,224,150,.4));
}
.bulb-orb {
  position: absolute; bottom: 0; left: 50%; transform: translate(-50%, 50%);
  width: var(--size); height: var(--size); border-radius: 50% 50% 52% 52%;
  background: radial-gradient(circle at 38% 32%, #fff8e3 0%, #ffe7a0 28%, #ecbb54 60%, #b97f2c 100%);
  box-shadow:
    0 0 10px 2px rgba(255,224,140,.9),
    0 0 26px 6px rgba(247,196,90,.55),
    0 0 58px 14px rgba(230,150,40,.32);
  animation: bulb-flicker var(--flk, 9s) ease-in-out var(--d, 0s) infinite;
}
.bulb-orb::after { /* little brass cap */
  content: ""; position: absolute; top: -22%; left: 50%; transform: translateX(-50%);
  width: 38%; height: 26%; border-radius: 2px;
  background: linear-gradient(#7d5a2a, #4f3a1c);
}
@keyframes sway { from { transform: rotate(-2.4deg); } to { transform: rotate(2.4deg); } }
@keyframes bulb-flicker { 0%,100% { opacity: 1; } 46% { opacity: .96; } 50% { opacity: .82; } 54% { opacity: .97; } }
@keyframes bokeh-glow { 0%,100% { opacity: .42; } 50% { opacity: .62; } }

.hero-copy {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(60px, 12vh, 130px);
  z-index: 5;
}
.hero-copy .eyebrow {
  color: #ecdca6; opacity: .92;
  text-shadow: 0 0 10px rgba(236,187,84,.35);
}
.hero-name {
  font-family: var(--display); font-weight: 800; font-stretch: var(--stretch);
  letter-spacing: -.012em; line-height: .98;
  font-size: clamp(46px, 9vw, 132px); margin: .12em 0 0; color: #f4ecd6;
  text-shadow: 0 2px 26px rgba(0,0,0,.5);
}
.hero-name .glow {
  color: #ffe9a8;
  text-shadow:
    0 0 12px rgba(255,225,150,.62),
    0 0 36px rgba(247,196,90,.5),
    0 0 74px rgba(230,150,40,.34);
  animation: name-flicker 8s ease-in-out infinite;
}
@keyframes name-flicker { 0%,100% { opacity: 1; } 48% { opacity: 1; } 50% { opacity: .86; } 52% { opacity: 1; } }
.hero-sub {
  font-family: var(--body); font-style: italic; font-size: clamp(18px, 2.1vw, 30px);
  color: #f2ecd6; margin: .55em 0 0; max-width: 28ch; line-height: 1.3;
  text-shadow: 0 1px 14px rgba(0,0,0,.5);
}
.scroll-cue {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 5;
  font-family: var(--cond); text-transform: uppercase; letter-spacing: .24em;
  font-size: 11px; color: #ecdca6; opacity: .8;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.scroll-cue .bar {
  width: 1.5px; height: 40px; background: #ecdca6; opacity: .55;
  box-shadow: 0 0 8px rgba(236,187,84,.5);
  animation: cue 1.8s ease-in-out infinite; transform-origin: top;
}
@media (prefers-reduced-motion: reduce) {
  .bulb, .bulb-orb, .bokeh, .hero-name .glow { animation: none; }
}
@keyframes cue { 0%,100% { transform: scaleY(.4); opacity: .25; } 50% { transform: scaleY(1); opacity: .6; } }

/* no-JS crawlable fallback */
.noscript-fallback {
  max-width: 760px; margin: 0 auto; padding: clamp(40px, 8vh, 90px) var(--gutter);
  font-family: var(--body); color: var(--ink);
}
.noscript-fallback h1 {
  font-family: var(--display); font-weight: 800; font-stretch: var(--stretch);
  font-size: clamp(36px, 6vw, 64px); line-height: 1; margin: 0 0 .4em;
}
.noscript-fallback h2 {
  font-family: var(--cond); text-transform: uppercase; letter-spacing: .12em;
  font-size: 15px; color: var(--p1); margin: 1.8em 0 .6em;
}
.noscript-fallback p { font-size: 19px; line-height: 1.55; max-width: 60ch; }
.noscript-fallback ul { padding-left: 1.1em; line-height: 1.6; }
.noscript-fallback a { color: var(--p2); }

/* ============ section scaffold ============ */
.section { padding: clamp(80px, 13vh, 170px) var(--gutter); position: relative; }
.section-inner { max-width: var(--maxw); margin: 0 auto; }

/* ---- section separation: dividers + alternating tones ---- */
.section { border-top: 1px solid color-mix(in oklab, var(--ink) 13%, transparent); }
.section.tone-wash { background: color-mix(in oklab, var(--paper) 74%, var(--hill-2) 26%); }
.section.tone-dark {
  background: var(--p2);          /* oxblood */
  --ink: #f4edd9;                 /* warm cream — flips descendant text light */
  --p1:  #e7b6ba;                 /* light rose for the section index */
  color: var(--ink);              /* set inherited color so the title flips too */
  border-top-color: color-mix(in oklab, #f4edd9 22%, transparent);
}
.section.tone-dark .lead { opacity: .9; }
.section-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: clamp(36px, 6vh, 80px); }
.section-index {
  font-family: var(--cond); font-weight: 600; letter-spacing: .1em;
  font-size: clamp(12px, 1vw, 14px); color: var(--p1);
}

/* ============ ABOUT ============ */
.about-grid {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px, 5vw, 80px);
  align-items: center;
}
.about-portrait { position: relative; }
.about-portrait .photo {
  width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; display: block; border-radius: 18px;
  border: 1.6px solid color-mix(in oklab, var(--ink) 80%, transparent);
  box-shadow: 8px 10px 0 -2px var(--p1), 0 26px 40px -28px var(--ink);
}
.about-portrait .pin {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  width: 78px; height: 22px; background: color-mix(in oklab, var(--p3) 70%, transparent);
  border-radius: 3px; border: 1.4px solid color-mix(in oklab, var(--ink) 60%, transparent);
  z-index: 2;
}
.about-bio {
  font-family: var(--body); font-style: italic; font-weight: 400;
  font-size: clamp(24px, 3vw, 40px); line-height: 1.18; margin: 0 0 28px; color: var(--ink);
}
.about-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.about-list li { display: flex; align-items: baseline; gap: 14px; }
.about-list .k {
  font-family: var(--cond); font-weight: 600; color: var(--p1);
  font-size: 14px; min-width: 24px;
}
.about-list .v { flex: 1; font-family: var(--body); font-size: clamp(17px, 1.5vw, 20px); line-height: 1.35; color: var(--ink); }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } .about-portrait { max-width: 380px; } }

/* ============ CODING — editorial list ============ */
.proj-list { border-top: 1.6px solid color-mix(in oklab, var(--ink) 30%, transparent); }
.proj {
  border-bottom: 1.6px solid color-mix(in oklab, var(--ink) 30%, transparent);
  cursor: pointer;
}
.proj-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: clamp(14px, 3vw, 40px);
  padding: clamp(20px, 3vh, 34px) 4px;
  transition: padding-left .35s cubic-bezier(.2,.7,.2,1), color .3s;
}
.proj:hover .proj-row, .proj.open .proj-row { padding-left: clamp(8px, 1.5vw, 22px); }
.proj-num {
  font-family: var(--cond); font-weight: 600; font-size: clamp(14px, 1.2vw, 17px);
  color: var(--p1); letter-spacing: .06em; align-self: start; padding-top: .35em;
}
.proj-main { min-width: 0; }
.proj-course {
  font-family: var(--cond); font-weight: 500; text-transform: uppercase;
  letter-spacing: .18em; font-size: clamp(11px, .95vw, 13px); color: var(--p2);
  display: block; margin-bottom: 8px;
}
.proj-title {
  font-family: var(--display); font-weight: 700; font-stretch: var(--stretch);
  text-transform: uppercase; letter-spacing: -.01em; line-height: .98;
  font-size: clamp(26px, 4.2vw, 58px); color: var(--ink); margin: 0;
  transition: color .3s;
}
.proj:hover .proj-title, .proj.open .proj-title { color: var(--p1); }
.proj-plus {
  width: clamp(34px, 3.4vw, 46px); aspect-ratio: 1; border-radius: 50%;
  border: 1.6px solid color-mix(in oklab, var(--ink) 70%, transparent);
  display: grid; place-items: center; align-self: start; margin-top: .2em;
  background: var(--paper-2); color: var(--ink);
  transition: transform .4s cubic-bezier(.2,.7,.2,1), background .3s, color .3s;
  position: relative;
}
.proj.open .proj-plus { transform: rotate(135deg); background: var(--p1); color: var(--paper-2); border-color: var(--p1); }
.proj-plus::before, .proj-plus::after {
  content: ""; position: absolute; background: currentColor; border-radius: 2px;
}
.proj-plus::before { width: 44%; height: 2px; }
.proj-plus::after { width: 2px; height: 44%; }

.proj-detail { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .5s cubic-bezier(.2,.7,.2,1); }
.proj.open .proj-detail { grid-template-rows: 1fr; }
.proj-detail-inner { overflow: hidden; }
.proj-body {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 44px);
  padding: 6px 4px clamp(26px, 4vh, 42px) clamp(40px, 6vw, 92px);
  align-items: start;
}
.proj-desc { font-family: var(--body); font-size: clamp(16px, 1.4vw, 19px); line-height: 1.55; margin: 0 0 16px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-family: var(--cond); font-weight: 500; text-transform: uppercase; letter-spacing: .08em;
  font-size: 11.5px; color: var(--paper-2); background: var(--p1);
  padding: 5px 11px; border-radius: 20px;
}
.codechip {
  font-family: var(--mono); font-size: clamp(12px, 1vw, 13px); line-height: 1.6;
  color: #d7e8db; background: #15241f; border-radius: 12px;
  border: 1.6px solid color-mix(in oklab, var(--ink) 70%, transparent);
  box-shadow: 5px 6px 0 -1px color-mix(in oklab, var(--ink) 22%, transparent);
  padding: 16px 18px; overflow-x: auto; margin: 0;
}
.codechip .c-key { color: #8fd3ab; } .codechip .c-com { color: #6f8c84; font-style: italic; } .codechip .c-fn { color: #eccd82; }
.meta-row {
  display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px;
}
.meta-row span {
  font-family: var(--mono); font-size: 11px; letter-spacing: .03em; color: var(--ink); opacity: .7;
  border: 1.3px solid color-mix(in oklab, var(--ink) 30%, transparent);
  padding: 3px 9px; border-radius: 6px;
}
@media (max-width: 720px) { .proj-body { grid-template-columns: 1fr; padding-left: 4px; } }

/* ============ ART ============ */
.art-intro { display: flex; flex-direction: row; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 20px 48px; }
.art-intro > .lead { max-width: 40ch; }
/* flex-column wall — mixed aspect ratios pack naturally (no multicol fragmentation) */
.art-grid {
  display: flex; align-items: flex-start;
  gap: clamp(26px, 3.4vw, 56px);
  margin-top: clamp(40px, 6vh, 72px);
}
.art-col {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column;
  gap: clamp(28px, 3.4vw, 56px);
}
.art-cell { position: relative; }
.art-cell .art-frame { position: relative; display: block; }
/* washi tape — varied placements per piece */
.tape {
  position: absolute; z-index: 4; width: clamp(64px, 5vw, 96px); height: clamp(22px, 1.8vw, 30px);
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--p3) 70%, transparent),
    color-mix(in oklab, var(--p3) 52%, transparent));
  border-left: 1px dashed rgba(255,255,255,.4);
  border-right: 1px dashed rgba(255,255,255,.4);
  box-shadow: 0 2px 7px rgba(0,0,0,.16);
}
.tape::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,.5), transparent 42%, rgba(255,255,255,.22) 70%, transparent);
}
.tape.t-tl  { top: -12px; left: -22px; transform: rotate(-45deg); }
.tape.t-tr  { top: -12px; right: -22px; transform: rotate(45deg); }
.tape.t-top { top: -13px; left: 50%; transform: translateX(-50%) rotate(-4deg); }
.art-cell image-slot,
.art-cell .art-img {
  display: block; width: 100%; height: auto; border-radius: 12px;
  object-fit: cover;
  border: 1.6px solid color-mix(in oklab, var(--ink) 80%, transparent);
  box-shadow: 6px 7px 0 -1px color-mix(in oklab, var(--ink) 14%, transparent),
              0 22px 34px -26px var(--ink);
  background: var(--paper-2);
}
.art-cap {
  font-family: var(--body); font-style: italic; font-size: clamp(15px, 1.3vw, 18px);
  color: var(--ink); opacity: .8; margin-top: 12px;
}
/* clickable affordance */
.art-cell { cursor: zoom-in; outline: none; }
/* art cells fade in on their own (NOT gated on the JS reveal snapshot, which
   can't track figures re-created when the column count changes) */
.art-revealed { animation: art-in .7s cubic-bezier(.2,.7,.2,1) both; }
@keyframes art-in { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .art-revealed { animation: none; } }
.art-cell .art-frame { transition: transform .3s cubic-bezier(.2,.7,.2,1); }
.art-cell:hover .art-frame,
.art-cell:focus-visible .art-frame { transform: translateY(-4px); }
.art-cell:focus-visible .art-img { outline: 2px solid var(--p3); outline-offset: 3px; }
.art-zoom {
  position: absolute; top: 10px; right: 10px; z-index: 4;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-size: 17px; line-height: 1;
  color: #f4ecd6; background: rgba(20,12,11,0.55);
  border: 1px solid rgba(244,236,214,0.4);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  opacity: 0; transform: scale(.85); transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.art-cell:hover .art-zoom,
.art-cell:focus-visible .art-zoom { opacity: 1; transform: scale(1); }

/* lightbox */
.art-lightbox {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(16px, 4vh, 56px) clamp(48px, 8vw, 110px);
  background: color-mix(in oklab, #160d0c 90%, transparent);
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  animation: reader-fade .3s ease;
}
.lb-figure {
  margin: 0; display: flex; flex-direction: column; align-items: center; gap: 16px;
  max-width: 100%; max-height: 100%;
}
.lb-img {
  max-width: min(92vw, 1100px); max-height: 80vh; width: auto; height: auto;
  object-fit: contain; border-radius: 8px;
  border: 1px solid rgba(244,236,214,0.18);
  box-shadow: 0 40px 80px -28px #000;
  animation: reader-rise .4s cubic-bezier(.2,.7,.2,1);
}
.lb-cap {
  font-family: var(--body); font-style: italic; color: #f4ecd6;
  font-size: clamp(15px, 1.4vw, 19px); text-align: center;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center;
}
.lb-count {
  font-family: var(--cond); font-style: normal; letter-spacing: .14em;
  font-size: 12px; opacity: .55; text-transform: uppercase;
}
.lb-close { position: fixed; top: 18px; right: 20px; }
.lb-arw {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 2;
  width: clamp(44px, 4vw, 56px); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  font-family: var(--display); font-size: 30px; line-height: 1; padding-bottom: 4px;
  color: #f4ecd6; background: rgba(244,236,214,0.1);
  border: 1px solid rgba(244,236,214,0.3);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: background .25s, transform .25s;
}
.lb-arw:hover { background: rgba(244,236,214,0.22); }
.lb-arw.prev { left: clamp(12px, 2vw, 28px); }
.lb-arw.next { right: clamp(12px, 2vw, 28px); }
@media (max-width: 600px) {
  .lb-arw { top: auto; bottom: 16px; transform: none; }
  .lb-arw.prev { left: 32%; }
  .lb-arw.next { right: 32%; }
}
/* ============ MOVIES ============ */
.movies-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3vw, 44px);
  margin-top: clamp(36px, 6vh, 70px); align-items: start;
}
.ticket {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  padding: 16px 20px; margin-bottom: 16px;
  background: var(--paper-2);
  border: 1.6px solid color-mix(in oklab, var(--ink) 80%, transparent);
  border-radius: 12px;
  box-shadow: 5px 6px 0 -1px color-mix(in oklab, var(--ink) 12%, transparent);
  position: relative;
  transition: transform .3s cubic-bezier(.2,.7,.2,1);
}
.ticket:hover { transform: translateX(6px); }
.ticket .stub {
  width: 54px; height: 72px; border-radius: 7px; flex: none;
  border: 1.4px solid color-mix(in oklab, var(--ink) 50%, transparent);
}
.ticket .ttl { font-family: var(--display); font-weight: 700; font-stretch: var(--stretch); text-transform: uppercase; font-size: clamp(16px, 1.6vw, 21px); color: var(--ink); line-height: 1; }
.ticket .sub { font-family: var(--cond); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; color: var(--p2); margin-top: 6px; }
.ticket .rate { font-family: var(--cond); font-size: 18px; color: var(--p3); letter-spacing: .05em; }
.poster-stack { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2vw, 26px); }
.poster-stack image-slot,
.poster-stack .poster {
  display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; border-radius: 10px;
  object-fit: cover;
  border: 1.6px solid color-mix(in oklab, var(--ink) 80%, transparent);
  box-shadow: 5px 6px 0 -1px color-mix(in oklab, var(--ink) 14%, transparent);
  background: var(--paper-2);
}
.poster-stack image-slot:nth-child(odd),
.poster-stack .poster:nth-child(odd) { transform: translateY(14px); }
@media (max-width: 820px) { .movies-grid { grid-template-columns: 1fr; } }

/* ============ MOVIES — featured production ============ */
.film-feature {
  display: grid; grid-template-columns: 1.18fr .9fr;
  gap: clamp(22px, 3vw, 46px);
  padding: clamp(20px, 2.6vw, 34px);
  margin: clamp(36px, 6vh, 70px) 0 clamp(40px, 7vh, 76px);
  align-items: stretch;
}
.film-feature-media { display: flex; flex-direction: column; gap: clamp(12px, 1.6vw, 18px); }
.film-embed {
  position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden;
  border: 1.6px solid color-mix(in oklab, var(--ink) 80%, transparent);
  background: #07111f;
  box-shadow: 5px 6px 0 -1px color-mix(in oklab, var(--ink) 16%, transparent);
}
.film-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.film-play {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer;
  background-size: cover; background-position: center; display: grid; place-items: center;
}
.film-play::after {
  content: ""; position: absolute; inset: 0;
  background: color-mix(in oklab, #07111f 34%, transparent); transition: background .3s;
}
.film-play:hover::after { background: color-mix(in oklab, #07111f 12%, transparent); }
.film-play-btn {
  position: relative; z-index: 2; width: clamp(54px, 6vw, 70px); aspect-ratio: 1; border-radius: 50%;
  background: var(--p2); border: 1.8px solid var(--paper-2);
  box-shadow: 0 12px 26px -8px #000; display: grid; place-items: center;
  transition: transform .25s;
}
.film-play:hover .film-play-btn { transform: scale(1.08); }
.film-play-btn::before {
  content: ""; width: 0; height: 0; border-style: solid;
  border-width: 11px 0 11px 19px; border-color: transparent transparent transparent var(--paper-2);
  margin-left: 5px;
}
.film-stills { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(10px, 1.4vw, 16px); }
.film-still { margin: 0; }
.film-still img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block;
  border-radius: 10px; border: 1.6px solid color-mix(in oklab, var(--ink) 75%, transparent);
  box-shadow: 4px 5px 0 -1px color-mix(in oklab, var(--ink) 12%, transparent);
}
.film-still figcaption {
  font-family: var(--cond); text-transform: uppercase; letter-spacing: .1em;
  font-size: 10.5px; color: var(--ink); opacity: .6; margin-top: 8px;
}

.film-feature-body { display: flex; flex-direction: column; }
.film-kicker {
  font-family: var(--cond); font-weight: 600; text-transform: uppercase; letter-spacing: .2em;
  font-size: 12px; color: var(--p2);
}
.film-title {
  font-family: var(--display); font-weight: 800; font-stretch: var(--stretch);
  text-transform: uppercase; letter-spacing: -.01em; line-height: .9;
  font-size: clamp(38px, 5vw, 66px); margin: 10px 0 0; color: var(--ink);
}
.film-credits {
  font-family: var(--cond); text-transform: uppercase; letter-spacing: .14em;
  font-size: 12.5px; color: var(--ink); opacity: .6; margin-top: 12px;
}
.film-roles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.role-chip {
  font-family: var(--cond); font-weight: 500; text-transform: uppercase; letter-spacing: .08em;
  font-size: 11.5px; color: var(--paper-2); background: var(--p2);
  padding: 5px 12px; border-radius: 20px;
}
.film-log {
  font-family: var(--body); font-size: clamp(16px, 1.4vw, 18px); line-height: 1.5;
  color: var(--ink); margin: 18px 0 0; max-width: 42ch;
}
.film-awards {
  display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 22px;
}
.award {
  display: flex; align-items: center; justify-content: flex-start; gap: 9px;
  font-family: var(--cond); font-weight: 600; text-transform: uppercase; letter-spacing: .12em;
  font-size: 13.5px; color: var(--ink);
}
.award .laurel { color: var(--p3); flex: none; }
.film-watch {
  font-family: var(--cond); font-weight: 600; text-transform: uppercase; letter-spacing: .12em;
  font-size: 13px; color: var(--paper-2); background: var(--p1); text-decoration: none;
  padding: 13px 22px; border-radius: 40px; margin-top: 24px; align-self: flex-start;
  border: 1.6px solid color-mix(in oklab, var(--ink) 80%, transparent);
  box-shadow: 4px 5px 0 -1px color-mix(in oklab, var(--ink) 16%, transparent);
  transition: transform .25s, background .25s;
}
.film-watch:hover { transform: translateY(-2px); }
.picnic-script { align-self: flex-start; margin-top: 22px; }
@media (max-width: 820px) {
  .film-feature { grid-template-columns: 1fr; }
}

/* ============ MOVIES — work in progress ============ */
.filmwip {
  margin: 0 0 clamp(20px, 3vh, 40px);
}
.filmwip-head {
  display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap;
  gap: 18px 40px;
}
.filmwip-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.filmwip-meta .film-roles { margin-top: 0; justify-content: flex-end; }
.status-pill {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--cond); font-weight: 600; text-transform: uppercase; letter-spacing: .14em;
  font-size: 12px; color: var(--ink); white-space: nowrap;
  background: var(--paper-2); padding: 7px 14px 7px 12px; border-radius: 30px;
  border: 1.5px solid color-mix(in oklab, var(--ink) 70%, transparent);
  box-shadow: 3px 4px 0 -1px color-mix(in oklab, var(--ink) 14%, transparent);
}
.status-pill .dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--p2); flex: none;
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--p2) 60%, transparent);
  animation: wip-pulse 2s ease-in-out infinite;
}
@keyframes wip-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--p2) 55%, transparent); }
  70% { box-shadow: 0 0 0 8px color-mix(in oklab, var(--p2) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--p2) 0%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .status-pill .dot { animation: none; } }
.filmwip-log { margin-top: clamp(18px, 2.4vw, 26px); max-width: 64ch; }

.filmwip-gallery {
  columns: 3; column-gap: clamp(12px, 1.6vw, 18px);
  margin-top: clamp(26px, 4vh, 44px);
}
.filmwip-gallery .shot {
  break-inside: avoid; margin: 0 0 clamp(12px, 1.6vw, 18px);
}
.filmwip-gallery .shot img {
  width: 100%; height: auto; display: block; border-radius: 10px;
  border: 1.6px solid color-mix(in oklab, var(--ink) 78%, transparent);
  box-shadow: 5px 6px 0 -1px color-mix(in oklab, var(--ink) 13%, transparent);
  background: #0c1620;
}
.filmwip-gallery .shot figcaption {
  font-family: var(--cond); text-transform: uppercase; letter-spacing: .12em;
  font-size: 10.5px; color: var(--ink); opacity: .58; margin-top: 7px;
}
@media (max-width: 820px) { .filmwip-gallery { columns: 2; } }
@media (max-width: 460px) { .filmwip-gallery { columns: 1; } }

.filmwip-sketches {
  display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(22px, 4vw, 56px);
  margin-top: clamp(30px, 5vh, 54px); align-items: start;
}
.sketch-note { padding-top: 8px; }
.sketch-note p {
  font-family: var(--body); font-style: italic; font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.4; color: var(--ink); margin: 12px 0 0; max-width: 32ch;
}
.sketch-pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2.4vw, 30px); }
.sketch { position: relative; margin: 0; }
.sketch .tape-bit {
  position: absolute; top: -12px; left: 24px; width: 80px; height: 22px; z-index: 3;
  background: color-mix(in oklab, var(--p3) 62%, transparent);
  border: 1.3px solid color-mix(in oklab, var(--ink) 45%, transparent);
  transform: rotate(-4deg);
}
.sketch img {
  width: 100%; height: auto; display: block; border-radius: 10px;
  background: #fbf8ef;
  border: 1.6px solid color-mix(in oklab, var(--ink) 78%, transparent);
  box-shadow: 6px 7px 0 -1px color-mix(in oklab, var(--ink) 13%, transparent),
              0 22px 34px -28px var(--ink);
}
.sketch figcaption {
  font-family: var(--body); font-style: italic; font-size: clamp(13px, 1.2vw, 15px);
  color: var(--ink); opacity: .72; margin-top: 10px; line-height: 1.35;
}
@media (max-width: 820px) {
  .filmwip-head { align-items: flex-start; }
  .filmwip-meta { align-items: flex-start; }
  .filmwip-meta .film-roles { justify-content: flex-start; }
  .filmwip-sketches { grid-template-columns: 1fr; }
}

/* ============ WRITING ============ */
.essay-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(18px, 2.4vw, 32px);
}
.essay {
  display: flex; flex-direction: column; cursor: pointer;
  padding: clamp(24px, 2.6vw, 36px);
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s;
}
.essay:hover {
  transform: translateY(-4px);
  box-shadow: 8px 11px 0 -1px color-mix(in oklab, var(--ink) 16%, transparent),
              0 30px 44px -28px color-mix(in oklab, var(--ink) 90%, transparent);
}
.essay-kind {
  font-family: var(--cond); font-weight: 600; text-transform: uppercase; letter-spacing: .18em;
  font-size: 11.5px; color: var(--p2);
}
.essay-title {
  font-family: var(--display); font-weight: 700; font-stretch: var(--stretch);
  text-transform: uppercase; letter-spacing: -.01em; line-height: 1;
  font-size: clamp(24px, 2.6vw, 36px); color: var(--ink); margin: 12px 0 0;
  transition: color .3s;
}
.essay:hover .essay-title { color: var(--p1); }
.essay-dek {
  font-family: var(--body); font-size: clamp(15px, 1.3vw, 17px); line-height: 1.45;
  color: var(--ink); opacity: .82; margin: 12px 0 0;
}
.essay-quote {
  font-family: var(--body); font-style: italic; font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.4; color: var(--ink); margin: clamp(16px, 2vw, 22px) 0 0;
  padding-left: 16px; border-left: 2.5px solid var(--p3);
}
.essay-foot {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  margin-top: auto; padding-top: clamp(18px, 2.4vw, 26px); flex-wrap: wrap;
}
.essay-meta {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .02em; color: var(--ink); opacity: .6;
}
.essay-read {
  font-family: var(--cond); font-weight: 600; text-transform: uppercase; letter-spacing: .1em;
  font-size: 12.5px; color: var(--p1);
}
@media (max-width: 760px) { .essay-grid { grid-template-columns: 1fr; } }

/* reader overlay */
.reader-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: color-mix(in oklab, var(--ink) 62%, transparent);
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  display: flex; justify-content: center;
  padding: clamp(16px, 4vh, 56px) clamp(12px, 4vw, 40px);
  animation: reader-fade .3s ease;
}
@keyframes reader-fade { from { opacity: 0; } to { opacity: 1; } }
.reader-doc {
  position: relative; width: min(100%, 760px); max-height: 100%;
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper-2);
  border: 1.6px solid color-mix(in oklab, var(--ink) 80%, transparent);
  border-radius: 16px;
  box-shadow: 0 40px 70px -30px #06101c;
  padding: clamp(34px, 5vw, 72px) clamp(24px, 5vw, 76px) clamp(40px, 6vw, 80px);
  animation: reader-rise .4s cubic-bezier(.2,.7,.2,1);
}
@keyframes reader-rise { from { transform: translateY(18px); opacity: .4; } to { transform: none; opacity: 1; } }
.reader-doc::-webkit-scrollbar { width: 9px; }
.reader-doc::-webkit-scrollbar-thumb { background: color-mix(in oklab, var(--ink) 26%, transparent); border-radius: 8px; }
.reader-close {
  position: sticky; top: 0; float: right; margin: -8px -8px 0 0;
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer; z-index: 2;
  display: grid; place-items: center; font-size: 26px; line-height: 1; padding-bottom: 3px;
  color: var(--ink); background: var(--paper);
  border: 1.5px solid color-mix(in oklab, var(--ink) 60%, transparent);
  transition: background .25s, transform .25s;
}
.reader-close:hover { background: var(--p2); color: var(--paper-2); transform: rotate(90deg); }
.reader-head {
  border-bottom: 1.5px solid color-mix(in oklab, var(--ink) 24%, transparent);
  padding-bottom: clamp(20px, 3vw, 30px); margin-bottom: clamp(22px, 3vw, 34px);
}
.reader-title {
  font-family: var(--display); font-weight: 800; font-stretch: var(--stretch);
  text-transform: uppercase; letter-spacing: -.01em; line-height: .98;
  font-size: clamp(30px, 4.4vw, 54px); color: var(--ink); margin: 12px 0 0;
}
.reader-byline {
  font-family: var(--cond); text-transform: uppercase; letter-spacing: .16em;
  font-size: 12px; color: var(--p2); margin-top: 14px;
}
.reader-prose p {
  font-family: var(--body); font-size: clamp(17px, 1.5vw, 20px); line-height: 1.66;
  color: var(--ink); margin: 0 0 1.15em; text-wrap: pretty;
}
.reader-prose p:first-child::first-letter {
  font-family: var(--display); font-weight: 800; float: left;
  font-size: 3.4em; line-height: .78; padding: 6px 12px 0 0; color: var(--p2);
}
.reader-end {
  text-align: center; color: var(--p3); font-size: 22px;
  margin-top: clamp(20px, 3vw, 32px); opacity: .8;
}

/* ============ CONTACT / footer ============ */
.contact {
  background: var(--p2); color: var(--paper-2);
  border-top: 1px solid color-mix(in oklab, var(--paper-2) 24%, transparent);
  padding: clamp(80px, 14vh, 180px) var(--gutter) clamp(40px, 7vh, 80px);
  position: relative; overflow: hidden;
}
.contact .big {
  font-family: var(--display); font-weight: 900; font-stretch: var(--stretch);
  text-transform: uppercase; letter-spacing: -.015em; line-height: .95;
  font-size: clamp(26px, 7vw, 96px); margin: 0; color: var(--paper-2);
}
.contact .eyebrow { color: var(--paper-2); opacity: .8; }
.contact-row {
  display: flex; flex-wrap: wrap; gap: 14px 28px; margin-top: clamp(28px, 5vh, 56px);
  max-width: var(--maxw);
}
.contact a.link {
  font-family: var(--cond); font-weight: 500; text-transform: uppercase; letter-spacing: .12em;
  font-size: clamp(14px, 1.3vw, 17px); color: var(--paper-2); text-decoration: none;
  border: 1.6px solid color-mix(in oklab, var(--paper-2) 60%, transparent);
  padding: 12px 22px; border-radius: 40px;
  box-shadow: 4px 5px 0 -1px color-mix(in oklab, #000 30%, transparent);
  transition: transform .25s, background .25s, color .25s;
}
.contact a.link:hover { transform: translateY(-2px); background: var(--paper-2); color: var(--p1); }
.contact .foot {
  margin-top: clamp(48px, 9vh, 100px); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-family: var(--cond); text-transform: uppercase; letter-spacing: .14em; font-size: 12px;
  color: var(--paper-2); opacity: .7;
  border-top: 1.4px solid color-mix(in oklab, var(--paper-2) 30%, transparent); padding-top: 20px;
  max-width: 100%;
}
.contact .leaf {
  position: absolute; width: clamp(120px, 18vw, 260px); aspect-ratio: 1 / 1.3;
  background: color-mix(in oklab, var(--paper-2) 14%, transparent);
  border-radius: 0 58% 0 58%; right: -40px; top: -40px; transform: rotate(20deg);
}

.section.center { text-align: center; }
.section.center .section-head { align-items: center; }
.section.center .lead { margin-left: auto; margin-right: auto; }

/* ============ POETRY ============ */
.poetry-stack {
  max-width: 60ch; margin: 0 auto;
  display: flex; flex-direction: column; gap: clamp(46px, 8vh, 92px);
}
.poem { position: relative; }
.poem-mark {
  text-align: center; color: var(--p3); font-size: 20px; opacity: .85;
  margin: 0 0 clamp(40px, 7vh, 84px); letter-spacing: .3em;
}
.poem-title {
  font-family: var(--body); font-style: italic; font-weight: 500;
  font-size: clamp(28px, 3.4vw, 44px); line-height: 1.08;
  color: var(--ink); margin: 0 0 clamp(20px, 3vh, 32px);
  text-wrap: balance;
}
.poem-body .stanza {
  font-family: var(--body); font-size: clamp(17px, 1.45vw, 20px);
  line-height: 1.62; color: var(--ink); margin: 0 0 1.5em;
  text-wrap: pretty;
}
.poem-body .stanza:last-child { margin-bottom: 0; }

/* ============ STORYBOOK ============ */
.storybook-sec { position: relative; }
.reader {
  display: flex; flex-direction: column; align-items: center; gap: clamp(16px, 2.4vh, 26px);
  outline: none;
}
.reader-stage {
  position: relative;
  width: min(100%, calc(76vh * 0.6985));
  aspect-ratio: 1668 / 2388;
  border-radius: 16px;
  border: 1.6px solid color-mix(in oklab, var(--ink) 78%, transparent);
  background: radial-gradient(120% 90% at 50% 0%, #15384a 0%, #0c2236 52%, #07111f 100%);
  box-shadow: 10px 12px 0 -2px color-mix(in oklab, var(--ink) 16%, transparent),
              0 40px 60px -36px #06101c;
  overflow: hidden;
}
.page-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.012);
  transition: opacity .7s cubic-bezier(.4,0,.2,1), transform .9s cubic-bezier(.2,.7,.2,1);
  user-select: none;
}
.page-img.on { opacity: 1; transform: scale(1); }

.reader-arw {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 6;
  width: clamp(42px, 4vw, 54px); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--display); font-size: clamp(22px, 2.4vw, 30px); line-height: 1; padding-bottom: 4px;
  color: #eaf2f6; cursor: pointer;
  background: rgba(8, 20, 30, 0.46);
  border: 1.5px solid rgba(233, 242, 246, 0.34);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: background .25s, transform .25s, opacity .25s;
}
.reader-arw:hover { background: rgba(8, 20, 30, 0.78); }
.reader-arw.prev { left: clamp(10px, 1.4vw, 18px); }
.reader-arw.next { right: clamp(10px, 1.4vw, 18px); }
.reader-arw:disabled { opacity: 0.28; cursor: default; }
.reader-arw:not(:disabled):hover { transform: translateY(-50%) scale(1.06); }

.reader-count {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 6;
  font-family: var(--cond); font-weight: 600; letter-spacing: .16em; font-size: 13px;
  color: #eaf2f6; background: rgba(8, 20, 30, 0.5);
  border: 1.3px solid rgba(233, 242, 246, 0.26); border-radius: 30px;
  padding: 6px 14px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.reader-count span { opacity: .5; margin: 0 2px; }

.reader-strip {
  display: flex; gap: 10px; width: 100%; max-width: min(100%, 760px);
  overflow-x: auto; padding: 6px 2px 10px; scroll-padding: 20px;
  scrollbar-width: thin;
}
.reader-strip::-webkit-scrollbar { height: 6px; }
.reader-strip::-webkit-scrollbar-thumb { background: color-mix(in oklab, var(--ink) 30%, transparent); border-radius: 6px; }
.thumb {
  flex: none; width: clamp(46px, 5vw, 60px); aspect-ratio: 1668 / 2388;
  border-radius: 6px; overflow: hidden; cursor: pointer; padding: 0;
  border: 2px solid color-mix(in oklab, var(--ink) 22%, transparent);
  background: #0c2236; opacity: .58;
  transition: opacity .25s, border-color .25s, transform .25s;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb:hover { opacity: .85; transform: translateY(-2px); }
.thumb.on { opacity: 1; border-color: var(--p3); }

.reader-meta {
  font-family: var(--cond); text-transform: uppercase; letter-spacing: .2em;
  font-size: 12px; color: var(--ink); opacity: .55;
}

/* ---------------- Code viewer (Built from scratch) ---------------- */
.code-open-btn {
  margin-top: 18px; display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .03em; color: var(--ink);
  background: var(--paper-2); cursor: pointer;
  border: 1.5px solid color-mix(in oklab, var(--ink) 55%, transparent);
  border-radius: 9px; padding: 9px 15px;
  transition: background .25s, color .25s, border-color .25s, transform .2s;
}
.code-open-btn:hover {
  background: var(--p1); color: var(--paper-2); border-color: var(--p1); transform: translateY(-1px);
}
.code-open-count { font-size: 10.5px; opacity: .72; padding-left: 10px; border-left: 1px solid currentColor; }

.code-overlay {
  position: fixed; inset: 0; z-index: 70;
  background: color-mix(in oklab, var(--ink) 66%, transparent);
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
  display: flex; justify-content: center;
  padding: clamp(16px, 4vh, 56px) clamp(12px, 4vw, 40px);
  animation: reader-fade .3s ease;
}
.code-modal {
  position: relative; display: flex; flex-direction: column;
  width: min(100%, 960px); max-height: 100%;
  background: #15241f; color: #d7e8db;
  border: 1.6px solid color-mix(in oklab, #000 45%, var(--neon-sage));
  border-radius: 15px; overflow: hidden;
  box-shadow: 0 40px 70px -30px #06101c;
  animation: reader-rise .4s cubic-bezier(.2,.7,.2,1);
}
.code-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 18px 20px 14px; border-bottom: 1px solid rgba(215,232,219,.14);
}
.code-modal-course {
  font-family: var(--mono); font-size: 11px; letter-spacing: .09em;
  text-transform: uppercase; color: #8fd3ab;
}
.code-modal-title {
  margin: 5px 0 0; font-family: var(--cond); font-weight: 600;
  font-size: clamp(18px, 2.2vw, 25px); color: #eaf3ec; line-height: 1.1;
}
.code-close {
  position: static; float: none; margin: 0; flex: none;
  background: #1d3029; color: #d7e8db; border-color: rgba(215,232,219,.3);
}
.code-close:hover { background: var(--neon-rose); color: #15241f; transform: none; }

.code-tabbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px 0; background: #11201b; border-bottom: 1px solid rgba(215,232,219,.14);
}
.code-tabs { display: flex; gap: 3px; overflow-x: auto; flex: 1; scrollbar-width: thin; }
.code-tab {
  font-family: var(--mono); font-size: 12px; white-space: nowrap; cursor: pointer;
  color: #9fb3aa; background: transparent; border: none;
  padding: 9px 14px; border-radius: 8px 8px 0 0; border-bottom: 2px solid transparent;
  transition: color .2s, background .2s, border-color .2s;
}
.code-tab:hover { color: #eaf3ec; background: rgba(215,232,219,.06); }
.code-tab.on { color: #eccd82; border-bottom-color: #eccd82; background: #15241f; }
.code-copy {
  flex: none; margin-bottom: 8px; align-self: center; cursor: pointer;
  font-family: var(--mono); font-size: 11px; letter-spacing: .03em; color: #d7e8db;
  background: rgba(20,36,31,.85); border: 1.3px solid rgba(215,232,219,.3);
  border-radius: 7px; padding: 6px 13px; transition: background .2s, color .2s;
}
.code-copy:hover { background: var(--neon-sage); color: #15241f; }

.code-viewport { overflow: auto; flex: 1; background: #15241f; }
.cv-pre {
  margin: 0; padding: 14px 18px 28px; font-family: var(--mono);
  font-size: 12.5px; line-height: 1.65; color: #d7e8db; tab-size: 4; counter-reset: ln;
}
.cv-pre code { display: block; }
.cv-line { display: block; counter-increment: ln; white-space: pre; }
.cv-line::before {
  content: counter(ln); display: inline-block; width: 2.6em; margin-right: 1.1em;
  text-align: right; color: #5c756c; user-select: none; -webkit-user-select: none;
}
@media (max-width: 560px) {
  .cv-pre { font-size: 11.5px; }
  .code-modal-head { padding: 14px 16px 12px; }
}
