/* ==========================================================================
   Animal Vision · 动物之眼 — v6 visual system
   Dark observatory: deep space, hairline metal, glass, one quiet accent per eye.
   ========================================================================== */

/* Fonts — all SIL OFL, self-hosted (no Google Fonts request, so it also loads in mainland China).
   Fraunces: high-contrast variable serif with an optical-size axis (display cuts at large sizes).
   Geist / Geist Mono: Vercel's neo-grotesk, crisper and more technical than Inter.
   AV Serif SC: Noto Serif SC (思源宋体), subset to the glyphs this site uses (~74 KB per weight). */
@font-face { font-family: 'Fraunces'; src: url(assets/fonts/Fraunces.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Fraunces'; font-style: italic; src: url(assets/fonts/Fraunces-Italic.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Geist'; src: url(assets/fonts/Geist.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url(assets/fonts/GeistMono.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'AV Serif SC'; src: url(assets/fonts/NotoSerifSC-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'AV Serif SC'; src: url(assets/fonts/NotoSerifSC-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }

/* The accent is a registered colour so the whole page can glide from one eye to the next. */
@property --acc { syntax: '<color>'; inherits: true; initial-value: #c8a06a; }
@property --glow-a { syntax: '<number>'; inherits: true; initial-value: 0; }

:root {
  /* motion scale: every transition uses --ease with one of these three durations */
  --t1: .35s;  /* hover, press, small state */
  --t2: .7s;   /* swaps: panel, tags, caption, stage pulse */
  --t3: 1.1s;  /* entrances, image blur → clear, accent glide */
  --mono-ls: .12em;  /* uppercase Geist Mono labels */
  --bg: #0b0b0c;
  --bg-deep: #070708;
  --bg2: #111113;
  --ink: #ece8e1;
  --ink2: rgba(236, 232, 225, .82);
  --mute: #8f8b84;
  --faint: #5d5a55;
  --line: rgba(236, 232, 225, .08);
  --line2: rgba(236, 232, 225, .15);
  --metal: linear-gradient(135deg, rgba(255,255,255,.28), rgba(255,255,255,.06) 30%, rgba(255,255,255,.02) 60%, rgba(255,255,255,.16));
  --acc: #c8a06a;
  --acc-soft: color-mix(in oklab, var(--acc) 22%, transparent);
  --acc-faint: color-mix(in oklab, var(--acc) 9%, transparent);
  --serif: 'Fraunces', 'AV Serif SC', 'Songti SC', 'Noto Serif SC', 'Source Han Serif SC', 'STSong', Georgia, serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --sans: 'Geist', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --pad: clamp(18px, 4vw, 56px);
  --wide: 1560px;
  transition: --acc .9s var(--ease);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.6 var(--sans); letter-spacing: .002em; font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; min-height: 100vh;
}
::selection { background: var(--acc); color: #111; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:focus-visible, a:focus-visible, label:focus-within { outline: 1.5px solid var(--acc); outline-offset: 3px; }
svg { display: block; }

/* ---------- atmosphere ---------- */
/* Two very soft light pools, tinted by the current eye. Fixed, painted once, no per-frame cost. */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vw 42vw at 72% -8%, var(--acc-faint), transparent 70%),
    radial-gradient(50vw 40vw at 6% 30%, rgba(120, 130, 160, .045), transparent 70%),
    radial-gradient(120vw 60vw at 50% 120%, rgba(0, 0, 0, .7), transparent 60%),
    var(--bg);
}
/* Night: a faint warm lamplight creeps into the room. */
body[data-light="night"]::before {
  background:
    radial-gradient(60vw 42vw at 72% -8%, rgba(214, 160, 92, .035), transparent 70%),
    radial-gradient(50vw 40vw at 6% 30%, rgba(60, 70, 110, .03), transparent 70%),
    radial-gradient(120vw 60vw at 50% 120%, rgba(0, 0, 0, .8), transparent 60%),
    #08080a;
}
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- entrance choreography ---------- */
.enter { opacity: 0; transform: translateY(14px); filter: blur(8px); animation: enter 1.15s var(--ease) forwards; animation-delay: calc(var(--d, 0) * 110ms + 80ms); }
@keyframes enter { to { opacity: 1; transform: none; filter: blur(0); } }
.rv { opacity: 0; transform: translateY(22px); filter: blur(6px); transition: opacity 1.1s var(--ease), transform 1.2s var(--ease), filter 1.1s var(--ease); }
.rv.in { opacity: 1; transform: none; filter: none; }
.swap { animation: swap .75s var(--ease); }
@keyframes swap { from { opacity: 0; transform: translateY(6px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

/* ---------- header ---------- */
.top {
  max-width: calc(var(--wide) + 2 * var(--pad)); margin: 0 auto;
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--pad);
}
.top::before {
  content: ''; position: absolute; inset: 0 calc(50% - 50vw); z-index: -1;
  background: linear-gradient(rgba(11, 11, 12, .82), rgba(11, 11, 12, 0));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  mask: linear-gradient(#000 55%, transparent); -webkit-mask: linear-gradient(#000 55%, transparent);
}
.mark { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo { width: 34px; height: 34px; overflow: visible; }
.logo .lg-lid, .logo .lg-ring { stroke: var(--ink); }
.logo .lg-iris { stroke: var(--ink); stroke-opacity: .4; transform-origin: 20px 22px; transition: transform 1.2s var(--ease); }
.logo .lg-pupil { fill: var(--acc); transform-origin: 20px 22px; transition: transform var(--t3) var(--ease), fill var(--t3) var(--ease); }
.logo .lg-arc { stroke-dasharray: 44; stroke-dashoffset: 44; animation: arc 1.6s .3s var(--ease) forwards; }
@keyframes arc { to { stroke-dashoffset: 0; } }
.mark:hover .lg-pupil { transform: scaleY(.82); }
.mark:hover .lg-iris { transform: rotate(90deg) scale(1.06); }
body[data-light="dusk"] .logo .lg-pupil { transform: scaleX(1.6); }
body[data-light="night"] .logo .lg-pupil { transform: scaleX(3.2) scaleY(.92); }
.wm { display: flex; align-items: baseline; gap: 12px; }
.mark-en { font-family: var(--serif); font-size: 20px; font-weight: 400; font-variation-settings: 'opsz' 36; letter-spacing: -.005em; }
.mark-en em { font-style: italic; font-weight: 300; }
.mark-zh { font-family: 'AV Serif SC', var(--serif); font-weight: 600; font-size: 11.5px; color: var(--mute); letter-spacing: .42em; padding-left: 12px; border-left: 1px solid var(--line2); }
.top-r { display: flex; align-items: center; gap: 4px; }
.lang, .gh, .theme {
  height: 34px; min-width: 34px; padding: 0 12px; border-radius: 999px;
  display: grid; place-items: center; color: var(--mute);
  font-size: 11.5px; letter-spacing: .16em; transition: color .4s var(--ease), background .4s var(--ease);
}
.gh svg { width: 17px; height: 17px; fill: currentColor; }
.lang:hover, .gh:hover, .theme:hover { color: var(--ink); background: rgba(255, 255, 255, .05); }
/* theme switch: one icon at a time, rotating in */
.theme { display: flex; align-items: center; gap: 7px; padding: 0 10px 0 9px; }
.theme svg { width: 16px; height: 16px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; }
.theme svg > * { transform-origin: 10px 10px; transition: opacity var(--t1) var(--ease), transform var(--t2) var(--ease); opacity: 0; transform: rotate(-60deg) scale(.6); }
.theme .fill { fill: currentColor; stroke: none; }
html:not([data-theme="light"]) .th-moon, html[data-theme="light"] .th-sun { opacity: 1; transform: none; }
.theme span { font-family: var(--mono); font-size: 10px; letter-spacing: var(--mono-ls); text-transform: uppercase; }

/* ---------- intro ---------- */
.intro {
  max-width: calc(var(--wide) + 2 * var(--pad)); margin: 0 auto;
  padding: clamp(6px, 1.6vh, 24px) var(--pad) clamp(10px, 2vh, 20px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 18px 56px;
}
.eyebrow {
  grid-column: 1 / -1; margin: 0; display: flex; align-items: center; gap: 14px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: var(--mono-ls); text-transform: uppercase; color: var(--mute);
}
.eyebrow::before { content: ''; width: 28px; height: 1px; background: linear-gradient(90deg, var(--acc), transparent); }
.eyebrow b { font-weight: 500; color: var(--ink2); }
h1 {
  font-family: var(--serif); font-weight: 400; margin: 0; text-wrap: balance;
  font-size: clamp(42px, 5.4vw, 84px); line-height: .94; letter-spacing: -.035em; font-weight: 300; font-variation-settings: 'opsz' 144;
  background: linear-gradient(180deg, #f6f2ea 30%, #bdb7ad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
html[lang^="zh"] h1 { font-family: 'AV Serif SC', var(--serif); letter-spacing: .015em; font-size: clamp(32px, 4vw, 58px); line-height: 1.12; font-weight: 600; font-feature-settings: 'palt'; }
.intro-r { display: grid; gap: 22px; max-width: 400px; padding-bottom: 6px; }
.stats { margin: 0; display: grid; grid-template-columns: repeat(3, auto); gap: 0; border-top: 1px solid var(--line); }
.stats div { padding: 12px 18px 0 0; }
.stats div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.stats dd { margin: 0; font-family: var(--serif); font-variation-settings: 'opsz' 72; font-weight: 300; font-size: 24px; line-height: 1.1; letter-spacing: -.01em; order: -1; }
.stats div { display: flex; flex-direction: column; }
.stats dt { font-family: var(--mono); font-size: 10px; letter-spacing: var(--mono-ls); color: var(--faint); margin-top: 4px; text-transform: uppercase; }
.lede { color: var(--mute); max-width: 380px; margin: 0; font-size: clamp(14px, 1.1vw, 15.5px); line-height: 1.75; }

/* ---------- studio layout ---------- */
.stage-wrap { padding: 0 var(--pad); }
.studio {
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(300px, 25vw, 372px);
  gap: clamp(20px, 2.4vw, 36px); max-width: var(--wide); margin: 0 auto; align-items: start;
}
.stage-col { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; }
.stage-col .bar { width: 100%; max-width: none; }

/* soft halo behind the photograph, coloured by the eye */
.halo {
  position: absolute; top: 0; left: 50%; z-index: -1; pointer-events: none;
  width: var(--stageW, 100%); height: var(--stageH, 60vh); transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--acc-soft), transparent);
  filter: blur(60px); opacity: .55; transition: opacity 1s var(--ease);
}
body[data-light="night"] .halo { background: radial-gradient(closest-side, rgba(214, 160, 92, .08), transparent); }
body[data-light="night"]::after { opacity: .45; }

/* ---------- stage ---------- */
.stage {
  position: relative; margin: 0 auto; border-radius: 20px; overflow: hidden; isolation: isolate;
  background: var(--bg-deep);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .06) inset,
    0 50px 140px -50px rgba(0, 0, 0, .95),
    0 24px 50px -30px rgba(0, 0, 0, .8);
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: ew-resize;
  transition: box-shadow .8s var(--ease), transform .8s var(--ease);
}
/* metal hairline: a gradient border drawn with a mask, so it never touches the canvas pixels */
.stage::before {
  content: ''; position: absolute; inset: 0; z-index: 7; border-radius: inherit; padding: 1px; pointer-events: none;
  background: var(--metal);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.stage canvas { display: block; width: 100%; height: 100%; opacity: 0; filter: blur(14px); transform: scale(1.015); transition: opacity .9s var(--ease), filter 1s var(--ease), transform 1.2s var(--ease); }
body.loaded .stage canvas { opacity: 1; filter: none; transform: none; }
.stage.grid { cursor: pointer; }
.stage.eagle { cursor: crosshair; }
.stage.flash canvas { animation: flash var(--t2) var(--ease); }
/* new eye: the rim catches the new accent for a moment, the image lifts a hair */
.stage.shift { animation: rim var(--t3) var(--ease); }
.stage.shift canvas { animation: lift var(--t2) var(--ease); }
@keyframes rim { 30% { box-shadow: 0 0 0 1px color-mix(in oklab, var(--acc) 45%, transparent) inset, 0 0 40px -10px color-mix(in oklab, var(--acc) 30%, transparent), 0 50px 140px -50px rgba(0,0,0,.95); } }
@keyframes lift { 35% { filter: brightness(1.06) contrast(1.03); } }
/* new photograph: same blur → clear as the first load */
.stage.swapimg canvas { animation: clear var(--t3) var(--ease); }
@keyframes clear { from { filter: blur(10px) brightness(.8); opacity: .55; transform: scale(1.012); } to { filter: none; opacity: 1; transform: none; } }
@keyframes flash { from { filter: blur(6px) brightness(.85); transform: scale(1.008); } to { filter: none; transform: none; } }

/* cursor light: one radial gradient that follows the pointer (two custom properties, no layout) */
.glow {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; mix-blend-mode: soft-light;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .22), transparent 60%);
  opacity: 0; transition: opacity .6s var(--ease);
}
.stage:hover .glow { opacity: 1; }
.stage.grid .glow { display: none; }

/* registration marks: a scientific-plate detail */
.ticks span { position: absolute; z-index: 3; width: 14px; height: 14px; pointer-events: none; border-color: rgba(255, 255, 255, .35); border-style: solid; border-width: 0; opacity: .8; }
.ticks span:nth-child(1) { left: 12px; top: 12px; border-left-width: 1px; border-top-width: 1px; }
.ticks span:nth-child(2) { right: 12px; top: 12px; border-right-width: 1px; border-top-width: 1px; }
.ticks span:nth-child(3) { left: 12px; bottom: 12px; border-left-width: 1px; border-bottom-width: 1px; }
.ticks span:nth-child(4) { right: 12px; bottom: 12px; border-right-width: 1px; border-bottom-width: 1px; }
.stage.grid .ticks { display: none; }

.tag {
  position: absolute; top: 18px; z-index: 4; pointer-events: none;
  padding: 7px 13px 7px 12px; border-radius: 999px;
  font-size: 11.5px; letter-spacing: .06em; line-height: 1;
  background: rgba(10, 10, 11, .42); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset;
  display: flex; align-items: center; gap: 8px; transition: opacity .45s var(--ease), border-color .9s var(--ease);
}
.tag i { font-family: var(--serif); font-style: italic; font-size: 14px; color: rgba(236, 232, 225, .66); letter-spacing: 0; }
.tag-l { left: 36px; }
.tag-r { right: 36px; border-color: color-mix(in oklab, var(--acc) 30%, rgba(255,255,255,.1)); }
.tag-r::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 3px var(--acc-faint), 0 0 12px var(--acc); }

/* ---------- divider ---------- */
.divider {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 48px; margin-left: -24px; z-index: 5;
  cursor: ew-resize; outline: none; touch-action: none;
}
.divider::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; margin-left: -.5px;
  background: linear-gradient(transparent, rgba(255, 255, 255, .9) 14%, rgba(255, 255, 255, .95) 50%, rgba(255, 255, 255, .9) 86%, transparent);
  box-shadow: 0 0 14px rgba(0, 0, 0, .55);
  transition: width .4s var(--ease), margin .4s var(--ease), box-shadow .5s var(--ease);
}
.divider::after { /* accent filament that wakes up while dragging */
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; margin-left: -.5px;
  background: var(--acc); filter: blur(3px); opacity: 0; transition: opacity .5s var(--ease);
}
.knob {
  position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px;
  border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 30%, rgba(40, 40, 44, .7), rgba(12, 12, 14, .62));
  backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, .85);
  box-shadow: 0 0 0 5px rgba(255, 255, 255, .06), 0 10px 32px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .2);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .5s var(--ease);
}
.knob svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.knob path { transition: transform .5s var(--ease); }
.divider:hover .knob, .divider:focus-visible .knob { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(255, 255, 255, .07), 0 12px 36px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .25); }
.divider:hover .knob path, .divider:focus-visible .knob path { transform: scaleX(1.12); transform-origin: 12px 12px; }
.stage.dragging .knob { transform: scale(.94); border-color: var(--acc); box-shadow: 0 0 0 10px var(--acc-faint), 0 0 28px var(--acc-soft), 0 10px 30px rgba(0, 0, 0, .5); }
.stage.dragging .divider::after { opacity: .9; }
.stage.dragging .divider::before { box-shadow: 0 0 22px rgba(255, 255, 255, .35); }
.stage.grid .divider, .stage.grid .tag { visibility: hidden; }
.stage.dragging { cursor: grabbing; }

/* ---------- eagle loupe ---------- */
.loupe {
  position: absolute; z-index: 6; pointer-events: none; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .08), 0 0 0 5px rgba(0, 0, 0, .25), 0 22px 50px rgba(0, 0, 0, .55), inset 0 0 30px rgba(0, 0, 0, .25);
  opacity: 0; transform: scale(.82); transition: opacity .3s var(--ease), transform .45s var(--ease);
}
.loupe::after { /* glass specular */
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(70% 50% at 30% 18%, rgba(255, 255, 255, .22), transparent 60%);
}
.loupe.on { opacity: 1; transform: scale(1); }
.loupe span {
  position: absolute; left: 50%; bottom: -13px; transform: translateX(-50%); z-index: 1;
  font-family: var(--serif); font-style: italic; font-size: 13px; padding: 2px 9px; border-radius: 99px;
  background: rgba(10, 10, 11, .75); border: 1px solid color-mix(in oklab, var(--acc) 60%, transparent); color: var(--acc);
}

/* ---------- grid tags ---------- */
.gridtags { position: absolute; inset: 0; pointer-events: none; display: none; z-index: 4; }
.stage.grid .gridtags { display: block; }
.gridtags div {
  position: absolute; padding: 12px; display: flex; align-items: flex-end;
  font-size: 11.5px; letter-spacing: .05em; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .6);
  animation: tile .8s var(--ease) both;
}
.gridtags div:nth-child(2) { animation-delay: 50ms; } .gridtags div:nth-child(3) { animation-delay: 100ms; }
.gridtags div:nth-child(4) { animation-delay: 150ms; } .gridtags div:nth-child(5) { animation-delay: 200ms; } .gridtags div:nth-child(6) { animation-delay: 250ms; }
@keyframes tile { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.gridtags span {
  padding: 6px 11px; border-radius: 99px; background: rgba(10, 10, 11, .5);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, .1);
}
.gridtags i { font-family: var(--serif); font-size: 13px; opacity: .65; margin-left: 7px; }

