/* Hero (00) and the Work opener: the full-bleed facade, the headline, the ways in, the opener (index and Lichfield
   card) and the proof strip. Static flow by default; with motion, js/motion.js pins the section (html.pinned) and
   shrinks the photograph into the card. The intro (headline slam, fades) is CSS, started by js/main.js. */

.stage { position: relative; background: var(--ink); color: var(--fg); }

/* ---------- the scene: photograph, shade, copy ---------- */
.hero-scene { position: relative; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; isolation: isolate; }
.frame { position: absolute; inset: 0; z-index: 1; overflow: hidden; transform-origin: 0 0; background: var(--ink-2); }
.counter, .fit, .depth { position: absolute; inset: 0; }
.depth { transform: scale(1.08); }
.hero-photo { width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; font-size: var(--fs-xs); color: var(--muted); }
.pinned .counter, .pinned .fit, .pinned .depth, .pinned .hero-photo { will-change: transform; }

.shade { position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(var(--ink-rgb), 0.72) 0%, rgba(var(--ink-rgb), 0.18) 22%, rgba(var(--ink-rgb), 0.28) 42%, rgba(var(--ink-rgb), 0.86) 72%, rgba(var(--ink-rgb), 0.96) 100%),
    linear-gradient(90deg, rgba(var(--ink-rgb), 0.55) 0%, rgba(var(--ink-rgb), 0) 60%); }

.hero-tag { position: absolute; z-index: 3; right: var(--gutter); top: calc(var(--header-h) + 20px); margin: 0; font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(var(--on-rgb), 0.8); text-align: right; text-shadow: 0 1px 12px rgba(var(--ink-rgb), 0.8); }

.hero-copy { position: absolute; inset: 0; z-index: 3; display: flex; align-items: flex-end; padding-bottom: clamp(72px, 11svh, 112px); pointer-events: none; }
.hero-copy .container { pointer-events: auto; }
.hero .eyebrow { margin: 0 0 clamp(12px, 2svh, 22px); color: var(--fg); }
.eyebrow-mark { width: 10px; height: 10px; flex: none; background: var(--amber); }

.hero-title { margin: 0; font-size: min(12vw, 21svh); font-weight: 900; line-height: 0.84; letter-spacing: -0.005em; color: var(--fg); }
.hl-line { display: block; white-space: nowrap; }
/* each word in its own clip, so it can rise into place (the intro below) */
.hl-word { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.04em 0.02em 0; margin: -0.04em -0.02em 0; }
.hl-word > span { display: inline-block; }
.hl-line + .hl-line .hl-word:last-child > span { color: var(--amber); }

.hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-top: clamp(18px, 3.2svh, 34px); }
.hero-side { display: grid; gap: clamp(14px, 2svh, 20px); min-width: 0; }
.hero-lede { margin: 0; max-width: 34rem; font-size: clamp(1rem, 0.9rem + 0.35vw, 1.1875rem); line-height: 1.55; color: var(--fg); text-wrap: pretty; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-chips .chip { min-height: 44px; padding-inline: 14px; border-color: rgba(var(--on-rgb), 0.5); color: var(--fg); background: rgba(var(--ink-rgb), 0.35); }
.hero-chips .chip:focus-visible { border-color: var(--amber); }
@media (hover: hover) { .hero-chips .chip:hover { border-color: var(--amber); } }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; flex: none; }
.mag-zone { display: inline-flex; }
.mag-in { display: inline-flex; align-items: center; gap: 10px; }
.hero-ctas .btn { min-height: 48px; padding-inline: 24px; font-size: 1rem; }
.hero-btn-ghost { --btn-bg: transparent; --btn-fg: var(--fg); --btn-bd: rgba(var(--on-rgb), 0.55); }
@media (hover: hover) {
  .hero .btn--primary:hover { --btn-bg: var(--amber-soft); --btn-fg: var(--ink); --btn-bd: var(--amber-soft); }
  .hero-btn-ghost:hover { --btn-bg: rgba(var(--on-rgb), 0.1); --btn-fg: var(--fg); --btn-bd: var(--fg); }
}

/* scroll cue */
.cue { position: absolute; z-index: 3; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(var(--on-rgb), 0.8); text-decoration: none; }
.cue-track { position: relative; width: 2px; height: 26px; background: rgba(var(--on-rgb), 0.22); overflow: hidden; }
.cue-track::after { content: ""; position: absolute; left: 0; top: 0; width: 2px; height: 10px; background: var(--amber); }
.motion .cue-track::after { animation: cue 1.6s var(--ease) infinite; }
@keyframes cue { from { transform: translateY(-12px); } to { transform: translateY(28px); } }

