/* ============================================================================
   嘎嘎sama — Personal Dossier
   Design system: Endfield-inspired industrial sci-fi
   Tokens measured from the reference (endfield.hypergryph.com):
     accent yellow #FFFA00 · blacks #000/#191919 · papers #FFF/#FAFAFA/#F2F2F2
     greys #E6E6E6/#D9D9D9/#8A8A8A/#6D6D6D · display type up to 274px vs 12px micro
     polygon() clip-paths, 45° diamond marks, near-zero radii
   ---------------------------------------------------------------------------
   1. Fonts          6. Primitives      11. Dossier (record + channels)
   2. Tokens         7. Header + nav    12. Footer
   3. Reset          8. Scroll readout  13. Motion
   4. Layout         9. Hero            14. Responsive
   5. Base type     10. Portrait
   ========================================================================= */

/* ── 1. Fonts (self-hosted, OFL: Archivo, IBM Plex Mono) ─────────────────── */
@font-face {
  font-family: 'Archivo';
  src: url('../fonts/archivo-latin-var.woff2') format('woff2-variations'),
       url('../fonts/archivo-latin-var.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'PlexMono';
  src: url('../fonts/plex-mono-latin-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'PlexMono';
  src: url('../fonts/plex-mono-latin-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ── 2. Tokens ───────────────────────────────────────────────────────────── */
:root {
  /* palette */
  --ink:        #0a0a0a;
  --ink-soft:   #191919;
  --black:      #000000;
  --paper:      #ffffff;
  --paper-2:    #fafafa;
  --line:       #d9d9d9;
  --line-2:     #e6e6e6;
  --line-dark:  rgba(255, 255, 255, 0.16);
  --gray:       #6d6d6d;   /* 5.1:1 on white · 5.4:1 on black — the one mid tone */
  --gray-text:  #5a5a5a;   /* 6.9:1 on white — safe for small text */
  --gray-3:     #6f6f6f;
  --gray-2:     #8a8a8a;
  --gray-2-dark:#9a9a9a;   /* 7.1:1 on #000 */
  --signal:     #fffa00;   /* Endfield industrial yellow */

  /* type */
  --font-sans: 'Archivo', 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB',
               'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --font-mono: 'PlexMono', ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas,
               'Liberation Mono', 'Courier New', monospace;

  --fs-micro:  clamp(10px, 0.70vw, 11.5px);   /* technical labels */
  --fs-tiny:   clamp(11px, 0.79vw, 12.5px);   /* mono values, URLs */
  --fs-body:   clamp(14px, 1.00vw, 16px);
  --fs-h2:     clamp(28px, 3.60vw, 52px);
  --fs-name:   clamp(42px, 8.30vw, 128px);    /* the personal name — the focus */
  --fs-ghost:  clamp(48px, 9.40vw, 146px);    /* backdrop wordmark, sized to FIT the column */

  --lh-tight: 0.92;
  --lh-snug:  1.18;
  --lh-body:  1.62;

  /* spacing */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px;
  --pad-x: clamp(20px, 4.5vw, 72px);
  --pad-y: clamp(56px, 6.0vw, 96px);       /* content sections: 56–96px */
  --hero-pad-y: clamp(72px, 7.5vw, 132px); /* the poster keeps more air */
  --shead-gap: clamp(24px, 2.6vw, 44px);   /* heading → content */
  --hdr-h: 56px;
  --rail-w: 0px;

  /* motion */
  --e-out:    cubic-bezier(0.22, 0.61, 0.36, 1);
  --d-fast:   180ms;
  --d-mid:    380ms;
  --d-slow:   760ms;

  /* geometry */
  --skew: -14deg;

  --focus: var(--ink);
}

/* dark theme scope */
.is-dark {
  --focus: var(--signal);
  --line: var(--line-dark);
  --gray-text: var(--gray-2-dark);
  background: var(--black);
  color: var(--paper);
}

/* ── 3. Reset ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

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

::selection { background: var(--signal); color: var(--ink); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0; left: 0;
  z-index: 200;
  display: flex; align-items: center;
  min-height: 44px;
  padding: 0 16px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  transform: translateY(-110%);
  transition: transform var(--d-fast) var(--e-out);
}
.skip-link:focus { transform: translateY(0); }

/* ── 4. Layout ───────────────────────────────────────────────────────────── */
.page { position: relative; overflow-x: clip; }

.shell {
  position: relative;
  padding-inline: var(--pad-x);
  padding-inline-start: calc(var(--pad-x) + var(--rail-w));
  margin-inline: auto;
  max-width: 1680px;
}

.section { padding-block: var(--pad-y); }

.band { position: relative; }
.band--white { background: var(--paper); }
.band--dark  { background: var(--black); color: var(--paper); }

section[id] { scroll-margin-top: var(--hdr-h); }

/* the hero/readout split ratio — kept in one place so the dossier seam can
   continue the hero's diagonal exactly */
:root {
  --hero-col-a: 1.14fr;
  --hero-col-b: 1fr;
}

/* ── 5. Base type ────────────────────────────────────────────────────────── */
.mono { font-family: var(--font-mono); }

.eyebrow {
  display: flex; align-items: center; gap: var(--sp-3);
  color: var(--gray-text);
  font-size: var(--fs-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.eyebrow__no {
  background: var(--signal); color: var(--ink);
  font-family: var(--font-mono); font-weight: 500;
  font-size: var(--fs-micro); letter-spacing: 0.06em;
  padding: 3px 7px 2px;
  transform: skewX(var(--skew));
}
.eyebrow__no > span { display: inline-block; transform: skewX(calc(-1 * var(--skew))); }
.eyebrow__line { flex: 1; height: 1px; background: var(--line); transform-origin: left; }

.shead { position: relative; margin-bottom: var(--shead-gap); }
.shead__top { margin-bottom: var(--sp-4); flex-wrap: wrap; }
.shead__title {
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: var(--lh-snug);
  letter-spacing: -0.01em;
  max-width: 18ch;
}
.shead__rule {
  margin-top: var(--sp-5);
  height: 2px;
  background: var(--ink);
  transform: scaleX(0); transform-origin: left;
}
.is-dark .shead__rule { background: var(--signal); }
.is-dark .shead__title { color: var(--paper); }

.txt-muted { color: var(--gray-2-dark); }

/* ── 6. Primitives ───────────────────────────────────────────────────────── */
.cross {
  position: absolute;
  width: 15px; height: 15px;
}
.cross::before, .cross::after {
  content: ''; position: absolute; background: currentColor;
}
.cross::before { left: 50%; top: 0; width: 1px; height: 100%; transform: translateX(-50%); }
.cross::after  { top: 50%; left: 0; height: 1px; width: 100%; transform: translateY(-50%); }

.diamond {
  width: 7px; height: 7px;
  background: var(--signal);
  transform: rotate(45deg);
  flex: none;
}

.bar {
  width: 22px; height: 2px;
  background: var(--signal);
  flex: none;
}

.tag {
  font-size: var(--fs-micro);
  letter-spacing: 0.16em;
  color: var(--gray-3);
}

.chip {
  display: inline-block;
  padding: 5px 12px 4px;
  background: var(--signal);
  color: var(--ink);
  font-weight: 700;
  font-size: clamp(13px, 1.05vw, 16px);
  letter-spacing: 0.04em;
  transform: skewX(var(--skew));
}
.chip > span { display: inline-block; transform: skewX(calc(-1 * var(--skew))); }

.en {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--gray-text);
  text-transform: uppercase;
}

.sub {
  display: block;
  font-size: var(--fs-tiny);
  color: var(--gray-text);
  letter-spacing: 0.02em;
}

/* ── 7. Header + nav ─────────────────────────────────────────────────────── */
.hdr {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--hdr-h);
  background: rgba(250, 250, 250, 0.86);
  backdrop-filter: blur(10px);
  transition: background var(--d-mid) var(--e-out), border-color var(--d-mid) var(--e-out);
  border-bottom: 1px solid transparent;
}
.hdr.is-stuck {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: var(--line-2);
}

.hdr__in {
  display: flex; align-items: center; gap: var(--sp-5);
  height: 100%;
  max-width: 1680px;
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.mark { display: flex; align-items: center; gap: 10px; flex: none; min-height: 44px; }
.mark__gfx { width: 22px; height: 22px; }
.mark__tx {
  font-size: clamp(13px, 1.05vw, 15px);
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.mark__tx span { color: var(--gray-3); font-weight: 500; }

.nav { display: flex; align-items: center; gap: var(--sp-2); margin-inline-start: auto; }
.nav__link {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  height: 44px; padding: 0 12px;
  font-size: var(--fs-tiny);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--gray-text);
  transition: color var(--d-fast) var(--e-out);
}
.nav__link .no {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--gray-text);
}
.nav__link::after {
  content: '';
  position: absolute; left: 12px; right: 12px; bottom: 9px;
  height: 2px;
  background: var(--signal);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--d-mid) var(--e-out);
}
.nav__link:hover { color: var(--ink); }
.nav__link[aria-current='true'] { color: var(--ink); }
.nav__link[aria-current='true'] .no { color: var(--ink); }
.nav__link[aria-current='true']::after { transform: scaleX(1); }

/* reading progress, driven by --p (0 → 1) from one scroll listener */
.hdr__prog {
  position: absolute; left: 0; bottom: -1px;
  width: 100%; height: 2px;
  background: var(--signal);
  transform: scaleX(var(--p, 0));
  transform-origin: left;
  will-change: transform;
}

.burger { display: none; }

/* mobile menu */
.menu {
  position: fixed; inset: 0; z-index: 150;
  display: flex; flex-direction: column;
  padding: calc(var(--hdr-h) + 24px) var(--pad-x) 32px;
}
.menu[hidden] { display: none; }
.menu__close {
  position: absolute; top: 10px; right: var(--pad-x);
  width: 36px; height: 36px;
  display: grid; place-items: center;
  color: var(--paper);
}
.menu__close svg { width: 18px; height: 18px; }
.menu__list { margin-top: var(--sp-6); }
.menu__item {
  display: flex; align-items: baseline; gap: var(--sp-4);
  padding: 14px 0;
  border-bottom: 1px solid var(--line-dark);
  font-size: clamp(24px, 7vw, 34px);
  font-weight: 700;
}
.menu__item .no {
  font-family: var(--font-mono);
  font-size: var(--fs-tiny);
  color: var(--signal);
}
.menu__foot {
  margin-top: auto;
  display: flex; flex-direction: column; gap: 10px;
  font-size: var(--fs-tiny);
  color: var(--gray-2-dark);
}

/* ── 8. Scroll readout (desktop) ─────────────────────────────────────────
   A progress meter, not a second copy of the navigation: it names the current
   chapter and fills a track. Decorative for assistive tech (aria-hidden). */
.rail {
  display: none;
  position: fixed; z-index: 90;
  left: 20px; top: 50%;
  transform: translateY(-50%);
  flex-direction: column; align-items: center; gap: 10px;
  color: var(--gray);
  pointer-events: none;
}
.rail__count { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.1em; }
.rail__count b { font-weight: 500; }
.rail__count i { font-style: normal; opacity: 0.55; }
.rail__track {
  position: relative;
  width: 2px; height: 88px;
  background: rgba(128, 128, 128, 0.32);
}
.rail__fill {
  position: absolute; left: 0; top: 0;
  width: 100%; height: var(--rail-p, 0%);
  background: var(--signal);
}
.rail__name {
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
}

/* ── 9. Hero ─────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  background: var(--paper);
  overflow: hidden;
}

.hero__mesh {
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(10, 10, 10, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(10, 10, 10, 0.045) 1px, transparent 1px);
  background-size: 96px 96px;
  mask-image: linear-gradient(to bottom, #000 0%, #000 62%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 62%, transparent 100%);
  will-change: transform;
}

.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: var(--hero-col-a) var(--hero-col-b);
  min-height: calc(100svh - var(--hdr-h) - 1px);
}

.hero__type {
  position: relative;
  display: flex; flex-direction: column;
  padding-block: var(--hero-pad-y);
  padding-inline-start: calc(var(--pad-x) + var(--rail-w));
  padding-inline-end: clamp(24px, 3vw, 56px);
}

.hero__cross {
  top: var(--sp-5);
  left: calc(var(--pad-x) + var(--rail-w));
  color: var(--gray-2);
}

.hero__wordmark {
  position: relative;
  margin-top: clamp(28px, 3.4vw, 52px);
}

/* the oversized wordmark is a backdrop: it FITS its column instead of running
   under the dark panel, so it never competes with the name for attention */
.ghost {
  display: block;
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.8;
  color: rgba(10, 10, 10, 0.035);
  -webkit-text-stroke: 1px rgba(10, 10, 10, 0.16);
  paint-order: stroke fill;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}
.hero__ghost {
  position: absolute;
  left: 0; bottom: -0.04em;
  font-size: var(--fs-ghost);
  will-change: transform;
}

.hero__name {
  position: relative; z-index: 1;
  font-size: var(--fs-name);
  font-weight: 900;
  line-height: var(--lh-tight);
  letter-spacing: -0.035em;
  color: var(--ink);
}
.hero__name .lat {
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.hero__alias {
  display: flex; align-items: center; gap: var(--sp-4);
  margin-top: clamp(20px, 2.2vw, 34px);
}

.hero__affil {
  display: flex; align-items: center; gap: var(--sp-3);
  flex-wrap: wrap;
  margin-top: var(--sp-5);
  font-size: var(--fs-tiny);
  letter-spacing: 0.06em;
  color: var(--gray-3);
}
.hero__affil .sep { color: var(--gray-2); }

.hero__note {
  margin-top: var(--sp-4);
  max-width: 34ch;
  font-size: var(--fs-tiny);
  line-height: 1.6;
  color: var(--gray-text);
}

.hero__scroll {
  display: inline-flex; align-items: center; gap: 10px;
  align-self: flex-start;
  min-height: 44px;
  margin-top: auto;
  padding-top: clamp(28px, 3.4vw, 52px);
  font-size: var(--fs-micro);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray-3);
  transition: color var(--d-fast) var(--e-out);
}
.hero__scroll .line {
  width: 34px; height: 1px;
  background: currentColor;
  transform-origin: left;
  transition: transform var(--d-mid) var(--e-out);
}
.hero__scroll .ic { width: 13px; height: 13px; transition: transform var(--d-mid) var(--e-out); }
.hero__scroll:hover { color: var(--ink); }
.hero__scroll:hover .line { transform: scaleX(1.5); }
.hero__scroll:hover .ic { transform: translateY(3px); }

/* right half: the dark wedge, cut on the diagonal */
.hero__spec {
  position: relative;
  clip-path: polygon(13% 0, 100% 0, 100% 100%, 0 100%);
  background: var(--black);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding-block: var(--hero-pad-y);
  padding-inline: clamp(24px, 4vw, 72px);
}
.hero__spec::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--signal);
  transform: scaleX(1) skewX(-8deg);
  transform-origin: left;
}
.js .hero__spec::before { transform: scaleX(0) skewX(-8deg); }
.js .is-ready .hero__spec::before {
  transform: scaleX(1) skewX(-8deg);
  transition: transform 700ms var(--e-out) 520ms;
}
.hero__vlabel {
  position: absolute;
  right: clamp(14px, 1.6vw, 26px); top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.28em;
  color: var(--gray-2-dark);
}

/* ── 10. Portrait ────────────────────────────────────────────────────────── */
.portrait { position: relative; width: min(100%, 420px); }

.portrait__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--ink-soft);
  overflow: hidden;
}
.portrait__img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  filter: grayscale(0.18) contrast(1.04);
  transition: transform 700ms var(--e-out), filter 700ms var(--e-out);
}

