/* ============================================================
   Keith Cheung — Portfolio
   ============================================================ */

/* ---------- Primitives (exact tokens) ---------- */
:root {
  /* neutral — shared (cream / warmth) */
  --cream:     #FAF9F5;   /* page bg · reversed text on dark             */
  --bone:      #E8E6DC;   /* subtle bg · card · divider                  */
  --ash:       #B0AEA5;   /* disabled · border · decorative text         */
  --stone:     #6B6A63;   /* caption · icon · metadata                   */
  --graphite:  #33322E;   /* secondary text · subhead                    */
  --ink:       #141413;   /* main text · dark section                    */

  /* blue — UIUX / narrative (Work) */
  --blue-wash:  #E3EAF2;  /* callout · quote bg · chart light            */
  --blue-light: #8FAAC7;  /* hover · secondary UI · chart 2nd layer      */
  --blue-base:  #3D5A80;  /* link · section marker · primary button      */
  --blue-deep:  #24384F;  /* pressed · dark section bg                   */

  /* yellow — Studio / index */
  --yellow-wash:  #FAF0DC; /* tag bg · hover row                         */
  --yellow-light: #F0CE85; /* secondary tag · chart                      */
  --yellow-base:  #E8B33D; /* section band · category tag · accent       */
  --yellow-deep:  #C08A1E; /* pressed · small text (only readable step)  */

  /* functional (contact form) */
  --error:   #B4472F;
  --success: #5F7A4A;

  --white:   #FFFFFF;

  /* legacy aliases → remapped onto the brand palette (keep old refs working) */
  --alu-gray:            var(--white);
  --silver:              var(--cream);
  --machined-steel:      var(--ash);
  --steel-mist:          var(--stone);
  --machined-steel-dark: var(--graphite);
  --graphite-2nd:        var(--stone);
  --obsidian:            var(--ink);
  --signal-blue:         var(--blue-base);
  --acid-volt:           var(--yellow-base);
}

/* ---------- Semantic mapping ---------- */
:root {
  --bg:          var(--cream);   /* page background          */
  --surface:     var(--ink);     /* dark containers          */
  --on-dark:     var(--cream);   /* text on dark             */
  --on-dark-dim: var(--ash);     /* dimmed text on dark      */
  --ink-dim:     var(--stone);   /* dimmed text on light     */
  --border:      var(--ash);     /* hairlines / card borders */
  --divider:     var(--bone);    /* subtle dividers          */

  /* radius system: 8px frames, 4px for a frame-inside-a-frame */
  --radius:        8px;
  --radius-nested: 4px;

  --gutter:      16px;   /* page horizontal padding / gutter                 */
  --col-gap:     16px;   /* gap between cards & table columns        */
  --inset:       16px;   /* text inset inside boxes / cards          */
  --section-gap: 40px;   /* vertical gap between sections            */
  --maxw:        1728px; /* page max width, centred beyond (stripe.dev) */
  --gap:         12px;   /* header inner gap                        */
  --header-h:    67px;   /* sticky header height (for hero sizing)   */

  --font: "Asta Sans", "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  /* mode-driven accent (Work = blue, Studio = yellow) */
  --accent:      var(--blue-base);   /* accent as FILL (buttons, bands)   */
  --accent-text: var(--blue-base);   /* accent as TEXT / links (legible)  */
  --on-accent:   var(--cream);       /* text colour that sits on accent   */
  --dot:         var(--yellow-base); /* status dot: yellow pops on blue   */
}
:root[data-mode="studio"] {
  --accent:      var(--yellow-base); /* vibrant fill (bands, tags)        */
  --accent-text: var(--yellow-deep); /* only readable yellow step for text*/
  --on-accent:   var(--ink);         /* dark text on the bright yellow    */
  --dot:         var(--ink);         /* dark dot stays visible on yellow  */
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { text-decoration: none; color: inherit; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;   /* toggle sits in the true centre */
  align-items: center;
  gap: var(--gap);
  padding: 16px var(--gutter);
}
.brand                     { grid-column: 1; justify-self: start; }
.toggle:not(.toggle--mobile) { grid-column: 2; justify-self: center; }
.nav                       { grid-column: 3; justify-self: end; }
.menu-open                 { grid-column: 3; justify-self: end; }

/* shared frosted-glass container */
.brand,
.nav,
.toggle,
.menu-open {
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(20, 20, 20, 0.08);
  color: var(--ink);
  border-radius: var(--radius);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5ch;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.brand__role { color: var(--graphite-2nd); font-weight: 500; }   /* #656565 */

/* ---------- Work / Studio toggle ---------- */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius);          /* outer frame = 8px */
}
.toggle__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: var(--radius-nested);   /* frame-in-frame = 4px */
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--graphite);          /* #282828 — inactive toggle text */
  transition: background-color .18s ease, color .18s ease;
}
.toggle__btn:hover { color: var(--ink); }
.toggle__btn.is-active {
  background: var(--accent);
  color: var(--on-accent);
}
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--dot);
  display: none;
}
.toggle__btn.is-active .dot { display: inline-block; }

