/* =========================================================
   Zeyu Li — Portfolio  ·  "Studio" direction
   Image-led · expressive · playful · work-first
   ========================================================= */

:root {
  /* Color — navy primary + aqua accent, soft aqua base */
  --paper:   #E9F2F4;
  --paper-2: #D8E8EB;
  --card:    #F3F9FA;
  --ink:     #113056;   /* deep navy — text & structure */
  --ink-2:   #34506B;
  --muted:   #4C6076;   /* darkened to clear WCAG AA (4.5:1) on --paper */
  --line:    #C6DBE0;
  --primary: #113056;   /* navy */
  --primary-ink:#0B2038;
  --accent:  #91CFD5;   /* aqua (accent) */

  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --text:    "Inter", "Helvetica Neue", Arial, sans-serif;

  --gutter: clamp(20px, 5vw, 76px);
  --maxw: 1560px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);       /* ease-out-quint */
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);   /* ease-out-expo — confident, decisive */

  /* Fluid spacing scale — single source of truth for section rhythm.
     Steps are ~1.3–1.5× apart so tight groupings and generous breaks read distinctly. */
  --space-3xl: clamp(108px, 14vh, 168px);  /* hero top pad */
  --space-2xl: clamp(44px, 7vw, 92px);     /* between major sections */
  --space-xl:  clamp(36px, 5vw, 70px);     /* section / block breaks */
  --space-lg:  clamp(28px, 5vw, 64px);     /* group separation */
  --space-md:  clamp(22px, 4vw, 44px);     /* heading-to-content, column gaps */
  --space-sm:  clamp(16px, 2.5vw, 30px);   /* tight groupings */
  --space-xs:  clamp(12px, 1.5vw, 22px);   /* inner gaps */

  /* z-index scale */
  --z-nav: 100;
  --z-progress: 110;   /* thin scroll line sits above the nav's translucent bar */
  --z-skip: 200;       /* skip link — above nav, below the lightbox */
  --z-lightbox: 300;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--text); font-size: 17px; line-height: 1.6; letter-spacing: -0.01em;
  text-wrap: pretty; /* avoid last-line widows in prose */
  overflow-x: clip;
}
/* Balance headings so short lines don't leave a lone trailing word */
h1, h2, h3, .name, .feat-title, .foot-hello, .cs-outcome p { text-wrap: balance; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }

img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--primary); color: #fff; }
:focus-visible { outline: 2.5px solid var(--primary); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: var(--z-skip); background: var(--ink); color: var(--paper); padding: 10px 16px; }
.skip:focus { left: 12px; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.label { font-family: var(--text); font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--primary); }