/* the soft slate band behind the fixed header while it is transparent over the photograph */
.site-header::before { content: ""; position: absolute; inset: 0 0 -28px; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(var(--ink-rgb), 0.7) 0, rgba(var(--ink-rgb), 0.35) 62%, rgba(var(--ink-rgb), 0) 100%);
  transition: opacity var(--t-med) var(--ease); }
.site-header.is-scrolled::before, .site-header.is-solid::before { opacity: 0; }

/* ---------- the intro: the photograph settles, the headline slams in word by word, then the buttons rise ----------
   The lede and the chips never wait: they are the first text a visitor reads (and the page's LCP element on phones). */
.intro-pending .hl-word > span { transform: translateY(115%); }
.intro-pending :is(.hero-fade, .cue, .hero-tag) { opacity: 0; }
.intro-play:not(.intro-done) .hero-photo { animation: hero-settle 1.7s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.intro-play:not(.intro-done) .shade { animation: shade-in 1.1s ease-out both; }
.intro-play:not(.intro-done) .hl-word > span { animation: word-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
.intro-play:not(.intro-done) .hl-line:first-child .hl-word:first-child > span { animation-delay: 0.12s; }
.intro-play:not(.intro-done) .hl-line:first-child .hl-word:last-child > span { animation-delay: 0.23s; }
.intro-play:not(.intro-done) .hl-line + .hl-line .hl-word:first-child > span { animation-delay: 0.34s; }
.intro-play:not(.intro-done) .hl-line + .hl-line .hl-word:last-child > span { animation-delay: 0.45s; }
.intro-play:not(.intro-done) .hero-fade { animation: rise-in 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) 0.8s both; }
.intro-play:not(.intro-done) .hero-ctas { animation-delay: 0.88s; }
.intro-play:not(.intro-done) :is(.cue, .hero-tag) { animation: appear 0.4s ease-out 1.3s both; }
@keyframes hero-settle { from { transform: scale(1.16); } to { transform: none; } }
@keyframes shade-in { from { opacity: 0.6; } to { opacity: 1; } }
@keyframes word-in { from { transform: translateY(115%) rotate(3deg); } to { transform: none; } }
@keyframes rise-in { from { transform: translateY(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }

/* ---------- the Work opener ---------- */
.work-intro { position: relative; z-index: 4; padding: 72px 0 48px; }
.wi-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.wi-head .eyebrow { margin: 0 0 14px; color: var(--muted); }
.wi-head h2 { margin: 0; font-size: clamp(2.25rem, 1.2rem + 3.6vw, 4.6rem); font-weight: 900; line-height: 0.92; text-wrap: balance; }
.wi-index { margin: clamp(18px, 3svh, 32px) 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line-strong); }
.wi-index a { position: relative; display: flex; align-items: center; gap: 14px; min-height: 46px; text-decoration: none; border-bottom: 1px solid var(--line-strong); font-weight: 600; overflow: hidden; }
.wi-index a::before { content: ""; position: absolute; inset: 0; background: rgba(var(--amber-rgb), 0.12); transform: scaleX(0); transform-origin: left; transition: transform 0.45s var(--ease); }
.wi-index a:hover::before, .wi-index a:focus-visible::before { transform: scaleX(1); }
.wi-index a:focus-visible { outline-offset: -2px; }
.wi-n { position: relative; width: 2.2em; color: var(--amber); font-family: var(--font-display); font-weight: 800; font-size: 1rem; letter-spacing: 0.06em; }
.wi-t { position: relative; flex: 1; min-width: 0; transition: transform 0.35s var(--ease); }
.wi-index a:hover .wi-t { transform: translateX(6px); }
.wi-k { position: relative; color: var(--muted); font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
.wi-card { display: block; color: inherit; text-decoration: none; }
.wi-card-media { position: relative; display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--ink-2); }
.wi-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
.wi-card-media::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--amber); transform: scaleX(0); transform-origin: left; transition: transform 0.5s var(--ease); }
.wi-card:hover .wi-card-media img { transform: scale(1.04); }
.wi-card:hover .wi-card-media::after, .wi-card:focus-visible .wi-card-media::after { transform: scaleX(1); }
.wi-card:focus-visible { outline-offset: 6px; }
.wi-card-cap { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-top: 14px; }
.wi-card-cap b { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; line-height: 1; text-transform: uppercase; letter-spacing: 0.02em; }
.wi-card-cap > span { color: var(--muted); font-size: 0.9375rem; text-align: right; }
.wi-card-cap .arrow { display: inline-block; color: var(--amber); transition: transform 0.3s var(--ease); }
.wi-card:hover .wi-card-cap .arrow { transform: translateX(6px); }