/* ---------- nav links ---------- */
.nav {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  padding: 14px 22px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.nav__link { color: var(--ink); transition: color .15s ease; }
.nav__link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* SHOP only appears in Studio mode */
:root[data-mode="work"] .nav__shop { display: none; }

/* ---------- hamburger (mobile only) ---------- */
.menu-open {
  display: none;
  width: 52px; height: 52px;
  align-items: center;
  justify-content: center;
}
.menu-open svg line,
.menu-close svg line {
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* ============================================================
   Mobile menu overlay
   ============================================================ */
.mobile-menu { position: fixed; inset: 0; z-index: 100; }
.mobile-menu[hidden] { display: none; }
.mobile-menu__backdrop {
  position: absolute; inset: 0;
  background: rgba(26,26,27,0.30);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade .2s ease;
}
.mobile-menu__panel {
  position: relative;
  margin: 14px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid rgba(20, 20, 20, 0.08);
  color: var(--ink);
  border-radius: var(--radius);          /* frame = 8px */
  animation: drop .22s cubic-bezier(.2,.7,.3,1);
}
.mobile-menu__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.mobile-menu__top .brand { padding: 0; background: none; font-size: 14px; }
.menu-close { display: inline-flex; color: var(--ink); padding: 4px; }

.toggle--mobile {
  display: flex;
  gap: 6px;
  width: 100%;
  padding: 0;
  background: none;
  border-radius: 0;
  margin-bottom: 8px;
}
.toggle--mobile .toggle__btn {
  flex: 1 1 0;                 /* both segments fill 50% each */
  justify-content: center;     /* text centred in each half   */
  padding: 12px;
  font-size: 14px;
}

.mobile-nav { display: flex; flex-direction: column; }
.mobile-nav__link {
  padding: 14px 4px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink);
}

@keyframes fade { from { opacity: 0; } }
@keyframes drop { from { opacity: 0; transform: translateY(-10px); } }

/* ============================================================
   Page body
   ============================================================ */
.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter) 16px;
  display: flex;
  flex-direction: column;
}
.section { padding-block: 80px; }     /* more breathing room between sections */
.footer  { padding-top: 32px; }       /* footer sits a bit closer to About */
/* extra room under the first heading = tolerance band so the fold lands here across sizes */
.page > .section:first-child .section__label { margin-bottom: 48px; }

/* shared framed box (thin outline, no fill) */
.box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ---------- Hero — text on top, dither media below (≈ one viewport) ---------- */
.hero {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);          /* whole hero follows the gutter */
  min-height: calc(100svh - 236px);  /* first screen = hero + "Selected Work" heading; cards sit below the fold */
  display: flex;
  flex-direction: column;
}
.hero__bg {                          /* dithered background texture (Alu-gray + silver) */
  position: absolute;
  top: -80px; left: 0;               /* extend up over the header (behind it, z 0 < 50) */
  width: 100%; height: calc(100% + 80px);
  z-index: 0;
  image-rendering: pixelated;
}
.hero__text { position: relative; z-index: 1; }
.hero__fx {                          /* cursor-dither overlay (extends up over the header, JS sets top/size) */
  position: absolute; left: 0; top: 0;
  z-index: 2;                        /* below the header (z 50) → dither shows around/through the pills */
  pointer-events: none;
}
.hero .ticker { position: relative; z-index: 3; }   /* stays clean above the fx layer */
.hero__text {
  padding: clamp(20px, 6vh, 72px) 0 clamp(16px, 3vh, 28px);
}
.hero__title {
  margin: 0;
  max-width: 16ch;
  font-size: clamp(40px, 5.4vw, 72px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.02em;
  /* cream halo keeps the dithered video off the letters (protection, not a visible outline) */
  text-shadow:
    0 0 3px var(--bg), 0 0 3px var(--bg),
    0 0 12px var(--bg), 0 0 12px var(--bg);
}
.hero__meta {
  margin: clamp(16px, 2.4vh, 28px) 0 0;
  font-size: clamp(16px, 1.5vw, 22px);
  color: var(--ink-dim);
}

/* ---- Hero status ticker tape (blue strip, white text, scrolling) ---- */
.ticker {
  margin-top: auto;                  /* pushed to the bottom of the hero (where the divider was) */
  overflow: hidden;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius);
}
.ticker__track {
  display: flex;
  width: max-content;
  animation: ticker-scroll 26s linear infinite;
}
.ticker__set {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 11px 2rem 11px 0;         /* vertical height + trailing gap before the loop */
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ticker__sep { opacity: 0.5; }
.ticker__clock { font-variant-numeric: tabular-nums; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; }
}
/* Studio's headline now uses the Work hero size + measure */
:root[data-mode="studio"] .hero__title {
  font-size: clamp(40px, 5.4vw, 72px);   /* match the Work hero */
  max-width: 16ch;                        /* Work's measure */
  line-height: 1.05;
}

/* dither media = full-bleed frame that fills the rest of the viewport */
.hero__media {
  position: relative;
  aspect-ratio: 16 / 9;             /* fixed 16:9 height */
  margin-bottom: var(--gutter);
  overflow: hidden;                 /* frame window for parallax */
  border-radius: var(--radius);
  background: var(--obsidian);
}
.hero__media .plate {               /* parallax plate holds both layers */
  position: absolute;
  top: -15%; left: 0;
  width: 100%; height: 130%;        /* taller than frame → room to move */
  will-change: transform;
}
.hero__media .dither,
.about__media .dither {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  image-rendering: pixelated;
}
.hero__media .halftone,
.about__media .halftone {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  image-rendering: auto;              /* smooth dots, not chunky pixels */
}
/* finer dither revealed through a soft trailing circle (a focus lens).
   JS sets the comet-trail mask each frame; opacity fades it in/out. */
