/* ==========================================================================
   光之标本室 / Museum of Light — 藤ちょこ illustration showcase
   Static, framework-free. Two motion ideas carry the site:
   1. scene changes are hidden behind a five-blade shutter (the "光闸")
   2. every work repaints the interface accent with its own signature colour
   ========================================================================== */

/* ---------------------------------------------------------------- webfaces */

@font-face {
  font-family: "CJK Serif";
  src: url("fonts/cjk-serif-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "CJK Serif";
  src: url("fonts/cjk-serif-500.woff2") format("woff2");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@property --accent {
  syntax: "<color>";
  inherits: true;
  initial-value: #69c8cd;
}

:root {
  --ink: #07080a;
  --ink-1: #0b0d11;
  --ink-2: #12151b;
  --paper: #f4efe6;
  --dim: rgba(244, 239, 230, .68);
  --faint: rgba(244, 239, 230, .52);
  --line: rgba(244, 239, 230, .14);
  --line-soft: rgba(244, 239, 230, .07);
  --accent: #69c8cd;

  --pad: clamp(16px, 3.4vw, 56px);
  --bar: clamp(58px, 5vw, 76px);
  --ease: cubic-bezier(.16, .84, .28, 1);
  --ease-out: cubic-bezier(.22, 1, .32, 1);

  --f-lat: "Instrument Serif", "CJK Serif", Georgia, "Times New Roman", serif;
  --f-cjk: "CJK Serif", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --f-mono: ui-monospace, "Cascadia Mono", SFMono-Regular, Consolas, "Liberation Mono", monospace;

  transition: --accent .9s var(--ease);
}

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

html {
  color-scheme: dark;
  background: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-cjk);
  font-size: clamp(15px, 1.02vw, 17px);
  line-height: 1.85;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; appearance: none; -webkit-appearance: none; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: #07080a; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: fixed;
  top: 10px; left: 10px;
  z-index: 90;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 12px;
  border-radius: 2px;
  transform: translateY(-160%);
  transition: transform .2s var(--ease);
}
.skip:focus-visible { transform: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ---------------------------------------------------------------- ambience */

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(72% 60% at 78% 12%, color-mix(in oklab, var(--accent) 14%, transparent), transparent 68%),
    radial-gradient(56% 50% at 6% 96%, color-mix(in oklab, var(--accent) 7%, transparent), transparent 70%);
  transition: background .9s var(--ease);
}

.hairline-top {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 1px;
  z-index: 30;
  background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--accent) 55%, transparent) 40%, transparent);
  opacity: .8;
  pointer-events: none;
}

/* a scrim so the fixed controls stay legible over artwork and cards */
.veil {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: clamp(64px, 12vh, 132px);
  z-index: 24;
  pointer-events: none;
  background: linear-gradient(to top, var(--ink) 6%, rgba(7, 8, 10, .88) 38%, transparent);
}

/* ------------------------------------------------------------------ header */

.top {
  position: fixed;
  z-index: 25;
  top: 0; left: 0; right: 0;
  height: var(--bar);
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 32px);
  padding: 0 var(--pad);
  background: linear-gradient(to bottom, rgba(7, 8, 10, .92), rgba(7, 8, 10, .55) 60%, transparent);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 44px;
  font-family: var(--f-cjk);
  font-size: clamp(15px, 1.1vw, 18px);
  letter-spacing: .06em;
  white-space: nowrap;
}
.brand em {
  font-family: var(--f-lat);
  font-style: italic;
  font-size: 1.15em;
  color: var(--accent);
}
.brand span {
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: .22em;
  color: var(--faint);
  text-transform: uppercase;
}

.top__meta {
  margin: 0;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--faint);
  white-space: nowrap;
}

.chapters {
  margin-left: auto;
  display: flex;
  align-items: stretch;
  gap: clamp(2px, .5vw, 10px);
}

.ch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 clamp(6px, .7vw, 12px);
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--faint);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .14em;
  transition: color .3s var(--ease);
}
.ch em {
  font-family: var(--f-cjk);
  font-style: normal;
  font-size: 12px;
  letter-spacing: .1em;
}
.ch::after {
  content: "";
  position: absolute;
  left: clamp(6px, .7vw, 12px);
  right: clamp(6px, .7vw, 12px);
  bottom: 12px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .38s var(--ease);
}
.ch:hover { color: var(--paper); }
.ch:hover::after { transform: scaleX(1); }
.ch[aria-current="true"] { color: var(--paper); }
.ch[aria-current="true"]::after { transform: scaleX(1); background: var(--paper); }