/* ---------------- NAV ---------------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-nav);
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px var(--gutter);
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid transparent; transition: border-color .3s var(--ease);
}
.top.scrolled { border-bottom-color: var(--line); }
.wordmark { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; display: inline-flex; align-items: center; gap: 7px; }
.wordmark .dot { width: 9px; height: 9px; background: var(--accent); border-radius: 50%; display: inline-block; }
.nav { display: flex; gap: clamp(16px, 2.2vw, 34px); align-items: center; }
.nav a { font-family: var(--display); font-weight: 500; font-size: 15px; position: relative; padding: 3px 1px; color: var(--ink-2); transition: color .25s var(--ease); }
.nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -1px; height: 2px; background: var(--primary); transition: right .3s var(--ease); }
.nav a:hover, .nav a[aria-current="true"] { color: var(--ink); }
.nav a:hover::after, .nav a[aria-current="true"]::after { right: 0; }
.menu-btn { display: none; align-items: center; min-height: 44px; padding-inline: 6px; margin-right: -6px; font-family: var(--display); font-weight: 500; font-size: 15px; background: none; border: none; color: var(--ink); cursor: pointer; }

/* ---------------- INTRO ---------------- */
.intro { padding: var(--space-3xl) 0 var(--space-xl); }
.intro-role { display: flex; align-items: center; gap: 10px; margin: 0 0 clamp(18px, 2.5vw, 30px); }
.intro-role .label { color: var(--ink-2); }
.intro-role .live { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.name {
  font-family: var(--display); font-weight: 700; letter-spacing: -0.045em; line-height: 0.94;
  font-size: clamp(3.2rem, 7vw, 7rem); margin: 0; text-transform: none;
}
.name-line { display: block; white-space: nowrap; }
.name .amp { color: var(--primary); }
.intro-grid { display: grid; grid-template-columns: 1fr auto; gap: 28px 40px; align-items: end; margin-top: clamp(24px, 4vw, 48px); border-top: 2px solid var(--ink); padding-top: 22px; }
.intro-say { max-width: 40ch; font-size: clamp(1.05rem, 1.5vw, 1.35rem); color: var(--ink-2); margin: 0; }
.intro-say .hl { color: var(--ink); font-weight: 600; box-shadow: inset 0 -0.5em 0 color-mix(in srgb, var(--accent) 30%, transparent); }
.intro-contact { font-family: var(--display); font-weight: 600; font-size: clamp(1.05rem, 1.5vw, 1.3rem); display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.intro-contact .arw { width: 22px; transition: transform .3s var(--ease); }
.intro-contact:hover { color: var(--primary); }
.intro-contact:hover .arw { transform: translateX(5px); }
.proof-strip { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: clamp(28px, 4vw, 54px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.proof-strip > div { padding: clamp(18px, 2.5vw, 30px) clamp(14px, 2vw, 26px); }
.proof-strip > div:first-child { padding-left: 0; }
.proof-strip > div + div { border-left: 1px solid var(--line); }
.proof-strip strong { display: block; font-family: var(--display); font-size: clamp(1.8rem, 3vw, 3rem); line-height: 1; letter-spacing: -0.035em; }
.proof-strip span { display: block; max-width: 27ch; margin-top: 9px; color: var(--muted); font-size: 13.5px; line-height: 1.45; }

/* ---------------- SECTION HEADS ---------------- */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin: var(--space-2xl) 0 var(--space-md); }
.sec-head h2 { font-family: var(--display); font-weight: 600; font-size: clamp(1.5rem, 3vw, 2.4rem); letter-spacing: -0.02em; margin: 0; }
.sec-head .label { align-self: center; }

/* ---------------- FEATURED WORK ---------------- */
.feat { display: block; margin-bottom: var(--space-2xl); }
.feat-media { display: block; overflow: hidden; background: var(--paper-2); position: relative; border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); }
.feat-media::after { content: "Open case study  ↗"; position: absolute; right: 16px; bottom: 16px; padding: 9px 12px; background: color-mix(in srgb, var(--ink) 90%, transparent); color: #fff; font-family: var(--display); font-size: 12px; letter-spacing: .04em; opacity: 0; transform: translateY(8px); transition: opacity .28s var(--ease), transform .28s var(--ease); }
.feat-media img, .feat-media video { width: 100%; height: 100%; object-fit: cover; transition: transform .55s var(--ease), filter .55s var(--ease); }
.feat:hover .feat-media::after, .feat-media:focus-visible::after { opacity: 1; transform: none; }
.feat:hover .feat-media img, .feat:hover .feat-media video { transform: scale(1.035); }
.feat-no { display: inline-flex; align-items: center; gap: 18px; font-family: var(--display); font-weight: 600; color: var(--primary); font-size: 44px; }
.feat-client { height: 56px; width: auto; display: block; }
.feat-title { font-family: var(--display); font-weight: 700; letter-spacing: -0.03em; line-height: 1; margin: 6px 0 0; }
.feat-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; color: var(--muted); font-size: 13.5px; font-family: var(--display); }
.feat-meta span { position: relative; }
.feat-meta span:not(:last-child)::after { content: "·"; position: absolute; right: -12px; color: var(--line); }
.feat-line { margin: 14px 0 0; color: var(--ink-2); font-size: clamp(1rem, 1.3vw, 1.15rem); max-width: 48ch; }
.feat-cta { display: inline-flex; align-items: center; gap: 9px; margin-top: 18px; font-family: var(--display); font-weight: 600; color: var(--ink); }
.feat-cta .arw { width: 20px; transition: transform .3s var(--ease); }
.feat:hover .feat-cta { color: var(--primary); }
.feat:hover .feat-cta .arw { transform: translateX(5px); }

/* 01 — full-width feature */
.feat-wide .feat-media { aspect-ratio: 16 / 9; }
.feat-wide .feat-heading { margin-bottom: clamp(20px, 3vw, 34px); }
.feat-wide .feat-title { font-size: clamp(2.4rem, 6vw, 5.2rem); }
.feat-wide .feat-info-after { display: flex; justify-content: flex-start; margin-top: 24px; }
.feat-wide .feat-right { text-align: left; max-width: 76ch; }
.feat-wide .feat-line { max-width: 76ch; }

/* 02 — two-column feature */
.feat-split { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(24px, 4vw, 64px); align-items: center; }
.feat-split .feat-media { aspect-ratio: 4 / 3; }
.feat-split .feat-title { font-size: clamp(2rem, 4vw, 3.6rem); }

/* 03 — offset feature */
.feat-offset { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(24px, 4vw, 70px); align-items: center; }
.feat-offset .feat-info { order: -1; padding-left: clamp(0px, 4vw, 60px); }
.feat-offset .feat-media { aspect-ratio: 5 / 4; }
.feat-offset .feat-title { font-size: clamp(1.9rem, 3.6vw, 3.2rem); }

/* ---------------- MORE WORK GALLERY ---------------- */
.more { padding-bottom: var(--space-xl); }
/* seamless, gapless mosaic — natural image proportions */
.gallery { column-count: 5; column-gap: 0; }
.g-item { break-inside: avoid; margin: 0; position: relative; overflow: hidden; display: block; line-height: 0; background: var(--paper-2); }
.g-item img, .g-item video { width: 100%; height: auto; transition: transform .7s var(--ease); }
.g-item:hover img, .g-item:hover video { transform: scale(1.05); }
.g-item figcaption {
  position: absolute; left: 0; bottom: 0; right: 0; padding: 12px 14px; line-height: 1.3;
  font-family: var(--display); font-weight: 500; font-size: 13px; color: #fff;
  background: linear-gradient(to top, rgba(10,9,6,.62), transparent);
  opacity: 0; transform: translateY(6px); transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.g-item:hover figcaption { opacity: 1; transform: none; }

/* ---------------- ABOUT PREVIEW ---------------- */
.about { padding: var(--space-2xl) 0; border-top: 2px solid var(--ink); }
.about-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: var(--space-xl); align-items: center; }
.about-portrait { background: none; }
.about-portrait img { width: 100%; height: auto; display: block; border-radius: 50%; filter: drop-shadow(0 22px 44px rgba(11, 32, 56, 0.18)); }
.about h2 { font-family: var(--display); font-weight: 600; font-size: clamp(1.6rem, 2.8vw, 2.5rem); letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 20px; max-width: 20ch; }
.about-body p { font-size: clamp(1.02rem, 1.35vw, 1.18rem); color: var(--ink-2); line-height: 1.62; max-width: 60ch; margin: 0 0 18px; }
.about-body p strong { color: var(--ink); font-weight: 600; }
.about-caps { margin-top: 26px; display: flex; flex-wrap: wrap; align-items: baseline; }
.about-caps li { font-size: 15px; color: var(--ink-2); }
.about-caps li:not(:last-child)::after { content: "·"; margin: 0 11px; color: var(--muted); }
.about-more { display: inline-flex; align-items: center; gap: 9px; margin-top: 26px; font-family: var(--display); font-weight: 600; color: var(--ink); }
.about-more .arw { width: 20px; transition: transform .3s var(--ease); }
.about-more:hover { color: var(--primary); }
.about-more:hover .arw { transform: translateX(5px); }

/* ---------------- FOOTER ---------------- */
.foot { background: var(--ink); color: #CFE3E7; padding: var(--space-xl) 0 36px; }
.foot a { color: #CFE3E7; }
.foot-top { display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px 40px; align-items: end; }
.foot-hello { font-family: var(--display); font-weight: 600; font-size: clamp(1.6rem, 3.4vw, 3rem); letter-spacing: -0.02em; line-height: 1.02; color: #fff; margin: 0; max-width: 16ch; }
.foot-hello a { color: var(--accent); border-bottom: 2px solid transparent; transition: border-color .3s var(--ease); }
.foot-hello a:hover { border-bottom-color: var(--accent); }
.foot-links { display: flex; flex-direction: column; gap: 8px; justify-self: end; text-align: right; }
.foot-links a, .foot-links span { font-size: 15px; color: #9BBAC1; }
.foot-links a { transition: color .25s var(--ease); }
.foot-links a:hover { color: #fff; }
.foot-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: clamp(40px, 6vw, 72px); padding-top: 22px; border-top: 1px solid rgba(255,255,255,.16); font-size: 13px; color: #8CAEB7; }

/* ---------------- CASE STUDY ---------------- */
.cs-hero { padding: var(--space-3xl) 0 var(--space-md); }
.back-link { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 500; font-size: 14px; color: var(--muted); margin-bottom: clamp(22px, 3vw, 34px); transition: color .25s var(--ease); }
.back-link:hover { color: var(--ink); }
.back-link .arw { width: 20px; transform: scaleX(-1); transition: transform .3s var(--ease); }
.back-link:hover .arw { transform: scaleX(-1) translateX(5px); }
.cs-hero h1 { font-family: var(--display); font-weight: 700; letter-spacing: -0.035em; line-height: 0.98; font-size: clamp(2.6rem, 7vw, 6rem); margin: 8px 0 0; max-width: 15ch; }
.cs-summary { font-size: clamp(1.1rem, 1.6vw, 1.5rem); color: var(--ink-2); max-width: 54ch; margin: clamp(20px, 3vw, 34px) 0 0; line-height: 1.42; }
.cs-facts { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 18px 30px; margin-top: var(--space-lg); border-top: 1px solid var(--line); padding-top: 24px; max-width: 1040px; }
.cs-facts > div .lbl { font-family: var(--display); font-size: 11.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 6px; }
.cs-facts > div .v { font-size: 14.5px; color: var(--ink); line-height: 1.35; }
.cs-impact { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); margin: var(--space-md) 0 var(--space-lg); border: 1px solid var(--line); background: color-mix(in srgb, var(--card) 58%, transparent); }
.cs-impact > div { padding: clamp(20px, 3vw, 34px); }
.cs-impact > div + div { border-left: 1px solid var(--line); }
.cs-impact .kicker { display: block; margin-bottom: 9px; font-family: var(--text); font-size: 11px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.cs-impact strong { display: block; font-family: var(--display); font-size: clamp(1.35rem, 2.5vw, 2.3rem); line-height: 1.05; letter-spacing: -.025em; }
.cs-impact p { margin: 10px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.45; }
.cs-body-wrap { padding-bottom: clamp(20px, 4vw, 40px); }
.cs-figure { margin: clamp(24px, 4vw, 58px) 0; }
.cs-figure img, .cs-figure video { width: 100%; display: block; cursor: zoom-in; background: var(--paper-2); border: 1px solid color-mix(in srgb, var(--ink) 9%, transparent); }
.cs-figure figcaption { margin-top: 12px; font-family: var(--display); font-size: 13px; color: var(--muted); letter-spacing: 0.02em; }
.cs-two { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 1.5vw, 22px); margin: clamp(24px, 4vw, 58px) 0; align-items: stretch; }
/* Paired figures share the row's height; the shorter image scales up and covers
   so both align, captions included — no fixed aspect ratio imposed. */
.cs-two figure { margin: 0; display: flex; flex-direction: column; }
.cs-two figure img, .cs-two figure video { flex: 1 1 auto; min-height: 0; width: 100%; object-fit: cover; }
.cs-block { max-width: 760px; margin: var(--space-xl) 0 clamp(4px, 2vw, 20px); padding-left: clamp(18px, 2.5vw, 34px); border-left: 2px solid var(--accent); }
.cs-body-wrap > .cs-block:nth-of-type(even) { margin-left: clamp(0px, 10vw, 150px); }
.cs-block .label { display: block; margin-bottom: 14px; }
.cs-block h2 { font-family: var(--display); font-weight: 600; font-size: clamp(1.6rem, 3vw, 2.6rem); letter-spacing: -0.02em; line-height: 1.08; margin: 0 0 16px; }
.cs-block p { font-size: clamp(1.02rem, 1.4vw, 1.2rem); color: var(--ink-2); line-height: 1.6; margin: 0 0 16px; max-width: 62ch; }
.cs-block p strong { color: var(--ink); font-weight: 600; }
.cs-outcome { background: var(--ink); color: #DDECEF; padding: var(--space-lg); margin: var(--space-xl) 0; }
.cs-outcome .label { color: var(--accent); margin-bottom: 18px; display: block; }
.cs-outcome p { font-family: var(--display); font-weight: 500; font-size: clamp(1.4rem, 2.6vw, 2.3rem); line-height: 1.24; letter-spacing: -0.01em; color: #fff; margin: 0; max-width: 26ch; }
.cs-next { border-top: 1px solid var(--line); }
.cs-next a { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: var(--space-lg) 0; transition: color .25s var(--ease); }
.cs-next .small { font-family: var(--display); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.cs-next h3 { font-family: var(--display); font-weight: 600; font-size: clamp(1.5rem, 3.4vw, 2.8rem); letter-spacing: -0.025em; margin: 8px 0 0; }
.cs-next a:hover h3 { color: var(--primary); }
.cs-next .arw { width: 36px; flex: none; transition: transform .3s var(--ease); }
.cs-next a:hover .arw { transform: translateX(6px); }
@media (max-width: 820px) {
  .cs-facts { grid-template-columns: 1fr 1fr; }
  .cs-impact { grid-template-columns: 1fr; }
  .cs-impact > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .cs-two { grid-template-columns: 1fr; }
}
@media (max-width: 460px) { .cs-facts { grid-template-columns: 1fr; } }

/* ---------------- LIGHTBOX ---------------- */
.g-item img { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; z-index: var(--z-lightbox); display: none; align-items: center; justify-content: center;
  background: rgba(11, 32, 56, 0.95); padding: clamp(16px, 4vw, 48px);
}
.lightbox.open { display: flex; }
.lightbox .lb-stage { max-width: 94vw; max-height: 88vh; }
.lightbox img { max-width: 94vw; max-height: 88vh; width: auto; height: auto; display: block; object-fit: contain; box-shadow: 0 40px 90px -24px rgba(0,0,0,.55); }
.lb-close, .lb-nav { position: absolute; background: none; border: none; color: #E9F2F4; cursor: pointer; line-height: 1; transition: color .25s var(--ease), transform .25s var(--ease); }
.lb-close { top: 18px; right: 22px; font-size: 32px; }
.lb-nav { top: 50%; transform: translateY(-50%); font-size: 44px; padding: 8px 16px; }
.lb-prev { left: clamp(4px, 2vw, 24px); } .lb-next { right: clamp(4px, 2vw, 24px); }
.lb-close:hover, .lb-nav:hover { color: var(--accent); }
.lb-next:hover { transform: translateY(-50%) translateX(3px); }
.lb-prev:hover { transform: translateY(-50%) translateX(-3px); }
.lb-count { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: #8FB2BB; font-family: var(--display); font-size: 12.5px; letter-spacing: 0.12em; }
@media (max-width: 640px) { .lb-nav { font-size: 34px; } .lb-close { font-size: 28px; } }

/* ---------------- REVEAL ---------------- */
/* Content is visible by default. Only when JS is running (html.js) do we hide-then-reveal,
   so a no-JS or headless render never ships a blank section. */
html.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity .45s var(--ease), transform .45s var(--ease); transition-delay: calc(var(--i, 0) * 45ms); }
html.js .reveal.in { opacity: 1; transform: none; }

/* ---------------- HERO LOAD CHOREOGRAPHY ---------------- */
/* The above-the-fold hero must NOT wait on IntersectionObserver — it can stall in
   background tabs / headless renders and leave the hero blank. It plays on `html.ready`,
   which JS sets on load, so the entrance is guaranteed. Stagger index via --i. */
html.js .intro .wrap > .reveal:nth-child(1) { --i: 0; }
html.js .intro .wrap > .reveal:nth-child(2) { --i: 1; }
html.js .intro .wrap > .reveal:nth-child(3) { --i: 3; }
html.js .intro .wrap > .reveal:nth-child(4) { --i: 4; }
html.js .cs-hero .wrap > .reveal:nth-child(2) { --i: 0; }
html.js .cs-hero .wrap > .reveal:nth-child(3) { --i: 1; }
html.js .cs-hero .wrap > .reveal:nth-child(4) { --i: 2; }
html.js .cs-hero .wrap > .reveal:nth-child(5) { --i: 3; }

/* Hero lines settle in on load (staggered fade + rise). */
html.ready .intro .wrap > .reveal,
html.ready .cs-hero .wrap > .reveal { opacity: 1; transform: none; }

/* Display headline: a clip-path wipe instead of a plain fade. */
html.js .name, html.js .cs-hero h1 {
  opacity: 1; transform: none;
  clip-path: inset(0 0 110% 0);
  transition: clip-path .62s var(--ease-expo);
  transition-delay: calc(var(--i, 0) * 55ms);
  will-change: clip-path;
}
html.js .name { --i: 2; }
html.js .cs-hero h1 { --i: 1; }
html.ready .name, html.ready .cs-hero h1 { clip-path: inset(0 0 -14% 0); will-change: auto; }

/* ---------------- GALLERY STAGGER ---------------- */
/* Sibling stagger for the mosaic — the container stays put; only the items animate. */
html.js .gallery.reveal { opacity: 1; transform: none; transition: none; }
html.js .gallery.reveal .g-item { opacity: 0; transform: translateY(14px); transition: opacity .45s var(--ease), transform .45s var(--ease); transition-delay: calc(var(--gi, 0) * 35ms); }
html.js .gallery.reveal.in .g-item { opacity: 1; transform: none; }
html.js .gallery .g-item:nth-child(1) { --gi: 0; }  html.js .gallery .g-item:nth-child(2) { --gi: 1; }
html.js .gallery .g-item:nth-child(3) { --gi: 2; }  html.js .gallery .g-item:nth-child(4) { --gi: 3; }
html.js .gallery .g-item:nth-child(5) { --gi: 4; }  html.js .gallery .g-item:nth-child(6) { --gi: 5; }
html.js .gallery .g-item:nth-child(7) { --gi: 6; }  html.js .gallery .g-item:nth-child(8) { --gi: 7; }
html.js .gallery .g-item:nth-child(9) { --gi: 8; }  html.js .gallery .g-item:nth-child(n+10) { --gi: 9; }

/* ---------------- SCROLL PROGRESS ---------------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: var(--z-progress); background: transparent; pointer-events: none; }
.progress span { display: block; height: 100%; width: 100%; transform: scaleX(0); transform-origin: 0 50%; background: var(--accent); }

/* ---------------- LIVE STATUS PULSE ---------------- */
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  70%  { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
}
.intro-role .live { animation: livePulse 2.6s var(--ease) infinite; }

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 1000px) {
  .gallery { column-count: 4; }
  .feat-wide .feat-info-after { justify-content: flex-start; }
  .feat-wide .feat-right { justify-self: start; }
}
@media (max-width: 820px) {
  .nav { display: none; }
  .nav.open { display: flex; flex-direction: column; align-items: stretch; gap: 0; position: fixed; inset: 60px 0 auto 0; background: var(--paper); border-bottom: 1px solid var(--line); padding: 6px var(--gutter) 20px; }
  .nav.open a { padding: 14px 0; font-size: 17px; border-bottom: 1px solid var(--line); }
  .nav.open a:last-child { border-bottom: none; }
  .menu-btn { display: inline-flex; }
  .intro-grid { grid-template-columns: 1fr; align-items: start; gap: 18px; }
  .proof-strip { grid-template-columns: 1fr; }
  .proof-strip > div { padding-inline: 0; }
  .proof-strip > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .feat-split, .feat-offset { grid-template-columns: 1fr; }
  .feat-offset .feat-info { order: 0; padding-left: 0; }
  .about-grid { grid-template-columns: 1fr; }
  .about-portrait { max-width: 360px; }
  .foot-top { grid-template-columns: 1fr; align-items: start; }
  .foot-links { justify-self: start; text-align: left; }
}
@media (max-width: 640px) {
  .name { font-size: clamp(2.65rem, 13.2vw, 4.05rem); line-height: .94; letter-spacing: -.05em; overflow-wrap: anywhere; }
  .name-line { white-space: normal; }
  .gallery { column-count: 2; }
  .g-item figcaption { opacity: 1; transform: none; font-size: 11.5px; padding: 8px 10px; }
  .feat-wide .feat-media { aspect-ratio: 16/9; }
  .feat-media::after { display: none; }
  .cs-block { padding-left: 16px; }
  .cs-body-wrap > .cs-block:nth-of-type(even) { margin-left: 0; }
}