.hero__media .lens-fine,
.about__media .lens-fine {
  pointer-events: none;
  opacity: 1;
  transition: opacity .5s ease;
  -webkit-mask-image: radial-gradient(circle 120px at -9999px -9999px, #000 30%, transparent 100%);
          mask-image: radial-gradient(circle 120px at -9999px -9999px, #000 30%, transparent 100%);
}

/* drag-and-drop affordance (dev tool — safe to delete this + ::after) */
.hero__media--drop { outline: 2px dashed rgba(255,255,255,0.85); outline-offset: -10px; }
.hero__media::after {
  content: "⤓ drop a photo or video to dither";
  position: absolute; right: 14px; bottom: 12px; z-index: 3;
  font-size: 11px; letter-spacing: 0.04em; color: #fff;
  background: rgba(20,20,28,0.55); padding: 6px 10px; border-radius: 6px;
  pointer-events: none;
}

/* full-bleed hairline divider */
.rule { border: 0; border-top: 1px solid var(--border); margin: 0; }

/* ---------- Section label ---------- */
.section__label {
  margin: 0 0 24px;
  font-size: clamp(34px, 4.4vw, 56px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.section__count {
  font-size: 0.42em;
  vertical-align: super;
  color: var(--ink-dim);
  margin-left: 4px;
  letter-spacing: 0;
}

/* ---------- Selected Work cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--col-gap);
}
.cards--2 { grid-template-columns: repeat(2, 1fr); }  /* half-width cards  */
.cards--4 { grid-template-columns: repeat(4, 1fr); }  /* quarter cards     */

/* Commissioned: fit the label + 2×2 cards into exactly one screen (desktop) */
@media (min-width: 721px) {
  #commissioned {
    min-height: calc(100svh - var(--header-h));
    padding-block: 36px;                  /* trim padding so the cards take most of the height */
    display: flex;
    flex-direction: column;
  }
  #commissioned .section__label { margin-bottom: 24px; }
  #commissioned .cards {
    flex: 1 1 auto;
    min-height: 0;
    grid-template-rows: repeat(2, 1fr);   /* two equal rows fill the leftover height */
  }
  #commissioned .card { min-height: 0; height: 100%; }
}

/* ---------- Illustration gallery — a wall, not cards ---------- */
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;                          /* tight enough to read as one field */
  align-items: flex-start;
}
.gallery__shot {
  position: relative;
  display: block;
  padding: 0; margin: 0; border: 0;
  border-radius: 0;                  /* no second corner language */
  overflow: hidden;
  line-height: 0;
  background-size: 8px 8px;          /* dithered LQIP tile (JS sets the image) */
  background-repeat: repeat;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  .gallery__shot { cursor: none; }   /* the site cursor mark takes over */
}
.gallery__shot img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;                 /* box already matches native ratio → no visible crop */
  opacity: 0;
  transition: opacity .4s ease;
}
.gallery__shot.is-loaded img { opacity: 1; }
.gallery__shot::after {              /* hover: a 1px accent hairline, nothing else */
  content: "";
  position: absolute; inset: 0;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color .15s ease;
}
@media (hover: hover) and (pointer: fine) {
  .gallery__shot:hover::after { border-color: var(--accent); }
}
/* <768: two-column masonry, 4px gap */
@media (max-width: 767px) {
  .gallery.is-masonry {
    display: block;
    column-count: 2;
    column-gap: 4px;
  }
  .gallery.is-masonry .gallery__shot {
    width: 100%; height: auto;
    margin: 0 0 4px;
    break-inside: avoid;
  }
  .gallery.is-masonry .gallery__shot img { height: auto; }
}

/* ---------- Illustration lightbox ---------- */
.gallery-lb {
  position: fixed; inset: 0; z-index: 200;
  display: none;
  align-items: center; justify-content: center;
  padding: clamp(24px, 6vh, 72px);
  background: rgba(20, 20, 19, 0.86);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.gallery-lb.is-open { display: flex; }
.gallery-lb__stage {
  margin: 0;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  max-width: 100%; max-height: 100%;
}
.gallery-lb__img {
  max-width: 100%;
  max-height: calc(100vh - clamp(24px, 6vh, 72px) * 2 - 40px);
  object-fit: contain;
  display: block;
}
.gallery-lb__cap {
  font-size: 13px;
  letter-spacing: 0.01em;
  color: var(--cream);
  opacity: 0.82;
}
/* frosted circular controls — same language as the site's other marks */
.gallery-lb__close,
.gallery-lb__nav {
  position: fixed;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(20, 20, 20, 0.08);
  border-radius: 50%;
  cursor: pointer;
}
.gallery-lb__close { top: 20px; right: 20px; font-size: 0; }
.gallery-lb__close::before,
.gallery-lb__close::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 16px; height: 2px; margin: -1px 0 0 -8px;
  background: currentColor; border-radius: 1px;
}
.gallery-lb__close::before { transform: rotate(45deg); }
.gallery-lb__close::after  { transform: rotate(-45deg); }
.gallery-lb__nav--prev { left: 20px; top: 50%; margin-top: -22px; }
.gallery-lb__nav--next { right: 20px; top: 50%; margin-top: -22px; }
@media (max-width: 767px) {
  .gallery-lb__nav--prev { left: 12px; }
  .gallery-lb__nav--next { right: 12px; }
  .gallery-lb__close { top: 12px; right: 12px; }
}
.card {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 400px;                /* all cards share the same height */
  padding: var(--inset);
  background: var(--surface);       /* fallback while image loads */
  color: var(--on-dark);
  border-radius: var(--radius);
  overflow: hidden;
}
.card__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
  transition: transform .5s var(--ease, ease);
}
.card:hover .card__img { transform: scale(1.03); }
.card::after {                      /* bottom scrim so label reads over any image */
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 45%);
  pointer-events: none;
}
.card__label {
  position: relative; z-index: 2;
  font-size: 28px; font-weight: 600; letter-spacing: -0.01em;
  text-shadow: 0 1px 10px rgba(0,0,0,.4);
}
/* Commissioned: halftone screen at rest, original photo on hover */
.card__halftone {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;                        /* over .card__img, under the scrim (z1) + label (z2) */
  opacity: 1;
  transition: opacity .45s var(--ease, ease);
  pointer-events: none;
}
.card:hover .card__halftone { opacity: 0; }   /* dissolve the print, reveal the photo */