/* ------------------------------------------------------------------ scenes */

.scene {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: calc(var(--bar) + clamp(14px, 3vh, 40px)) var(--pad) calc(var(--bar) + clamp(10px, 3vh, 40px));
  overflow: hidden auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.scene::-webkit-scrollbar { display: none; }
.scene.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.no-js .scene,
.scene.is-static { opacity: 1; visibility: visible; pointer-events: auto; position: relative; min-height: 100svh; }

.wrap { width: 100%; max-width: 1560px; margin: auto; }
.scene--view .wrap,
.scene--show .wrap,
.scene--about .wrap { max-width: 1340px; }
.scene--view .wrap { flex: 1 1 auto; min-height: 0; margin-block: 0; align-items: stretch; }
.scene--view .panel { align-self: center; }

/* ------------------------------------------------------------- type system */

.eyebrow {
  margin: 0;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow::before {
  content: "";
  width: clamp(18px, 3vw, 46px);
  height: 1px;
  background: var(--accent);
  flex: none;
}

h1, h2 {
  margin: 0;
  font-family: var(--f-cjk);
  font-weight: 500;
  letter-spacing: .015em;
}

.ln { display: block; overflow: hidden; padding-bottom: .06em; }
.ln > * { display: block; will-change: transform; }

.lede {
  margin: 0;
  max-width: 34ch;
  color: var(--dim);
  font-size: clamp(14px, 1.06vw, 17px);
  line-height: 1.95;
  text-wrap: pretty;
}

.lat {
  font-family: var(--f-lat);
  font-style: italic;
  letter-spacing: .01em;
}

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid color-mix(in oklab, var(--accent) 60%, transparent);
  border-radius: 2px;
  background: color-mix(in oklab, var(--accent) 10%, transparent);
  color: var(--paper);
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: .16em;
  cursor: pointer;
  transition: transform .22s var(--ease), background .3s var(--ease), border-color .3s var(--ease);
}
.btn:hover {
  transform: translateY(-2px);
  background: color-mix(in oklab, var(--accent) 22%, transparent);
  border-color: var(--accent);
}
.btn:active { transform: translateY(1px); }
.btn svg { flex: none; }

.link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background-color: transparent;
  cursor: pointer;
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: .16em;
  color: var(--paper);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size .4s var(--ease), color .3s var(--ease);
}
.link:hover { background-size: 100% 1px; }
.link--dim { color: var(--dim); }
.link--dim:hover { color: var(--paper); }

/* -------------------------------------------------------------------- hero */

.scene--hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  align-items: center;
  gap: clamp(22px, 4vw, 76px);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2.2vh, 26px);
  min-width: 0;
}

.hero-title {
  font-size: clamp(40px, 6.6vw, 104px);
  line-height: .96;
  letter-spacing: .03em;
}
.hero-title .lat {
  font-size: clamp(19px, 2.3vw, 34px);
  line-height: 1.2;
  color: var(--accent);
  margin-top: .3em;
  padding-bottom: .1em;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .18em;
  color: var(--faint);
  text-transform: uppercase;
}
.hero-facts li { display: flex; align-items: center; gap: 10px; }
.hero-facts li + li::before {
  content: "";
  width: 3px; height: 3px;
  background: var(--accent);
  border-radius: 50%;
  opacity: .8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 26px;
  margin-top: clamp(2px, 1vh, 10px);
}

.hero-hint {
  margin: clamp(6px, 1.6vh, 20px) 0 0;
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: .18em;
  color: var(--faint);
  text-transform: uppercase;
}

.hero-art {
  margin: 0;
  justify-self: end;
  min-width: 0;
}
.frame {
  position: relative;
  padding: clamp(7px, .9vw, 14px);
  border: 1px solid var(--line);
  background: rgba(9, 11, 14, .55);
  box-shadow: 0 40px 90px -50px #000, 0 0 0 1px rgba(0, 0, 0, .5);
}
.frame::before,
.frame::after {
  content: "";
  position: absolute;
  left: -1px; right: -1px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}
.frame::before { top: -1px; }
.frame::after { bottom: -1px; transform-origin: 100% 50%; }

.frame img {
  height: clamp(300px, 68svh, 720px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  background: var(--ink-1);
}

.hero-art figcaption {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--faint);
  text-transform: uppercase;
}

/* ------------------------------------------------------------------- index */

.scene--index .wrap { display: flex; flex-direction: column; gap: clamp(16px, 2.4vh, 30px); }
.scene--index { padding-bottom: calc(var(--bar) + clamp(38px, 7vh, 84px)); }

