/* 袁灝 portfolio. A light room, washed with the colour of whichever still is passing. */

:root {
  --bg: #f5f5f7;
  --bg-rgb: 245 245 247;
  --ink: #1d1d1f;
  --ink-2: #48484d;
  --ink-3: #6b6b70;
  --line: rgb(0 0 0 / 0.14);
  --mark: #0066cc;
  --plate: #e6e6ea;              /* shown while a still loads */
  --lift: 0 28px 56px -28px rgb(24 24 40 / 0.42);
  --r: 14px;

  --f-display: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", "Songti SC", serif;
  --f-body: "Hanken Grotesk", "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "PingFang SC", sans-serif;

  --gut: clamp(20px, 5vw, 84px);
  --nav-h: 56px;
  --out: cubic-bezier(0.16, 1, 0.3, 1);

  --z-ring: 1;
  --z-shade: 2;
  --z-info: 3;
  --z-nav: 20;
}

:lang(zh-Hans) {
  --f-display: "Noto Serif SC", "Songti SC", "Shippori Mincho B1", serif;
  --f-body: "Hanken Grotesk", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  scrollbar-color: #c2c2c8 var(--bg);
}

body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main { overflow-x: clip; position: relative; }

/* Room light: a 24px canvas of the passing stills (pastel versions) stretched over the viewport.
   The stretch itself is the softening; a CSS blur here costs a full-screen filter pass on every scroll frame. */