/* ---------- Selected Work — dither at rest, photo + info panel on hover ---------- */
.card--case {
  flex-direction: column;
  align-items: stretch;
  min-height: 0;                      /* height follows the thumbnail, not the 400px floor */
  padding: 0;
  background: var(--accent);          /* revealed at the bottom as the info panel on hover */
  border: 1px solid var(--border);    /* #CDCDCD */
}

.card__media {
  position: relative;
  flex: 0 0 auto;
  aspect-ratio: 2880 / 1856;          /* match the thumbnail so its brand-colour margins show on every side */
  min-height: 0;
  overflow: hidden;
}

.card__dither,
.card__photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.card__photo { object-fit: cover; z-index: 0; }

/* blue dither dots overlay the photo, then dissolve away cell-by-cell (scattered
   reveal driven by dither.js — triggered when the card scrolls into view) */
.card__dither {
  display: block;
  z-index: 1;
  image-rendering: pixelated;
}

/* info panel — revealed at the bottom on hover (image keeps top/left/right edges) */
.card__info {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 0;
  padding: 0 var(--inset);
  opacity: 0;
  overflow: hidden;
  transition: max-height .5s var(--ease), padding .5s var(--ease), opacity .35s ease;
}
.card--case:hover .card__info {
  max-height: 160px;
  padding-top: 14px;
  padding-bottom: var(--inset);
  opacity: 1;
}
.card__name { font-size: 28px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.05; color: var(--alu-gray); }
.card__desc { font-size: 13px; line-height: 1.35; color: rgba(255, 255, 255, 0.82); padding-right: 28px; }

/* info slides up over the image bottom — card footprint stays fixed, no downward growth */
.card--case .card__info {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  background: var(--accent);
}

/* rest = full thumbnail with its margins; hover zooms the image in place, keeping bg on the sides + top.
   Tune the zoom with scale() below (bigger = more zoom, less margin shown). */
.card--case .card__photo,
.card--case .card__dither {
  transition: transform .5s var(--ease);
  transform-origin: center;
}
.card--case:hover .card__photo,
.card--case:hover .card__dither { transform: scale(1.08); }

/* rest-state overlaid name → fades out on hover */
.card--case .card__label {
  position: absolute;
  left: var(--inset); bottom: var(--inset); z-index: 3;
  transition: opacity .3s ease;
}
.card--case:hover .card__label { opacity: 0; }

/* bottom scrim shows only while resting */
.card--case::after { transition: opacity .4s ease; }
.card--case:hover::after { opacity: 0; }

/* chevron, bottom-right, appears on hover */
.card__arrow {
  position: absolute;
  right: var(--inset); bottom: var(--inset); z-index: 3;
  color: var(--alu-gray);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .35s ease, transform .4s var(--ease);
}
.card--case:hover .card__arrow { opacity: 1; transform: none; }

/* ---------- All Work list ---------- */
.worklist { display: flex; flex-direction: column; }
.worklist__head,
.worklist__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--col-gap);
  align-items: center;
}
.worklist__head {
  padding-bottom: 10px;
  color: var(--steel-mist);
  font-size: 12px;
}
.worklist__row {
  position: relative;
  isolation: isolate;                 /* keep the fill behind the row's text */
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  transition: color .3s ease;
}
/* blue fill that springs up from the bottom on hover */
.worklist__row::before {
  content: "";
  position: absolute;
  inset: 0 -16px;                     /* bleed into the gutter, both sides */
  z-index: -1;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .45s var(--ease);
}
.worklist__row:hover::before,
.worklist__row:focus-visible::before { transform: scaleY(1); }
.worklist__row:hover,
.worklist__row:hover .worklist__meta,
.worklist__row:focus-visible,
.worklist__row:focus-visible .worklist__meta { color: var(--on-accent); }
.worklist__name { font-size: 28px; font-weight: 500; }
.worklist__head .worklist__name { font-size: 12px; font-weight: 400; }
.worklist__meta {
  display: flex;
  justify-content: space-between;
  gap: var(--col-gap);
  font-size: 14px;
  color: var(--ink-dim);
  transition: color .3s ease;
}
.worklist__head .worklist__meta { font-size: 12px; }
.worklist__tags { white-space: nowrap; }

/* cursor-following image preview for the All Work rows */
.worklist__preview {
  position: fixed;
  top: 0; left: 0;
  z-index: 60;
  width: 520px;
  height: 336px;
  border-radius: var(--radius);
  overflow: hidden;
  pointer-events: none;
  background: var(--surface);
  box-shadow: 0 14px 46px rgba(20, 20, 20, 0.22);
  opacity: 0;
  transform: translateY(-50%) scale(0.92);
  transform-origin: left center;
  transition: opacity .22s ease, transform .3s var(--ease), left .12s ease, top .12s ease;
}
.worklist__preview.is-on { opacity: 1; transform: translateY(-50%) scale(1); }
.worklist__preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 720px) { .worklist__preview { display: none; } }

/* ---------- About — dithered gradient panel with a focus lens ---------- */
.about {
  min-height: 352px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  padding: var(--inset);
}
.about--dither {
  position: relative;
  min-height: 376px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.about__media { position: absolute; inset: 0; z-index: 0; }
.about__content {
  position: relative;
  z-index: 2;
  margin-top: auto;                 /* anchor content to the bottom (over the white end) */
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: var(--inset);
}
.about__label { font-size: 13px; color: var(--ink-dim); }
.about__text {
  margin: 0;
  max-width: 62ch;
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
}
/* dithered About: text runs the panel width so the CTA tucks under it (per Figma) */
.about--dither .about__text { max-width: none; }
.about__more { font-size: 13px; color: var(--ink-dim); }
.about__more:hover { color: var(--ink); }
/* the dithered About panel: View more sits bottom-right with a chevron */
.about--dither .about__more {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--ink);
  transition: gap .2s ease;
}
.about--dither .about__more:hover { gap: 8px; }
.about--dither .about__more svg { display: block; }

