/* ─────────────────────────────────────────────
   Geewizz — Stage.
   A huge foil wordmark that folds into its dock, then you on the left, one
   big piece of work, and a quiet strip of thumbnails down the right edge.
   Feed and Work share that space. No titles, no numbers: just the work.
   Brand tokens: paper ground, Geist, foil, teal accent, mono-spec rows.
   Knobs live on <html> as data-* and --vars (see the Dials).
   ───────────────────────────────────────────── */

@font-face { font-family: 'Geist'; src: url('fonts/Geist.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('fonts/GeistMono.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

@property --dot { syntax: '<length>'; inherits: false; initial-value: 0px; }

:root {
  --ground: #edebe8;
  --panel: #f5f4f2;
  --mat: #e4e1dd;
  --ink: #201e1c;
  --ink-strong: #000;
  --dim: rgba(32, 30, 28, 0.56);
  --hair: #c8c4bf;
  --accent: #24dae0;
  --dark: #171513;
  --dark-ink: #ebe7e2;
  --dark-dim: rgba(235, 231, 226, 0.55);
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --gutter: clamp(16px, 2.6vw, 36px);
  --col-gap: clamp(28px, 3.4vw, 64px);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);

  /* dials (defaults = Hannah's Edge tuning) */
  --thumb-w: 96px;
  --thumb-gap: 16px;
  --idle-o: 0.45;
  --idle-g: 0;
  --t-ms: 520ms;
  --dot-size: 9px;
  --dock-size: clamp(48px, 5.2vw, 100px);
  --stage-max: 1100px;

  /* white-on-cream press, from the Figma wordmark: #fff → #f2efeb → #a09a92 */
  --foil-tone: #e2ded8;
  --press-lip: rgba(255, 255, 255, 0.7);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #1b1917;
    --panel: #242220;
    --mat: #2b2926;
    --ink: #ebe7e2;
    --ink-strong: #fff;
    --dim: rgba(235, 231, 226, 0.55);
    --hair: #3b3734;
    --dark: #0f0e0d;
    --foil-tone: #161412;
    --press-lip: rgba(255, 255, 255, 0.06);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 15px/1.45 var(--font);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; letter-spacing: inherit; text-transform: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
ol, ul { list-style: none; margin: 0; padding: 0; }
p, h2, h3, figure { margin: 0; }

.skip { position: fixed; left: 12px; top: -60px; z-index: 60; padding: 8px 12px; background: var(--ink); color: var(--ground); }
.skip:focus { top: 12px; }
.spec { font: 500 11px/1.5 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; }
.dim { color: var(--dim); }
.arrow { display: inline-block; transition: transform 240ms var(--ease); }
a:hover .arrow { transform: translate(2px, -2px); }

/* ── the wordmark ──
   Letterpress logic: a fill a touch darker than the paper, with a hairline of
   light on the lower lip, reads as pressed IN. (A lighter fill reads as
   raised.) A faint sheen follows the pointer, like the foil catching light.
   foil.js draws the big version; this one is the docked mark. */
.foil {
  display: inline-block;
  font-family: var(--font);
  font-weight: 600;
  letter-spacing: -0.07em;
  line-height: 0.82;
  padding: 0 0.07em 0.1em 0;
  white-space: nowrap;
  color: transparent;
  background-image:
    radial-gradient(18% 110% at var(--fx, 30%) var(--fy, 20%), rgb(255 255 255 / calc(var(--press-sheen, 0.3) * 1)), rgb(255 255 255 / 0) 70%),
    linear-gradient(var(--foil-tone), var(--foil-tone));
  -webkit-background-clip: text;
  background-clip: text;
  /* a filter, not text-shadow: a text-shadow would paint over the clipped fill */
  filter: drop-shadow(0 1px 0 var(--press-lip));
  user-select: none;
  -webkit-user-select: none;
}
.foil span { font-weight: inherit; }

.hero { position: relative; height: 100svh; }
.hero-foot {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: var(--gutter);
  display: flex; justify-content: space-between; gap: 16px; color: var(--dim);
  opacity: calc(1 - var(--p, 0) * 4);
}
.hero-cue { animation: nudge 2.4s var(--ease) infinite; }
@keyframes nudge { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(4px); } }

/* Fixed, and moved by transform only: it never triggers layout while you scroll. */
.mark {
  position: fixed; left: 0; top: 0; z-index: 30;
  transform-origin: 0 0; will-change: transform;
  line-height: 0;
  visibility: hidden; /* until measured */
}
.mark.ready { visibility: visible; }
.mark .foil { font-size: var(--hero-size, 20vw); }
/* foil press (foil.js) owns the big wordmark; the CSS foil takes over as it docks */
.paper-gl { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 1; pointer-events: none; }
.hero, .shell, .end { position: relative; z-index: 2; }
.mark.has-gl .foil { opacity: clamp(0, calc((var(--p, 0) - 0.6) * 5), 1); }
.bar { display: none; }

/* ── identity ── */
.me-top { display: grid; gap: 12px; justify-items: start; }
.me-body { display: grid; gap: 14px; align-content: end; }
.me-name { font-weight: 600; letter-spacing: -0.02em; }
/* the role sits under the name, the same size, a lighter weight */
.me-role { display: block; font-weight: 400; color: var(--dim); letter-spacing: -0.01em; }
.me-bio { max-width: 36ch; }
.me-group { display: grid; gap: 8px; margin-top: 10px; }
.me-head { color: var(--dim); font: inherit; font-weight: 400; margin: 0; }
/* side projects stack, one per line */
.me-links { display: grid; gap: 4px; justify-items: start; }
.me-links a, .me-foot a { border-bottom: 1px solid transparent; transition: border-color 200ms; }
.me-links a:hover, .me-foot a[href]:hover { border-color: currentColor; }
.me-foot { display: flex; flex-wrap: wrap; gap: 4px 18px; position: relative; }
.me-foot .todo { color: var(--dim); cursor: default; }
@container (max-width: 290px) { .me-foot { column-gap: 12px; } }
.me { container-type: inline-size; }

/* Contact copies the address; this says so over the links row, then gets out of the way */
.copied {
  position: absolute; left: -11px; top: 50%; z-index: 35;
  padding: 6px 11px 5px; border-radius: 999px; white-space: nowrap; text-transform: none; letter-spacing: 0.01em;
  background: var(--ink); color: var(--ground);
  opacity: 0; transform: translateY(-50%) scale(0.96); transform-origin: left center; pointer-events: none;
  transition: opacity 220ms, transform 320ms var(--ease);
}
.copied.on { opacity: 1; transform: translateY(-50%); }

/* ── Feed / Work: one switch. A black dot marks where you are and rolls across when you switch ── */
.views { display: grid; gap: 4px; justify-items: start; z-index: 32; }
.views-tabs { position: relative; display: flex; gap: 16px; }
.views-tabs button { padding: 2px 0 2px 14px; color: var(--dim); transition: color 220ms; }
.views-tabs button:hover, .views-tabs button[aria-pressed='true'] { color: var(--ink); }
.views-tabs button[hidden] { display: none; }
.views-dot {
  position: absolute; left: 0; top: 50%; width: 7px; height: 7px; margin-top: -4.5px;
  border-radius: 50%; background: var(--ink); pointer-events: none;
  transform-origin: 50% 50%; /* site.js rolls it, and stretches it as it goes */
}
.views-note { text-wrap: balance; }
.feed-note { padding: 0 0 18px; text-wrap: balance; }

/* Work, while the full work is on its way: a loose pile you can push around (site.js: initPile) */
/* phones: cards a little bigger and pulled in towards the middle, so the pile sits inside the screen */
.pile { position: relative; width: 100%; height: 112vw; --wk: 1.45; --xk: 0.72; }
.pile-card {
  position: absolute; left: calc((50 + (var(--x) - 50) * var(--xk, 1)) * 1%); top: calc(var(--y) * 1%); margin: 0;
  width: calc(var(--w) * var(--wk, 1) * 1%); aspect-ratio: var(--ar);
  translate: -50% -50%; scale: 1;
  transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(calc(var(--r) + var(--tilt, 0deg)));
  background: var(--mat); border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), 0 10px 26px -12px rgba(0, 0, 0, 0.38);
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: scale 200ms var(--ease), box-shadow 200ms var(--ease);
}
.pile-card img, .pile-card video { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; pointer-events: none; }
.pile-card video { position: absolute; inset: 0; }
/* padded cards: the picture sits inside a margin of its own edge colour */
.pile-card.is-padded { background: var(--edge); }
.pile-card.is-padded img, .pile-card.is-padded video { position: absolute; inset: var(--pad); width: calc(100% - var(--pad) * 2); height: calc(100% - var(--pad) * 2); object-fit: contain; border-radius: 0; }
/* a piece of the pile, large */
.piece-view { border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: transparent; display: none; place-items: center; cursor: zoom-out; }
.piece-view[open] { display: grid; }
.piece-view::backdrop { background: color-mix(in srgb, var(--ground) 94%, transparent); }
.piece-fig { position: relative; margin: 0; aspect-ratio: var(--ar); width: min(88vw, calc(82dvh * var(--ar))); background: var(--mat); border-radius: 3px; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.45); }
.piece-fig img, .piece-fig video { display: block; width: 100%; height: 100%; object-fit: cover; }
.piece-fig.is-padded { background: var(--edge); }
.piece-fig.is-padded img, .piece-fig.is-padded video { position: absolute; inset: var(--pad); width: calc(100% - var(--pad) * 2); height: calc(100% - var(--pad) * 2); object-fit: contain; }
.piece-close { position: fixed; top: var(--gutter, 24px); right: var(--gutter, 24px); color: var(--dim); }
.pile-card { cursor: grab; }
@media (hover: hover) { .pile-card:not(.is-sticker):not(.is-held):hover { scale: 1.015; } }
.pile-card.is-held { scale: 1.035; cursor: grabbing; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1), 0 26px 48px -16px rgba(0, 0, 0, 0.45); }
.pile-card:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.pile-card.is-sticker, .pile-card.is-sticker.is-held { background: none; box-shadow: none; }
.pile-card.is-sticker img { object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.28)); }
.pile-hint { color: var(--dim); padding-top: 14px; text-align: center; }
.t-soon .book-card { border-top: 0 !important; padding: 0 !important; display: block !important; }
@media (prefers-reduced-motion: reduce) { .pile-card { transition: none; } }
.feed-note:empty { display: none; }
.views-note:empty { display: none; }