.glow { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: var(--bg); }
.glow canvas {
  position: absolute; left: -10%; top: -10%;
  width: 120%; height: 120%;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
::selection { background: var(--mark); color: #fff; }

:focus-visible { outline: 2px solid var(--mark); outline-offset: 4px; }

.skip {
  position: fixed; left: 12px; top: 12px; z-index: 40;
  padding: 10px 16px; background: var(--ink); color: var(--bg);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

.sec-title {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: clamp(2rem, 4.4vw, 3.5rem);
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-wrap: balance;
}
/* --p is the scroll-driven entrance progress (0 → 1). Without it everything rests in place. */
.sec-title .wd { display: inline-block; white-space: nowrap; }
.sec-title .ch {
  --q: clamp(0, calc((var(--p, 1) - var(--i) / var(--n) * 0.6) * 2.5), 1);
  display: inline-block;
  opacity: var(--q);
  /* rises into place while the heading tracks in from wide (transforms only, so nothing reflows) */
  transform: translate(calc(var(--i) * (1 - var(--p, 1)) * 0.42em), calc((1 - var(--q)) * 0.6em));
}

/* ───────── Nav ───────── */

.nav {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-nav);
  height: var(--nav-h);
  display: flex; align-items: center; gap: clamp(16px, 3vw, 40px);
  padding-inline: var(--gut);
  background: rgb(var(--bg-rgb) / 0.78);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid rgb(0 0 0 / 0.07);
  transition: transform 0.7s var(--out);
}
.nav.is-away { transform: translateY(-100%); }
.nav:focus-within { transform: none; }
.nav__name { display: flex; align-items: baseline; gap: 12px; margin-right: auto; }
.nav__kanji { font-weight: 500; font-size: 1.25rem; letter-spacing: 0.12em; }
.nav__latin { font-size: 0.8125rem; color: var(--ink-2); letter-spacing: 0.04em; }
.nav__links { display: flex; gap: clamp(16px, 2.4vw, 34px); font-size: 0.875rem; }
.nav__links a, .nav__lang button {
  color: var(--ink-2);
  padding-block: 8px;
  background: linear-gradient(currentColor, currentColor) no-repeat 0 calc(100% - 4px) / 0 1px;
  transition: color 0.3s, background-size 0.5s var(--out);
}
.nav__links a:hover, .nav__lang button:hover { color: var(--ink); background-size: 100% 1px; }
.nav__lang { display: flex; gap: 14px; font-size: 0.8125rem; }
.nav__lang button[aria-pressed="true"] { color: var(--ink); background-size: 100% 1px; }

/* ───────── Opening ───────── */

.hero { position: relative; height: 480svh; }
.hero__pin {
  position: sticky; top: 0;
  height: 100svh; overflow: hidden;
}
.hero__space {
  position: absolute; inset: 0;
  perspective: 1200px;
  perspective-origin: 50% 50%;
}
.hero__cam { position: absolute; inset: 0; transform-style: preserve-3d; pointer-events: none; }
.fly {
  position: absolute; left: 50%; top: 50%;
  width: var(--w);
  will-change: transform, opacity;
}
.fly { display: block; overflow: hidden; cursor: zoom-in; border-radius: var(--r); box-shadow: var(--lift); background: var(--plate); }
.fly img { width: 100%; height: auto; transition: transform 1.2s var(--out); }
.fly:hover img { transform: scale(1.04); }
.fly::after {
  content: ""; position: absolute; inset: 55% 0 0 0; pointer-events: none;
  background: linear-gradient(rgb(0 0 0 / 0), rgb(0 0 0 / 0.5));
  opacity: 0; transition: opacity 0.5s;
}
.fly__cap {
  position: absolute; left: 4%; bottom: 5%; z-index: 1;
  font-family: var(--f-display); font-weight: 500; font-size: clamp(0.9375rem, 1.5vw, 1.375rem); letter-spacing: 0.06em; color: #fff;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.5s, transform 0.7s var(--out);
}
.fly:hover::after { opacity: 1; }
.fly:hover .fly__cap { opacity: 1; transform: none; }
.fly:first-child::after, .fly:last-child::after { display: none; }
.card img, .still img, .fly img { -webkit-user-drag: none; user-select: none; }
.is-dragging, .is-dragging * { cursor: grabbing !important; user-select: none; }

.hero__front {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(36px, 7.5vh, 84px);
  padding: calc(var(--nav-h) + 16px) var(--gut) clamp(72px, 10vh, 104px);
  pointer-events: none;
}
.hero__front > * { pointer-events: auto; will-change: transform, opacity; }

.hero__id { text-align: center; }
.hero__name { display: flex; flex-direction: column; align-items: center; gap: 0.1em; font-weight: 500; }
.hero__kanji {
  font-family: var(--f-display);
  font-size: clamp(4.5rem, 11vw, 8rem);
  line-height: 1.1;
  --open: 0;
  letter-spacing: 0.12em; margin-right: -0.12em;
  white-space: nowrap;
}
.hero__kanji .nm { display: inline-block; transform: translateX(calc(var(--k) * var(--open) * 1em)); will-change: transform; }
/* the name is the same in every language, so it always uses the face that has 灝 */
.hero__kanji, .nav__kanji { font-family: var(--f-name, "Shippori Mincho B1", "Hiragino Mincho ProN", serif); }
.hero__latin { font-size: clamp(1.125rem, 1.6vw, 1.5rem); font-weight: 400; letter-spacing: 0.06em; color: var(--ink-2); }
:lang(en) .hero__name { flex-direction: column-reverse; }
:lang(en) .hero__latin { font-family: var(--f-display); font-size: clamp(3.25rem, 8.4vw, 7rem); line-height: 1.05; font-weight: 500; letter-spacing: 0.01em; color: var(--ink); }
:lang(en) .hero__kanji { font-size: clamp(1.25rem, 1.8vw, 1.625rem); --open: 0 !important; letter-spacing: 0.2em; margin-right: -0.2em; color: var(--ink-2); }
.hero__roles { margin-top: clamp(14px, 2.2vh, 26px); font-size: clamp(1.0625rem, 1.5vw, 1.375rem); letter-spacing: 0.02em; }
.hero__meta {
  margin-top: 14px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px;
  font-size: 0.875rem; color: var(--ink-2);
}
.hero__meta .k { color: var(--ink-3); margin-right: 0.8em; }
.hero__open { display: inline-flex; align-items: center; gap: 9px; }
.hero__open i { width: 7px; height: 7px; border-radius: 50%; background: #30d158; }

/* Colour barcode: each segment is one graded still, reduced to ten columns of its colour */
.hero__bars { width: 100%; max-width: 1180px; }
.bars {
  display: flex; height: clamp(104px, 21vh, 220px);
  border-radius: var(--r); overflow: hidden; box-shadow: var(--lift);
}
.bar { flex: 1 1 0; min-width: 0; cursor: zoom-in; transition: flex-grow 0.7s var(--out); }
.bar:hover, .bar:focus-visible { flex-grow: 3.2; }
.bars__cap { margin-top: 16px; text-align: center; font-size: 0.875rem; color: var(--ink-2); min-height: 1.75em; }

.hero__cue {
  position: absolute; left: 50%; bottom: clamp(12px, 2.2vh, 24px);
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 0.8125rem; line-height: 1; color: var(--ink-2);
  letter-spacing: 0.2em; margin-right: -0.2em;
  pointer-events: none;
}
:lang(en) .hero__cue { letter-spacing: 0.12em; }
.hero__cue i { width: 1px; height: 22px; background: var(--line); position: relative; overflow: hidden; }
.hero__cue i::after {
  content: ""; position: absolute; inset: 0; background: var(--ink);
  animation: cue 2.4s var(--out) infinite;
}
@keyframes cue { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }

/* first paint: the name settles in once */
.intro .hero__id > * { animation: rise 1.2s var(--out) both; }
.intro .hero__id > :nth-child(2) { animation-delay: 0.12s; }
.intro .hero__id > :nth-child(3) { animation-delay: 0.22s; }
.intro .hero__cue { animation: fade 1.2s 0.6s both; }
.intro .bars { animation: wipe 1.7s var(--out) 0.25s both; }
.intro .bars__cap { animation: fade 1.2s 1s both; }
@keyframes wipe { from { clip-path: inset(0 100% 0 0 round var(--r)); } to { clip-path: inset(0 0 0 0 round var(--r)); } }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }
@keyframes fade { from { opacity: 0; } }

/* ───────── Works ring ───────── */

.works {
  position: relative; z-index: 1;
  margin-top: -100svh;            /* slides up over the last opening frame */
  height: calc(100svh + var(--n, 6) * 88svh);
  background: var(--bg);
}
.works__pin { position: sticky; top: 0; height: 100svh; overflow: hidden; }

.amb { position: absolute; inset: 0; background: var(--bg); }
.amb img {
  position: absolute; inset: -12%; width: 124%; height: 124%; max-width: none;
  object-fit: cover;
  filter: blur(56px) saturate(1.3);
  opacity: 0; will-change: opacity;
}
.amb::after { content: ""; position: absolute; inset: 0; background: rgb(var(--bg-rgb) / 0.22); }

.works__shade {
  position: absolute; inset: 0; z-index: var(--z-shade); pointer-events: none;
  background:
    linear-gradient(90deg, rgb(var(--bg-rgb) / 0.86) 0%, rgb(var(--bg-rgb) / 0.66) 24%, rgb(var(--bg-rgb) / 0) 48%),
    linear-gradient(0deg, rgb(var(--bg-rgb) / 0.6) 0%, rgb(var(--bg-rgb) / 0) 24%);
}

.works__title {
  position: absolute; z-index: var(--z-info);
  left: var(--gut); top: calc(var(--nav-h) + clamp(12px, 4vh, 44px));
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(1.25rem, 1.8vw, 1.625rem);
  letter-spacing: 0.14em;
  color: var(--ink-2);
}
:lang(en) .works__title { letter-spacing: 0.02em; }

.ring__space {
  position: absolute; z-index: var(--z-ring);
  left: 63%; top: 47%;
  width: 0; height: 0;
  perspective: 2100px;
}
.ring { position: absolute; left: 0; top: 0; transform-style: preserve-3d; will-change: transform; }
.card {
  --cw: min(50vw, 880px);
  --ch: 62svh;
  position: absolute; left: 0; top: 0;
  display: block;
  width: min(var(--cw), calc(var(--ch) * var(--ar)));
  aspect-ratio: var(--ar);
  transform-origin: 0 0;        /* turn about the ring axis, not the card centre */
  transform: rotateY(calc(var(--i) * var(--step, 60deg))) translateZ(var(--R, 700px)) translate(-50%, -50%);
  backface-visibility: hidden;
  will-change: opacity;
  background: var(--plate);
  border-radius: var(--r);
  box-shadow: var(--lift);
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  touch-action: pan-y;
}
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--out); }
.card:hover img { transform: scale(1.035); }