/* About sits 16px above the footer (continuous card spacing) */
.section:has(.about) { padding-bottom: 16px; }
.section:has(.about) + .footer { padding-top: 0; }

/* ---------- Footer / contact ---------- */
.footer {
  display: grid;
  grid-template-columns: 1fr 2fr;   /* left CTA ~1/3, right links ~2/3 */
  gap: var(--col-gap);
}
.footer__col {
  min-height: 351px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;   /* top block + bottom block */
  padding: var(--inset);
}
.footer__headline {
  margin: 0;
  max-width: 22ch;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 500;
  line-height: 1.25;
}
.footer__links { display: flex; flex-direction: column; gap: 8px; }
.footer__pair { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; }
.footer__pair span { color: var(--ink-dim); }
.footer__modes { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.footer__social { display: flex; gap: 24px; font-size: 13px; color: var(--ink-dim); }
.footer__pair a { transition: color .15s ease; }
.footer__pair:hover a { color: var(--accent-text); }   /* only the value reacts; label stays */
.footer__dlicon { vertical-align: -2px; margin-left: 3px; }

/* right footer card as a 3-column sitemap (Work / Studio / Connect) */
.footer__col--nav { justify-content: flex-start; }
.footer__nav {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 24px;
}
.footer__navcol { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }
.footer__navhead {
  font-size: 12px;
  color: var(--steel-mist);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.footer__navcol a {
  font-size: 15px;
  color: var(--ink);
  transition: color .15s ease;
}
.footer__navcol a:hover { color: var(--accent-text); }

/* ============================================================
   Scroll effects  (line-mask reveal · fade · parallax)
   ============================================================ */
:root {
  --ease: cubic-bezier(0.16, 1, 0.3, 1);   /* expo-out — the "premium" curve */
  --reveal-dur: 0.9s;
  --reveal-stagger: 0.08s;
}
/* prevent a flash of un-split text before JS builds the lines */
html.js .reveal { visibility: hidden; }
/* text rises line-by-line out of a mask */
.line { display: block; overflow: hidden; padding-bottom: 0.08em; }
.line-in { display: block; transform: translateY(110%); opacity: 0; }
/* single-line heading rises out of a mask (same look as the hero title) */
.section__label--reveal { overflow: hidden; padding-top: 0.2em; margin-top: -0.2em; }
.section__label--reveal .sl-rise { display: inline-block; transform: translateY(110%); opacity: 0; will-change: transform; }
.section__label--reveal.is-in .sl-rise {
  transform: none; opacity: 1;
  transition: transform 0.9s var(--ease), opacity 0.5s linear;
}
@media (prefers-reduced-motion: reduce) {
  .section__label--reveal .sl-rise { transform: none; opacity: 1; }
}
.is-in .line-in {
  transform: translateY(0); opacity: 1;
  transition: transform var(--reveal-dur) var(--ease),
              opacity   calc(var(--reveal-dur) * .6) linear;
  transition-delay: calc(var(--i, 0) * var(--reveal-stagger));
}
/* whole-block fade + rise (sub-heads, cards, rows) */
.fade { opacity: 0; transform: translateY(16px); }
.fade.is-in {
  opacity: 1; transform: none;
  transition: opacity .8s ease, transform .8s var(--ease);
  transition-delay: calc(var(--i, 0) * var(--reveal-stagger));
}
@media (prefers-reduced-motion: reduce) {
  .line-in { transform: none; opacity: 1; }
  .fade { opacity: 1; transform: none; }
  .hero__media .dither,
  .hero__media .halftone { transform: none !important; }
}

/* ============================================================
   Responsive
   ============================================================ */
/* tablet: 2-up cards, footer stacks */
@media (max-width: 900px) {
  .cards,
  .cards--4 { grid-template-columns: repeat(2, 1fr); }
  .footer { grid-template-columns: 1fr; }
  .footer__col { min-height: 220px; }
}

/* mobile: switch header to hamburger, single-column layout */
@media (max-width: 720px) {
  :root { --section-gap: 32px; }
  .section { padding-block: 48px; }
  .hero { min-height: calc(100svh - 185px); }   /* smaller header + section padding on mobile */

  .toggle:not(.toggle--mobile),
  .nav { display: none; }
  .menu-open { display: inline-flex; }
  .site-header { padding: 12px var(--gutter); }

  .cards,
  .cards--2,
  .cards--4 { grid-template-columns: 1fr; }
  .card:not(.card--case) { min-height: 280px; }   /* case cards hug their thumbnail, no floor */

  .worklist__head { display: none; }
  .worklist__row  { grid-template-columns: 1fr; gap: 6px; align-items: start; }
  .worklist__meta { flex-direction: column; align-items: flex-start; gap: 2px; }

  .about { min-height: 0; }

  /* dithered About: stack the dither as a top band, text below (no overlap) */
  .about--dither { min-height: 0; }
  .about--dither .about__media {
    position: relative; inset: auto;
    flex: 0 0 auto;
    height: 150px;
  }
  .about--dither .about__content { margin-top: 0; }

  .footer__nav { grid-template-columns: 1fr 1fr; gap: 20px 16px; }
}

body.menu-active { overflow: hidden; }

/* ============================================================
   Inner / case-study page  (project.html)
   Scroll-away header + sticky meta sidebar that reveals a
   compact title once the big header leaves the viewport.
   ============================================================ */

/* --- Scroll-away header: Back + big title + subtitle --- */
.proj-head { padding: 72px 0 64px; }   /* top padding clears the fixed back button */
/* back = fixed circle-X, top-left, always reachable (desktop + mobile).
   Border + fill match the homepage menu button (frosted glass). */
.proj-back {
  position: fixed;
  top: 16px; left: 16px;
  z-index: 70;
  width: 40px; height: 40px;
  padding: 2px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  font-size: 0;                                   /* hide the "‹ Back" text */
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(20, 20, 20, 0.08);
  border-radius: 50%;
  transition: background .15s ease;
}
.proj-back::before,
.proj-back::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 16px; height: 2px;
  margin: -1px 0 0 -8px;
  background: currentColor;
  border-radius: 1px;
}
.proj-back::before { transform: rotate(45deg); }
.proj-back::after  { transform: rotate(-45deg); }
.proj-back:hover { background: rgba(255, 255, 255, 0.72); }
.proj-title {
  margin: 0;
  font-size: clamp(44px, 6vw, 84px);
  font-weight: 600;
  line-height: 1.0;
  letter-spacing: -0.02em;
}
.proj-sub {
  margin: 20px 0 0;
  max-width: none;
  font-size: clamp(20px, 2.2vw, 32px);
  font-weight: 400;
  line-height: 1.15;
  color: var(--ink-dim);
}

/* --- Two-column body --- */
.proj-body {
  display: grid;
  grid-template-columns: 389px 1fr;
  gap: 16px;
  align-items: stretch;   /* left column fills full height so the back-zone covers it */
  padding-bottom: 80px;
}

/* left column wrapper — holds the sticky card + the back-zone */
.proj-side { position: relative; }

/* empty area below the card → clicking anywhere here goes back */
.proj-backzone {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  cursor: none;            /* replaced by the following "Back" label */
}

/* sticky meta sidebar — sits above the back-zone so the card isn't a back target */
.proj-meta {
  position: sticky;
  top: 72px;                 /* clears the fixed back button at the top-left */
  align-self: start;
  z-index: 1;
}

/* cursor-following "Back" label */
.proj-cursor {
  position: fixed;
  left: 0; top: 0;
  z-index: 60;
  pointer-events: none;
  transform: translate(-100px, -100px);
  transition: transform .13s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
/* matches the figure-plate cursor mark: an accent-blue square, icon-only */
.proj-cursor__in {
  display: block;
  position: relative;
  width: 48px; height: 48px;
  margin: -24px 0 0 -24px;          /* centre the mark on the pointer */
  font-size: 0;                     /* hide the "Back" text node — icon-only, like the plate mark */
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);              /* homepage-menu frosted fill */
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(20, 20, 20, 0.08);
  border-radius: 50%;
  opacity: 0;
  transition: opacity .1s ease;
  will-change: opacity;
}
.proj-cursor__arrow { display: none; }               /* the Back mark is an X now */
.proj-cursor__in::before,
.proj-cursor__in::after {
  content: "";
  position: absolute; top: 50%; left: 50%;
  width: 16px; height: 2px;
  margin: -1px 0 0 -8px;
  background: currentColor;
  border-radius: 1px;
}
.proj-cursor__in::before { transform: rotate(45deg); }
.proj-cursor__in::after  { transform: rotate(-45deg); }
.proj-cursor.is-on .proj-cursor__in { opacity: 1; }
.proj-meta__role {
  margin: 0;
  max-width: none;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
}
.proj-meta__team {
  margin: 16px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-dim);
}