/* The yellow plate is an entrance mask, never a resting cover: the avatar must
   be visible without a pointer (touch devices have no hover). */
.portrait__wash {
  position: absolute; inset: 0;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: right;
  pointer-events: none;
}
.js .portrait__wash { transform: scaleX(1); }
.js .is-ready .portrait__wash {
  transform: scaleX(0);
  transition: transform var(--d-slow) var(--e-out) 240ms;
}
.portrait__half {
  position: absolute; inset: auto 0 0 0;
  height: 42%;
  background:
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.5) 0 1px, transparent 1px 5px);
  mix-blend-mode: multiply;
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 700ms var(--e-out);
}
.portrait__ruler {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 14px;
  background:
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0 1px, transparent 1px 12px);
  opacity: 0.55;
  pointer-events: none;
}
.portrait__brk {
  position: absolute;
  width: 22px; height: 22px;
  border: 2px solid var(--signal);
  transition: width var(--d-mid) var(--e-out), height var(--d-mid) var(--e-out);
}
.portrait__brk--tl { left: 10px; top: 10px; border-right: 0; border-bottom: 0; }
.portrait__brk--tr { right: 10px; top: 10px; border-left: 0; border-bottom: 0; }
.portrait__brk--bl { left: 10px; bottom: 10px; border-right: 0; border-top: 0; }
.portrait__brk--br { right: 10px; bottom: 10px; border-left: 0; border-top: 0; }