/* ---------- drop + loading ---------- */
.drop {
  position: absolute; inset: 14px; z-index: 9; border-radius: 14px;
  display: grid; place-items: center; background: rgba(8, 8, 9, .66);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-family: var(--serif); font-size: clamp(22px, 2.6vw, 34px); letter-spacing: -.01em;
  opacity: 0; pointer-events: none; transition: opacity .35s var(--ease);
}
.drop::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: conic-gradient(from var(--spin, 0deg), transparent 0 60%, var(--acc), transparent 90%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: spin 3s linear infinite paused;
}
body.dragover .drop { opacity: 1; }
body.dragover .drop::before { animation-play-state: running; }
@property --spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --spin: 360deg; } }

.loading { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; z-index: 8; overflow: hidden; opacity: 0; transition: opacity .5s; }
.loading.on { opacity: 1; }
.loading span { position: absolute; top: 0; bottom: 0; width: 34%; background: linear-gradient(90deg, transparent, var(--acc), #fff, var(--acc), transparent); animation: load 1.4s var(--ease-io) infinite; }
@keyframes load { from { left: -34%; } to { left: 100%; } }
.nogl[hidden] { display: none; }
.nogl { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; text-align: center; color: var(--mute); margin: 0; }

/* ---------- control dock ---------- */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: var(--stageW, 100%); margin: 16px auto 0; padding: 6px;
  border-radius: 999px; background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015));
  border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 20px 40px -30px rgba(0, 0, 0, .8);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.eyes { display: flex; gap: 2px; flex-wrap: nowrap; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.eyes::-webkit-scrollbar { display: none; }
.eye {
  position: relative; display: flex; align-items: baseline; gap: 7px; flex: none;
  height: 38px; padding: 0 15px; border-radius: 999px; color: var(--mute);
  transition: color .45s var(--ease), background .45s var(--ease), box-shadow .45s var(--ease);
  white-space: nowrap;
}
.eye b { font-weight: 500; font-size: 13.5px; line-height: 38px; }
.eye i { font-family: var(--serif); font-style: italic; font-size: 14.5px; opacity: .5; transition: opacity .45s var(--ease); }
.eye::before {
  content: ''; position: absolute; left: 50%; bottom: 4px; width: 14px; height: 1px; margin-left: -7px; border-radius: 1px;
  background: var(--c); opacity: 0; transform: scaleX(0); transition: .5s var(--ease); box-shadow: 0 0 8px var(--c);
}
.eye:hover { color: var(--ink); }
.eye:hover::before { opacity: .45; transform: scaleX(.5); }
.eye[aria-selected="true"] { color: var(--ink); background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), inset 0 1px 0 rgba(255, 255, 255, .08); }
.eye[aria-selected="true"] i { opacity: .8; }
.eye[aria-selected="true"]::before { opacity: 1; transform: scaleX(1); }
.eye.human { display: none; }
.stage-wrap.gridmode .eye.human { display: flex; }