.sect-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 28px;
  padding-bottom: clamp(10px, 1.6vh, 18px);
  border-bottom: 1px solid var(--line);
}
.sect-head h2 {
  font-size: clamp(26px, 3.4vw, 52px);
  line-height: 1.1;
  letter-spacing: .04em;
}
.sect-head .lede { max-width: 46ch; }
.sect-count {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .2em;
  color: var(--faint);
  white-space: nowrap;
  padding-bottom: .4em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(10px, 1.6vw, 26px);
  align-items: start;
}

.card {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  transition: transform .3s var(--ease);
}
.card:hover { transform: translateY(-2px); }

.card__frame {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--ink-1) center / cover no-repeat;
  border: 1px solid var(--line-soft);
  transition: border-color .35s var(--ease);
}
.card__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(7, 8, 10, .5), transparent 42%);
  opacity: 0;
  transition: opacity .4s var(--ease);
  pointer-events: none;
}
.card__frame img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  transform: scale(1);
  transition: transform .55s var(--ease), opacity .6s var(--ease);
}
.card:hover .card__frame img { transform: scale(1.028); }
.card:hover .card__frame { border-color: color-mix(in oklab, var(--a) 70%, transparent); }
.card:hover .card__frame::after { opacity: 1; }

.card__meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 0 0;
  border-top: 1px solid var(--line);
  margin-top: 10px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--faint);
  text-transform: uppercase;
  transition: color .3s var(--ease);
}
.card__no { color: var(--dim); transition: color .3s var(--ease); }
.card__glyph {
  font-family: var(--f-cjk);
  font-size: 14px;
  letter-spacing: .08em;
  color: var(--paper);
}
.card__label { margin-left: auto; font-size: 9px; letter-spacing: .16em; }
.card:hover .card__meta { color: var(--paper); }
.card:hover .card__no { color: var(--a); }

/* ------------------------------------------------------------------ viewer */

.scene--view .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(248px, 24vw, 352px);
  align-items: center;
  gap: clamp(18px, 3vw, 60px);
  height: 100%;
}

.stage {
  position: relative;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  touch-action: pan-y;
}
.plate {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}
.plate img {
  position: absolute;
  inset: 0;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  will-change: transform, opacity;
  box-shadow: 0 30px 70px -40px #000;
}
.stage__hint {
  position: absolute;
  bottom: -2px;
  left: 0;
  margin: 0;
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: .2em;
  color: var(--faint);
  text-transform: uppercase;
}

/* the run of eight works, standing where the plate leaves air */
.rail {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  z-index: 3;
}
.rail button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.rail button::after {
  content: "";
  width: 14px;
  height: 1px;
  background: rgba(244, 239, 230, .28);
  transition: width .38s var(--ease), background .38s var(--ease);
}
.rail button:hover::after { width: 24px; background: var(--paper); }
.rail button[aria-current="true"]::after { width: 34px; background: var(--accent); }

.panel {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.4vh, 16px);
  border-left: 1px solid var(--line);
  padding-left: clamp(16px, 2vw, 32px);
  min-width: 0;
}
.panel h2 { font-size: clamp(20px, 2vw, 28px); letter-spacing: .06em; }
.panel__no {
  margin: 0;
  font-family: var(--f-lat);
  font-style: italic;
  font-size: clamp(40px, 4.6vw, 76px);
  line-height: .9;
  color: var(--accent);
}
.panel__glyph {
  margin: 0;
  font-family: var(--f-cjk);
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.1;
  letter-spacing: .12em;
}
.panel__label {
  margin: 0;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .26em;
  color: var(--faint);
  text-transform: uppercase;
}
.meta {
  margin: clamp(4px, 1vh, 12px) 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.meta > div { display: flex; gap: 12px; align-items: center; border-top: 1px solid var(--line-soft); padding-top: 8px; }
.meta dt { color: var(--faint); min-width: 44px; }
.meta dd { margin: 0; color: var(--dim); }

.chips { display: flex; gap: 5px; }
.chips i {
  width: 16px; height: 16px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
}

.panel__link { margin-top: clamp(6px, 1.4vh, 14px); align-self: flex-start; }

/* ---------------------------------------------------------------- the show */

.scene--show .wrap {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  align-items: center;
  gap: clamp(24px, 4.4vw, 88px);
}

.poster {
  margin: 0;
  justify-self: center;
  padding: clamp(8px, 1vw, 16px);
  background: rgba(9, 11, 14, .5);
  border: 1px solid var(--line);
  box-shadow: 0 40px 90px -50px #000;
}
.poster img {
  height: clamp(300px, 62svh, 660px);
  width: auto;
  object-fit: contain;
}

.show-copy { display: flex; flex-direction: column; gap: clamp(14px, 2.2vh, 26px); min-width: 0; }
.show-copy .lede { max-width: 56ch; text-wrap: pretty; }
.show-copy h2 { font-size: clamp(30px, 4.2vw, 64px); line-height: 1.06; letter-spacing: .04em; }
.show-copy .lat { color: var(--accent); font-size: clamp(19px, 2.1vw, 30px); }

.facts {
  margin: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
  max-width: none;
}
.facts > div {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.facts dt {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--faint);
  text-transform: uppercase;
  min-width: 62px;
}
.facts dd { margin: 0; font-size: clamp(14px, 1.06vw, 16px); letter-spacing: .04em; }
.note { margin: 0; font-size: 12.5px; color: var(--faint); max-width: 40ch; line-height: 1.8; }

/* ------------------------------------------------------------------- about */

.scene--about .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center;
  gap: clamp(24px, 4vw, 80px);
}