/* compact title — hidden until the big header scrolls away */
.proj-meta__title {
  max-height: 0;
  margin-bottom: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-6px);
  transition: max-height .55s var(--ease),
              margin-bottom .55s var(--ease),
              opacity .3s ease,
              transform .55s var(--ease);
}
.proj-body.is-scrolled .proj-meta__title {
  max-height: 160px;
  margin-bottom: 24px;
  opacity: 1;
  transform: none;
}
.proj-meta__title h2 {
  margin: 0;
  font-size: clamp(24px, 1.9vw, 30px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.0;
}
.proj-meta__title p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.3;
  color: var(--ink-dim);
}

/* --- Right column: case-study content --- */
.proj-content { display: flex; flex-direction: column; gap: 16px; }
.proj-img {
  position: relative;
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius);
}
.proj-img--hero { aspect-ratio: 843 / 400; }
.proj-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.proj-row .proj-img { aspect-ratio: 413 / 400; }
.proj-row--short .proj-img { aspect-ratio: 413 / 200; }
.proj-text {
  margin: 0;
  max-width: 62ch;
  padding-block: 16px;
  font-size: clamp(16px, 1.15vw, 19px);
  line-height: 1.6;
  color: var(--ink);
}

/* --- typed figures (tag + plate + load-bearing caption) --- */
.proj-figure { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.proj-figure--inset { max-width: 480px; }          /* 4:5 / 1:1 narrow naturally */
.proj-figure--lg { max-width: 600px; }             /* a larger portrait, to sit as a peer beside a full-width figure */
.proj-figure--wide { max-width: 760px; }           /* a capped landscape — generous but not full-bleed */
.proj-figure__tag {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--steel-mist);
  font-variant-numeric: tabular-nums;
}
.proj-caption { font-size: 13px; line-height: 1.45; color: var(--ink-dim); max-width: 48ch; }