.works__info {
  position: absolute; z-index: var(--z-info);
  left: var(--gut); top: 50%;
  width: min(30vw, 30rem);
  transform: translateY(-46%);
}
.winfo {
  position: absolute; left: 0; top: 50%; width: 100%;
  transform: translateY(calc(-50% + 18px));
  opacity: 0; visibility: hidden;
  transition: opacity 0.45s, transform 0.7s var(--out), visibility 0s 0.45s;
}
.winfo.is-on { opacity: 1; visibility: visible; transform: translateY(-50%); transition-delay: 0.08s, 0.08s, 0s; }
.winfo__kind { font-size: 0.9375rem; color: var(--ink-2); display: flex; gap: 0.9em; align-items: baseline; }
.winfo__kind b { font-weight: 400; color: var(--ink); font-variant-numeric: tabular-nums; }
.winfo__title {
  margin-top: 14px;
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(2rem, 3.7vw, 3.5rem);
  line-height: 1.25; letter-spacing: 0.02em;
  text-wrap: balance;
}
.winfo__title.is-long { font-size: clamp(1.625rem, 2.7vw, 2.5rem); line-height: 1.35; }
.winfo__en { margin-top: 8px; font-size: 0.9375rem; color: var(--ink-2); }
.winfo__roles { margin-top: clamp(18px, 3vh, 30px); font-size: 1rem; line-height: 1.9; display: flex; flex-wrap: wrap; column-gap: 0.7em; }
.winfo__roles span { white-space: nowrap; }
.winfo__roles span:not(:last-child)::after { content: "/"; color: var(--ink-3); margin-left: 0.7em; }
.go {
  display: inline-flex; align-items: center; gap: 12px;
  margin-top: clamp(20px, 3.4vh, 36px);
  padding: 12px 22px 12px 24px;
  border: 1px solid var(--ink); border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-size: 0.9375rem;
  transition: background-color 0.4s, color 0.4s, border-color 0.4s;
}
.go i { font-style: normal; transition: transform 0.5s var(--out); }
.go:hover { background: var(--mark); border-color: var(--mark); color: #fff; }
.go:hover i { transform: translate(3px, -3px); }
.go--play i { font-size: 0.6875rem; }
.go--play:hover i { transform: translateX(3px); }

.works__index {
  position: absolute; z-index: var(--z-info);
  left: var(--gut); right: var(--gut); bottom: clamp(20px, 4.4vh, 44px);
  display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); gap: clamp(8px, 1.2vw, 18px);
}
.seg { display: block; width: 100%; text-align: left; padding-top: 12px; position: relative; color: var(--ink-3); transition: color 0.4s; }
.seg::before, .seg i { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 1px; background: var(--line); }
.seg i { background: var(--ink); transform-origin: 0 50%; transform: scaleX(0); }
.seg span { display: block; font-size: 0.8125rem; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg b { font-weight: 400; margin-right: 0.8em; font-variant-numeric: tabular-nums; }
.seg:hover, .seg.is-on { color: var(--ink); }
.seg.is-on b { color: var(--mark); }

.works__step {
  position: absolute; z-index: var(--z-info);
  right: var(--gut); bottom: calc(clamp(20px, 4.4vh, 44px) + 64px);
  display: flex; gap: 10px;
}
.works__step button {
  width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 50%;
  display: grid; place-items: center; font-size: 1rem;
  transition: background-color 0.4s, color 0.4s, border-color 0.4s, opacity 0.4s;
}
.works__step button:hover:not(:disabled) { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.works__step button:disabled { opacity: 0.3; cursor: default; }

.works__flat { display: none; }

/* ───────── Colour stills ───────── */

.color { padding-block: clamp(96px, 18vh, 220px) clamp(48px, 8vh, 96px); position: relative; z-index: 1; }
.color__head {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px 32px;
  padding-inline: var(--gut); margin-bottom: clamp(48px, 9vh, 104px);
}
.color__hint { font-size: 0.875rem; color: var(--ink-2); }
.strip { margin-bottom: clamp(56px, 10vh, 120px); }
.strip__head {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 20px;
  padding-inline: var(--gut); margin-bottom: 18px;
}
.strip__head h3 { font-family: var(--f-display); font-weight: 500; font-size: clamp(1.375rem, 2.2vw, 1.875rem); letter-spacing: 0.04em; }
.strip__head p { font-size: 0.875rem; color: var(--ink-2); font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; column-gap: 0.8em; }
.strip__head p span { white-space: nowrap; }
.strip__head p span:not(:last-child)::after { content: "·"; margin-left: 0.8em; color: var(--ink-3); }
.strip__track {
  display: flex; gap: clamp(8px, 1vw, 14px);
  width: max-content;
  padding-inline: var(--gut);
  will-change: transform;
  touch-action: pan-y;
}
.still {
  flex: none; display: block;
  height: clamp(220px, 44svh, 520px);
  aspect-ratio: var(--ar);
  overflow: hidden; cursor: zoom-in;
  background: var(--plate);
  border-radius: 12px;
}
.still img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--out); }
.still:hover img { transform: scale(1.03); }