.about-copy { display: flex; flex-direction: column; gap: clamp(12px, 2vh, 22px); min-width: 0; }
.about-copy h2 { font-size: clamp(28px, 3.6vw, 56px); line-height: 1.08; letter-spacing: .04em; }
.about-copy p { margin: 0; max-width: 54ch; color: var(--dim); text-wrap: pretty; }
.about-copy p strong { font-weight: 500; color: var(--paper); }

.credit {
  margin-top: clamp(6px, 1.6vh, 14px);
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.95;
  color: var(--faint);
  max-width: 66ch;
  text-wrap: pretty;
}
.credit b { font-weight: 500; color: var(--dim); }

.about-actions { display: flex; flex-wrap: wrap; gap: 8px 26px; align-items: center; }

.numeral {
  justify-self: end;
  text-align: right;
  min-width: 0;
}
.numeral p { margin: 0; }
.numeral .big {
  font-family: var(--f-lat);
  font-size: clamp(78px, 13vw, 232px);
  line-height: .82;
  letter-spacing: .01em;
  background: linear-gradient(100deg, #e17381, #8be2ed 22%, #4aede8 42%, #69c8cd 58%, #96dbe9 70%, #c1272f 88%, #b21917);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.numeral .cap {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .34em;
  color: var(--faint);
  text-transform: uppercase;
  margin-top: clamp(8px, 1.6vh, 18px);
}
.swatches {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-top: clamp(10px, 1.8vh, 20px);
}
.swatches i {
  width: clamp(18px, 2.6vw, 40px);
  height: 3px;
  border-radius: 2px;
}

/* --------------------------------------------------------------------- hud */

.hud {
  position: fixed;
  z-index: 26;
  left: var(--pad);
  right: var(--pad);
  bottom: max(10px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}
.hud > * { pointer-events: auto; }

.hud__state {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--faint);
  text-transform: uppercase;
}
.hud__state b { font-weight: 400; color: var(--dim); }

.hud__nav { display: flex; align-items: center; gap: 6px; }

.arrow {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(10, 12, 15, .5);
  color: var(--paper);
  cursor: pointer;
  transition: transform .22s var(--ease), border-color .3s var(--ease), background .3s var(--ease);
}
.arrow:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 16%, transparent);
}
.arrow:active { transform: translateY(1px); }
.arrow svg { width: 15px; height: 15px; }

.hud__index {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--dim);
  border: 1px solid transparent;
  border-radius: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.is-viewing .hud__index { opacity: 1; pointer-events: auto; }
.hud__index:hover { color: var(--paper); border-color: var(--line); }

/* ----------------------------------------------------------------- curtain */

.curtain {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  pointer-events: none;
}
.curtain i {
  position: relative;
  flex: 1 1 0;
  background: linear-gradient(to bottom, #171d26, #0e1116);
  transform: translateY(101%);
  will-change: transform;
  box-shadow: 0 0 44px rgba(0, 0, 0, .7);
  border-left: 1px solid rgba(244, 239, 230, .05);
}
.curtain i:first-child { border-left: 0; }
.curtain i::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 0;
  height: 1px;
  background: var(--accent);
  opacity: .9;
}

/* ---------------------------------------------------------------- entrance */

.scene [data-rise] { opacity: 0; }
.scene .ln > * { transform: translateY(104%); }
.scene .frame::before,
.scene .frame::after { transform: scaleX(0); }