/* Work's bookends: a project's opening card, as a feed card on phones and a label in the strip on desktop */
.book-tile { display: none; }
.t-book .book-card { display: grid; gap: 14px; padding: 28px 0 4px; border-top: 1px solid var(--ink); }
.t-book .book-card .book-name { font-size: clamp(30px, 9vw, 44px); font-weight: 600; letter-spacing: -0.04em; line-height: 0.95; }
.t-book .book-card .book-text { display: grid; gap: 10px; max-width: 52ch; }
.t-book .book-card .book-meta, .t-book .book-card .book-next { color: var(--dim); }
.t-book .book-card .book-todo { color: var(--dim); border: 1px dashed var(--hair); border-radius: 4px; padding: 12px 14px; }
.t-book:not(:first-child) { margin-top: 32px; }

/* ── a thumbnail (and, on phones, a feed card) ── */
.t[hidden] { display: none; }
.t-btn { display: block; position: relative; width: 100%; text-align: left; }
.t-media { position: relative; overflow: hidden; background: var(--mat); border-radius: 3px; aspect-ratio: var(--ar); }
.t-media img, .t-media video { width: 100%; height: 100%; object-fit: cover; }
.t-media video { position: absolute; inset: 0; opacity: 0; transition: opacity 300ms; }
.t-media video.on { opacity: 1; }
.t-cap { padding-top: 10px; }
.t-cap a, .stage-link a, .viewer-link { border-bottom: 1px solid var(--hair); transition: border-color 200ms; }
.t-cap a:hover, .stage-link a:hover, .viewer-link:hover { border-color: currentColor; }

