/* ==========================================================================
   Tokens
   ========================================================================== */
/* Palette from the portfolio + resume: charcoal, light grey, orange. */
:root {
  --bg: #e4e4e4;
  --ink: #231f20;
  --paper: #dfdfdf;
  --muted: #6b6869;
  --line: rgba(35, 31, 32, 0.15);
  --accent: #ff4f2e;
  --gutter: clamp(16px, 2.2vw, 32px);
  --display: "Archivo", "Arial Narrow", Arial, sans-serif;
  --serif: "Newsreader", Times, serif;
  --ease: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--display);
  font-variation-settings: "wdth" 75;
  font-weight: 600;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, video { display: block; max-width: 100%; }

.serif {
  font-family: var(--serif);
  font-weight: 300;
  font-variation-settings: normal;
  letter-spacing: -0.01em;
}
/* Dark sections, like the portfolio slides. */
.dark {
  background: var(--ink);
  color: var(--paper);
  --line: rgba(223, 223, 223, 0.16);
  --muted: #9c9899;
}
.section-head .label, .manifesto > .label, .dark .label { color: var(--accent); }

.label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-weight: 700;
}

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px var(--gutter);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  mix-blend-mode: difference;
  color: #fff;
}
.nav-logo { font-size: 20px; font-weight: 900; letter-spacing: -0.01em; }
.nav-links { display: flex; gap: 32px; }
.nav-link { position: relative; text-transform: uppercase; font-weight: 700; }
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform 0.45s var(--ease);
}
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }

@media (max-width: 640px) {
  .nav-links { gap: 16px; }
}

/* ==========================================================================
   Custom cursor
   ========================================================================== */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 90;
  width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%; background: var(--accent);
  pointer-events: none;
  display: grid; place-items: center;
  transition: width 0.35s var(--ease-out), height 0.35s var(--ease-out), margin 0.35s var(--ease-out), background 0.3s;
}
.cursor-label {
  font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--bg);
  opacity: 0; transition: opacity 0.2s;
}
.cursor.is-big { width: 84px; height: 84px; margin: -42px 0 0 -42px; }
.cursor.is-big .cursor-label { opacity: 1; }
.cursor.is-hidden { width: 0; height: 0; margin: 0; }
@media (hover: none) { .cursor { display: none; } }
/* Hide the system cursor everywhere the dot is active (grab/pointer included). */
.has-cursor, .has-cursor * { cursor: none !important; }
.cursor.is-out { opacity: 0; }

/* ==========================================================================
   Page transition curtain
   ========================================================================== */
.curtain {
  position: fixed; inset: 0; z-index: 100;
  background: var(--accent);
  transform: translateY(0);
  pointer-events: none;
}
/* Lifts off on load; rises from below when leaving. */
.is-ready .curtain { transform: translateY(-101%); transition: transform 0.9s var(--ease); }
.is-leaving .curtain { transform: translateY(0); animation: curtain-in 0.6s var(--ease) both; }
@keyframes curtain-in { from { transform: translateY(101%); } to { transform: translateY(0); } }

/* ==========================================================================
   Reveal helpers
   ========================================================================== */
.line { display: block; overflow: hidden; }
.line > span {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 1.1s var(--ease-out);
}
.is-in .line > span { transform: none; }
.reveal-lines .line:nth-child(2) > span { transition-delay: 0.06s; }
.reveal-lines .line:nth-child(3) > span { transition-delay: 0.12s; }
.reveal-lines .line:nth-child(4) > span { transition-delay: 0.18s; }
.reveal-lines .line:nth-child(5) > span { transition-delay: 0.24s; }

.char { display: inline-block; will-change: transform; }

/* ==========================================================================
   Hero
   ========================================================================== */
/* Like the portfolio cover: empty dark screen, small orange labels, and the
   name sitting flush along the bottom edge. */
.hero {
  position: relative;
  height: 100svh;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 var(--gutter);
}
/* Cursor trail of work, behind the name and labels. On touch screens the
   browser only scrolls the hero vertically; sideways swipes draw the trail. */