.portrait__cap {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--sp-4);
  margin-top: var(--sp-4);
  color: var(--paper);
}
.portrait__who { font-weight: 700; font-size: clamp(14px, 1.15vw, 17px); }
.portrait__who em { font-style: normal; color: var(--gray-2-dark); font-weight: 500; }
.portrait__id {
  font-size: var(--fs-micro);
  letter-spacing: 0.1em;
  text-align: right;
  color: var(--gray-2-dark);
}

/* avatar micro-interaction: the frame breathes, the halftone thins out.
   Pointer-only so a touch tap can never latch a hover state. */
@media (hover: hover) and (pointer: fine) {
  .portrait__frame:hover .portrait__img { filter: grayscale(0.06) contrast(1.07); transform: scale(1.035); }
  .portrait__frame:hover .portrait__half { opacity: 0.28; }
  .portrait__frame:hover .portrait__brk { width: 30px; height: 30px; }
}

/* ── 11. Dossier — record (light) + channels (dark), one chapter ─────────── */
.dossier { position: relative; }

.dossier__grid {
  display: grid;
  /* same ratio as the hero, so the straight seam continues the hero's diagonal */
  grid-template-columns: var(--hero-col-a) var(--hero-col-b);
  align-items: stretch;
}

.dossier__rec {
  background: var(--paper);
  padding-block: var(--pad-y);
  padding-inline-start: calc(var(--pad-x) + var(--rail-w));
  padding-inline-end: clamp(28px, 3.4vw, 64px);
}