/* switching views, the column falling into place and the viewer are all moved by site.js (GSAP),
   so nothing they move carries a CSS transition of its own */
.strip-dot { display: none; }

.stage { display: none; }
.end { display: flex; justify-content: space-between; gap: 16px; color: var(--dim); padding: 48px var(--gutter) 110px; }
.end a:hover { color: var(--ink); }

/* ── phones and small tablets: a plain, generous feed ── */
@media (max-width: 759px) {
  .bar {
    display: block; position: fixed; inset: 0 0 auto; height: 60px; z-index: 29;
    background: color-mix(in srgb, var(--ground) 88%, transparent);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--hair);
    opacity: 0; transition: opacity 250ms; pointer-events: none;
  }
  .docked .bar { opacity: 1; }
  .me { padding: 8px var(--gutter) 40px; }
  .dock { display: none; }
  .me-foot { margin-top: 18px; }
  .strip { padding: 0 var(--gutter); }
  .thumbs { display: grid; gap: 40px; max-width: 600px; margin-inline: auto; }
  .t-media { max-width: min(100%, var(--native, 9999px)); }
  .dials-toggle, .dials { display: none !important; }
  /* the switch rides in the top bar, opposite the mark */
  .views { position: fixed; top: 0; right: var(--gutter); height: 60px; align-content: center; opacity: 0; pointer-events: none; transition: opacity 250ms; }
  .docked .views { opacity: 1; pointer-events: auto; }
  .views-note { display: none; }
  .projects { display: none !important; }
}