/* ───────── Credits (skills) ───────── */

.credits { padding: clamp(72px, 12vh, 160px) var(--gut) clamp(96px, 18vh, 220px); position: relative; z-index: 1; }
.credits__grid { max-width: 68rem; margin-inline: auto; }
.credits__title { margin-left: calc(38% + clamp(20px, 3vw, 48px)); margin-bottom: clamp(44px, 8vh, 88px); }
.credits__list { display: grid; row-gap: clamp(22px, 4vh, 40px); }
.credit {
  position: relative;
  display: grid; grid-template-columns: 38% minmax(0, 1fr); column-gap: clamp(20px, 3vw, 48px); align-items: baseline;
  padding-top: clamp(20px, 3.4vh, 32px);
}
/* a rule draws across, the label slides in, then the items arrive one after another */
.credit::before {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 1px; background: var(--line);
  transform-origin: 0 50%;
  transform: scaleX(clamp(0, calc(var(--p, 1) * 1.8), 1));
}
.credit dt {
  --q: clamp(0, calc(var(--p, 1) * 3), 1);
  text-align: right; font-size: 0.9375rem; color: var(--ink-2);
  opacity: var(--q);
  transform: translateX(calc((1 - var(--q)) * -28px));
}
.credit ul { display: flex; flex-wrap: wrap; gap: 4px 1.5em; font-size: clamp(1.0625rem, 1.5vw, 1.25rem); line-height: 1.7; }
.credit li {
  --q: clamp(0, calc((var(--p, 1) - 0.14 - var(--i) / var(--n) * 0.5) * 3), 1);
  opacity: var(--q);
  transform: translateY(calc((1 - var(--q)) * 20px));
}