.proj-img--screen     { aspect-ratio: 16 / 9; }
.proj-img--comparison { aspect-ratio: 16 / 9; }
.proj-img--artifact   { aspect-ratio: 4 / 5; }
.proj-img--diagram    { aspect-ratio: 1 / 1; }

/* composite — two panels in one plate */
.proj-composite { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.proj-composite .proj-img { aspect-ratio: 4 / 5; }

/* a labelled empty panel — states a gap instead of reading as a broken image */
.proj-img--empty {
  background: transparent;
  border: 1px dashed var(--border);
  display: grid; place-items: center;
}
.proj-img--empty::after {
  content: attr(data-label);
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--steel-mist);
}

/* inner page: stack columns, drop the sticky behaviour */
@media (max-width: 860px) {
  .proj-body { grid-template-columns: 1fr; gap: 32px; padding-bottom: 56px; }
  .proj-meta { position: static; }
  .proj-meta__title { display: none; }   /* redundant once meta is on top */
  .proj-head { padding: 72px 0 40px; }   /* back button is fixed (base rule); trim bottom padding */
  .proj-backzone { display: none; }      /* no back-zone once stacked */
  .proj-cursor { display: none; }
}
@media (max-width: 520px) {
  .proj-row--short { grid-template-columns: 1fr; }
  .proj-composite { grid-template-columns: 1fr; }
}

/* ============================================================
   Figure plate — expand + lightbox   (pilot: Cyclopes)
   Vanilla adaptation of MD/figure-plate-spec.md.
   ============================================================ */
:root {
  --accent-on-dark: var(--blue-light);       /* lighter blue, legible on the backdrop */
  --backdrop: rgba(18, 18, 17, 0.94);
  --dur-open: 420ms;
  --dur-close: 280ms;
}

/* plate: resting hairline frame + hover-blue (JS tags plates with .is-plate) */
.proj-img.is-plate {
  box-shadow: 0 0 0 1px var(--border);
  transition: box-shadow 140ms var(--ease);
}
.proj-img.is-plate:hover,
.proj-img.is-plate.is-focus {
  box-shadow: 0 0 0 1.5px var(--accent);
  outline: none;
}
@media (hover: hover) {
  .proj-img.is-plate:hover { cursor: none; }   /* the cursor mark takes over */
}

/* cursor-following mark — one element at root, repositioned by rAF */
.plate-cursor {
  position: fixed; left: 0; top: 0; z-index: 120;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  opacity: 0;
  color: var(--ink);                                 /* glyph colour */
  background: rgba(255, 255, 255, 0.5);              /* homepage-menu frosted fill */
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(20, 20, 20, 0.08);
  border-radius: 50%;
  will-change: transform;
  transition: opacity 100ms ease;
}
.plate-cursor.is-on { opacity: 1; }
.plate-cursor.on-dark { background: rgba(255, 255, 255, 0.62); color: var(--ink); }  /* keep readable on the dark lightbox */
.plate-cursor svg { display: block; }

/* touch / no-hover: persistent corner mark instead of the cursor mark */
@media (hover: none) {
  .proj-img.is-plate::after {
    content: "";
    position: absolute; right: 10px; bottom: 10px;
    width: 14px; height: 14px;
    background: no-repeat center / contain
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='1.5' y='1.5' width='21' height='21' fill='none' stroke='%23CDCDCD'/%3E%3Cpath d='M12 7v10M7 12h10' stroke='%23CDCDCD' fill='none'/%3E%3C/svg%3E");
  }
}

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; padding: 24px;
}
@media (hover: hover) { .lightbox { cursor: none; } }
.lightbox__backdrop {
  position: absolute; inset: 0;
  background: var(--backdrop);
  opacity: 0;
  transition: opacity var(--dur-open) var(--ease);
}
.lightbox.is-open .lightbox__backdrop { opacity: 1; }
.lightbox.is-closing .lightbox__backdrop { transition-duration: var(--dur-close); opacity: 0; }

.lightbox__stage {
  position: relative; z-index: 1; margin: 0;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  max-width: 100%; max-height: 100%;
  pointer-events: none;              /* clicks fall through to close */
}
.lightbox__tag {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.6); font-variant-numeric: tabular-nums;
  opacity: 0; transition: opacity 200ms ease 120ms;
}
.lightbox__caption {
  font-size: 13px; line-height: 1.45; color: rgba(255,255,255,0.6);
  max-width: 48ch; text-align: center;
  opacity: 0; transition: opacity 200ms ease 120ms;
}
.lightbox.is-open .lightbox__tag,
.lightbox.is-open .lightbox__caption { opacity: 1; }

.lightbox__plate {
  position: relative;
  flex: none;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.14);
  transform-origin: top left;
  overflow: hidden;
}
/* dither-expand: the ring plays on the inline plate, then the popup pops in */
.lightbox__plate.is-pop { opacity: 0; transform: scale(0.92); transition: opacity 220ms ease, transform 320ms var(--ease); }
.lightbox__plate.is-pop.is-shown { opacity: 1; transform: none; }
.lightbox__plate img,
.lightbox__plate canvas { width: 100%; height: 100%; display: block; object-fit: contain; }