.ctrl { display: flex; align-items: center; gap: 6px; flex: none; }
.seg {
  position: relative; display: inline-flex; padding: 3px; border-radius: 999px;
  background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 2px rgba(0, 0, 0, .4);
}
.seg button {
  position: relative; z-index: 1; height: 32px; padding: 0 13px; border-radius: 999px;
  font-size: 12.5px; color: var(--mute); transition: color .4s var(--ease);
  display: inline-flex; align-items: center; gap: 6px;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] { color: #121212; }
.seg button svg { display: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.seg .pill {
  position: absolute; top: 3px; bottom: 3px; border-radius: 999px;
  background: linear-gradient(180deg, #f7f3ec, #d9d4cb);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 4px 14px rgba(0, 0, 0, .35);
  transition: left .55s var(--ease), width .55s var(--ease);
}
.btn {
  height: 38px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--ink); background: rgba(255, 255, 255, .04);
  box-shadow: inset 0 0 0 1px var(--line2); transition: background .4s var(--ease), box-shadow .4s var(--ease), transform .3s var(--ease);
}
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: transform .45s var(--ease); }
.btn:hover { background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28), 0 0 24px var(--acc-faint); }
.btn:hover svg { transform: translateY(2px); }
.btn:active { transform: scale(.97); }

/* ---------- about this eye ---------- */
.about {
  position: sticky; top: 78px; display: flex; flex-direction: column; gap: 20px;
  padding: 26px 26px 22px; border-radius: 22px; overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015) 40%, rgba(255, 255, 255, .01));
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, .07), 0 40px 90px -50px rgba(0, 0, 0, .9);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.about::before { /* accent light leaking from the top edge */
  content: ''; position: absolute; left: 10%; right: 10%; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--acc), transparent); opacity: .7;
}
.about::after {
  content: ''; position: absolute; inset: -40% -20% auto; height: 70%; pointer-events: none;
  background: radial-gradient(closest-side, var(--acc-faint), transparent); filter: blur(20px);
}
.about > * { position: relative; z-index: 1; }
.about-top { display: flex; align-items: center; justify-content: space-between; font-family: var(--mono); font-size: 10px; letter-spacing: var(--mono-ls); text-transform: uppercase; color: var(--faint); }
.about-top .idx { font-variant-numeric: tabular-nums; color: var(--mute); }
.about-top .idx b { color: var(--acc); font-weight: 500; }
.latin { margin: 14px 0 0; font-family: var(--serif); font-style: italic; font-weight: 300; font-size: 17px; color: var(--acc); letter-spacing: .01em; }
.about h2 { font-family: var(--serif); font-weight: 300; font-variation-settings: 'opsz' 144; font-size: clamp(54px, 4.8vw, 82px); line-height: .9; margin: 6px 0 20px; letter-spacing: -.04em; }
html[lang^="zh"] .about h2 { font-family: 'AV Serif SC', var(--serif); font-weight: 600; }
.about-head { position: relative; }
.about-head::before { /* giant faint folio number, magazine style */
  content: attr(data-n); position: absolute; right: -10px; top: -44px; z-index: -1;
  font-family: var(--serif); font-variation-settings: 'opsz' 144; font-weight: 200; font-size: 150px; line-height: 1; letter-spacing: -.06em;
  color: transparent; -webkit-text-stroke: 1px rgba(236, 232, 225, .05); opacity: calc(var(--folio, 1) * var(--folio-len, 1)); transition: opacity var(--t2) var(--ease);
}
.line { font-family: var(--serif); font-style: italic; font-weight: 300; font-variation-settings: 'opsz' 24; font-size: 18px !important; line-height: 1.5 !important; color: var(--ink) !important; padding-left: 14px; border-left: 1.5px solid var(--acc); }
html[lang^="zh"] .line { font-family: 'AV Serif SC', var(--serif); font-style: normal; font-size: 15.5px !important; line-height: 1.8 !important; }
html[lang^="zh"] .about h2 { letter-spacing: -.01em; font-feature-settings: 'palt'; }
.line { font-size: 14.5px; line-height: 1.75; margin: 0; color: var(--ink2); text-wrap: pretty; }
.caveat { color: var(--mute); font-size: 12px; line-height: 1.65; margin: 12px 0 0; padding-left: 12px; border-left: 1px solid var(--line2); }
.caveat:empty { display: none; }
.opts { margin-top: 18px; display: flex; gap: 8px; }
.opts:empty { display: none; }
.toggle { display: inline-flex; align-items: center; gap: 10px; height: 34px; padding: 0 14px 0 7px; border-radius: 99px; box-shadow: inset 0 0 0 1px var(--line2); font-size: 12.5px; transition: background .4s var(--ease); }
.toggle:hover { background: rgba(255, 255, 255, .05); }
.toggle .sw { width: 30px; height: 18px; border-radius: 99px; background: rgba(255, 255, 255, .12); position: relative; transition: background .4s var(--ease); }
.toggle .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink); transition: transform .45s var(--ease); }
.toggle[aria-pressed="true"] .sw { background: var(--acc); }
.toggle[aria-pressed="true"] .sw::after { transform: translateX(12px); background: #111; }

/* instruments: spectrum + acuity + low light */
.meters { display: grid; gap: 14px; padding: 16px 0 4px; border-top: 1px solid var(--line); }
.meter { display: grid; gap: 7px; }
.meter-h { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; letter-spacing: var(--mono-ls); text-transform: uppercase; color: var(--faint); }
.meter-h em { font-style: normal; letter-spacing: .04em; text-transform: none; color: var(--mute); font-variant-numeric: tabular-nums; }
.spec { position: relative; height: 22px; }
.spec .band {
  position: absolute; left: 0; right: 0; top: 9px; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg,
    #1b1030 0%, #3a1d6e 12%, #5b2bb0 20%, #4b4be0 37.5%, #2aa6d6 50%, #3fbf6a 62.5%, #c9cf3a 70%, #f0a03a 80%, #e2483a 90%, #7a1d1d 100%);
  opacity: .5;
}
.spec .band::after { /* UV: beyond human sight */
  content: ''; position: absolute; left: 0; top: -3px; bottom: -3px; width: 20%; border-radius: 2px;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .14) 0 1px, transparent 1px 4px);
}
.spec i {
  position: absolute; top: 3px; width: 1px; height: 16px; background: var(--ink); left: var(--x);
  box-shadow: 0 0 8px var(--acc); transform-origin: bottom; animation: rise .8s var(--ease) both;
}
.spec i::after { content: ''; position: absolute; top: -3px; left: -2.5px; width: 6px; height: 6px; border-radius: 50%; background: var(--acc); }
.spec i:nth-child(3) { animation-delay: 60ms; } .spec i:nth-child(4) { animation-delay: 120ms; } .spec i:nth-child(5) { animation-delay: 180ms; }
@keyframes rise { from { transform: scaleY(0); opacity: 0; } to { transform: none; opacity: 1; } }
.spec-scale { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--faint); letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.rail { position: relative; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .03); }
.rail b { position: absolute; left: 0; top: 0; bottom: 0; width: var(--v); border-radius: 2px; background: linear-gradient(90deg, color-mix(in oklab, var(--acc) 40%, transparent), var(--acc)); box-shadow: 0 0 10px var(--acc-soft); transition: width 1s var(--ease); }
.rail s { position: absolute; top: -4px; bottom: -4px; width: 1px; left: var(--h); background: rgba(255, 255, 255, .5); }
.rail s::after { content: attr(data-l); position: absolute; top: 12px; left: 50%; transform: translateX(-50%); font-size: 9px; letter-spacing: .1em; color: var(--faint); white-space: nowrap; text-decoration: none; }
.meter.has-mark { padding-bottom: 10px; }