/* ---------- proof strip ---------- */
.proof { position: relative; z-index: 5; background: var(--ink); color: var(--fg); }
.proof-rule { height: 1px; background: rgba(var(--on-rgb), 0.22); transform-origin: left; }
.proof-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; margin: 0; padding: 22px 0 26px; list-style: none; }
.proof-grid li { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding-left: 14px; border-left: 2px solid var(--amber); }
.proof-num { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.6rem, 1rem + 1.5vw, 2.5rem); line-height: 1; letter-spacing: 0.01em; white-space: nowrap; }
.proof-grid li > span { font-size: 0.875rem; line-height: 1.35; color: var(--muted); text-wrap: balance; }

/* ---------- pinned (js/motion.js): one screen holds the scene, then the opener and the proof strip ---------- */
.pinned .stage { height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; }
.pinned .work-intro { position: absolute; left: 0; right: 0; top: var(--header-h); bottom: var(--proof-h, 132px); padding: 0; display: flex; align-items: center; pointer-events: none; }
.pinned .work-intro .container { max-height: 100%; }
.pinned .wi-card-media { background: transparent; }
.pinned .wi-card-media img { opacity: 0; }
.pinned .stage .proof { position: absolute; left: 0; right: 0; bottom: 0; background: transparent; pointer-events: none; }
.pinned .stage.is-work .work-intro, .pinned .stage.is-work .proof { pointer-events: auto; }
.pinned .stage.is-work .hero-copy .container, .pinned .stage.is-work .cue { pointer-events: none; }
@media (max-height: 760px) and (min-width: 861px) {
  .pinned .wi-index li:nth-child(n + 5) { display: none; }
  .pinned .wi-index a { min-height: 44px; }
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .wi-grid { grid-template-columns: minmax(0, 1fr); }
  .pinned .wi-index { display: none; } /* pinned on a narrow screen, the card and the chapters below name the projects */
  .hero-row { flex-direction: column; align-items: flex-start; gap: 20px; }
  .hero-tag { display: none; }
}
@media (max-width: 720px) {
  .hero-title { font-size: 15.6vw; line-height: 0.86; }
  .hero-copy { padding-bottom: 76px; }
  .hero-ctas { width: 100%; flex-wrap: nowrap; }
  .hero-ctas .mag-zone { flex: 1.3 1 0; }
  .hero-ctas > .btn { flex: 1 1 0; }
  .hero-ctas .btn { width: 100%; padding-inline: 12px; white-space: nowrap; }
  .shade { background: linear-gradient(180deg, rgba(var(--ink-rgb), 0.7) 0%, rgba(var(--ink-rgb), 0.25) 18%, rgba(var(--ink-rgb), 0.4) 36%, rgba(var(--ink-rgb), 0.9) 56%, rgba(var(--ink-rgb), 0.97) 100%); }
  .proof-grid { grid-template-columns: 1fr 1fr; gap: 14px 16px; padding: 16px 0 18px; }
  .proof-grid li:last-child { grid-column: 1 / -1; }
  .proof-grid li { gap: 3px; padding-left: 10px; }
  .proof-num { font-size: 1.45rem; }
  .proof-grid li > span { font-size: 0.8125rem; }
  .wi-card-cap b { font-size: 1.35rem; }
  .wi-card-cap > span { font-size: 0.875rem; }
  .wi-head h2 { font-size: clamp(2rem, 9.4vw, 2.6rem); }
  .pinned .work-intro { align-items: flex-start; padding-top: 18px; }
  .pinned .wi-grid { gap: 18px; }
}
/* the chips need room: on short screens they would push the headline off the top of the photograph, so there they
   are left to the Work list's own filters (the same choices, further down) */
@media (max-height: 699.98px) { .hero-chips { display: none; } }
/* short landscape (phones on their side, zoomed windows): one headline line, a shorter scene */
@media (orientation: landscape) and (max-height: 500px) {
  .hero-scene { min-height: 360px; }
  .hero-title { font-size: min(9vw, 17svh); }
  .hl-line { display: inline; }
  .hero-copy { padding-bottom: 56px; }
  .hero-lede { font-size: 0.9375rem; max-width: 46rem; }
  .cue { display: none; }
}

/* Chinese: hanzi at the 13 px floor in the small labels, no capitals tracking */
.lang-zh .hero-title { font-size: min(10vw, 17svh); letter-spacing: 0.02em; line-height: 1.02; } /* hanzi are square: a step smaller */
@media (max-width: 720px) { .lang-zh .hero-title { font-size: 13vw; } }
.lang-zh .hl-word { padding-top: 0.08em; margin-top: -0.08em; }
.lang-zh :is(.hero-tag, .cue, .wi-k) { font-size: var(--fs-label-zh); letter-spacing: 0.04em; }
.lang-zh .proof-grid li > span { font-size: 0.875rem; }
.lang-zh .wi-head h2 { line-height: 1.1; }

@media (prefers-reduced-motion: reduce) {
  .depth { transform: none; }
  .cue-track::after { animation: none; }
}