.dossier__chan {
  padding-block: var(--pad-y);
  padding-inline-start: clamp(28px, 3.4vw, 64px);
  padding-inline-end: var(--pad-x);
}

/* identity record */
.rec { border-top: 2px solid var(--ink); }
.rec__row {
  display: grid;
  grid-template-columns: minmax(96px, 12ch) minmax(0, 1fr);
  gap: var(--sp-4);
  align-items: baseline;
  padding-block: clamp(14px, 1.5vw, 22px);
  border-bottom: 1px solid var(--line-2);
}
.rec__key {
  font-size: var(--fs-micro);
  letter-spacing: 0.12em;
  color: var(--gray-text);
}
.rec__key .en { margin-top: 3px; letter-spacing: 0.14em; }
.rec__val {
  margin: 0;
  font-size: clamp(17px, 1.55vw, 24px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.rec__val .sub { margin-top: 4px; font-weight: 400; }

/* channel index — real external entries */
.chan { border-top: 2px solid var(--paper); }
.chan__item {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 34px;
  align-items: center;
  column-gap: var(--sp-4);
  row-gap: 5px;
  min-height: 82px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line-dark);
  color: var(--paper);
  isolation: isolate;
}
/* the yellow fill wipes in from the left */
.chan__item::before {
  content: '';
  position: absolute; inset: 0;
  z-index: -1;
  background: var(--signal);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--d-mid) var(--e-out);
}
.chan__no {
  grid-row: 1;
  font-family: var(--font-mono);
  font-size: var(--fs-tiny);
  color: var(--gray-2-dark);
  transition: color var(--d-fast) var(--e-out);
}
.chan__name {
  grid-row: 1;
  font-size: clamp(19px, 1.75vw, 27px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.chan__name .en { margin-top: 3px; color: var(--gray-2-dark); transition: color var(--d-fast) var(--e-out); }
.chan__url {
  grid-column: 2 / 4;
  grid-row: 2;
  font-family: var(--font-mono);
  font-size: var(--fs-tiny);
  letter-spacing: 0.02em;
  color: var(--gray-2-dark);
  word-break: break-all;
  transition: color var(--d-fast) var(--e-out);
}
.chan__go {
  grid-column: 3;
  grid-row: 1;
  display: grid; place-items: center;
  color: var(--paper);
  transition: color var(--d-fast) var(--e-out), transform var(--d-mid) var(--e-out);
}
.chan__go svg { width: 20px; height: 20px; }

.chan__item:hover, .chan__item:focus-visible { color: var(--ink); }
.chan__item:hover::before, .chan__item:focus-visible::before { transform: scaleX(1); }
.chan__item:hover .chan__no, .chan__item:focus-visible .chan__no,
.chan__item:hover .chan__url, .chan__item:focus-visible .chan__url { color: var(--ink); }
.chan__item:hover .chan__name .en, .chan__item:focus-visible .chan__name .en { color: var(--ink); }
.chan__item:hover .chan__go, .chan__item:focus-visible .chan__go { color: var(--ink); transform: translateX(5px); }
.chan__item:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

/* ── 12. Footer ──────────────────────────────────────────────────────────── */
.foot {
  padding-top: clamp(48px, 5vw, 80px);
  padding-bottom: clamp(24px, 2.4vw, 40px);
}
.foot__top {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--sp-5);
  flex-wrap: wrap;
}
.foot__mark {
  font-size: clamp(28px, 4.2vw, 54px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.03em;
}
.foot__mark span { color: var(--signal); }
.to-top {
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 44px;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.14em;
  color: var(--gray-2-dark);
  transition: color var(--d-fast) var(--e-out);
}
.to-top svg { width: 14px; height: 14px; transition: transform var(--d-mid) var(--e-out); }
.to-top:hover { color: var(--signal); }
.to-top:hover svg { transform: translateY(-3px); }

.foot__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); flex-wrap: wrap;
  margin-top: clamp(28px, 3.4vw, 52px);
  padding-top: clamp(18px, 2vw, 28px);
  border-top: 1px solid var(--line);
  color: var(--gray-2-dark);
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
}
.foot__sig { display: flex; align-items: center; gap: 10px; }