/* ───────── Contact ───────── */

.contact { position: relative; z-index: 1; padding-top: clamp(72px, 12vh, 160px); }
.contact__in { padding-inline: var(--gut); }
.contact__still {
  margin: clamp(48px, 9vh, 104px) var(--gut) 0;
  aspect-ratio: 2.37; overflow: hidden;
  border-radius: 18px; box-shadow: var(--lift); background: var(--plate);
}
.contact__still img { width: 100%; height: 100%; object-fit: cover; will-change: transform; }
.contact__copy { margin-top: clamp(18px, 3vh, 28px); max-width: 34em; font-size: clamp(1rem, 1.3vw, 1.125rem); }
.contact__mail {
  display: inline-block; margin-top: clamp(28px, 5vh, 52px);
  font-size: clamp(1.5rem, 3.4vw, 2.75rem); line-height: 1.3; letter-spacing: 0.01em;
  overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 100% 1px;
  padding-bottom: 6px;
  transition: color 0.4s;
}
.contact__mail:hover { color: var(--mark); }
.contact__alt { margin-top: clamp(24px, 4vh, 40px); display: flex; flex-wrap: wrap; gap: 10px 40px; font-size: 1rem; }
.contact__alt span { color: var(--ink-2); margin-right: 0.9em; }
.contact__alt a { background: linear-gradient(currentColor, currentColor) no-repeat 0 100% / 100% 1px; padding-bottom: 2px; }
.contact__alt a:hover { color: var(--mark); }
.foot {
  position: relative;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding: clamp(28px, 5vh, 48px) var(--gut) 28px;
  font-size: 0.8125rem; color: var(--ink-2);
}
.foot a:hover { color: var(--ink); }