.facts { margin: 0; display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--line); }
.facts div { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 78px 1fr; gap: 12px; align-items: baseline; transition: background .4s var(--ease); }
.facts div:last-child { border-bottom: 0; }
.facts dt { font-family: var(--mono); font-size: 10px; letter-spacing: var(--mono-ls); text-transform: uppercase; color: var(--faint); }
.facts dd { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink2); }

/* ---------- gallery ---------- */
.gallery { width: 100%; margin: 34px 0 0; padding: 0; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; }
h3 { text-wrap: balance; font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3.2vw, 46px); margin: 0; letter-spacing: -.015em; }
.gallery h3 { font-size: 24px; display: flex; align-items: baseline; gap: 12px; }
.gallery h3::after { content: '06'; font-family: var(--mono); font-size: 10px; letter-spacing: var(--mono-ls); color: var(--faint); }
.hint { color: var(--mute); margin: 0; max-width: 520px; font-size: 12.5px; font-style: normal; }
.hint::before { content: '— '; color: var(--acc); }
.thumbs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; counter-reset: t; }
.thumb {
  position: relative; display: flex; flex-direction: column; gap: 0; padding: 5px; border-radius: 14px; cursor: pointer; counter-increment: t; text-align: left;
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015));
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, .05), 0 16px 30px -22px rgba(0, 0, 0, .9);
  transition: transform .6s var(--ease), box-shadow .6s var(--ease), background .6s var(--ease);
}
.thumb .ph { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--bg2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.03); transition: transform 1.4s var(--ease), filter .7s var(--ease); filter: saturate(.72) brightness(.74); }
.thumb::before {
  content: counter(t, decimal-leading-zero); position: absolute; top: 12px; left: 13px; z-index: 2;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em; color: rgba(255, 255, 255, .7);
}
.thumb .cap { display: flex; flex-direction: column; gap: 3px; padding: 9px 7px 5px; min-width: 0; }
.thumb .cap b { font-family: var(--serif); font-weight: 400; font-variation-settings: 'opsz' 24; font-size: 16px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[lang^="zh"] .thumb .cap b { font-family: 'AV Serif SC', var(--serif); font-size: 14.5px; font-weight: 600; letter-spacing: .04em; }
.thumb .cap small { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 9.5px; letter-spacing: var(--mono-ls); color: var(--faint); text-transform: uppercase; white-space: nowrap; }
.thumb .cap small::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--c); opacity: .8; flex: none; }
.thumb:hover { transform: translateY(-4px); background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), 0 26px 44px -24px rgba(0, 0, 0, .95); }
.thumb:hover img { transform: scale(1.08); filter: saturate(1) brightness(.96); }
.thumb.on { box-shadow: inset 0 0 0 1px var(--acc), 0 0 0 3px var(--acc-faint), 0 18px 36px -22px rgba(0, 0, 0, .95); }
.thumb.on img { filter: saturate(1) brightness(1); }
.thumb.on .cap small { color: var(--mute); }
.thumb.on::after { content: ''; position: absolute; top: 13px; right: 13px; z-index: 2; width: 6px; height: 6px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 10px var(--acc); }