/* ── 12b. Error sheet (404) ──────────────────────────────────────────────── */
.err {
  display: flex; align-items: center;
  min-height: calc(100svh - var(--hdr-h) - 1px);
}
.err > .shell { width: 100%; }
.err__title {
  margin-top: clamp(18px, 2.2vw, 30px);
  font-size: clamp(64px, 13vw, 180px);
  font-weight: 900;
  line-height: 0.86;
  letter-spacing: -0.04em;
}
.err__note { margin-top: var(--sp-5); max-width: 40ch; color: var(--gray-text); }

.acts { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: clamp(28px, 3.2vw, 46px); }
.act {
  position: relative;
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  font-size: clamp(14px, 1.05vw, 16px);
  isolation: isolate;
  transition: border-color var(--d-fast) var(--e-out);
}
.act::before {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background: var(--signal);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--d-mid) var(--e-out);
}
.act__no {
  font-family: var(--font-mono); font-weight: 400;
  font-size: var(--fs-micro); color: var(--gray-text);
  transition: color var(--d-fast) var(--e-out);
}
.act svg { width: 16px; height: 16px; transition: transform var(--d-mid) var(--e-out); }
.act:hover, .act:focus-visible { border-color: var(--ink); }
.act:hover::before, .act:focus-visible::before { transform: scaleX(1); }
.act:hover .act__no, .act:focus-visible .act__no { color: var(--ink); }
.act:hover svg, .act:focus-visible svg { transform: translateX(4px); }