/* ════════════════════════════════════════════
   Desktop: the three-panel stage
   ════════════════════════════════════════════ */
@media (min-width: 760px) {
  .shell {
    display: grid; column-gap: var(--col-gap);
    padding: 0 var(--gutter);
    grid-template-columns: minmax(240px, 0.9fr) minmax(0, 2.6fr) var(--thumb-w);
    grid-template-areas: 'me stage strip';
  }

  .me {
    grid-area: me; position: sticky; top: 0; height: 100vh;
    display: grid; grid-template-rows: auto 1fr auto; gap: 24px;
    padding: var(--gutter) 0;
  }
  .dock { height: calc(var(--dock-size) * 0.82); width: calc(var(--dock-size) * 3.2); line-height: 0; }
  /* once docked, the flying mark hands over to this one: same type, same place, real size */
  .dock-foil { font-size: var(--dock-size); visibility: hidden; }
  .docked .dock-foil { visibility: visible; }
  .docked .mark .foil { opacity: 0 !important; }

  /* Work: the projects, bracketed like the Figma reference — [●] CULTURE AMP  [ ] UP BANK … */
  .projects[hidden] { display: none; }
  .projects { display: grid; gap: 3px; justify-items: start; margin-top: 18px; }
  .projects button { color: var(--dim); transition: color 200ms; white-space: nowrap; }
  .projects button::before { content: '[ ] '; white-space: pre; }
  .projects button[aria-current='true'] { color: var(--ink); }
  .projects button[aria-current='true']::before { content: '[●] '; }
  .projects button:hover { color: var(--ink); }

  /* where the switch sits (Dials → Switch) */
  .stage > .views, [data-views='corner'] .views, [data-views='pill'] .views { grid-auto-flow: column; align-items: center; gap: 18px; }
  /* stage: over the work, top right, rising with the page */
  .stage > .views { position: absolute; top: var(--gutter); right: 0; }
  /* corner: the same spot, but there from the moment you land */
  [data-views='corner'] .views { position: fixed; top: var(--gutter); right: calc(var(--gutter) + var(--thumb-w) + var(--col-gap)); }
  /* pill: floats up once everything has fallen into place */
  [data-views='pill'] .views {
    position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%);
    gap: 14px; padding: 8px 16px 8px 12px;
    background: color-mix(in srgb, var(--panel) 88%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--hair); border-radius: 999px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    transition: opacity 300ms, transform 400ms var(--ease);
  }
  [data-views='pill'] body:not(.docked) .views { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }
  .stage > .views .views-note, [data-views='corner'] .views-note, [data-views='pill'] .views-note { padding-left: 14px; border-left: 1px solid var(--hair); }

  .strip { grid-area: strip; }
  /* the padding lets the first and last thumbs reach the read line */
  .thumbs {
    display: flex; flex-direction: column; align-items: center; gap: var(--thumb-gap);
    padding: calc(50vh - var(--thumb-w) * 0.35) 0 calc(50vh - var(--thumb-w) * 0.35);
  }
  .t { width: 100%; position: relative; }
  .t-cap, .t-media video { display: none; }
  .t-media {
    border-radius: 2px;
    opacity: var(--idle-o); filter: grayscale(var(--idle-g));
    transition: opacity 250ms, filter 250ms, transform 350ms var(--ease);
  }
  [data-shape='square'] .t-media { aspect-ratio: 1; }
  [data-shape='landscape'] .t-media { aspect-ratio: 4 / 3; }
  .t-btn { cursor: pointer; }
  .t-btn:hover .t-media, .t.is-active .t-media { opacity: 1; filter: none; }
  /* in the strip a project opens with its name on a hairline */
  .t-book .book-card { display: none; }
  .t-book .book-tile {
    display: block; padding: 8px 0 2px; border-top: 1px solid var(--ink);
    color: var(--dim); font-size: 9px; line-height: 1.3; text-wrap: balance; transition: color 200ms;
  }
  .t-book:not(:first-child) { margin-top: calc(var(--thumb-gap) + 18px); }
  .t-book.is-active .book-tile, .t-book .t-btn:hover .book-tile { color: var(--ink); }

  /* which one is on stage: one dot, which glides down the strip to the next */
  .strip { position: relative; }
  [data-marker='dot'] .strip-dot {
    display: block; position: absolute; top: 0; left: -14px; width: 6px; height: 6px;
    border-radius: 50%; background: var(--accent); pointer-events: none;
  }
  [data-marker='ring'] .t.is-active .t-media { outline: 1.5px solid var(--ink); outline-offset: 3px; }
  [data-marker='lift'] .t.is-active .t-media { transform: scale(1.14); }

  /* with no captions the work gets the height; room is kept only for the switch when it sits up here or in the pill */
  .stage {
    grid-area: stage; display: grid; align-content: center;
    position: sticky; top: 0; height: 100vh;
    --top-room: 0px; --foot-room: 0px;
    padding: calc(var(--gutter) + var(--top-room)) 0 calc(var(--gutter) + var(--foot-room));
    --stage-h: calc(100vh - var(--gutter) * 2 - var(--top-room) - var(--foot-room) - 40px);
  }
  [data-views='stage'] .stage, [data-views='corner'] .stage { --top-room: 34px; }
  [data-views='pill'] .stage { --foot-room: 52px; }
  .feed-note { display: none; }
  .stage-fig { display: grid; gap: 12px; justify-items: center; position: relative; container-type: inline-size; }
  /* the stage is one fixed space and every piece sits on its centre, so nothing moves but the piece itself */
  .stage-media { position: relative; display: grid; width: 100%; height: var(--stage-h); place-items: center; cursor: zoom-in; outline-offset: 6px; }
  /* Offcuts, not a showcase: each piece keeps its own shape but takes up the same amount of paper
     (--rt is the square root of its ratio), well inside the stage. A piece's "size" line nudges it. */
  .frame {
    --side: min(calc(var(--stage-h) * 0.64), 66cqw);
    grid-area: 1 / 1; place-self: center; position: relative;
    aspect-ratio: var(--ar);
    width: min(100cqw, calc(var(--stage-h) * var(--arn)), var(--stage-max), var(--native, 9999px), calc(var(--side) * var(--rt, 1) * var(--size, 1)));
    border-radius: 3px; overflow: hidden; background: var(--mat) center / cover no-repeat;
  }
  .frame img, .frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  /* holds its line even when empty, so the work doesn't jump between a site and a picture */
  .stage-link { min-height: 1.5em; }

  /* backdrops */
  /* panel: it wraps the piece with an even margin, so it is always the piece's shape. Its bottom-right
     corner is pinned, so a narrower or shorter piece only pulls the top and left edges in */
  [data-backdrop='panel'] .stage { align-content: end; }
  [data-backdrop='panel'] .stage-media { --pad: clamp(18px, 2.2vw, 36px); width: fit-content; height: auto; background: var(--panel); border-radius: 6px; padding: var(--pad); place-items: center; }
  [data-backdrop='panel'] .frame {
    place-self: center;
    width: min(calc(100cqw - var(--pad) * 2), calc((var(--stage-h) - var(--pad) * 2) * var(--arn)), var(--stage-max), var(--native, 9999px));
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 12px 32px -12px rgba(0, 0, 0, 0.18);
  }

  /* a project's opening card: its name and the words about it, on the stage where the work goes */
  .frame.book {
    aspect-ratio: auto; width: min(100cqw, 640px); min-height: min(62vh, calc(var(--stage-h) * 0.8));
    overflow: visible; background: none; box-shadow: none !important; border-radius: 0;
    display: grid; align-content: end; gap: 18px; padding: 8px 0; cursor: default;
  }
  [data-backdrop='panel'] .frame.book { width: min(calc(100cqw - var(--pad) * 2), 640px); }
  /* the pile takes the whole stage */
  /* the pile sits at the same height as an Offcut on the stage: centred, about three quarters of its height */
  .frame.book.pile-frame { display: grid; align-content: end; justify-items: center; width: 100cqw; height: var(--stage-h); min-height: 0; padding: 0; gap: 10px; }
  .pile-frame .pile { height: calc(var(--stage-h) * 0.78); width: min(100%, calc(var(--stage-h) * 1.5)); --wk: 1.01; --xk: 1; }
  .pile-frame .pile-hint { padding: 0; justify-self: center; }
  .t-soon .t-btn { visibility: hidden; }
  .t-soon .book-card { display: none !important; }
  .book-kicker { color: var(--dim); }
  .book-name { font-size: clamp(34px, 4.4vw, 64px); font-weight: 600; letter-spacing: -0.04em; line-height: 0.95; }
  .book-meta { color: var(--dim); }
  .book-text { display: grid; gap: 12px; max-width: 52ch; font-size: 16px; }
  .book-todo { color: var(--dim); border: 1px dashed var(--hair); border-radius: 4px; padding: 12px 14px; }
  .book-next { color: var(--dim); }
  [data-backdrop='dark'] .stage { isolation: isolate; color: var(--dark-ink); --ink: var(--dark-ink); --dim: var(--dark-dim); --hair: #3b3734; }
  [data-backdrop='dark'] .stage::before { content: ''; position: absolute; inset: 14px calc(-1 * clamp(14px, 1.7vw, 32px)); z-index: -1; background: var(--dark); border-radius: 8px; }
  [data-backdrop='dark'] .stage { padding-inline: clamp(16px, 2.4vw, 40px); }
  [data-backdrop='dark'] .frame { background: #23201e; place-self: end center; }
  [data-backdrop='dark'] .stage-fig { justify-items: center; }
  [data-backdrop='dark'] .stage > .views { right: clamp(16px, 2.4vw, 40px); }

  /* how a new piece arrives */
  .frame.in { animation: var(--t-ms) var(--ease) both; }
  [data-transition='halftone'] .frame.in {
    -webkit-mask: radial-gradient(circle, #000 var(--dot), transparent calc(var(--dot) + 0.6px)) 0 0 / var(--dot-size) var(--dot-size);
    mask: radial-gradient(circle, #000 var(--dot), transparent calc(var(--dot) + 0.6px)) 0 0 / var(--dot-size) var(--dot-size);
    animation-name: develop;
  }
  [data-transition='fade'] .frame.in { animation-name: fade-in; }
  [data-transition='slide'] .frame.in { animation-name: slide-in; }
  .frame.out { animation: fade-out calc(var(--t-ms) * 0.7) ease forwards; }
  [data-transition='none'] .frame.out { display: none; }

  .end { grid-column: 1 / -1; }
}
@media (min-width: 760px) and (max-width: 1100px) {
  :root { --col-gap: 24px; }
  .shell { grid-template-columns: minmax(190px, 0.8fr) minmax(0, 2.4fr) var(--thumb-w); }
  .me-bio { font-size: 14px; }
}
@keyframes develop { from { --dot: 0px; } to { --dot: calc(var(--dot-size) * 0.75); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes slide-in { from { opacity: 0; transform: translateY(18px); } }
@keyframes fade-out { to { opacity: 0; } }

/* ── review aid: dials ── */
.dials-toggle {
  position: fixed; right: var(--gutter); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 40;
  padding: 6px 11px; border-radius: 999px; color: var(--dim);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--hair);
  transition: opacity 300ms, color 200ms;
}
.dials-toggle:hover, .dials-toggle[aria-expanded='true'] { color: var(--ink); }
body:not(.docked) .dials-toggle[aria-expanded='false'] { opacity: 0; pointer-events: none; }

.dials {
  position: fixed; right: var(--gutter); bottom: 60px; z-index: 41; width: 280px;
  max-height: calc(100vh - 110px); overflow: auto;
  padding: 14px; display: grid; gap: 12px;
  background: var(--panel); border: 1px solid var(--hair); border-radius: 10px;
  box-shadow: 0 16px 48px -12px rgba(0, 0, 0, 0.25);
}
.dials[hidden] { display: none; }
.dial { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 10px; }
.dial output { color: var(--dim); font-variant-numeric: tabular-nums; }
.dial input[type='range'] { grid-column: 1 / -1; width: 100%; margin: 0; accent-color: var(--ink); }
.dial .seg { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; }
.dial .seg button { padding: 4px 8px; border: 1px solid var(--hair); border-radius: 999px; color: var(--dim); }
.dial .seg button[aria-pressed='true'] { border-color: var(--ink); color: var(--ink); }
.wm { display: grid; gap: 12px; padding-bottom: 14px; margin-bottom: 2px; border-bottom: 1px solid var(--hair); }
.wm-head { display: flex; justify-content: space-between; align-items: center; color: var(--dim); }
.wm-head b { color: var(--ink); font-weight: 500; }
.wm-head button { padding: 4px 8px; border: 1px solid var(--hair); border-radius: 999px; color: var(--ink); }
.dials-actions { display: flex; gap: 8px; padding-top: 10px; border-top: 1px solid var(--hair); }
.dials-actions button { flex: 1; padding: 8px; border: 1px solid var(--hair); border-radius: 6px; }
.dials-actions button:hover { border-color: var(--ink); }

/* ── viewer ── */
/* The paper comes up as a veil (site.js fades --veil), so the piece can be seen
   growing out of the page beneath it. The frame is sized before anything loads,
   from its ratio and the room there is, so it has somewhere to fly to at once. */
.viewer {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: var(--gutter);
  border: 0; color: var(--ink); overflow: hidden;
  background: color-mix(in srgb, var(--ground) calc(var(--veil, 1) * 100%), transparent);
  display: none; grid-template-rows: 1fr auto; gap: 18px;
}
.viewer[open] { display: grid; }
.viewer::backdrop { background: transparent; }
.viewer-media { min-height: 0; display: grid; place-items: center; container-type: size; }
.viewer-frame {
  grid-area: 1 / 1; position: relative;
  aspect-ratio: var(--ar); width: min(100cqw, calc(100cqh * var(--arn)), var(--native, 9999px));
  border-radius: 3px; overflow: hidden; background: var(--mat);
  transform-origin: 0 0;
}
.viewer-frame img, .viewer-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.viewer-nav { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.viewer-nav button { padding: 8px 10px; border: 1px solid var(--hair); border-radius: 999px; min-width: 40px; }
.viewer-nav button:hover { border-color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

/* ── Dials → Wordmark foil: "portfolio" is the foil from the portfolio site (src/index.css), so
   the big wordmark is CSS, not the paper press: the measured ramp #fff → #f2efeb → #a09a92 at
   95.6°, brushed streaks, a specular core with warm and cool fringes that follows the cursor,
   a counter-shade opposite it, and a hairline emboss ── */
:root {
  --pf-angle: 95.6deg; --pf-a: #fff; --pf-b: #f2efeb; --pf-c: #a09a92;
  --pf-spec: rgba(255, 255, 255, 0.9); --pf-shade: rgba(88, 82, 74, 0.28);
  --pf-warm: rgba(255, 208, 156, 0.5); --pf-cool: rgba(178, 208, 255, 0.42);
  --pf-brush-l: rgba(255, 255, 255, 0.055); --pf-brush-d: rgba(60, 55, 48, 0.055);
  --pf-emboss-lo: rgba(255, 255, 255, 0.3); --pf-emboss-hi: rgba(88, 82, 74, 0.1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --pf-a: #8b857d; --pf-b: #625d57; --pf-c: #3a3733;
    --pf-spec: rgba(255, 255, 255, 0.16); --pf-shade: rgba(0, 0, 0, 0.45);
    --pf-warm: rgba(255, 196, 132, 0.16); --pf-cool: rgba(150, 190, 255, 0.14);
    --pf-brush-l: rgba(255, 255, 255, 0.07); --pf-brush-d: rgba(0, 0, 0, 0.16);
    --pf-emboss-lo: rgba(255, 255, 255, 0.08); --pf-emboss-hi: rgba(0, 0, 0, 0.5);
  }
}
[data-foil-style='portfolio'] .foil {
  background-image:
    repeating-linear-gradient(var(--pf-angle), var(--pf-brush-l) 0 1px, var(--pf-brush-d) 1px 2.5px),
    radial-gradient(19% 88% at var(--fx, 36%) var(--fy, 30%), var(--pf-spec) 0%, rgba(255, 255, 255, 0.22) 26%, transparent 62%),
    radial-gradient(26% 96% at calc(var(--fx, 36%) - 6%) var(--fy, 30%), var(--pf-warm) 0%, transparent 62%),
    radial-gradient(26% 96% at calc(var(--fx, 36%) + 6%) var(--fy, 30%), var(--pf-cool) 0%, transparent 62%),
    radial-gradient(circle farthest-side at var(--fx-op, 64%) calc(100% - var(--fy, 30%)), var(--pf-shade) 0%, transparent 55%),
    linear-gradient(var(--pf-angle), var(--pf-a) 1.41%, var(--pf-b) 56.62%, var(--pf-c) 114.66%);
  background-blend-mode: soft-light, screen, soft-light, soft-light, multiply, normal;
  filter: none;
  text-shadow: 0 0.5px 0 var(--pf-emboss-lo), 0 -0.5px 0.5px var(--pf-emboss-hi);
}
[data-foil-style='portfolio'] .mark.has-gl .foil { opacity: 0.9; }
[data-foil-style='portfolio'] .paper-gl { display: none; }

/* ── Dials → Hero: "bike" sets the portfolio's 3D figure on the wordmark (bike.js). Drag to turn her ── */
.bike-gl {
  position: absolute; left: 0; top: 0; z-index: 31; width: 100%;
  cursor: grab; touch-action: pan-y; opacity: 0;
}
.bike-gl.arriving { transition: opacity 900ms var(--ease); }
.bike-gl.grabbing { cursor: grabbing; }
.bike-gl[hidden] { display: none; }