.upload {
  grid-column: 1 / -1; order: 99; position: relative; overflow: hidden; cursor: pointer;
  display: grid; grid-template-columns: 46px auto 1fr auto; align-items: center; gap: 2px 18px;
  min-height: 92px; padding: 0 24px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .008));
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .5s var(--ease), background .5s var(--ease);
}
.upload::before { /* dashed hairline drawn as a gradient so it can animate */
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    linear-gradient(90deg, var(--line2) 50%, transparent 0) 0 0 / 10px 1px repeat-x,
    linear-gradient(90deg, var(--line2) 50%, transparent 0) 0 100% / 10px 1px repeat-x,
    linear-gradient(0deg, var(--line2) 50%, transparent 0) 0 0 / 1px 10px repeat-y,
    linear-gradient(0deg, var(--line2) 50%, transparent 0) 100% 0 / 1px 10px repeat-y;
  transition: opacity .4s;
}
.upload:hover::before, body.dragover .upload::before { animation: march 1.2s linear infinite; }
@keyframes march { to { background-position: 10px 0, -10px 100%, 0 -10px, 100% 10px; } }
.upload::after { content: attr(data-paste); text-transform: uppercase; font-family: var(--mono); grid-column: 4; grid-row: 1 / 3; font-size: 10px; letter-spacing: var(--mono-ls); color: var(--faint); padding: 5px 9px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line); }
.upload:hover, body.dragover .upload { background: linear-gradient(90deg, var(--acc-faint), rgba(255, 255, 255, .01)); }
.upload.on { box-shadow: inset 0 0 0 1px var(--acc); }
.upload .plus { grid-row: 1 / 3; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--line2); transition: transform .6s var(--ease), background .4s; }
.upload:hover .plus { transform: rotate(90deg); background: var(--acc-faint); }
.upload .plus svg { width: 16px; height: 16px; stroke: var(--ink); stroke-width: 1.4; fill: none; stroke-linecap: round; }
.upload b { font-family: var(--serif); font-weight: 400; font-size: 23px; line-height: 1.1; align-self: end; }
.upload small { grid-column: 2 / 4; align-self: start; color: var(--mute); font-size: 12px; line-height: 1.5; }