/* ── 13. Motion ──────────────────────────────────────────────────────────── */
/* entrance: staggered, masked — only under .js so no-JS always shows content */
.js .anim { opacity: 0; transform: translateY(14px); }
.js .is-ready .anim {
  opacity: 1; transform: none;
  transition: opacity var(--d-slow) var(--e-out), transform var(--d-slow) var(--e-out);
  transition-delay: var(--d, 0ms);
}
.js .anim--ghost { transform: translateY(20px); }
.js .is-ready .anim--ghost { transform: none; }
.js .anim--wipe { transform: scaleX(0); }
.js .is-ready .anim--wipe { transform: scaleX(1); }

.js .rv { opacity: 0; transform: translateY(16px); }
.js .rv.is-in {
  opacity: 1; transform: none;
  transition: opacity var(--d-mid) var(--e-out), transform var(--d-mid) var(--e-out);
  transition-delay: var(--rv-delay, 0ms);
}
.js .rv .shead__rule { transform: scaleX(0); }
.js .rv.is-in .shead__rule {
  transform: scaleX(1);
  transition: transform var(--d-slow) var(--e-out);
  transition-delay: calc(var(--rv-delay, 0ms) + 120ms);
}

/* Watchdog: if the bundle never boots, nothing stays masked. */
.no-boot .anim,
.no-boot .rv { opacity: 1 !important; transform: none !important; }
.no-boot .shead__rule { transform: scaleX(1) !important; }
.no-boot .anim--wipe { transform: scaleX(1) !important; }
.no-boot .portrait__wash { transform: scaleX(0) !important; }
.no-boot .hero__spec::before { transform: scaleX(1) skewX(-8deg) !important; }