/* ───────── Reveal on entry (enhances an already visible default) ───────── */

.rv { transition: opacity 0.9s var(--out), transform 1.1s var(--out); transition-delay: var(--d, 0s); }
.rv.is-pre { opacity: 0; transform: translateY(28px); }

/* ───────── Lightbox ───────── */

.lb {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  /* the viewing room stays dark so nothing competes with the grade */
  --ink: #f5f5f7; --ink-2: rgb(255 255 255 / 0.72);
  background: rgb(10 10 11 / 0.97); color: var(--ink);
}
.lb::backdrop { background: rgb(8 8 8 / 0.6); }
.lb[open] { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; animation: fade 0.35s both; }
.lb__fig { grid-column: 2; display: grid; justify-items: center; gap: 14px; padding-block: 56px 20px; height: 100%; grid-template-rows: minmax(0, 1fr) auto; }
.lb__fig img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; align-self: center; }
.lb__fig figcaption { display: flex; gap: 1.2em; font-size: 0.9375rem; color: var(--ink-2); }
.lb__fig figcaption span:first-child { color: var(--ink); font-family: var(--f-display); letter-spacing: 0.04em; }
.lb__btn { width: 56px; height: 56px; display: grid; place-items: center; font-size: 1.125rem; color: var(--ink-2); transition: color 0.3s; }
.lb__btn:hover { color: var(--ink); }
.lb__close { position: absolute; right: 12px; top: 8px; z-index: 1; }
.lb__prev { grid-column: 1; margin-inline: clamp(0px, 1.5vw, 24px); }
.lb__next { grid-column: 3; margin-inline: clamp(0px, 1.5vw, 24px); }
html.lb-open { overflow: hidden; }

/* ───────── Video player ───────── */