/* ---------- science ---------- */
/* ---------- atlas: all six eyes on one ruler ---------- */
.atlas, .science { max-width: calc(var(--wide) + 2 * var(--pad)); margin: clamp(90px, 14vh, 160px) auto 0; padding: 0 var(--pad); }
.kicker { margin: 0 0 16px; display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 10.5px; letter-spacing: var(--mono-ls); text-transform: uppercase; color: var(--acc); }
.kicker::before { content: ''; width: 28px; height: 1px; background: currentColor; opacity: .7; }
.atlas-h, .sci-h { max-width: 720px; }
.atlas h3, .science h3 { font-weight: 300; font-variation-settings: 'opsz' 144; letter-spacing: -.03em; line-height: 1; }
html[lang^="zh"] .atlas h3, html[lang^="zh"] .science h3 { font-family: 'AV Serif SC', var(--serif); font-weight: 600; letter-spacing: .01em; font-feature-settings: 'palt'; line-height: 1.2; }
.atlas-p, .sci-p { margin: 18px 0 0; color: var(--mute); font-size: 14.5px; line-height: 1.8; max-width: 560px; }
.atlas-t { margin-top: 40px; border-top: 1px solid var(--line2); }
.arow {
  width: 100%; display: grid; grid-template-columns: minmax(200px, 1.1fr) minmax(0, 2.2fr) minmax(0, 1fr) 70px; gap: 28px; align-items: center;
  padding: 16px 14px; border-bottom: 1px solid var(--line); text-align: left; position: relative;
  transition: background .5s var(--ease);
}
.arow::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--c); transform: scaleY(0); transition: transform .6s var(--ease); }
.arow:hover { background: rgba(255, 255, 255, .025); }
.arow.on { background: linear-gradient(90deg, color-mix(in oklab, var(--c) 9%, transparent), transparent 70%); }
.arow.on::before { transform: none; }
.ahead { padding: 12px 14px; font-family: var(--mono); font-size: 10px; letter-spacing: var(--mono-ls); text-transform: uppercase; color: var(--faint); }
.an { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.an em { font-style: normal; font-family: var(--mono); font-size: 10px; color: var(--faint); }
.an b { font-family: var(--serif); font-weight: 400; font-variation-settings: 'opsz' 48; font-size: 26px; line-height: 1; letter-spacing: -.01em; }
html[lang^="zh"] .an b { font-family: 'AV Serif SC', var(--serif); font-weight: 600; font-size: 21px; }
.an i { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: 14px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aspec { position: relative; height: 30px; }
.aspec::before { content: ''; position: absolute; left: 0; right: 0; top: 14px; height: 2px; border-radius: 1px; opacity: .38;
  background: linear-gradient(90deg, #1b1030 0%, #3a1d6e 12%, #5b2bb0 20%, #4b4be0 37.5%, #2aa6d6 50%, #3fbf6a 62.5%, #c9cf3a 70%, #f0a03a 80%, #e2483a 90%, #7a1d1d 100%); }
.aspec::after { content: ''; position: absolute; left: 0; width: 20%; top: 9px; height: 12px; background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .1) 0 1px, transparent 1px 4px); }
.aspec i { position: absolute; left: var(--x); top: 9px; width: 1px; height: 12px; background: var(--ink); }
.aspec i::before { content: ''; position: absolute; left: -3px; top: 3px; width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.aspec small { position: absolute; top: 15px; left: 50%; transform: translateX(-50%); font-family: var(--mono); font-size: 9px; color: var(--faint); opacity: 0; transition: opacity .4s var(--ease); }
.arow:hover .aspec small, .arow.on .aspec small { opacity: 1; }
.aacu { display: flex; align-items: center; gap: 12px; }
.aacu b { flex: 1; height: 2px; border-radius: 1px; background: linear-gradient(90deg, var(--c) var(--v), rgba(255, 255, 255, .07) var(--v)); }
.aacu small, .again { font-family: var(--mono); font-size: 11px; color: var(--mute); font-variant-numeric: tabular-nums; }
.aacu small { width: 38px; text-align: right; }
.again { text-align: right; }

/* ---------- science: editorial two-column ---------- */
.science { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px clamp(40px, 6vw, 110px); align-items: start; }
.sci-h { position: sticky; top: 100px; }
.notes { display: grid; grid-template-columns: 1fr; counter-reset: n; border-top: 1px solid var(--line2); }
.notes div {
  position: relative; counter-increment: n; display: grid; grid-template-columns: 70px 150px minmax(0, 1fr); gap: 4px 24px; align-items: baseline;
  padding: 26px 0; border-bottom: 1px solid var(--line);
}
.notes div::before { content: counter(n, decimal-leading-zero); font-family: var(--serif); font-variation-settings: 'opsz' 144; font-weight: 200; font-size: 44px; line-height: .8; color: transparent; -webkit-text-stroke: 1px rgba(236, 232, 225, .35); transition: -webkit-text-stroke-color var(--t2) var(--ease); }
.notes div::after { content: ''; position: absolute; left: 0; bottom: -1px; height: 1px; width: 100%; background: linear-gradient(90deg, var(--acc), transparent 60%); transform: scaleX(0); transform-origin: left; transition: transform .9s var(--ease); }
.notes div:hover::before { -webkit-text-stroke-color: color-mix(in oklab, var(--acc) 70%, transparent); }
.notes div:hover::after { transform: none; }
.notes b { font-family: var(--mono); font-size: 10.5px; letter-spacing: var(--mono-ls); text-transform: uppercase; color: var(--ink2); font-weight: 500; }
.notes p { margin: 0; color: #b4afa7; font-size: 14px; line-height: 1.8; }

/* ---------- one-line live caption between intro and stage ---------- */
.caption {
  max-width: var(--wide); margin: 0 auto 12px; padding: 0;
  font-family: var(--serif); font-weight: 300; font-style: italic; font-size: 15px; color: var(--mute); letter-spacing: .005em;
  display: block; min-height: 22px;
}
.caption::before { content: ''; display: inline-block; vertical-align: .15em; margin-right: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 10px var(--acc); flex: none; animation: breathe 3.2s var(--ease-io) infinite; }
.caption b { font-weight: 400; color: var(--ink); }
.caption em { color: var(--ink2); }
html[lang^="zh"] .caption { font-family: 'AV Serif SC', var(--serif); font-style: normal; font-size: 13.5px; letter-spacing: .04em; }
html[lang^="zh"] .caption b { font-weight: 600; color: var(--acc); margin: 0 .15em; }
html[lang^="zh"] .caption em { font-style: normal; }
.caption.swap { animation: capin var(--t2) var(--ease); }
@keyframes capin { from { opacity: 0; filter: blur(4px); transform: translateY(3px); } }
@keyframes breathe { 50% { opacity: .45; } }

/* ---------- live readout chip on the stage ---------- */
.readout {
  position: absolute; right: 36px; bottom: 18px; z-index: 4; pointer-events: none; display: flex; gap: 0;
  padding: 0 4px; border-radius: 8px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; color: rgba(236, 232, 225, .85);
  background: rgba(10, 10, 11, .45); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .09); transition: opacity .45s var(--ease);
}
.readout span { padding: 7px 10px; white-space: nowrap; }
.readout span + span { border-left: 1px solid rgba(255, 255, 255, .1); }
.readout span:first-child { color: var(--acc); }
.stage.grid .readout { display: none; }

/* slow aurora behind everything: one transformed layer, GPU-composited */
body::after {
  content: ''; position: fixed; z-index: -1; pointer-events: none; width: 70vmax; height: 70vmax; left: 40%; top: -30vmax;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--acc) 7%, transparent), transparent);
  filter: blur(40px); will-change: transform; animation: drift 38s var(--ease-io) infinite alternate;
}
@keyframes drift { from { transform: translate3d(-12vw, 0, 0) scale(1); } to { transform: translate3d(14vw, 8vh, 0) scale(1.15); } }