/* close button, top-left */
.lightbox__close {
  position: absolute; left: 20px; top: 20px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; margin: 0;
  background: transparent; border: 1px solid rgba(255,255,255,0.28);
  border-radius: var(--radius);
  color: rgba(255,255,255,0.85);
  font: inherit; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase;
  opacity: 0; transition: opacity 200ms ease, border-color 140ms ease, color 140ms ease;
}
.lightbox.is-open .lightbox__close { opacity: 1; }
.lightbox__close:hover { border-color: var(--accent-on-dark); color: #fff; }
.lightbox__close svg { display: block; }

@media (prefers-reduced-motion: reduce) {
  .lightbox__plate { transition: none !important; transform: none !important; }
}

/* crisp image inside a plate — default, no effect at rest */
.proj-img { overflow: hidden; }
.proj-img__src {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: top;   /* hero shows the top fold */
  display: block;
  border-radius: inherit;
}
/* illustration / artifact plates: white ground + fit the whole art (no crop),
   so line-art with a transparent background stays legible */
.proj-img--paper { background: #fff; }
.proj-img--paper .proj-img__src { object-fit: contain; object-position: center; }

/* a row of screens (e.g. a questionnaire flow) — each cropped to its top,
   the whole screen revealed on expand */
.proj-flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.proj-flow .proj-img { aspect-ratio: 4 / 5; }
.proj-img--phone { background: #fff; }         /* keeps default cover + object-position: top */
@media (max-width: 560px) { .proj-flow { grid-template-columns: 1fr; } }

/* logo lockups — sub-brands side by side */
.proj-logos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 560px) { .proj-logos { grid-template-columns: 1fr; } }

/* two-up screen showcase */
.proj-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .proj-grid2 { grid-template-columns: 1fr; } }

/* product-UI screens — each shown full-width (hero size), stacked */
.proj-uigrid { display: flex; flex-direction: column; gap: 16px; }
.proj-uigrid .proj-img { aspect-ratio: 2880 / 1540; background: #fff; }
.proj-uigrid .proj-img__src { object-fit: contain; object-position: center; }

/* illustration cluster — one large anchor + a rail of smaller supporting pieces */
.proj-cluster {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  grid-template-rows: repeat(3, 1fr);
  gap: 12px;
  aspect-ratio: 4 / 3;
}
.proj-cluster .proj-img { background: #fff; }
.proj-cluster .proj-img__src { object-fit: contain; object-position: center; }
.proj-cluster .proj-img--main { grid-column: 1; grid-row: 1 / -1; }   /* the big one */
@media (max-width: 560px) {
  .proj-cluster { grid-template-columns: repeat(3, 1fr); grid-template-rows: auto auto; aspect-ratio: auto; }
  .proj-cluster .proj-img--main { grid-column: 1 / -1; grid-row: 1; aspect-ratio: 4 / 5; }
  .proj-cluster .proj-img:not(.proj-img--main) { aspect-ratio: 4 / 3; }
}
/* dither-ring overlay — sits above the expanded image during the open sweep */
.fx-dither {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  image-rendering: pixelated;
}

/* ============================================================
   Next project — boxed card between content and footer
   ============================================================ */
.next-proj {
  position: relative;
  display: grid;
  grid-template-columns: 1fr minmax(0, 42%);   /* text left, image right */
  align-items: stretch;
  margin-top: var(--section-gap);
  overflow: hidden;                            /* image bleeds to the rounded box edge */
  color: var(--ink);
  text-decoration: none;
  transition: border-color .2s ease;
}
.next-proj:hover { border-color: var(--accent); }
.next-proj__body {
  grid-column: 1; grid-row: 1;                  /* same row as the image → side by side */
  display: flex; flex-direction: column; justify-content: flex-start;   /* text top-left */
  gap: 6px;
  padding: 28px 32px;
}
.next-proj__media {
  grid-column: 2; grid-row: 1;                 /* right, flush to the frame — no padding */
  position: relative;                          /* contain the absolute image */
  min-height: 210px;
  background: var(--surface);
  overflow: hidden;
}
.next-proj__media img {
  position: absolute; inset: 0;                /* fill the cell; don't drive the card height */
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
  transition: transform .4s var(--ease);
}
.next-proj:hover .next-proj__media img { transform: scale(1.03); }
.next-proj__eyebrow {
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-dim);
}
.next-proj__name {
  margin: 2px 0 0;
  font-size: clamp(26px, 3vw, 34px); font-weight: 600;
  letter-spacing: -0.01em; line-height: 1.05;
}
.next-proj__tags { margin: 0; font-size: 13px; color: var(--ink-dim); }
.next-proj__desc {
  margin: 6px 0 0; font-size: 15px; line-height: 1.5;
  color: var(--ink-dim); max-width: 46ch;
}
/* static arrow chip — shown on touch (no hover). Desktop uses the cursor-following mark below. */
.next-proj__cta {
  position: absolute;
  right: 16px; bottom: 16px;
  z-index: 2;
  width: 48px; height: 48px;
  margin: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0;                                /* hide the "View project" text */
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(20, 20, 20, 0.08);
  border-radius: 50%;
}
.next-proj__cta svg { width: 18px; height: 18px; }

/* fine-pointer / hover devices: hide the static chip + OS cursor; a frosted arrow follows the pointer */
@media (hover: hover) and (pointer: fine) {
  .next-proj { cursor: none; }
  .next-proj__cta { display: none; }
}
.next-cursor {
  position: fixed; left: 0; top: 0; z-index: 65;
  width: 48px; height: 48px;
  margin: -24px 0 0 -24px;                      /* centre the mark on the pointer */
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(20, 20, 20, 0.08);
  border-radius: 50%;
  opacity: 0;
  transition: opacity .12s ease, transform .13s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}
.next-cursor.is-on { opacity: 1; }
.next-cursor svg { width: 20px; height: 20px; }
@media (max-width: 720px) {
  .next-proj { grid-template-columns: 1fr; }
  .next-proj__body { grid-column: 1; grid-row: 1; padding: 24px 22px 20px; }   /* text on top */
  .next-proj__media { grid-column: 1; grid-row: 2; aspect-ratio: 16 / 10; min-height: 0; }  /* image below */
  .next-proj__cta { top: auto; bottom: 16px; }  /* static chip over the image at the bottom (touch) */
}