.vp {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  --ink: #f5f5f7; --ink-2: rgb(255 255 255 / 0.72);
  background: rgb(10 10 11 / 0.97); color: var(--ink);
}
.vp::backdrop { background: rgb(8 8 8 / 0.6); }
.vp[open] { display: grid; animation: fade 0.35s both; }
.vp__fig { display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; align-content: center; gap: 14px; height: 100dvh; padding: 56px 16px 20px; }
.vp__fig video { display: block; width: auto; height: auto; max-width: calc(100vw - 32px); max-height: calc(100dvh - 132px); border-radius: 10px; background: #000; align-self: center; }
.vp__fig figcaption { font-family: var(--f-display); font-size: 0.9375rem; letter-spacing: 0.04em; color: var(--ink); }

/* ───────── Narrow screens ───────── */

@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__latin { display: none; }

  .hero__cue { display: none; }
  .bars { height: clamp(88px, 16vh, 150px); }
  .bars__cap { font-size: 0.8125rem; }

  .ring__space { left: 50%; top: 31%; perspective: 1100px; }
  .card { --cw: 78vw; --ch: 34svh; }
  .works__title { top: calc(var(--nav-h) + 4px); font-size: 1rem; }
  .works__shade { background: linear-gradient(0deg, rgb(var(--bg-rgb) / 0.86) 0%, rgb(var(--bg-rgb) / 0.5) 40%, rgb(var(--bg-rgb) / 0) 62%); }
  .works__info { left: var(--gut); right: var(--gut); width: auto; top: auto; bottom: 86px; height: 36svh; transform: none; }
  .winfo { top: 0; transform: translateY(18px); }
  .winfo.is-on { transform: none; }
  .winfo__title { font-size: clamp(1.625rem, 7vw, 2.25rem); }
  .winfo__title.is-long { font-size: clamp(1.25rem, 5.4vw, 1.75rem); }
  .winfo__roles { margin-top: 12px; font-size: 0.9375rem; }
  .go { margin-top: 16px; padding: 10px 18px; }
  /* on phones the arrows sit beside the section title, clear of the text block */
  .works__step { top: calc(var(--nav-h) + 2px); bottom: auto; gap: 8px; }
  .works__step button { width: 36px; height: 36px; font-size: 0.875rem; }
  .color__hint { display: none; }
  .seg span { font-size: 0; }
  .seg span b { font-size: 0.75rem; margin: 0; }

  .strip__track { width: auto; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; transform: none !important; }
  .strip__track::-webkit-scrollbar { display: none; }
  .still { height: auto; width: 84vw; scroll-snap-align: center; }

  .contact__still { aspect-ratio: 16 / 10; border-radius: 14px; }

  .credits__title { margin-left: 0; }
  .credit { grid-template-columns: 1fr; row-gap: 8px; }
  .credit dt { text-align: left; }

  .lb[open] { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .lb__fig { grid-column: 1; grid-row: 1; padding: 56px 12px 8px; }
  .lb__prev, .lb__next { grid-row: 2; grid-column: 1; margin: 0 0 12px; }
  .lb__prev { justify-self: start; margin-left: 12px; }
  .lb__next { justify-self: end; margin-right: 12px; }
}

/* Touch screens keep :hover on the last thing touched; don't let that stick */
@media (hover: none) {
  .fly:hover img, .card:hover img, .still:hover img { transform: none; }
  .fly:hover::after, .fly:hover .fly__cap { opacity: 0; }
  .bar:hover { flex-grow: 1; }
}

/* ───────── Flat mode: reduced motion, no pinned 3D ───────── */

html.flat { scroll-behavior: auto; }
.flat .hero { height: 100svh; }
.flat .hero__cue i::after, .flat .intro .hero__id > *, .flat .intro .hero__cue, .flat .intro .bars, .flat .intro .bars__cap { animation: none; }
.flat .hero__space { display: none; }
.flat .works { margin-top: 0; height: auto; padding: clamp(96px, 16vh, 180px) var(--gut) 0; }
.flat .works__pin { display: none; }
.flat .color__hint { display: none; }
.flat .fly { cursor: zoom-in; }
.flat .works__flat { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: clamp(40px, 6vw, 72px) clamp(24px, 4vw, 56px); }
.flat .works__flat > h2 { grid-column: 1 / -1; }
.flat .fwork img { width: 100%; height: auto; max-height: 70svh; object-fit: contain; object-position: left; margin-bottom: 20px; }
.flat .fwork .winfo { position: static; opacity: 1; visibility: visible; transform: none; }
.flat .strip__track { width: auto; overflow-x: auto; transform: none !important; }
.flat .rv, .flat .rv.is-pre { opacity: 1; transform: none; transition: none; }
.flat .card img, .flat .still img { transition: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .lb[open] { animation: none; }
}