/* ---------- footer ---------- */
.foot {
  max-width: min(var(--wide), calc(100% - 2 * var(--pad))); margin: clamp(80px, 13vh, 150px) auto 0; padding: 26px 0 48px;
  border-top: 1px solid var(--line); color: var(--faint); font-size: 11.5px; line-height: 1.8;
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.foot p { margin: 0; max-width: 860px; }
.foot a { color: var(--mute); text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: color .4s, background-size .6s var(--ease); }
.foot a:hover { color: var(--ink); background-size: 100% 1px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .about-head { --folio: 0; }
}
@media (max-width: 1100px) {
  .science { grid-template-columns: 1fr; }
  .sci-h { position: static; }
  .arow { grid-template-columns: minmax(150px, 1fr) minmax(0, 2fr) 90px 54px; gap: 18px; }
  .an i { display: none; }
}
@media (max-width: 980px) {
  .studio { grid-template-columns: 1fr; }
  .about { position: static; }
  .thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .intro { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 14px; }
  .mark-zh { display: none; }
  .stage { border-radius: 14px; }
  .ticks { display: none; }
  .tag { top: 10px; font-size: 11px; padding: 6px 10px; }
  .tag-l { left: 10px; } .tag-r { right: 10px; }
  .tag i { display: none; }
  .bar { flex-direction: column; align-items: stretch; gap: 6px; border-radius: 22px; padding: 6px; }
  .eyes { margin: 0; }
  .eye { padding: 0 13px; height: 36px; }
  .eye b { line-height: 36px; }
  .ctrl { justify-content: space-between; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .ctrl::-webkit-scrollbar { display: none; }
  .seg { flex: none; }
  .seg button { padding: 0 11px; font-size: 12px; height: 30px; }
  #views button { padding: 0 10px; }
  #views button span { display: none; }
  #views button svg { display: block; }
  .btn { width: 38px; padding: 0; justify-content: center; flex: none; }
  .btn span { display: none; }
  .gridtags div { padding: 6px; }
  .gridtags span { font-size: 10.5px; padding: 4px 8px; }
  .gridtags i { display: none; }
  .about { padding: 22px 20px 18px; }
  .thumbs { gap: 8px; }
  .thumb span { font-size: 15px; }
  .upload { grid-template-columns: 40px 1fr; padding: 16px 18px; }
  .upload .plus { width: 40px; height: 40px; }
  .upload::after { display: none; }
  .upload b { font-size: 20px; }
  .upload small { grid-column: 2; }
  .notes div { grid-template-columns: 52px 1fr; }
  .notes div p { grid-column: 2; }
  .notes div::before { font-size: 34px; grid-row: 1 / 3; }
  .arow { grid-template-columns: 1fr 64px 46px; gap: 12px; padding: 14px 6px; }
  .aspec { grid-column: 1 / -1; grid-row: 2; }
  .ahead span:nth-child(2) { display: none; }
  .an b { font-size: 20px; }
  .readout { right: 10px; bottom: 10px; font-size: 9.5px; }
  .readout span { padding: 5px 7px; }
  .readout span:nth-child(3) { display: none; }
  .caption { font-size: 13px; margin-bottom: 10px; }
  /* small display sizes: lower optical size and open the tracking back up */
  h1, .atlas h3, .science h3 { font-variation-settings: 'opsz' 60; letter-spacing: -.015em; }
  .about h2 { font-variation-settings: 'opsz' 72; letter-spacing: -.025em; }
  .ahead span { white-space: nowrap; }
  .arow { grid-template-columns: 1fr 74px 50px; }
  html[lang^="zh"] .caption { font-size: 12.5px; }
  .notes div { padding: 22px 0; }
  .arow { min-height: 0; }
  .stats dd { font-size: 20px; }
  .thumb .cap small { display: none; }
  .logo { width: 30px; height: 30px; }
  .knob { width: 42px; height: 42px; margin: -21px 0 0 -21px; }
  .glow { display: none; }
}
@media (hover: none) { .glow { display: none; } }

/* =====================================================================
   LIGHT THEME — warm paper. Dark is the default; light only by choice.
   The stage keeps a dark frame so photographs still read as prints.
   ===================================================================== */
html { color-scheme: dark; }
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f1ec;
  --bg2: #ebe6de;
  --ink: #1c1a17;
  --ink2: rgba(28, 26, 23, .8);
  --mute: #6a645b;
  --faint: #9d968b;
  --line: rgba(40, 32, 20, .1);
  --line2: rgba(40, 32, 20, .18);
  --metal: linear-gradient(135deg, rgba(0,0,0,.22), rgba(0,0,0,.06) 30%, rgba(0,0,0,.03) 60%, rgba(0,0,0,.16));
  --paper: rgba(255, 253, 249, .72);
}
html.theme-anim body, html.theme-anim body *:not(canvas) {
  transition: background-color var(--t2) var(--ease), color var(--t2) var(--ease), border-color var(--t2) var(--ease), box-shadow var(--t2) var(--ease), fill var(--t2) var(--ease), stroke var(--t2) var(--ease) !important;
}
html[data-theme="light"] ::selection { color: #fff; }
html[data-theme="light"] body::before {
  background:
    radial-gradient(60vw 42vw at 72% -8%, color-mix(in oklab, var(--acc) 10%, transparent), transparent 70%),
    radial-gradient(50vw 40vw at 6% 30%, rgba(190, 170, 140, .14), transparent 70%),
    radial-gradient(120vw 60vw at 50% 120%, rgba(214, 204, 188, .5), transparent 60%),
    var(--bg);
}
html[data-theme="light"] body[data-light="night"]::before {
  background:
    radial-gradient(60vw 42vw at 72% -8%, rgba(70, 80, 120, .07), transparent 70%),
    radial-gradient(120vw 60vw at 50% 120%, rgba(190, 186, 180, .5), transparent 60%),
    #efede9;
}
html[data-theme="light"] body::after { opacity: .6; }
html[data-theme="light"] .grain { opacity: .025; mix-blend-mode: multiply; }
html[data-theme="light"] .top::before { background: linear-gradient(rgba(244, 241, 236, .9), rgba(244, 241, 236, 0)); }
html[data-theme="light"] .lang:hover, html[data-theme="light"] .gh:hover, html[data-theme="light"] .theme:hover { background: rgba(40, 32, 20, .06); }
html[data-theme="light"] h1 { background: linear-gradient(180deg, #2a2621 30%, #6b6359); -webkit-background-clip: text; background-clip: text; }
html[data-theme="light"] .halo { opacity: .55; }
html[data-theme="light"] body[data-light="night"] .halo { background: radial-gradient(closest-side, rgba(70, 80, 120, .1), transparent); }

/* stage: dark print on paper, soft paper shadow instead of a black void.
   Everything drawn over the photograph keeps the dark-theme ink. */
html[data-theme="light"] .stage, html[data-theme="light"] .drop {
  --ink: #ece8e1; --ink2: rgba(236, 232, 225, .82); --mute: #a29d95; --faint: #6f6b65;
  --line: rgba(236, 232, 225, .1); --line2: rgba(236, 232, 225, .18);
  --metal: linear-gradient(135deg, rgba(255,255,255,.22), rgba(255,255,255,.05) 30%, rgba(255,255,255,.02) 60%, rgba(255,255,255,.12));
  color: var(--ink);
}
html[data-theme="light"] .stage .readout span:first-child, html[data-theme="light"] .stage .tag::before { color: color-mix(in oklab, var(--acc) 55%, #fff); }
html[data-theme="light"] .stage {
  background: #141311;
  box-shadow: 0 0 0 1px rgba(30, 24, 16, .22), 0 1px 0 rgba(255, 255, 255, .6), 0 40px 80px -40px rgba(70, 52, 28, .45), 0 16px 30px -22px rgba(40, 30, 16, .35);
}
html[data-theme="light"] .stage.shift { animation-name: rimL; }
@keyframes rimL { 30% { box-shadow: 0 0 0 1px color-mix(in oklab, var(--acc) 70%, transparent), 0 0 40px -12px color-mix(in oklab, var(--acc) 40%, transparent), 0 40px 80px -40px rgba(70, 52, 28, .45); } }

/* glass surfaces become frosted paper */
html[data-theme="light"] .bar {
  background: linear-gradient(180deg, rgba(255, 253, 249, .9), rgba(250, 247, 241, .75));
  box-shadow: inset 0 1px 0 #fff, 0 18px 36px -26px rgba(70, 52, 28, .35);
}
html[data-theme="light"] .eye[aria-selected="true"] { background: #fff; box-shadow: inset 0 0 0 1px var(--line2), 0 2px 8px -4px rgba(60, 44, 20, .3); }
html[data-theme="light"] .seg { background: rgba(40, 32, 20, .05); box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 2px rgba(40, 32, 20, .08); }
html[data-theme="light"] .seg .pill { background: linear-gradient(180deg, #2a2722, #171512); box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 4px 12px rgba(40, 30, 16, .3); }
html[data-theme="light"] .seg button[aria-checked="true"] { color: #f4f1ec; }
html[data-theme="light"] .btn { background: rgba(255, 255, 255, .7); }
html[data-theme="light"] .btn:hover { background: #fff; box-shadow: inset 0 0 0 1px var(--line2), 0 0 24px var(--acc-faint); }
html[data-theme="light"] .about {
  background: linear-gradient(180deg, rgba(255, 253, 249, .92), rgba(250, 247, 241, .7));
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 #fff, 0 40px 80px -50px rgba(70, 52, 28, .4);
}
html[data-theme="light"] .about-head::before { -webkit-text-stroke-color: rgba(40, 32, 20, .09); }
html[data-theme="light"] .toggle:hover { background: rgba(40, 32, 20, .05); }
html[data-theme="light"] .toggle .sw { background: rgba(40, 32, 20, .14); }
html[data-theme="light"] .toggle[aria-pressed="true"] .sw::after { background: #fff; }
html[data-theme="light"] .spec .band, html[data-theme="light"] .aspec::before { opacity: .7; filter: saturate(.8); }
html[data-theme="light"] .spec .band::after, html[data-theme="light"] .aspec::after { background: repeating-linear-gradient(135deg, rgba(40, 32, 20, .18) 0 1px, transparent 1px 4px); }
html[data-theme="light"] .rail { background: rgba(40, 32, 20, .08); box-shadow: none; }
html[data-theme="light"] .rail s { background: rgba(40, 32, 20, .5); }
html[data-theme="light"] .aspec i { background: var(--ink); }
html[data-theme="light"] .aspec i::before { box-shadow: 0 0 0 2px var(--bg); }
html[data-theme="light"] .aacu b { background: linear-gradient(90deg, var(--c) var(--v), rgba(40, 32, 20, .08) var(--v)); }
html[data-theme="light"] .arow:hover { background: rgba(40, 32, 20, .035); }
html[data-theme="light"] .arow.on { background: linear-gradient(90deg, color-mix(in oklab, var(--c) 16%, transparent), transparent 70%); }
html[data-theme="light"] .thumb { background: rgba(255, 253, 249, .8); box-shadow: inset 0 0 0 1px var(--line), 0 14px 26px -22px rgba(70, 52, 28, .45); }
html[data-theme="light"] .thumb:hover { background: #fff; box-shadow: inset 0 0 0 1px var(--line2), 0 24px 40px -24px rgba(70, 52, 28, .5); }
html[data-theme="light"] .thumb.on { box-shadow: inset 0 0 0 1px var(--acc), 0 0 0 3px var(--acc-faint), 0 18px 32px -22px rgba(70, 52, 28, .5); }
html[data-theme="light"] .thumb img { filter: saturate(.85) brightness(.95); }
html[data-theme="light"] .thumb:hover img, html[data-theme="light"] .thumb.on img { filter: none; }
html[data-theme="light"] .upload { background: linear-gradient(90deg, rgba(255, 253, 249, .8), rgba(255, 253, 249, .35)); }
html[data-theme="light"] .upload .plus { background: #fff; }
html[data-theme="light"] .notes div::before { -webkit-text-stroke-color: rgba(40, 32, 20, .3); }
html[data-theme="light"] .notes div:hover::before { -webkit-text-stroke-color: var(--acc); }
html[data-theme="light"] .notes p { color: #4d4840; }
html[data-theme="light"] .logo .lg-lid, html[data-theme="light"] .logo .lg-ring, html[data-theme="light"] .logo .lg-iris { stroke: var(--ink); }

/* ---------- stage "+": change the photo in place ---------- */
.swapbtn {
  position: absolute; left: 14px; bottom: 14px; z-index: 9; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; color: #ece8e1;
  background: rgba(10, 10, 11, .5); border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  transition: transform var(--t1) var(--ease), background var(--t1) var(--ease), border-color var(--t1) var(--ease);
}
.swapbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; transition: transform var(--t2) var(--ease); }
.swapbtn:hover { background: rgba(10, 10, 11, .72); border-color: color-mix(in oklab, var(--acc) 70%, transparent); }
.swapbtn[aria-expanded="true"] svg { transform: rotate(45deg); }
.picker {
  position: absolute; left: 14px; bottom: 64px; z-index: 10; width: min(360px, calc(100% - 28px));
  padding: 14px; border-radius: 16px; color: #ece8e1;
  background: rgba(14, 14, 15, .82); border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .7);
  backdrop-filter: blur(20px) saturate(1.3); -webkit-backdrop-filter: blur(20px) saturate(1.3);
  opacity: 0; transform: translateY(8px) scale(.98); transform-origin: 0 100%; pointer-events: none;
  transition: opacity var(--t1) var(--ease), transform var(--t1) var(--ease);
}
.picker.on { opacity: 1; transform: none; pointer-events: auto; }
.pk-h { margin: 0 0 10px; font: 500 10px/1 var(--mono); letter-spacing: var(--mono-ls); text-transform: uppercase; color: #a29d95; }
.pk-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pk-list button { position: relative; border-radius: 9px; overflow: hidden; aspect-ratio: 3 / 2; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.pk-list img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--t2) var(--ease); }
.pk-list button:hover img { transform: scale(1.05); }
.pk-list span { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 7px 5px; font-size: 11px; text-align: left; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); }
.pk-list button.on { box-shadow: inset 0 0 0 2px var(--acc); }
.pk-list button.on::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 2px var(--acc); border-radius: inherit; }
.pk-act { display: flex; gap: 8px; margin-top: 10px; }
.pk-btn { flex: 1; height: 38px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 12.5px; cursor: pointer;
  background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); transition: background var(--t1) var(--ease); }
.pk-btn:hover { background: rgba(255, 255, 255, .12); }
.pk-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pk-cam { display: none; }
@media (hover: none) and (pointer: coarse) { .pk-cam { display: flex; } }
.stats-m { display: none; }

@media (prefers-reduced-motion: reduce) {
  .picker, .swapbtn svg { transition: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .enter, .rv { opacity: 1; transform: none; filter: none; }
  .stage canvas { opacity: 1; filter: none; transform: none; }
}

/* the dock follows the photograph's width; when that is narrow, drop the Latin names first */
.bar { container-type: inline-size; }
@container (max-width: 820px) { .eye i { display: none; } }
@media (max-width: 980px) {
  /* stage, dock, this eye, then samples */
  .stage-col { display: contents; }
  .stage { order: 1; } .studio > .stage-col > .bar, .bar { order: 2; } .about { order: 3; } .gallery { order: 4; margin-top: 8px; }
  .halo { display: none; }
}
@media (max-width: 720px) {
  .eyebrow span { display: none; }
  .theme span { display: none; }
  .theme { padding: 0 9px; }
}

/* phones: controls first, numbers after the photograph */
@media (max-width: 720px) {
  .intro-r .stats { display: none; }
  .stats-m { display: grid; order: 2; margin: 14px 0 4px; }
  .studio > .stage-col > .bar, .studio .bar { order: 0; margin: 0 0 12px; }
  .swapbtn { left: 10px; bottom: 10px; width: 38px; height: 38px; }
  .picker { left: 10px; bottom: 58px; width: calc(100% - 20px); padding: 12px; }
}

@media (max-width: 720px) {
  .pk-h { display: none; }
  .pk-list { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 6px; margin: 0 -2px; }
  .pk-list::-webkit-scrollbar { display: none; }
  .pk-list button { flex: 0 0 31%; scroll-snap-align: start; }
  .pk-act { margin-top: 8px; }
  .pk-btn { height: 34px; font-size: 12px; }
}
.stage.grid .swapbtn, .stage.grid .picker { display: none; }