.hero { touch-action: pan-y; }
.trail { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.trail-img {
  position: absolute;
  /* --kw/--kh are set per image in JS so each covers about the same area. */
  --s: clamp(150px, 21vw, 320px);
  width: calc(var(--s) * var(--kw, 1)); height: calc(var(--s) * var(--kh, 1));
  object-fit: contain;
  transform: translate(-50%, -50%);
}
.trail-hint {
  position: absolute; left: 50%; top: 42%; z-index: 1;
  transform: translate(-50%, -50%);
  margin: 0;
  display: flex; align-items: center; gap: 12px;
  color: var(--paper); opacity: 0.75;
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap; pointer-events: none;
  transition: opacity 0.5s;
}
.trail-hint svg { width: 22px; height: 12px; }
.trail-hint svg:first-child { animation: hint-left 1.6s var(--ease-out) infinite; }
.trail-hint svg:last-child { animation: hint-right 1.6s var(--ease-out) infinite; }
@keyframes hint-left { 50% { transform: translateX(-5px); } }
@keyframes hint-right { 50% { transform: translateX(5px); } }
.trail-hint.is-gone { opacity: 0; }
.hero-meta, .wordmark { position: relative; z-index: 1; }
/* Same blend as the nav: white with difference reads as light grey on the
   charcoal and inverts over the trail images behind it. */
.hero .wordmark { color: #fff; mix-blend-mode: difference; }
.hero-meta {
  display: flex; justify-content: space-between; gap: 16px;
  /* Same small uppercase label style used across the site, in orange. */
  color: var(--accent);
  font-size: clamp(13px, 1.1vw, 16px);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 1vh;
}

.wordmark {
  margin: 0 0 clamp(10px, 1.4vw, 24px);
  padding: 0;
  color: var(--paper);
  font-weight: 900;
  font-variation-settings: "wdth" 62;
  line-height: 0.8;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  user-select: none;
  /* font-size is fitted in JS */
}

/* ==========================================================================
   Intro: paragraph on the left, drifting image on the right
   ========================================================================== */
.intro {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 6vw;
  padding: 20vh var(--gutter) 22vh;
}
.intro-text {
  margin: 0;
  max-width: 20ch;
  font-size: clamp(30px, 3.8vw, 64px);
  line-height: 1.04;
}
.intro-media {
  justify-self: end;
  width: min(100%, 520px);
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  overflow: hidden;
  will-change: transform;
}
.intro-media-inner {
  height: 100%;
  will-change: transform;
}
.intro-media-inner > * {
  width: 100%; height: 118%;
  margin-top: -9%;
  object-fit: cover;
}
@media (max-width: 760px) {
  .intro { grid-template-columns: 1fr; gap: 8vh; padding: 14vh var(--gutter); }
  .intro-media { justify-self: start; width: 78%; }
}

/* ==========================================================================
   Section heads
   ========================================================================== */
.section-head {
  display: flex; justify-content: space-between;
  padding: 14px var(--gutter);
  border-top: 1px solid var(--line);
}

/* ==========================================================================
   Work list
   ========================================================================== */
.work { padding-top: 12vh; }
.work-list { list-style: none; margin: 0; padding: 4vh var(--gutter) 10vh; }
.work-item { overflow: hidden; }
.work-link {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.9vw;
  padding: 0.3vh 0;
}
.work-title {
  display: flex;
  align-items: center;
  margin: 0;
  font-size: clamp(40px, 6.6vw, 124px);
  font-weight: 900;
  font-variation-settings: "wdth" 62;
  line-height: 0.92;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateY(105%);
  transition: transform 1.1s var(--ease-out);
}
.work-item.is-in .work-title { transform: none; }
.work-half + .work-img { margin-left: 0.12em; }
/* The image slot opens from zero width, pushing the two halves apart. */
.work-img {
  position: relative;
  display: block;
  width: 0;
  height: 0.74em;
  margin-right: 0.12em;
  border-radius: 0.06em;
  overflow: hidden;
  transition: width 0.7s var(--ease), margin 0.7s var(--ease);
}
.work-img > * {
  position: absolute; top: 0; left: 50%;
  width: 1.4em; height: 100%;
  transform: translateX(-50%) scale(1.25);
  object-fit: cover;
  transition: transform 0.9s var(--ease);
}
.work-img > .ph span, .work-img > .ph em { display: none; }
.work-link:hover .work-img { width: 1.4em; margin-left: 0.14em; margin-right: 0.14em; }
/* Joined titles (e.g. UN|PLUG) read as one word until the image opens. */
.work-joined:not(:hover) .work-img { margin: 0; }
.work-link:hover .work-img > * { transform: translateX(-50%) scale(1); }

.work-client {
  align-self: center;
  font-size: clamp(14px, 1.15vw, 19px);
  white-space: nowrap;
}
.work-num { color: var(--accent-c, var(--accent)); }
@media (max-width: 760px) {
  .work-link { flex-direction: column; gap: 4px; padding: 1.4vh 0; }
  .work-title { white-space: normal; flex-wrap: wrap; justify-content: center; text-align: center; font-size: clamp(40px, 12vw, 80px); }
}
@media (hover: none) {
  .work-img { display: none; }
  .work-half + .work-img + .work-half { margin-left: 0.24em; }
  .work-joined .work-half + .work-img + .work-half { margin-left: 0; }
  /* iOS Safari leaves slivers of the title at the row's clipped bottom edge
     after the slide-up, so touch screens fade the titles in instead. */
  .work-item { overflow: visible; }
  .work-title { transform: none; opacity: 0; transition: opacity 0.9s var(--ease-out); }
  .work-item.is-in .work-title { opacity: 1; }
}

/* Floating hover preview */
.preview {
  position: fixed; left: 0; top: 0; z-index: 40;
  width: clamp(220px, 24vw, 400px);
  aspect-ratio: 4 / 5;
  pointer-events: none;
}
.preview-inner {
  width: 100%; height: 100%;
  border-radius: 6px;
  overflow: hidden;
  transform: scale(0);
  transition: transform 0.55s var(--ease-out);
}
.preview.is-on .preview-inner { transform: scale(1); }
.preview-inner > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.preview .ph span { font-size: clamp(36px, 4.6vw, 80px); }
@media (hover: none) { .preview { display: none; } }

/* Generated placeholder art for projects with no cover */
.ph {
  position: relative; overflow: hidden;
  background: var(--c, #888);
  color: rgba(255, 255, 255, 0.92);
  display: grid; place-items: center;
  font-weight: 900; font-variation-settings: "wdth" 62;
  text-transform: uppercase;
}
.ph::before {
  content: ""; position: absolute; inset: -30%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.35), transparent 40%),
    radial-gradient(circle at 75% 70%, rgba(0,0,0,0.35), transparent 45%);
  animation: drift 9s ease-in-out infinite alternate;
}
.ph span { position: relative; font-size: clamp(40px, 8vw, 140px); line-height: 0.85; text-align: center; }
.ph em {
  position: absolute; left: 12px; bottom: 10px; font-style: normal;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; opacity: 0.8;
  font-variation-settings: "wdth" 85;
}
@keyframes drift { to { transform: translate(8%, -6%) rotate(12deg); } }

/* ==========================================================================
   Manifesto
   ========================================================================== */
.manifesto {
  padding: 22vh var(--gutter) 22vh;
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: var(--gutter);
}
.manifesto-text {
  margin: 0;
  font-size: clamp(30px, 4.2vw, 68px);
  line-height: 1.04;
}
.manifesto-text .word { opacity: 0.15; transition: opacity 0.25s linear; }
.manifesto-text .word.on { opacity: 1; }
@media (max-width: 640px) { .manifesto { grid-template-columns: 1fr; } }

/* ==========================================================================
   Stats
   ========================================================================== */
/* Room for the fixed nav when the Experience link lands here. */
.stats { padding-top: 72px; }
.stats-list { list-style: none; margin: 0; padding: 0 var(--gutter); }
.stat {
  display: grid; grid-template-columns: 1fr auto; align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--line);
  text-transform: uppercase;
}
.stat-label { font-size: clamp(18px, 2.4vw, 36px); font-weight: 800; }
.stat-label small {
  display: block; margin-top: 2px;
  font-family: var(--serif); font-weight: 300; font-variation-settings: normal;
  font-size: clamp(15px, 1.2vw, 19px); text-transform: none; color: var(--accent);
}
.stat { gap: 16px; padding: 14px 0; }
.stat-value {
  font-size: clamp(40px, 6vw, 96px); font-weight: 900; font-variation-settings: "wdth" 62;
  line-height: 0.9; font-variant-numeric: tabular-nums;
}
/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background: var(--ink); color: var(--paper);
  padding: 16vh 0 20px;
  overflow: hidden;
}
.footer-kicker { padding: 0 var(--gutter); margin: 0 0 2vh; font-size: clamp(22px, 2.6vw, 40px); }
.footer-cta {
  display: block; padding: 0 var(--gutter);
  font-size: clamp(80px, 19vw, 360px); font-weight: 900; font-variation-settings: "wdth" 62;
  line-height: 0.82; letter-spacing: -0.02em;
  transition: color 0.4s;
}
.footer-cta:hover { color: var(--accent); }
.marquee { margin-top: 10vh; border-block: 1px solid var(--accent); padding: 14px 0; white-space: nowrap; }
/* Text stays light; the ✺ separators (every other span) are orange. */
.marquee-track > span:nth-child(even) { color: var(--accent); }
.marquee-track { display: inline-flex; gap: 3rem; animation: marquee 30s linear infinite; font-size: 18px; text-transform: uppercase; font-weight: 800; }
@keyframes marquee { to { transform: translateX(-50%); } }
.footer-row { display: flex; justify-content: space-between; padding: 20px var(--gutter) 0; font-size: 13px; text-transform: uppercase; font-weight: 700; }
.footer-socials { display: flex; gap: 20px; }