/* ── 14. Responsive ──────────────────────────────────────────────────────── */
@media (min-width: 1200px) {
  .rail { display: flex; }
}

/* Below this width the hero stops being a two-column poster. Set at 900px so a
   1024x768 landscape tablet keeps the asymmetric composition. */
@media (max-width: 900px) {
  :root { --rail-w: 0px; }

  .hero__grid,
  .dossier__grid { grid-template-columns: minmax(0, 1fr); }

  .hero__spec {
    clip-path: none;
    padding-block: clamp(40px, 7vw, 72px);
  }
  .hero__spec::before { display: none; }
  .hero__vlabel { display: none; }
  .hero__type { padding-block: clamp(72px, 9vw, 110px) clamp(36px, 5vw, 56px); }
  .portrait { width: min(100%, 340px); }

  .dossier__chan { padding-inline: calc(var(--pad-x) + var(--rail-w)); }
}

@media (max-width: 720px) {
  :root {
    --pad-y: clamp(48px, 11vw, 64px);
    --hero-pad-y: clamp(48px, 12vw, 72px);
    --shead-gap: clamp(24px, 5vw, 32px);
    --fs-h2: clamp(26px, 8vw, 38px);
  }

  .hdr__in { padding-inline: var(--pad-x); }
  .nav { display: none; }
  .burger {
    display: grid; place-items: center;
    margin-inline-start: auto;
    width: 44px; height: 44px;
    color: var(--ink);
  }
  .burger svg { width: 20px; height: 20px; }

  .hero__wordmark { margin-top: 20px; }
  .hero__alias { margin-top: 16px; }
  .hero__scroll { margin-top: 20px; padding-top: 0; }

  /* The plate is capped against the room the fold actually leaves it, so its
     bottom edge lands on screen instead of being sliced off. The frame keeps a
     definite width, so the cap turns the square into a wide plate and object-fit
     crops the picture: the screen ends on a finished shape with its own corner
     brackets rather than on an accidental slice of a square. 456px is what the
     phone hero spends above the plate (measured), plus a gutter. */
  .portrait__frame { max-height: max(170px, calc(100svh - 456px)); }

  .portrait { width: 100%; max-width: none; }
  .portrait__id { text-align: right; }

  .rec__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
  .rec__key .en { display: inline; margin-left: 8px; }

  .chan__item { grid-template-columns: 34px minmax(0, 1fr) 28px; min-height: 74px; }

  .foot__top { align-items: flex-start; flex-direction: column; gap: var(--sp-4); }
  .foot__bar { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* Short phones (375x667, 320x568) have roughly 100px less to spend. Tighten the
   hero rhythm and cap the plate harder, so the name, the identity lines and a
   complete plate still share the first screen. Only short screens pay for this:
   taller phones keep the roomier rhythm untouched. */
@media (max-width: 720px) and (max-height: 700px) {
  .hero__type { padding-block: 64px 20px; }
  .hero__spec { padding-block: 20px; }
  .hero__wordmark { margin-top: 14px; }
  .hero__alias { margin-top: 12px; }
  .hero__affil { margin-top: 14px; }
  .hero__note { margin-top: 12px; }
  .hero__scroll { margin-top: 14px; }
  .portrait__frame { max-height: max(180px, calc(100svh - 382px)); }
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
  .js .rv, .js .hero .anim { opacity: 1 !important; transform: none !important; }
  .js .shead__rule { transform: scaleX(1) !important; }
  .portrait__wash { transform: scaleX(0) !important; }
  .hero__spec::before { transform: scaleX(1) skewX(-8deg) !important; }
  .hero__ghost { transform: none !important; }
  .hero__mesh { transform: none !important; }
}