.scene.is-active [data-rise] {
  animation: rise .9s var(--ease-out) both;
  animation-delay: var(--d, 0s);
}
.scene.is-active .ln > * {
  animation: lineUp 1.05s var(--ease-out) both;
  animation-delay: var(--d, 0s);
}
.scene.is-active .frame::before {
  animation: drawX 1.1s var(--ease-out) both;
  animation-delay: .2s;
}
.scene.is-active .frame::after {
  animation: drawX 1.1s var(--ease-out) both;
  animation-delay: .34s;
}
.scene.is-active .frame img {
  animation: settle 1.6s var(--ease-out) both;
}
.scene.is-active .card__frame img {
  animation: plateIn .9s var(--ease-out) both;
  animation-delay: var(--d, 0s);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes lineUp {
  from { transform: translateY(104%); }
  to { transform: none; }
}
@keyframes drawX {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes settle {
  from { transform: scale(1.035); opacity: .3; }
  to { transform: none; opacity: 1; }
}
@keyframes plateIn {
  from { opacity: 0; transform: scale(1.03); }
  to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------- compact screens */

@media (max-width: 1080px) {
  .scene--view .wrap { grid-template-columns: minmax(0, 1fr) clamp(220px, 30vw, 300px); }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .scene--hero .wrap,
  .scene--about .wrap,
  .scene--show .wrap { grid-template-columns: minmax(0, 1fr); }
  .scene--hero .wrap { gap: clamp(14px, 2.6vh, 30px); }
  .hero-art { justify-self: start; }
  .frame img { height: clamp(220px, 38svh, 400px); }
  .numeral { justify-self: start; text-align: left; }
  .swatches { justify-content: flex-start; }
  .scene--show .poster { justify-self: start; }
  .poster img { height: clamp(280px, 46svh, 520px); }
}

@media (max-height: 700px) and (min-width: 961px) {
  .frame img { height: 58svh; }
  .hero-copy { gap: 10px; }
}

@media (max-width: 860px) {
  .scene--view .wrap { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .scene--view { padding-bottom: calc(var(--bar) + 54px); }
  .stage { height: auto; min-height: 40svh; }
  .plate img { position: relative; max-height: 44svh; }
  .plate img + img { position: absolute; }
  .panel { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 14px; }
  .panel__no { font-size: 30px; }
  .stage__hint { display: none; }
  .rail { display: none; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  body { overflow: hidden; }
  .hero-hint { display: none; }
  .hud__state { display: none; }
  .is-viewing .hud__state { display: flex; }
  .top { gap: 10px; }
  .top__meta { display: none; }
  .brand span { display: none; }
  .ch { padding: 0 7px; gap: 0; }
  .ch em { display: none; }
  .ch::after { bottom: 9px; left: 7px; right: 7px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
  .card__label { display: none; }
  .sect-head h2 { font-size: 26px; }
  .hud__state { font-size: 9px; letter-spacing: .14em; }
  .panel h2 { font-size: 18px; }
  .scene--show .poster { justify-self: start; }
  .poster img { height: clamp(260px, 44svh, 420px); }
  .numeral .big { font-size: clamp(64px, 20vw, 120px); }
}

@media (max-width: 420px) {
  .hero-facts { font-size: 9px; gap: 8px 12px; }
  .hero-title { font-size: 34px; }
  .card__meta { font-size: 9px; gap: 7px; }
  .about-actions .link { min-height: 40px; }
}

/* ------------------------------------------------------------ reduced motion */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-delay: 0s !important;
    transition-duration: .001ms !important;
  }
  .scene [data-rise] { opacity: 1; }
  .scene .ln > * { transform: none; }
  .scene .frame::before,
  .scene .frame::after { transform: scaleX(1); }
  .curtain { display: none; }
}

/* ------------------------------------------------------------------ no-js */

.no-js body { overflow: auto; }
.no-js .hud,
.no-js .curtain { display: none; }
.no-js .scene { padding-top: calc(var(--bar) + 30px); padding-bottom: calc(var(--bar) + 30px); }
.no-js .scene + .scene { border-top: 1px solid var(--line); }
.no-js .top { position: absolute; }
.no-js .scene .frame::before,
.no-js .scene .frame::after { transform: scaleX(1); }
.no-js .scene [data-rise] { opacity: 1; }
.no-js .scene .ln > * { transform: none; }

h1[tabindex="-1"]:focus,
h2[tabindex="-1"]:focus { outline: none; }