/* ==========================================================================
   Project page
   ========================================================================== */
/* Dark opening screen with the client label + title sitting at the bottom. */
.p-hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 90px var(--gutter) 2vh;
}
.p-client { margin: 0 0 1vh; }
.p-hero { position: relative; }

/* Down arrow in the empty top half of each project's opening screen. */
.scroll-cue {
  position: absolute;
  right: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  color: var(--paper);
  opacity: 0;
  animation: cue-in 1s 1.2s var(--ease-out) forwards;
}
.scroll-cue .label { color: var(--accent); writing-mode: vertical-rl; letter-spacing: 0.12em; }
.scroll-cue svg { overflow: visible; animation: cue-bob 2.2s ease-in-out infinite; }
.scroll-cue path { fill: none; stroke: currentColor; stroke-width: 1.6; }
.scroll-cue-line { stroke-dasharray: 62; animation: cue-draw 2.2s var(--ease) infinite; }
.scroll-cue:hover { color: var(--accent); }
@keyframes cue-in { to { opacity: 1; } }
@keyframes cue-bob { 50% { transform: translateY(8px); } }
@keyframes cue-draw { 0% { stroke-dashoffset: 62; } 45%, 100% { stroke-dashoffset: 0; } }
@media (max-width: 640px) { .scroll-cue { top: 38%; } }
.p-title .line > span { white-space: nowrap; } /* long lines shrink to fit in JS */
.p-title {
  min-width: 0;
  max-width: calc(100% - 56px); /* keep clear of the scroll arrow on the right */
  margin: 0;
  font-size: clamp(64px, 15vw, 280px);
  font-weight: 900;
  font-variation-settings: "wdth" 62;
  line-height: 0.82;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.p-meta {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter);
  margin: 0; padding: 14px var(--gutter);
  border-block: 1px solid var(--line);
}
.p-meta dt { font-size: 12px; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.p-meta dd { margin: 4px 0 0; font-family: var(--serif); font-weight: 300; font-variation-settings: normal; font-size: 20px; }
@media (max-width: 640px) {
  .p-meta { grid-template-columns: 1fr; }
}


.p-intro {
  margin: 0; padding: 18vh var(--gutter) 14vh calc(25% + var(--gutter));
  font-size: clamp(26px, 3vw, 48px); line-height: 1.12;
}
@media (max-width: 640px) { .p-intro { padding-left: var(--gutter); } }

.p-blocks { display: grid; gap: 14vh; padding: 0 var(--gutter) 18vh; }
.p-text {
  margin: 0 0 0 50%;
  max-width: 34ch;
  font-size: clamp(18px, 1.6vw, 24px); line-height: 1.35;
}
@media (max-width: 640px) { .p-text { margin-left: 0; } }

/* Media in a "window" frame */
/* Swipeable slide strip; bleeds to the screen edges. */
.carousel { margin: 0 calc(var(--gutter) * -1); min-width: 0; }
.carousel-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 14px var(--gutter) 3vh;
  border-top: 1px solid var(--line);
}
.carousel-head .label { color: var(--accent); white-space: nowrap; }
.carousel-title {
  margin: 0;
  font-size: clamp(40px, 6.4vw, 116px);
  font-weight: 900;
  font-variation-settings: "wdth" 62;
  line-height: 0.88;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.carousel-track {
  display: flex; gap: 12px;
  overflow-x: auto;
  padding: 0 var(--gutter);
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track.is-drag { cursor: grabbing; }
.carousel-card {
  flex: 0 0 clamp(240px, 30vw, 440px);
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  overflow: hidden;
  background: #cfcfcf;
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.8s var(--ease-out), transform 1s var(--ease-out);
  transition-delay: calc(var(--i) * 60ms);
}
.carousel.is-in .carousel-card { opacity: 1; transform: none; }
.carousel-card > * { width: 100%; height: 100%; object-fit: cover; user-select: none; }
.carousel-bar { height: 2px; margin: 18px var(--gutter) 0; background: var(--line); }
.carousel-bar span { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }

/* Pinned sideways gallery (height is set in JS). Bleeds edge to edge. */
.hscroll {
  position: relative;
  margin: 0 calc(var(--gutter) * -1);
  min-width: 0;
  background: var(--hs-bg, var(--ink));
  color: var(--hs-ink, var(--paper));
}
.hscroll-sticky {
  position: sticky; top: 0;
  height: 100svh;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
}
.hscroll-track {
  display: flex; align-items: center;
  gap: clamp(32px, 5vw, 90px);
  width: max-content;
  padding: 0 12vw;
  will-change: transform;
}
.frame.hscroll-frame { width: auto; margin: 0; flex: none; transform-origin: 50% 60%; }
.hscroll-frame .frame-media img {
  height: var(--h, min(62svh, 640px));
  width: auto; max-width: none;
}
.hscroll-text {
  flex: none;
  width: min(30ch, 72vw);
  font-family: var(--serif); font-weight: 300; font-variation-settings: normal;
  font-size: clamp(22px, 2.4vw, 38px);
  line-height: 1.15;
}
.hscroll-text.is-big {
  width: auto;
  font-family: var(--display); font-weight: 900; font-variation-settings: "wdth" 62;
  font-size: clamp(80px, 13vw, 220px);
  line-height: 0.85; text-transform: uppercase; letter-spacing: -0.02em;
  white-space: pre-line;
}
.hscroll-bar {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: 4svh;
  height: 2px; background: color-mix(in srgb, currentColor 20%, transparent);
}
.hscroll-bar span { display: block; height: 100%; background: currentColor; transform-origin: left; transform: scaleX(0); }
@media (max-width: 640px) {
  .hscroll-frame .frame-media img { height: auto; width: 82vw; }
  .hscroll-track { padding: 0 9vw; }
}

/* Game-spinner wheel (height and --r are set in JS). The wheel's centre sits
   --r below the active window, so only the top of the wheel shows, with the
   windows riding on its rim. Segment colours are set in JS. */
.spinner {
  position: relative;
  margin: 0 calc(var(--gutter) * -1);
  min-width: 0;
  background: var(--hs-bg, var(--ink));
  color: var(--hs-ink, var(--paper));
  --cx: 60%;
  --cy: 56svh;
  --card: min(37vw, 50svh, 560px);
}
/* A full-screen panel; sideways drags spin it, vertical swipes scroll the page. */
.spinner-sticky {
  position: relative; height: 100svh; overflow: hidden;
  touch-action: pan-y;
  user-select: none; -webkit-user-select: none;
  overscroll-behavior-x: contain;
}
.spinner:focus-visible { outline: 2px solid var(--hs-ink, var(--paper)); outline-offset: -6px; }
.spinner-wheel {
  position: absolute; left: var(--cx); top: calc(var(--cy) + var(--r));
  width: 0; height: 0;
}
.spinner-disc {
  position: absolute;
  --d: calc(2 * (var(--r) - var(--card) * 0.08));
  left: calc(var(--d) / -2); top: calc(var(--d) / -2);
  width: var(--d); height: var(--d);
  border-radius: 50%;
  border: 10px solid currentColor;
  box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  background: currentColor;
}
.spinner-disc svg { display: block; width: 100%; height: 100%; }
.frame.spinner-card {
  position: absolute; left: 0; top: 0;
  width: var(--card); margin: 0;
  transform-origin: 0 0; /* the wheel's centre; the rotation is set in JS */
}
.spinner-card .frame-media img { pointer-events: none; user-select: none; }
/* Title with the short paragraph under it, clear of the wheel. */
.spinner-copy {
  position: absolute; left: var(--gutter); top: 14svh; z-index: 1;
  width: min(440px, 34vw);
}
.spinner-title {
  margin: 0;
  font-weight: 900; font-variation-settings: "wdth" 62;
  font-size: clamp(64px, 8vw, 150px);
  line-height: 0.85; text-transform: uppercase; letter-spacing: -0.02em;
  white-space: pre-line;
}
.spinner-text {
  margin: 28px 0 0;
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(19px, 1.6vw, 26px); line-height: 1.2;
}
.spinner-text.is-in { animation: spinner-text 0.6s var(--ease-out); }
.spinner-text.is-empty { opacity: 0; }
@keyframes spinner-text { from { opacity: 0; transform: translateY(12px); } }
.spinner-ui {
  position: absolute; right: var(--gutter); bottom: 4svh;
  display: flex; align-items: center; gap: 14px;
  z-index: 1;
}
.spinner-hint { font-size: 13px; font-weight: 800; text-transform: uppercase; }
.spinner-count {
  padding: 10px 16px; border-radius: 999px;
  background: var(--hs-bg, var(--ink));
  font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.spinner-btn {
  padding: 12px 26px; border-radius: 999px;
  background: var(--hs-ink, var(--paper)); color: var(--hs-bg, var(--ink));
  box-shadow: 0 0 0 3px var(--hs-bg, var(--ink));
  font-size: 15px; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase;
  transition: transform 0.3s var(--ease-out);
}
.spinner-btn:hover { transform: rotate(-4deg) scale(1.05); }
@media (max-width: 640px) {
  .spinner { --cx: 50%; --cy: 62svh; --card: min(76vw, 40svh); }
  .spinner-copy { top: 11svh; right: var(--gutter); width: auto; }
  .spinner-title { font-size: clamp(44px, 13vw, 72px); }
  .spinner-text { margin-top: 14px; font-size: 17px; }
  .spinner-ui { bottom: 3svh; }
}

/* Pile of file windows; the top one can be dragged away. */
/* As wide as the page allows while the window, the peeking cards and the
   controls still fit in one screen height (slides are 16:9). */
.stack {
  --w: min(100%, calc((100svh - 250px) * 16 / 9));
  outline: none;
  padding: 2vh 0 4vh;
  min-width: 0;
}
.stack-deck {
  display: grid;
  width: var(--w);
  margin: 0 auto;
  padding-bottom: 40px; /* room for the cards peeking out below */
  touch-action: pan-y;
  user-select: none;
}
.frame.stack-card {
  grid-area: 1 / 1;
  width: 100%;
  margin: 0;
  transform-origin: 50% 100%;
  transition: transform 0.55s var(--ease-out), opacity 0.4s;
  will-change: transform;
}
.stack-card.is-top { cursor: grab; }
.stack-deck.is-drag .stack-card.is-top { cursor: grabbing; }
.stack-card .frame-media img { pointer-events: none; }
/* One slim bar lined up with the window: count · hint · prev/next. */
.stack-ui {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: var(--w);
  margin: 6px auto 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.stack-count {
  font-size: 22px; font-weight: 900; font-variation-settings: "wdth" 62;
  letter-spacing: 0.01em; font-variant-numeric: tabular-nums;
}
.stack-hint { color: var(--muted); }
.stack-btns { display: flex; justify-content: flex-end; gap: 28px; }
.stack-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em;
  transition: color 0.3s;
}
.stack-btn svg { transition: transform 0.4s var(--ease-out); }
.stack-btn[data-dir="-1"] svg { transform: scaleX(-1); }
.stack-btn[data-dir="1"]:hover svg { transform: translateX(4px); }
.stack-btn[data-dir="-1"]:hover svg { transform: scaleX(-1) translateX(4px); }
.stack-btn:hover { color: var(--accent); }
@media (max-width: 640px) {
  .stack-ui { grid-template-columns: auto 1fr; row-gap: 8px; }
  .stack-hint { grid-column: 1 / -1; grid-row: 2; }
}

/* Images sit in desktop-style file windows: title bar with three dots + name. */
.frame {
  width: min(78%, 1100px);
  background: #f4f4f4;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0,0,0,0.06), 0 30px 60px -24px rgba(0,0,0,0.4);
}
.frame-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(35, 31, 32, 0.12);
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  color: var(--ink);
}
.frame-bar i { width: 10px; height: 10px; border-radius: 50%; background: #cfcfcf; }
.frame-bar i:first-child { background: var(--accent); }
.frame-bar b { margin-left: 8px; font-weight: 700; }
.frame-media { position: relative; }
.frame-media > * { width: 100%; height: auto; }
.frame-media > .ph { aspect-ratio: 16 / 9; }
@media (max-width: 640px) { .frame { width: 100%; } }

/* Masonry-ish columns so mixed aspect ratios pack without cropping. */
.gallery { columns: var(--cols, 3); column-gap: var(--gutter); }
.gallery > div { break-inside: avoid; margin-bottom: var(--gutter); border-radius: 6px; overflow: hidden; }
.gallery > div > * { width: 100%; height: auto; }
.gallery > div > .ph { aspect-ratio: 4 / 5; }
@media (max-width: 900px) { .gallery { columns: min(var(--cols, 3), 2); } }
@media (max-width: 480px) { .gallery[style*="--cols: 2"], .gallery[style*="--cols:2"] { columns: 1; } }

/* Even grid: every cell the same shape, images cropped to fill. */
.gallery-grid {
  columns: auto;
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), 1fr);
  gap: var(--gutter);
}
.gallery-grid > div { margin: 0; aspect-ratio: var(--aspect, 4 / 5); }
.gallery-grid > div > * { height: 100%; object-fit: cover; }
@media (max-width: 760px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

/* Cells rise in one after another. */
.gallery-cell {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease-out), transform 1.1s var(--ease-out);
  transition-delay: calc(var(--i) * 70ms);
}
.gallery.is-in .gallery-cell { opacity: 1; transform: none; }

/* Feature row: file window on the left, its text beside it. */
.feature {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  align-items: center;
  gap: 5vw;
  padding-top: 10vh;
}
.feature .frame { width: 100%; margin: 0; }
.feature-text { max-width: 30ch; font-size: clamp(18px, 1.6vw, 24px); line-height: 1.35; }
.feature-text p { margin: 0 0 0.9em; }
.feature-text p:first-child { font-size: 1.35em; line-height: 1.15; }
.feature .frame, .feature-text {
  opacity: 0; transform: translateY(40px);
  transition: opacity 0.9s var(--ease-out), transform 1.1s var(--ease-out);
}
.feature-text { transition-delay: 0.15s; }
.feature.is-in .frame, .feature.is-in .feature-text { opacity: 1; transform: none; }
@media (max-width: 760px) {
  .feature { grid-template-columns: 1fr; gap: 6vh; }
}

/* Chapter: oversized label (e.g. a year) with a short paragraph beside it. */
.chapter {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 4vw;
  margin-bottom: -8vh; /* sit close to the gallery that follows */
  padding-top: 2vh;
  border-top: 1px solid var(--line);
}
.chapter-label {
  margin: 0;
  font-size: clamp(110px, 22vw, 400px);
  font-weight: 900;
  font-variation-settings: "wdth" 62;
  line-height: 0.8;
  letter-spacing: -0.02em;
}
.chapter-body {
  justify-self: end;
  margin: 0 0 0.5em;
  max-width: 30ch;
  font-size: clamp(18px, 1.6vw, 24px);
  line-height: 1.35;
}
@media (max-width: 640px) {
  .chapter { grid-template-columns: 1fr; gap: 12px; margin-bottom: -10vh; }
  .chapter-body { justify-self: start; }
}

.parallax { will-change: transform; }

.p-next {
  display: grid; grid-template-columns: 1fr 3fr; align-items: end; gap: var(--gutter);
  padding: 4vh var(--gutter) 10vh;
  border-top: 1px solid var(--line);
}
.p-next-link { display: block; text-align: right; }
.p-next-title {
  display: block;
  font-size: clamp(56px, 11vw, 200px); font-weight: 900; font-variation-settings: "wdth" 62;
  line-height: 0.84; text-transform: uppercase; letter-spacing: -0.015em;
  transition: color 0.4s;
}
.p-next-link:hover .p-next-title { color: var(--accent); }

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .line > span { transform: none; }
  .manifesto-text .word { opacity: 1; }
}
