/* ==========================================================================
   DEEPANKAR PATEL — VOL. 01
   Ink, paper and one stamp of vermilion.
   ========================================================================== */

/* ------------------------------------------------------------------ FONTS
   Self-hosted (SIL Open Font License). Shippori Mincho is subset to the few
   Japanese characters the site uses plus ASCII; Dela Gothic's Japanese file
   only carries the ドン SFX glyphs.                                        */
@font-face {
  font-family: "Dela Gothic One";
  src: url("../fonts/dela-gothic-one-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: block;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Dela Gothic One";
  src: url("../fonts/dela-gothic-one-sfx.woff2") format("woff2");
  font-weight: 400;
  font-display: block;
  unicode-range: U+30B4, U+30C9, U+30F3, U+FF01;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}
@font-face {
  font-family: "Shippori Mincho B1";
  src: url("../fonts/shippori-mincho-subset.woff2") format("woff2");
  font-weight: 700 800;
  font-display: swap;
}

/* ----------------------------------------------------------------- TOKENS */
:root {
  --c-paper: #f2ede3;
  --c-paper-2: #e7e0d1;
  --c-ink: #141312;
  --c-ink-2: #3a3834;
  --c-night: #0e0e0d;
  --c-night-2: #1a1917;
  --c-bone: #efe9dc;
  --c-bone-2: #bdb6a8;

  --paper: var(--c-paper);
  --paper-2: var(--c-paper-2);
  --ink: var(--c-ink);
  --ink-2: var(--c-ink-2);
  --muted: #6c685f;
  --accent: #e0402f;
  --accent-ink: #fff8f0;

  /* colours used by .invert sections */
  --inv-paper: var(--c-night);
  --inv-paper-2: var(--c-night-2);
  --inv-ink: var(--c-bone);
  --inv-ink-2: var(--c-bone-2);
  --inv-muted: #8e897f;

  --tone: color-mix(in srgb, var(--ink) 16%, transparent);
  --stroke: 3px;
  --gutter: clamp(10px, 1.4vw, 18px);
  --pad: 16px;
  --maxw: 1320px;
  --radius: 2px;

  --f-display: "Dela Gothic One", "Arial Black", Impact, sans-serif;
  --f-body: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --f-jp: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", serif;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-snap: cubic-bezier(.7, 0, .2, 1);
  --topbar-h: 64px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: var(--c-night);
    --paper-2: var(--c-night-2);
    --ink: var(--c-bone);
    --ink-2: var(--c-bone-2);
    --muted: #8e897f;
    --accent: #ff5b45;
    --inv-paper: var(--c-paper);
    --inv-paper-2: var(--c-paper-2);
    --inv-ink: var(--c-ink);
    --inv-ink-2: var(--c-ink-2);
    --inv-muted: #6c685f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: var(--c-night);
  --paper-2: var(--c-night-2);
  --ink: var(--c-bone);
  --ink-2: var(--c-bone-2);
  --muted: #8e897f;
  --accent: #ff5b45;
  --inv-paper: var(--c-paper);
  --inv-paper-2: var(--c-paper-2);
  --inv-ink: var(--c-ink);
  --inv-ink-2: var(--c-ink-2);
  --inv-muted: #6c685f;
  color-scheme: dark;
}

.invert {
  --paper: var(--inv-paper);
  --paper-2: var(--inv-paper-2);
  --ink: var(--inv-ink);
  --ink-2: var(--inv-ink-2);
  --muted: var(--inv-muted);
  --tone: color-mix(in srgb, var(--ink) 16%, transparent);
  background: var(--paper);
  color: var(--ink);
}

@media (min-width: 720px) {
  :root { --pad: 28px; --stroke: 3px; }
}
@media (min-width: 1100px) {
  :root { --pad: 56px; --stroke: 3.5px; --topbar-h: 72px; }
}

/* ------------------------------------------------------------------ RESET */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--topbar-h); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .4s ease, color .4s ease;
}
@supports (overflow-x: clip) { body { overflow-x: clip; } }
body.is-locked { overflow: hidden; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* paper grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.mono { font-family: var(--f-mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--ink); color: var(--paper); padding: 10px 14px; }
.skip-link:focus { top: 12px; }
.only-desktop { display: none; }
@media (min-width: 1000px) { .only-desktop { display: inline; } }

/* --------------------------------------------------------------- PRIMITIVES */
.panel {
  position: relative;
  background: var(--paper);
  border: var(--stroke) solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .4s ease, background-color .4s ease;
}

.tone {
  background-image: radial-gradient(var(--tone) 1.1px, transparent 1.4px);
  background-size: 6px 6px;
}

.speedlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: var(--ink);
  opacity: .1;
  transition: opacity .5s ease;
}
.speedlines svg { width: 100%; height: 100%; }
.speedlines polygon { fill: currentColor; }

.bubble {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  border: var(--stroke) solid var(--ink);
  border-radius: 999px / 70%;
  padding: 16px 24px;
  font-weight: 500;
}
.bubble::after,
.bubble::before {
  content: "";
  position: absolute;
  border-style: solid;
}
/* tail */
.bubble::before {
  left: 22%;
  bottom: -22px;
  border-width: 22px 12px 0 4px;
  border-color: var(--ink) transparent transparent transparent;
  transform: skewX(-18deg);
}
.bubble::after {
  left: calc(22% + 3px);
  bottom: -14px;
  border-width: 16px 8px 0 2px;
  border-color: var(--paper) transparent transparent transparent;
  transform: skewX(-18deg);
}

.narration {
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 10px 14px;
  font-size: .9rem;
  line-height: 1.45;
  font-weight: 500;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--f-mono);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  white-space: nowrap;
}
.tag--accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tag--ink { background: var(--ink); color: var(--paper); }

.btn {
  --shadow: 5px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .01em;
  text-decoration: none;
  border: var(--stroke) solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow) var(--shadow) 0 var(--ink);
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out), background-color .2s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: calc(var(--shadow) + 2px) calc(var(--shadow) + 2px) 0 var(--ink); }
.btn:active { transform: translate(var(--shadow), var(--shadow)); box-shadow: 0 0 0 var(--ink); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--ghost { background: transparent; box-shadow: none; border-color: transparent; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; padding-inline: 8px; }
.btn--ghost:hover { box-shadow: none; transform: none; text-decoration-color: var(--accent); }
.btn--light { background: var(--paper); }
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; box-shadow: none; border-style: dashed; }

/* ------------------------------------------------------------- REVEALS */
/* 1px left unclipped (and opacity 0) so IntersectionObserver still sees the element */
.js .reveal {
  opacity: 0;
  clip-path: inset(0 0 calc(100% - 1px) 0);
  transform: translateY(24px) rotate(var(--rot, 0deg));
  transition: clip-path .9s var(--ease-out), transform .9s var(--ease-out), opacity .2s linear;
  transition-delay: var(--d, 0s);
}
.js .reveal.in { opacity: 1; clip-path: inset(-50vh -50vw); transform: none; }

/* ============================================================= THE STORY (opening)
   Motion language (shared with the rest of the site):
     --ease-out   decelerate, for things arriving
     --ease-snap  hard in/out, for impacts and slams
     --ease-inout camera moves and hand-offs
   Start → a ~6s manga short: the red button becomes an ink drop, the drop
   opens a manga page (look · sketch · build · ship), the camera pushes
   into the eye, and the pupil flies out to become the homepage sun/moon.
   Skip  → the cover lifts like a curtain; the homepage rises into place. */
:root { --ease-inout: cubic-bezier(.76, 0, .24, 1); }
.story {
  --acc: #ff5b45;
  --page: #f2ede3;
  --ink-night: #0e0e0d;
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  background: var(--ink-night);
  color: var(--c-bone);
  overflow: hidden;
}
.no-js .story, .story[hidden] { display: none; }
.story:focus { outline: none; }
.story > * { grid-area: 1 / 1; }

.story__lines { position: absolute; inset: -25%; color: var(--c-bone); opacity: 0; pointer-events: none; }
.story__lines > div { position: absolute; left: 50%; top: 50%; width: 170vmax; height: 170vmax; translate: -50% -50%; animation: spin 180s linear infinite; }
.story__lines svg { width: 100%; height: 100%; }
.story__lines polygon { fill: currentColor; }
.story.is-go .story__lines { opacity: .1; transition: opacity 1.4s; }
.story:not([data-scene="0"]) .story__lines { opacity: 0; transition: opacity .4s; }

/* ---- scene 0: cover */
.story__cover { position: relative; z-index: 2; width: min(88vw, 640px); text-align: center; container-type: inline-size; }
.story__vol { display: inline-flex; gap: 10px; color: var(--acc); margin-bottom: 22px; }
.story__title { font-family: var(--f-display); font-weight: 400; line-height: .86; letter-spacing: -.02em; text-transform: uppercase; }
.story__title > span { display: block; white-space: nowrap; }
.story__first { font-size: calc(100cqi / 8.05); }
.story__last { font-size: calc(100cqi / 4.35); color: var(--acc); margin-top: .03em; }
.story__title .ch { display: inline-block; opacity: 0; }
.story__sub { font-family: var(--f-jp); font-weight: 800; font-size: clamp(1rem, 3.6vw, 1.2rem); letter-spacing: .08em; margin: 18px 0 34px; color: var(--c-bone-2); }
.story__actions { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.story__start {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 0 28px;
  background: var(--acc);
  color: #fff8f0;
  font-weight: 700;
  font-size: 1.05rem;
  box-shadow: 6px 6px 0 var(--c-bone);
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.story__start::after { content: ""; position: absolute; inset: 0; border: 2px solid var(--acc); opacity: 0; pointer-events: none; }
.story.is-go .story__start::after { animation: ring 2s 2.4s ease-out infinite; }
@keyframes ring { 0% { opacity: .9; scale: 1; } 100% { opacity: 0; scale: 1.18 1.5; } }
.story__start:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--c-bone); }
.story__start:active { transform: translate(5px, 5px); box-shadow: 1px 1px 0 var(--c-bone); }
.story__play { width: 0; height: 0; border-style: solid; border-width: 8px 0 8px 13px; border-color: transparent transparent transparent currentColor; transition: transform .3s var(--ease-out); }
.story__start:hover .story__play { transform: scale(1.15); }
.story__skip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 6px; color: var(--c-bone-2); font-size: .92rem; font-weight: 500; }
.story__skip span { transition: transform .3s var(--ease-out); }
.story__skip:hover { color: var(--c-bone); }
.story__skip:hover span { transform: translateX(5px); }

/* cover entrance (after fonts load) */
.story__vol, .story__sub, .story__actions { opacity: 0; }
.story.is-go .story__vol { animation: rise-in .7s .1s var(--ease-out) forwards; }
.story.is-go .story__title .ch { animation: ch-drop .6s var(--ease-out) forwards; animation-delay: calc(var(--i) * 38ms + .25s); }
.story.is-go .story__sub { animation: rise-in .7s 1s var(--ease-out) forwards; }
.story.is-go .story__actions { animation: rise-in .7s 1.2s var(--ease-out) forwards; }
@keyframes rise-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes ch-drop {
  0% { opacity: 0; transform: translateY(-45%) scale(2) rotate(-8deg); filter: blur(5px); }
  55% { opacity: 1; transform: translateY(4%) scale(.95); filter: none; }
  100% { opacity: 1; transform: none; }
}

/* ---- scene 1: the cover falls away, the button becomes a drop of ink */
.story:not([data-scene="0"]) .story__cover { pointer-events: none; }
.story[data-scene="1"] .story__title .ch { opacity: 1; animation: ch-fall .6s cubic-bezier(.55, 0, .85, .25) forwards; animation-delay: calc(var(--i) * 20ms); }
.story[data-scene="1"] .story__title .ch:nth-child(even) { --r: -14deg; }
@keyframes ch-fall { to { opacity: 0; transform: translateY(60vh) rotate(var(--r, 16deg)); } }
.story[data-scene="1"] .story__vol, .story[data-scene="1"] .story__sub, .story[data-scene="1"] .story__actions { opacity: 1; animation: fade-up .3s ease-in forwards; }
@keyframes fade-up { to { opacity: 0; transform: translateY(-10px); } }
.story[data-scene="op"] .story__cover { visibility: hidden; }

.story__disk {
  position: fixed;
  z-index: 4;
  left: 0;
  top: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, #ef6a4f 0%, #e3432e 65%, #cf3822 100%);
  transform-origin: 0 0;
  visibility: hidden;
  pointer-events: none;
}
.story__disk::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 42% 40%, #faf6ee 0%, #ece3d2 60%, #d9ccb6 100%); opacity: 0; transition: opacity .7s .15s; }
.story.is-fly .story__disk { visibility: visible; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .story.is-fly .story__disk::after { opacity: 1; } }
:root[data-theme="dark"] .story.is-fly .story__disk::after { opacity: 1; }


/* ---- the Start hit: two inverted impact frames, a shake and a ドン！ */
.story.is-impact { animation: impact-frame .38s steps(1); }
@keyframes impact-frame { 0% { filter: invert(1); } 26% { filter: none; } 52% { filter: invert(1) contrast(1.4); } 78% { filter: none; } }
.story.is-impact .story__cover { animation: shake .4s; }
.story__sfx {
  position: relative;
  z-index: 7;
  font-family: var(--f-display);
  font-size: clamp(5rem, 26vw, 15rem);
  line-height: 1;
  color: var(--acc);
  -webkit-text-stroke: clamp(4px, 1vw, 8px) var(--ink-night);
  paint-order: stroke fill;
  text-shadow: 10px 10px 0 var(--ink-night);
  rotate: -10deg;
  opacity: 0;
  pointer-events: none;
}
.story.is-impact .story__sfx, .story[data-scene="1"] .story__sfx { animation: story-sfx .9s var(--ease-out) forwards; }
@keyframes story-sfx { 0% { opacity: 0; scale: .3; rotate: -26deg; } 18% { opacity: 1; scale: 1.15; rotate: -8deg; } 32% { scale: 1; rotate: -10deg; } 70% { opacity: 1; } 100% { opacity: 0; scale: 1.4; } }

/* ============================================================= THE OPENING (OP)
   A beat-cut anime opening at 150 BPM: one cut per beat (400ms).
   Cuts: words → projects → record → hero pose → title drop.
   JS sets .story[data-cut] and toggles .is-on on beat children;
   showing an element restarts its entrance animation.               */
.op { --beat: 400ms; position: absolute; inset: 0; z-index: 3; display: none; overflow: hidden; background: var(--ink-night); color: var(--c-bone); }
.story[data-scene="op"] .op { display: block; }
.op.pump { animation: pump .32s var(--ease-out); }
@keyframes pump { from { transform: scale(1.035); } }
.op__lines { position: absolute; left: 50%; top: 50%; width: 180vmax; height: 180vmax; translate: -50% -50%; color: var(--c-bone); opacity: .1; animation: spin 14s linear infinite; }
.op__lines svg { width: 100%; height: 100%; }
.op__lines polygon { fill: currentColor; }
.op__cut { position: absolute; inset: 0; display: none; }
.story[data-cut="words"] .op__words, .story[data-cut="projects"] .op__projects, .story[data-cut="stats"] .op__stats,
.story[data-cut="hero"] .op__hero, .story[data-cut="title"] .op__title { display: block; }
.op__flash { position: absolute; inset: 0; z-index: 9; background: #fff; opacity: 0; pointer-events: none; }
.op__flash.go { animation: op-flash .22s ease-out; }
@keyframes op-flash { from { opacity: .95; } to { opacity: 0; } }
.op__bars i { position: absolute; left: 0; right: 0; z-index: 8; height: 0; background: #000; transition: height .35s var(--ease-snap); }
.op__bars i:first-child { top: 0; }
.op__bars i:last-child { bottom: 0; }
.story:is([data-cut="hero"], [data-cut="title"]) .op__bars i { height: 7vh; }

/* cut 1 · word slams: one full-bleed card per beat */
.op__word { position: absolute; inset: 0; display: none; place-content: center; justify-items: center; gap: 2vh; overflow: hidden; }
.op__word.is-on { display: grid; }
.op__word--a { background: var(--ink-night); color: var(--c-bone); }
.op__word--b { background: var(--page); color: var(--ink-night); }
.op__word--c { background: var(--acc); color: var(--ink-night); }
.op__word b { font-family: var(--f-display); font-weight: 400; font-size: min(17vw, 30vh); line-height: .9; letter-spacing: -.02em; animation: word-slam .38s var(--ease-snap) both, drift var(--beat) linear both; }
.op__word--c b { color: var(--page); -webkit-text-stroke: max(3px, .5vw) var(--ink-night); paint-order: stroke fill; text-shadow: .06em .06em 0 var(--ink-night); }
.op__word small { font-size: clamp(.7rem, 1.6vw, 1rem); opacity: .7; animation: rise-in .3s .1s var(--ease-out) both; }
@keyframes word-slam { 0% { opacity: 0; transform: scale(2.8) skewX(-14deg); filter: blur(10px); } 55% { opacity: 1; transform: scale(.94) skewX(3deg); filter: none; } 100% { transform: none; } }
@keyframes drift { from { translate: -1.5vw 0; } to { translate: 1.5vw 0; } }
.op__slash { position: absolute; left: -20%; right: -20%; top: 50%; height: 16vh; background: var(--acc); rotate: -18deg; translate: -110% -50%; animation: slash .34s var(--ease-snap) both; }
.op__word--c .op__slash { background: var(--ink-night); }
.op__word--b .op__slash { opacity: .9; }
@keyframes slash { to { translate: 110% -50%; } }

/* cut 2 · projects on slanted strips, whip-panned off */
.op__projects { display: none; background: var(--ink-night); }
.story[data-cut="projects"] .op__projects { display: flex; flex-direction: column; justify-content: center; gap: 2.4vh; }
.op__strip { position: relative; display: flex; align-items: baseline; gap: 3vw; padding: 2.4vh 7vw; transform: skewY(-6deg) translateX(var(--from)); opacity: 0; }
.op__strip:nth-child(odd) { --from: -115%; }
.op__strip:nth-child(even) { --from: 115%; justify-content: flex-end; }
.op__strip:nth-child(1) { background: var(--page); color: var(--ink-night); }
.op__strip:nth-child(2) { background: var(--acc); color: var(--ink-night); }
.op__strip:nth-child(3) { background: var(--c-bone); color: var(--ink-night); }
.op__strip.is-on { animation: strip-in .36s var(--ease-snap) forwards; }
@keyframes strip-in { 0% { opacity: 1; transform: skewY(-6deg) translateX(var(--from)); filter: blur(6px); } 100% { opacity: 1; transform: skewY(-6deg) translateX(0); filter: none; } }
.op__strip b { font-family: var(--f-display); font-weight: 400; font-size: min(12vw, 13vh); line-height: .9; text-transform: uppercase; }
.op__strip span { font-family: var(--f-mono); font-size: clamp(.62rem, 1.5vw, .95rem); letter-spacing: .1em; text-transform: uppercase; }
.op__strip i { font-style: normal; font-family: var(--f-mono); font-size: clamp(.62rem, 1.4vw, .9rem); color: inherit; opacity: .6; }
.op__projects.whip .op__strip { animation: whip .26s cubic-bezier(.6, 0, .9, .3) forwards; opacity: 1; }
.op__projects.whip .op__strip:nth-child(2) { animation-delay: .03s; }
.op__projects.whip .op__strip:nth-child(3) { animation-delay: .06s; }
@keyframes whip { from { transform: skewY(-6deg); } to { transform: skewY(-6deg) translateX(-140%); filter: blur(10px); } }

/* cut 3 · the record: one giant number per beat */
.op__stat { position: absolute; inset: 0; display: none; place-content: center; justify-items: center; overflow: hidden; }
.op__stat.is-on { display: grid; }
.op__stat:nth-child(1) { background: var(--page); color: var(--ink-night); --rot: -5deg; }
.op__stat:nth-child(2) { background: var(--ink-night); color: var(--c-bone); --rot: 4deg; }
.op__stat:nth-child(3) { background: var(--acc); color: var(--ink-night); --rot: -3deg; }
.op__stat::before { content: ""; position: absolute; left: 50%; top: 50%; width: 140vmax; height: 140vmax; translate: -50% -50%; background: repeating-conic-gradient(currentColor 0 1.2deg, transparent 1.2deg 9deg); opacity: .09; animation: spin 6s linear infinite; }
.op__stat b { position: relative; font-family: var(--f-display); font-weight: 400; font-size: min(40vw, 46vh); line-height: .85; rotate: var(--rot); animation: stat-slam .36s var(--ease-snap) both; }
.op__stat:nth-child(1) b { color: var(--acc); -webkit-text-stroke: max(3px, .45vw) var(--ink-night); paint-order: stroke fill; }
.op__stat:nth-child(2) b { color: transparent; -webkit-text-stroke: max(3px, .45vw) var(--c-bone); }
.op__stat:nth-child(3) b { color: var(--page); -webkit-text-stroke: max(3px, .45vw) var(--ink-night); paint-order: stroke fill; text-shadow: .05em .05em 0 var(--ink-night); }
.op__stat span { position: relative; font-family: var(--f-display); font-size: min(7vw, 7vh); text-transform: uppercase; rotate: var(--rot); animation: rise-in .25s .12s var(--ease-out) both; }
.op__stat em { position: absolute; right: 6vw; top: 12vh; font-style: normal; font-family: var(--f-display); font-size: min(14vw, 16vh); color: var(--ink-night); rotate: 12deg; animation: sfx-pop .4s .1s var(--ease-snap) both; }
@keyframes stat-slam { 0% { opacity: 0; transform: scale(3.2) translateY(-10%); } 60% { opacity: 1; transform: scale(.92); } 100% { transform: none; } }
.op__stat.is-on { animation: shake .3s .05s; }
@keyframes sfx-pop { 0% { opacity: 0; scale: .3; } 60% { opacity: 1; scale: 1.2; } 100% { opacity: 1; scale: 1; } }

/* cut 4 · hero pose: the robot flies in over speed streaks */
.op__hero { background: var(--acc); overflow: hidden; }
.op__streaks { position: absolute; inset: -10% -40%; background: repeating-linear-gradient(180deg, transparent 0 18px, rgba(14, 14, 13, .55) 18px 21px, transparent 21px 44px, rgba(245, 239, 228, .5) 44px 46px); -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 160px, transparent 160px 200px, #000 200px 320px, transparent 320px 360px); mask-image: repeating-linear-gradient(90deg, #000 0 160px, transparent 160px 200px, #000 200px 320px, transparent 320px 360px); animation: streak .22s linear infinite; }
@keyframes streak { to { transform: translateX(-360px); } }
.op__marquee { position: absolute; left: 0; white-space: nowrap; font-family: var(--f-display); font-size: min(13vw, 16vh); line-height: 1; text-transform: uppercase; color: transparent; -webkit-text-stroke: 2px var(--ink-night); opacity: .55; }
.op__marquee--1 { top: 8vh; animation: mq-l 3s linear both; }
.op__marquee--2 { bottom: 8vh; animation: mq-r 3s linear both; }
@keyframes mq-l { from { transform: translateX(0); } to { transform: translateX(-60%); } }
@keyframes mq-r { from { transform: translateX(-60%); } to { transform: translateX(0); } }
.op__bot { position: absolute; left: 50%; bottom: 4vh; height: 84vh; width: auto; max-width: 96vw; overflow: visible; translate: -50% 0; animation: bot-in .55s var(--ease-out) both; filter: drop-shadow(10px 10px 0 var(--ink-night)); }
@keyframes bot-in { 0% { transform: translateX(80vw) rotate(12deg) scale(.8); } 70% { transform: translateX(-3vw) rotate(-3deg) scale(1.03); } 100% { transform: none; } }
.op__flash-star { position: absolute; left: 50%; top: 32vh; width: min(34vw, 30vh); aspect-ratio: 1; translate: -50% -50%; background: #fff; clip-path: polygon(50% 0, 56% 44%, 100% 50%, 56% 56%, 50% 100%, 44% 56%, 0 50%, 44% 44%); scale: 0; animation: star-flash .45s .6s var(--ease-snap) both; }
@keyframes star-flash { 0% { scale: 0; rotate: 0deg; } 45% { scale: 1.2; rotate: 45deg; } 100% { scale: 0; rotate: 90deg; } }

/* cut 5 · title drop: strobe cuts, then the name over the rising sun */
.op__title { background: var(--ink-night); }
.op__strobe b { position: absolute; inset: 0; display: none; place-items: center; font-family: var(--f-display); font-weight: 400; font-size: min(30vw, 40vh); line-height: 1; }
.op__strobe b:nth-child(odd) { background: var(--page); color: var(--ink-night); }
.op__strobe b:nth-child(even) { background: var(--ink-night); color: var(--acc); }
.op__strobe b.is-on { display: grid; animation: strobe-zoom .1s linear both; }
@keyframes strobe-zoom { from { transform: scale(1.3); } }
.op__sun { position: absolute; left: 50%; top: 42%; width: min(62vmin, 520px); aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; background: radial-gradient(circle at 42% 38%, #ef6a4f 0%, #e3432e 65%, #cf3822 100%); scale: 0; }
.op__title.is-drop .op__sun { animation: sun-up .7s var(--ease-out) forwards; }
@keyframes sun-up { 0% { scale: 0; } 70% { scale: 1.06; } 100% { scale: 1; } }
.op__name { position: absolute; left: 50%; top: 42%; translate: -50% -50%; width: min(92vw, 900px); text-align: center; container-type: inline-size; opacity: 0; }
.op__title.is-drop .op__name { opacity: 1; }
.op__name b { display: block; font-family: var(--f-display); font-weight: 400; text-transform: uppercase; line-height: .86; letter-spacing: -.02em; white-space: nowrap; }
.op__first { font-size: calc(100cqi / 8.05); color: var(--c-bone); text-shadow: .05em .05em 0 var(--ink-night); }
.op__last { font-size: calc(100cqi / 4.35); color: var(--ink-night); -webkit-text-stroke: max(2px, .3vw) var(--c-bone); paint-order: stroke fill; margin-top: .02em; }
.op__title.is-drop .op__first { animation: name-in .4s var(--ease-snap) both; }
.op__title.is-drop .op__last { animation: name-in .4s .1s var(--ease-snap) both; }
@keyframes name-in { 0% { clip-path: inset(0 100% 0 0); transform: translateX(-8%) skewX(-20deg); } 100% { clip-path: inset(0 -10% 0 0); transform: none; } }
.op__vol { color: var(--c-bone); margin-bottom: 2vh; text-shadow: 0 1px 6px rgba(0,0,0,.6); animation: rise-in .4s .3s var(--ease-out) both; }
.op__title.is-drop { animation: shake .4s .05s; }
.story.is-fly .op__sun { visibility: hidden; }
.story.is-fly .op { background: transparent; }
.story.is-fly .op__name { opacity: 0; transition: opacity .25s; }

/* ---- homepage arrival after the story: focus lines burst from the character */
.kv__burst { position: absolute; left: 52%; top: 36%; width: 320%; aspect-ratio: 1; translate: -50% -50%; color: var(--ink); opacity: 0; pointer-events: none; }
.kv__burst svg { width: 100%; height: 100%; }
.kv__burst polygon { fill: currentColor; }
.intro-full.is-playing .kv__burst { animation: kv-burst 1.8s .1s var(--ease-out); }
@keyframes kv-burst { 0% { opacity: 0; scale: 1.5; } 20% { opacity: .35; } 100% { opacity: 0; scale: 1; } }
.intro-full.is-playing .kv__title .kv__name { animation: shake .4s 1.05s; }

/* ---- subtitles */
.story__sub-line {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: calc(9vh + env(safe-area-inset-bottom));
  translate: -50% 0;
  width: min(90vw, 700px);
  text-align: center;
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  font-weight: 500;
  color: #fff;
  text-shadow: 0 2px 10px #000;
  pointer-events: none;
}
.story__sub-line.swap { animation: sub-in .6s var(--ease-out); }
@keyframes sub-in { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0); } }

/* ---- sound toggle (cover + top bar): three equaliser bars that dance while on */
.story__sound { display: inline-flex; align-items: center; gap: 10px; margin-top: 26px; min-height: 36px; padding: 0 12px; color: var(--c-bone-2); border: 1.5px solid rgba(239, 233, 220, .22); opacity: 0; }
.story.is-go .story__sound { animation: rise-in .7s 1.4s var(--ease-out) forwards; }
.story[data-scene="1"] .story__sound { animation: fade-up .3s ease-in forwards; opacity: 1; }
.story__sound:hover { color: var(--c-bone); border-color: var(--c-bone); }
.snd-ico { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.snd-ico i { width: 3px; height: 100%; background: currentColor; transform-origin: bottom; animation: eq .9s ease-in-out infinite alternate; }
.snd-ico i:nth-child(2) { animation-delay: -.3s; }
.snd-ico i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { from { transform: scaleY(.3); } to { transform: scaleY(1); } }
[aria-pressed="false"] .snd-ico i { animation: none; transform: scaleY(.25); opacity: .6; }
.snd-btn .snd-ico { color: var(--ink); }
.story__sound[aria-pressed="true"] .snd-ico { color: var(--acc); }

/* ---- story chrome */
.story__hud { position: absolute; inset: 0; z-index: 6; pointer-events: none; opacity: 0; transition: opacity .4s; }
.story:not([data-scene="0"]) .story__hud { opacity: 1; }
.story.is-reveal .story__hud { opacity: 0; }
.story__scene-label { position: absolute; left: var(--pad); top: calc(20px + env(safe-area-inset-top)); color: var(--c-bone-2); display: grid; gap: 4px; }
.story__scene-label span { display: inline-block; }
.story__scene-label span.swap { animation: name-swap .45s var(--ease-out); }
.story__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(239, 233, 220, .12); }
.story__progress i { display: block; height: 100%; background: var(--acc); transform-origin: 0 50%; transform: scaleX(0); }
.story.is-running .story__progress i { transform: scaleX(1); transition: transform var(--story-len, 5.3s) linear; }

/* ---- the Skip exit: a curtain lift, nothing more */
.story.is-lift { transform: translateY(-100%); transition: transform .75s var(--ease-inout); }
.story.is-lift::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--acc); }
.story.is-lift .story__cover, .story.is-lift .op { translate: 0 -6vh; opacity: .4; transition: translate .75s var(--ease-inout), opacity .5s; }

@media (max-width: 719px) {
  .story__sfx { -webkit-text-stroke-width: 4px; text-shadow: 5px 5px 0 var(--ink-night); }
  .story__start { min-height: 56px; width: min(78vw, 320px); justify-content: center; }
}

/* ============================================================= CHAPTER WIPE
   Page-to-page transition: two skewed manga panels sweep across, a chapter
   card flashes, the page jumps underneath, and the panels sweep out.     */
.wipe { position: fixed; inset: 0; z-index: 450; pointer-events: none; overflow: hidden; visibility: hidden; }
.wipe.is-active { visibility: visible; pointer-events: auto; }
.wipe__panel { position: absolute; top: -10%; bottom: -10%; left: -20%; right: -20%; transform: translateX(120%) skewX(-12deg); transition: transform .42s var(--ease-inout); }
.wipe__panel--a { background: var(--accent); }
.wipe__panel--b { background: #0e0e0d; transition-delay: .07s; }
.wipe.is-in .wipe__panel { transform: translateX(0) skewX(-12deg); }
.wipe.is-out .wipe__panel { transform: translateX(-125%) skewX(-12deg); }
.wipe.is-out .wipe__panel--a { transition-delay: .07s; }
.wipe.is-out .wipe__panel--b { transition-delay: 0s; }
.wipe__card { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: min(90vw, 900px); text-align: center; color: #efe9dc; opacity: 0; }
.wipe.is-in .wipe__card { opacity: 1; transition: opacity .1s .3s; }
.wipe.is-out .wipe__card { opacity: 0; transition: opacity .12s; }
.wipe__kanji { font-family: var(--f-jp); font-weight: 800; color: var(--accent); font-size: clamp(1rem, 3vw, 1.4rem); }
.wipe__num { display: block; font-family: var(--f-display); font-size: clamp(5rem, 22vw, 14rem); line-height: .85; color: transparent; -webkit-text-stroke: 2px #efe9dc; }
.wipe__title { display: block; font-family: var(--f-display); font-size: clamp(1.8rem, 7vw, 4.4rem); line-height: .95; text-transform: uppercase; margin-top: 8px; }
.wipe.is-in .wipe__num { animation: word-slam .38s .28s var(--ease-snap) both; }
.wipe.is-in .wipe__title { animation: name-in .36s .36s var(--ease-snap) both; }

/* ============================================================= NAV */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 120; }
.progress span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 110;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 var(--pad);
  padding-top: env(safe-area-inset-top);
  transition: transform .4s var(--ease-out), background-color .3s;
}
.topbar.is-scrolled {
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1.5px solid color-mix(in srgb, var(--ink) 18%, transparent);
}
.topbar.is-hidden { transform: translateY(-100%); }
.topbar.on-invert { --paper: var(--inv-paper); --ink: var(--inv-ink); color: var(--ink); }
.topbar.on-dark { --paper: #0b0b0a; --ink: #efe9dc; color: var(--ink); }

.stamp {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-family: var(--f-display);
  font-size: 1rem;
  letter-spacing: .02em;
  border-radius: 4px;
  transform: rotate(-5deg);
  box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 0 4px var(--accent-ink);
  transition: transform .3s var(--ease-out);
}
.stamp:hover { transform: rotate(4deg) scale(1.06); }

.topbar__chapter { display: flex; align-items: baseline; gap: 8px; min-width: 0; overflow: hidden; color: var(--ink); }
.topbar__num { color: var(--accent); font-weight: 600; }
.topbar__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; }
.topbar__name.swap { animation: name-swap .5s var(--ease-out); }
@keyframes name-swap { from { transform: translateY(100%); opacity: 0; } to { transform: none; opacity: 1; } }

.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; transition: transform .5s var(--ease-out); }
.icon-btn:hover svg { transform: rotate(-30deg); }
.index-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 16px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.index-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.index-btn__bars { display: grid; gap: 4px; }
.index-btn__bars i { display: block; width: 18px; height: 2px; background: currentColor; }
.index-btn__bars i:last-child { width: 12px; }

/* side rail (desktop) */
.rail { display: none; }
@media (min-width: 1100px) {
  .rail {
    display: block;
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
  }
  .rail ol { display: grid; gap: 6px; }
  .rail a {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    height: 22px;
    text-decoration: none;
    color: var(--ink);
    font-family: var(--f-mono);
    font-size: .66rem;
    letter-spacing: .1em;
    text-transform: uppercase;
  }
  .rail a span { opacity: 0; transform: translateX(6px); transition: opacity .25s, transform .25s var(--ease-out); background: var(--paper); padding: 2px 6px; border: 1.5px solid var(--ink); }
  .rail a i { width: 10px; height: 10px; border: 2px solid var(--ink); background: var(--paper); transform: rotate(45deg); transition: background-color .25s, transform .3s var(--ease-out); }
  .rail a:hover span, .rail a:focus-visible span { opacity: 1; transform: none; }
  .rail a[aria-current="true"] i { background: var(--accent); border-color: var(--accent); transform: rotate(45deg) scale(1.3); }
  .rail.on-invert { --paper: var(--inv-paper); --ink: var(--inv-ink); }
  .rail.on-dark { --paper: #0b0b0a; --ink: #efe9dc; }
}

/* index overlay */
.index {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--paper);
  color: var(--ink);
  padding: calc(16px + env(safe-area-inset-top)) var(--pad) 24px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.index[hidden] { display: none; }
.index__head { display: flex; align-items: center; justify-content: space-between; height: 48px; margin-bottom: 16px; }
.index__close { width: 48px; height: 48px; font-size: 2rem; line-height: 1; border: 2px solid var(--ink); display: grid; place-items: center; }
.index__close:hover { background: var(--ink); color: var(--paper); }
.index__grid {
  flex: 1;
  display: grid;
  gap: var(--gutter);
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: minmax(96px, 1fr);
}
.index__grid li:first-child { grid-column: span 2; }
@media (min-width: 900px) {
  .index__grid { grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(140px, 1fr); }
  .index__grid li:first-child { grid-column: span 2; grid-row: span 2; }
  .index__grid li:nth-child(4) { grid-column: span 2; }
}
.index__grid a {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 14px;
  border: var(--stroke) solid var(--ink);
  text-decoration: none;
  overflow: hidden;
  transition: background-color .25s, color .25s;
}
.index__grid a::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--tone) 1.1px, transparent 1.4px);
  background-size: 6px 6px;
  opacity: 0;
  transition: opacity .3s;
}
.index__grid a:hover, .index__grid a:focus-visible { background: var(--ink); color: var(--paper); }
.index__grid a[aria-current="true"] { box-shadow: inset 0 0 0 4px var(--accent); }
.index__grid .ix-num { font-family: var(--f-display); font-size: clamp(1.6rem, 5vw, 3rem); line-height: 1; }
.index__grid .ix-title { font-weight: 700; font-size: clamp(1rem, 2.2vw, 1.4rem); line-height: 1.15; position: relative; }
.index__grid .ix-label { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }
.index__grid .ix-kanji { position: absolute; right: 12px; top: 12px; font-family: var(--f-jp); font-weight: 800; opacity: .5; }
.index.is-open .index__grid li { animation: ix-in .6s var(--ease-out) both; animation-delay: calc(var(--i) * 45ms); }
@keyframes ix-in { from { clip-path: inset(0 0 100% 0); transform: translateY(14px); } to { clip-path: inset(0); transform: none; } }

/* cursor */
.cursor { display: none; }
@media (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .cursor {
    display: block;
    position: fixed;
    left: 0; top: 0;
    z-index: 400;
    pointer-events: none;
  }
  .cursor span {
    display: block;
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    transition: width .25s var(--ease-out), height .25s var(--ease-out), margin .25s var(--ease-out), background-color .25s, opacity .3s;
    opacity: 0;
  }
  .cursor.is-on span { opacity: 1; }
  .cursor.is-hover span { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: color-mix(in srgb, var(--accent) 16%, transparent); }
  .cursor.is-down span { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
}

/* ============================================================= CHAPTER SHELL */
.chapter {
  position: relative;
  isolation: isolate;
  padding: calc(var(--topbar-h) + 48px) var(--pad) 96px;
}
.chapter > * { max-width: var(--maxw); margin-inline: auto; }
.chapter > .speedlines { max-width: none; margin: 0; }
@media (min-width: 1100px) { .chapter { padding-right: calc(var(--pad) + 40px); } }

.chapter__head {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  gap: 16px;
  margin-bottom: 36px;
}
/* mobile: the big outlined number sits behind the title like a page watermark */
.chapter__head > .chapter__num { position: absolute; right: -6px; top: -34px; z-index: -1; opacity: .55; }
@media (min-width: 720px) {
  .chapter__head { grid-template-columns: auto 1fr; margin-bottom: 40px; }
  .chapter__head > .chapter__num { position: static; opacity: 1; z-index: auto; }
}
.chapter__num {
  font-family: var(--f-display);
  font-size: clamp(6rem, 16vw, 11rem);
  line-height: .8;
  color: transparent;
  -webkit-text-stroke: 2px var(--ink);
  letter-spacing: -.03em;
  transform: translateY(var(--py, 0));
}
.chapter__head.in .chapter__num { animation: num-in 1s var(--ease-out) both; }
@keyframes num-in { from { opacity: 0; translate: 50px 0; } }
.chapter__kanji { font-family: var(--f-jp); font-weight: 800; font-size: 1.05rem; color: var(--accent); margin-bottom: 4px; }
.chapter__kanji .mono { color: var(--muted); font-family: var(--f-mono); }
.chapter__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(2.1rem, 7vw, 4.6rem);
  line-height: .95;
  letter-spacing: -.01em;
  text-transform: uppercase;
}
.chapter__sub { margin-top: 10px; max-width: 56ch; color: var(--ink-2); font-size: 1.02rem; }

/* ============================================================= 00 · HERO — key visual
   Deliberately minimal: one sky, one orb (sun by day, moon by night), the
   protagonist, and the title. The character watches the cursor and powers
   up when poked.                                                         */
.chapter.hero {
  --kv-sky: radial-gradient(ellipse 60% 55% at 68% 48%, #f6d9bf 0%, #f3e8d8 55%, #f5efe4 85%);
  --kv-orb: radial-gradient(circle at 42% 38%, #ef6a4f 0%, #e3432e 65%, #cf3822 100%);
  --kv-orb-glow: none;
  --kv-silhouette: #141312;
  --kv-rim: #fff6ea;
  --kv-phones: #3a3632;
  --kv-stars: 0;
  --kv-fade: linear-gradient(90deg, #f5efe4 0%, rgba(245, 239, 228, .6) 38%, transparent 58%);
  --paper: #f5efe4; --paper-2: #ebe1d0; --ink: #141312; --ink-2: #3a3834; --muted: #6c685f; --accent: #e0402f;
  --hud: rgba(245, 239, 228, .75);
  position: relative;
  height: 100svh;
  min-height: 600px;
  padding: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chapter.hero {
    --kv-sky: radial-gradient(ellipse 60% 55% at 68% 48%, #1c1a17 0%, #0f0e0d 55%, #0b0b0a 85%);
    --kv-orb: radial-gradient(circle at 42% 40%, #faf6ee 0%, #ece3d2 60%, #d9ccb6 100%);
    --kv-orb-glow: 0 0 90px 10px rgba(239, 233, 220, .1);
    --kv-silhouette: #060606;
    --kv-rim: #f6efe2;
    --kv-phones: #26221f;
    --kv-stars: 1;
    --kv-fade: linear-gradient(90deg, #0b0b0a 0%, rgba(11, 11, 10, .6) 38%, transparent 58%);
    --paper: #0b0b0a; --paper-2: #151412; --ink: #efe9dc; --ink-2: #bdb6a8; --muted: #8e897f; --accent: #e8432f;
    --hud: rgba(11, 11, 10, .6);
  }
}
:root[data-theme="dark"] .chapter.hero {
    --kv-sky: radial-gradient(ellipse 60% 55% at 68% 48%, #1c1a17 0%, #0f0e0d 55%, #0b0b0a 85%);
    --kv-orb: radial-gradient(circle at 42% 40%, #faf6ee 0%, #ece3d2 60%, #d9ccb6 100%);
    --kv-orb-glow: 0 0 90px 10px rgba(239, 233, 220, .1);
    --kv-silhouette: #060606;
    --kv-rim: #f6efe2;
    --kv-phones: #26221f;
    --kv-stars: 1;
    --kv-fade: linear-gradient(90deg, #0b0b0a 0%, rgba(11, 11, 10, .6) 38%, transparent 58%);
    --paper: #0b0b0a; --paper-2: #151412; --ink: #efe9dc; --ink-2: #bdb6a8; --muted: #8e897f; --accent: #e8432f;
    --hud: rgba(11, 11, 10, .6);
}
.chapter.hero > .kv { max-width: none; margin: 0; }
.kv { position: relative; height: 100%; overflow: hidden; isolation: isolate; }
.kv__sky { position: absolute; inset: 0; background: var(--kv-sky); pointer-events: none; }
.kv__sky::after { content: ""; position: absolute; inset: 0; background: var(--kv-fade); }
.kv__stars { position: absolute; inset: 0 0 45% 0; opacity: var(--kv-stars); }
.kv__stars i { position: absolute; left: var(--x); top: var(--y); width: 1.5px; height: 1.5px; border-radius: 50%; background: #efe9dc; opacity: .5; }
.kv__layer { position: absolute; inset: 0; transform: translate3d(var(--px, 0px), var(--py, 0px), 0); will-change: transform; pointer-events: none; }
.kv__orb {
  position: absolute;
  left: 70%;
  top: 46%;
  width: min(62vh, 46vw);
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: var(--kv-orb);
  box-shadow: var(--kv-orb-glow);
}

/* ---- the companion: a floating robot drawn in the site's ink, paper and one red */
.chapter.hero, .profile__portrait, .op__bot {
  --ch-line: #141312;
  --ch-shell: #f7f1e6;
  --ch-shade: #e6dccb;
  --ch-dark: #1c1a18;
  --ch-tone: rgba(20, 19, 18, .16);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.chapter.hero, .profile__portrait, .op__bot) { --ch-shell: #ece4d4; --ch-shade: #d3c7b3; } }
:root[data-theme="dark"] :is(.chapter.hero, .profile__portrait, .op__bot) { --ch-shell: #ece4d4; --ch-shade: #d3c7b3; }
.kv__char-layer { z-index: 3; }
.kv__char { position: absolute; right: 2vw; bottom: 0; height: 94%; aspect-ratio: 600 / 800; pointer-events: none; }
.kv__hero { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.kv__tone-dot { fill: var(--ch-tone); }
.kv__tone { fill: url(#kv-tone); }
.kv__shell { fill: var(--ch-shell); stroke: var(--ch-line); stroke-width: 5; stroke-linejoin: round; }
.kv__head-tone { fill: var(--ch-shade); }
.kv__arm { fill: var(--ch-shell); stroke: var(--ch-line); stroke-width: 5; stroke-linejoin: round; }
.kv__hand { fill: var(--ch-dark); stroke: var(--ch-line); stroke-width: 4; }
.kv__neck { fill: var(--ch-dark); }
.kv__thruster { fill: var(--ch-dark); stroke: var(--ch-line); stroke-width: 4; stroke-linejoin: round; }
.kv__flame { fill: var(--accent); transform-box: fill-box; transform-origin: 50% 0; animation: flame .18s steps(2) infinite alternate; }
.kv__flame--in { fill: #ffd2a6; animation-duration: .13s; }
@keyframes flame { from { transform: scaleY(.82) scaleX(1.04); } to { transform: scaleY(1.08) scaleX(.94); } }
.kv__shadow { fill: var(--ink); opacity: .14; transform-box: fill-box; transform-origin: center; animation: shadow 4s ease-in-out infinite; }
@keyframes shadow { 50% { transform: scale(.8); opacity: .08; } }
.kv__float { animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-14px); } }
.kv__scarf { fill: var(--accent); stroke: var(--ch-line); stroke-width: 4; stroke-linejoin: round; }
.kv__screen { fill: var(--ch-dark); stroke: var(--ch-line); stroke-width: 4; }
.kv__prompt { font-family: var(--f-mono); font-size: 26px; font-weight: 600; fill: var(--accent); }
.kv__caret { fill: #efe9dc; animation: caret 1s steps(1) infinite; }
.kv__led { fill: var(--accent); stroke: var(--ch-line); stroke-width: 3; }
.kv__led--off { fill: var(--ch-shade); }
.kv__hanko rect { fill: none; stroke: var(--accent); stroke-width: 4; }
.kv__hanko text { font-family: var(--f-display); font-size: 19px; fill: var(--accent); text-anchor: middle; }
.kv__ear { fill: var(--accent); stroke: var(--ch-line); stroke-width: 5; }
.kv__ear-in { fill: var(--ch-dark); }
.kv__antenna { transform-box: view-box; transform-origin: 370px 172px; animation: antenna 3s ease-in-out infinite; }
@keyframes antenna { 0%, 100% { rotate: -6deg; } 50% { rotate: 7deg; } }
.kv__stalk { fill: none; stroke: var(--ch-line); stroke-width: 6; stroke-linecap: round; }
.kv__bulb { fill: var(--accent); stroke: var(--ch-line); stroke-width: 5; }
.kv__visor { fill: var(--ch-dark); stroke: var(--ch-line); stroke-width: 5; }
.kv__visor-shine { fill: none; stroke: rgba(239, 233, 220, .55); stroke-width: 4; stroke-linecap: round; }
.kv__lens { fill: #2e2a26; }
.kv__iris { transition: transform .08s linear; }
.kv__iris-ring { fill: var(--accent); }
.kv__iris-deep { fill: #9e2616; }
.kv__pupil { fill: #0a0a0a; }
.kv__glint { fill: #fff; }
.kv__lid { fill: var(--ch-dark); transform-box: fill-box; transform-origin: 50% 0; transform: scaleY(0); }
.kv__eye.is-blink .kv__lid { animation: lid .22s ease-in-out; }
@keyframes lid { 50% { transform: scaleY(1); } }
.kv__blush { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; opacity: .7; }
.kv__mouth { fill: none; stroke: var(--ch-line); stroke-width: 4; stroke-linecap: round; }
.kv__head { transform-box: view-box; transform-origin: 370px 390px; }
.kv__head-intro { transform-box: view-box; transform-origin: 370px 390px; }
.kv__torso { transform-box: view-box; transform-origin: 370px 604px; }
.kv__char.is-power .kv__bulb { animation: bulb .5s steps(2) 2; }
@keyframes bulb { 50% { fill: #fff; } }
.kv__char.is-power .kv__flame { animation-duration: .07s; }
.kv__char.is-power .kv__float { animation: hop .6s var(--ease-out); }
@keyframes hop { 30% { transform: translateY(-40px); } 100% { transform: none; } }

.kv__aura use { fill: none; stroke: var(--accent); stroke-width: 14; stroke-linejoin: round; }
.kv__aura { opacity: 0; transition: opacity .35s; }
.kv__char.is-hover .kv__aura { opacity: 0; }
.kv__char.is-power .kv__aura { animation: aura 1.1s var(--ease-out); }

.kv__char.is-power .kv__head { animation: jolt .45s; }
@keyframes aura { 0% { opacity: 1; } 60% { opacity: 1; } 100% { opacity: 0; } }
@keyframes jolt { 20% { translate: -4px 2px; } 45% { translate: 3px -2px; } 70% { translate: -2px 1px; } 100% { translate: 0 0; } }

.kv__poke {
  position: absolute;
  left: 34%;
  top: 11%;
  width: 54%;
  height: 70%;
  border-radius: 45%;
  pointer-events: auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.kv__poke:focus-visible { outline-offset: -6px; }
.kv__speech {
  position: absolute;
  left: 38%;
  top: 20%;
  translate: -100% 0;
  max-width: 220px;
  padding: 12px 16px;
  background: #fbf7ee;
  color: #141312;
  border: 3px solid #141312;
  border-radius: 999px / 70%;
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  scale: .4;
  transform-origin: 100% 60%;
  transition: opacity .2s, scale .35s var(--ease-out);
  pointer-events: none;
}
.kv__speech::after { content: ""; position: absolute; right: -16px; top: 55%; border-style: solid; border-width: 8px 0 8px 18px; border-color: transparent transparent transparent #141312; }
.kv__speech.is-on { opacity: 1; scale: 1; }
.kv__hint {
  position: absolute;
  left: 38%;
  top: 14%;
  translate: -100% 0;
  padding: 4px 8px;
  color: var(--accent);
  font-size: .62rem;
  opacity: 0;
  pointer-events: none;
}
.is-playing .kv__hint { animation: hint 5s 4s ease-in-out both; }
.kv__char.was-poked .kv__hint { display: none; }
@keyframes hint { 0%, 100% { opacity: 0; } 12%, 85% { opacity: 1; } }


/* ---- title */
.kv__title { position: absolute; z-index: 5; left: var(--pad); top: 50%; translate: 0 -46%; width: min(42vw, 600px); container-type: inline-size; }
.kv__kicker { color: var(--accent); margin-bottom: 20px; }
.kv__name { font-family: var(--f-display); font-weight: 400; text-transform: uppercase; line-height: .86; letter-spacing: -.02em; color: var(--ink); cursor: default; }
.kv__name .hero__line { display: block; white-space: nowrap; }
.kv__name .hero__line:first-child { font-size: calc(100cqi / 8.05); }
.kv__name .hero__line--outline { font-size: calc(100cqi / 4.45); color: var(--accent); margin-top: .02em; }
.kv__name .ch { display: inline-block; }
.is-playing .kv__name .ch { animation: ch-slam .7s var(--ease-out) both; animation-delay: calc(var(--i) * 40ms + .5s); }
@keyframes ch-slam {
  0% { opacity: 0; transform: translateY(-40%) scale(1.4) rotate(-5deg); filter: blur(4px); }
  60% { opacity: 1; filter: none; }
  100% { opacity: 1; transform: none; }
}
.kv__tagline { margin-top: 24px; max-width: 34ch; font-size: clamp(1.02rem, 1.3vw, 1.2rem); line-height: 1.5; color: var(--ink-2); }
.kv__tagline p { min-height: 3em; }
.kv__tagline p::after { content: "▍"; color: var(--accent); margin-left: 2px; animation: caret 1s steps(1) infinite; }
.kv__tagline.is-done p::after { content: none; }
@keyframes caret { 50% { opacity: 0; } }

/* class: one clear line, four quiet switches */
.kv__class { margin: 26px 0 30px; padding-left: 14px; border-left: 2px solid var(--accent); }
.kv__class-desc { display: none; }
.kv__class-desc b { color: var(--ink); font-weight: 700; }
.kv__class-desc.swap { animation: role-swap .45s var(--ease-out); }
@keyframes role-swap { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
.kv__class-tabs { display: flex; gap: 18px; margin-top: 10px; }
.kv__tab { position: relative; padding: 4px 0 6px; font-family: var(--f-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kv__tab > span { display: flex; gap: 6px; }
.kv__tab b { font-weight: 400; opacity: .6; }
.kv__tab em { font-style: normal; }
.kv__tab .l { display: none; }
.kv__tab[aria-selected="true"] .l { display: inline; }
.kv__tab[aria-selected="true"] .s { display: none; }
.kv__tab:hover { color: var(--ink); }
.kv__tab[aria-selected="true"] { color: var(--ink); }
.kv__tab i { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: color-mix(in srgb, var(--ink) 15%, transparent); }
.kv__tab i::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
.kv__tab[aria-selected="true"] i::after { animation: tab-timer var(--cycle, 3.6s) linear forwards; }
.kv__class.is-paused .kv__tab i::after { animation-play-state: paused; }
@keyframes tab-timer { to { transform: scaleX(1); } }

/* CTAs */
.kv__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px; }
.kv-cta { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; font-weight: 700; font-size: 1rem; text-decoration: none; transition: transform .25s var(--ease-out), background-color .25s, color .25s, gap .25s var(--ease-out); }
.kv-cta--primary { padding: 0 26px; background: var(--accent); color: #fff8f0; }
.kv-cta--primary:hover { transform: translateY(-2px); gap: 14px; }
.kv-cta--ghost { color: var(--ink); border-bottom: 2px solid color-mix(in srgb, var(--ink) 25%, transparent); min-height: 40px; }
.kv-cta--ghost:hover { border-color: var(--accent); gap: 14px; }
/* stats: three big numbers */
.kv__stats { display: flex; gap: clamp(18px, 3vw, 40px); margin-top: 30px; }
.kv__stat { display: grid; gap: 4px; padding-left: 12px; border-left: 2px solid var(--accent); }
.kv__stat b { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.9rem, 3.2vw, 2.8rem); line-height: 1; color: var(--ink); }
.kv__stat b small { font-size: .55em; color: var(--accent); margin-left: 1px; }
.kv__stat span { font-family: var(--f-mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* entrance: a slow fade up, then the title */
.js .kv__orb { opacity: 0; scale: .9; transition: opacity 1.4s .1s, scale 2s var(--ease-out) .1s; }
.is-playing .kv__orb { opacity: 1; scale: 1; }
.js .kv__char { opacity: 0; translate: 5% 0; transition: opacity 1.2s .3s, translate 1.8s var(--ease-out) .3s; }
.is-playing .kv__char { opacity: 1; translate: 0 0; }
.js .kv__title > :not(.kv__name) { opacity: 0; translate: 0 12px; transition: opacity .8s, translate .9s var(--ease-out); }
.is-playing .kv__title > :not(.kv__name) { opacity: 1; translate: 0 0; }
.is-playing .kv__title > .kv__kicker { transition-delay: .35s; }
.is-playing .kv__title > .kv__tagline { transition-delay: 1s; }
.is-playing .kv__title > .kv__class { transition-delay: 1.15s; }
.is-playing .kv__title > .kv__cta { transition-delay: 1.3s; }
.is-playing .kv__title > .kv__stats { transition-delay: 1.45s; }

@keyframes shake {
  10% { translate: -7px 3px; } 25% { translate: 6px -4px; } 40% { translate: -4px 2px; }
  55% { translate: 3px -1px; } 75% { translate: -1px 1px; } 100% { translate: 0 0; }
}

/* ---- arrival after the story: the sun/moon is already there (it was the
   pupil); the character rises into frame, lifts his head, opens his eyes */
.intro-full .kv__orb { opacity: 1; scale: 1; transition: none; }
.intro-full .kv__char { translate: 6% 5%; transition: opacity .8s .05s, translate 1.4s var(--ease-out) .05s; }
.intro-full.is-playing .kv__char { translate: 0 0; }
.intro-full .kv__head-intro { transform: rotate(10deg) translateY(10px); }
.intro-full.is-playing .kv__head-intro { transform: none; transition: transform 1.5s var(--ease-out) .35s; }
.intro-full:not(.is-playing) .kv__lid { transform: scaleY(1); }
.intro-full.is-playing .kv__lid { animation: lid-open .4s 1.05s var(--ease-out) both; }
.intro-full.is-playing .kv__name .ch { animation-delay: calc(var(--i) * 40ms + .55s); }

/* ---- arrival after Skip: one quick, quiet rise; nothing slams */
.intro-quick.is-playing .kv { animation: kv-rise .9s var(--ease-out) both; }
@keyframes kv-rise { from { transform: translateY(7vh); } }
.intro-quick .kv__orb, .intro-quick .kv__char { transition-duration: .8s; transition-delay: .1s; }
.intro-quick.is-playing .kv__title > :not(.kv__name) { transition: opacity .5s var(--ease-out), translate .7s var(--ease-out); transition-delay: calc(var(--k, 0) * 55ms + .2s); }
.intro-quick.is-playing .kv__name .ch { animation: ch-quick .6s var(--ease-out) both; animation-delay: calc(var(--i) * 14ms + .1s); }
@keyframes ch-quick { from { opacity: 0; transform: translateY(35%); } }
.intro-quick .kv__tagline p::after { content: none; }


/* ---- the name: letters ripple on hover; click makes the robot do its special move */
.kv__name { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.kv__name .ch { transition: translate .35s var(--ease-out), color .25s, text-shadow .25s; transition-delay: calc(var(--i) * 28ms); }
.kv__name.wave .ch { translate: 0 -16%; }
.kv__name.wave .hero__line:first-child .ch { color: var(--accent); }
.kv__name.wave .hero__line--outline .ch { color: var(--ink); }
.kv__name .ch:hover { translate: 0 -22%; transition-delay: 0s; }
.kv__name.shock .ch { animation: ch-shock .55s var(--ease-snap) both; animation-delay: calc(var(--i) * 22ms); }
@keyframes ch-shock { 0% { transform: none; } 35% { transform: translateY(-30%) rotate(-8deg) scale(1.15); } 70% { transform: translateY(6%) rotate(3deg); } 100% { transform: none; } }

.kv__char.is-super .kv__float { animation: super-move 1.5s var(--ease-out); transform-box: view-box; transform-origin: 370px 430px; }
@keyframes super-move {
  0% { transform: none; }
  18% { transform: translateY(24px) scale(1.04, .92); }
  38% { transform: translateY(-110px) rotate(-20deg); }
  62% { transform: translateY(-140px) rotate(340deg) scale(1.08); }
  80% { transform: translateY(8px) rotate(360deg) scale(1.02, .96); }
  100% { transform: rotate(360deg); }
}
.kv__char.is-super .kv__flame { animation: super-flame .12s steps(2) infinite alternate; }
@keyframes super-flame { from { transform: scaleY(1.6) scaleX(1.2); } to { transform: scaleY(2.4) scaleX(.9); } }
.kv__char.is-super .kv__iris-ring { animation: lens-charge .18s steps(2) 6; }
@keyframes lens-charge { 50% { fill: #fff; } }
.kv__char.is-super .kv__bulb { animation: bulb .2s steps(2) 6; }
.kv__char.is-super .kv__burst { animation: kv-burst 1.4s var(--ease-out); }
.kv__char.is-super .kv__aura { animation: aura 1.5s var(--ease-out); }
.kv__char.is-super .kv__shadow { animation: shadow-super 1.5s var(--ease-out); }
@keyframes shadow-super { 40%, 65% { transform: scale(.45); opacity: .05; } }

/* portrait: character above, title below */
@media (max-width: 719px), (orientation: portrait) and (max-width: 1099px) {
  .kv__sky::after { background: linear-gradient(0deg, var(--paper) 42%, color-mix(in srgb, var(--paper) 70%, transparent) 52%, transparent 64%); }
  .kv__orb { left: 62%; top: 26%; width: min(78vw, 480px); }
  .kv__char { height: 46%; right: -12vw; bottom: auto; top: 6%; }
  .kv__char-layer { z-index: auto; }
  .kv__sky::after { z-index: 4; }
  .kv__sky { z-index: auto; }
  .kv__title { top: auto; translate: none; left: var(--pad); right: var(--pad); width: auto; bottom: calc(86px + env(safe-area-inset-bottom)); }
  .kv__kicker { margin-bottom: 14px; }
  .kv__tagline { margin-top: 16px; font-size: 1rem; }
  .kv__tagline p { min-height: 0; }
  .kv__class { margin: 18px 0 22px; }
  .kv__cta { gap: 12px 22px; }
  .kv-cta--primary { flex: 1 1 auto; justify-content: center; }
  .kv__stats { margin-top: 18px; justify-content: space-between; gap: 10px; }
  .kv__stat b { font-size: 1.8rem; }
  .kv__stat span { font-size: .58rem; }
  .kv__speech { left: 2%; top: 30%; translate: -62% 0; font-size: .8rem; padding: 8px 12px; max-width: 150px; white-space: normal; z-index: 6; }
  .kv__hint { top: 26%; left: 10%; }
}
@media (min-width: 720px) and (orientation: portrait) and (max-width: 1099px) {
  .kv__title { right: auto; width: min(76vw, 600px); bottom: 7vh; }
  .kv__char { right: -6vw; height: 54%; }
}
@media (max-height: 620px) and (orientation: landscape) {
  .kv__tagline, .kv__stats { display: none; }
}

/* ============================================================= 01 · PROFILE */
.profile {
  display: grid;
  gap: var(--gutter);
  grid-template-columns: 1fr;
}
.profile__card { display: grid; grid-template-columns: 1fr; }
.profile__portrait {
  position: relative;
  aspect-ratio: 4 / 4.2;
  border-bottom: var(--stroke) solid var(--ink);
  overflow: hidden;
  background: var(--paper-2);
}
.profile__portrait img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.1); }
.profile__portrait .speedlines { opacity: .16; }
.profile__portrait .kv__aura { display: none; }
.profile__portrait svg.sil { position: absolute; left: 50%; bottom: 0; width: 100%; height: 100%; transform: translateX(-50%); }
.sil__body { fill: var(--ink); }
.sil__tone { fill: url(#sil-tone); }
.sil__rim { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.sil__eye { fill: var(--paper); }
.sil__collar { fill: none; stroke: var(--paper); stroke-width: 3; opacity: .6; }
.profile__badge {
  position: absolute;
  top: 14px;
  left: 14px;
}
.profile__id { padding: 18px 18px 20px; container-type: inline-size; }
.profile__name { font-family: var(--f-display); font-weight: 400; font-size: min(2.4rem, calc(100cqi / 8.1)); line-height: 1; text-transform: uppercase; }
.profile__kata { font-family: var(--f-jp); font-weight: 700; color: var(--muted); margin-top: 6px; letter-spacing: .08em; }

.sheet { display: grid; gap: var(--gutter); }
.sheet__block { padding: 18px 18px 20px; }
.sheet__label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.sheet__label::after { content: ""; flex: 1; height: 1.5px; background: currentColor; opacity: .5; }

.dl { display: grid; gap: 10px; }
.dl div { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: baseline; border-bottom: 1.5px dashed color-mix(in srgb, var(--ink) 20%, transparent); padding-bottom: 10px; }
.dl div:last-child { border-bottom: 0; padding-bottom: 0; }
.dl dt { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.dl dd { margin: 0; font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border: 2px solid var(--ink); }
.stats li { padding: 14px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.stats li:nth-child(2n) { border-right: 0; }
.stats li:nth-last-child(-n+2) { border-bottom: 0; }
.stats strong { display: block; font-family: var(--f-display); font-weight: 400; font-size: 2rem; line-height: 1; }
.stats span { display: block; margin-top: 6px; font-family: var(--f-mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
@media (min-width: 560px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stats li { border-bottom: 0; }
  .stats li:nth-child(2n) { border-right: 2px solid var(--ink); }
  .stats li:last-child { border-right: 0; }
}

.backstory { display: grid; gap: 12px; }
.backstory .narration { font-size: 1rem; }
.backstory .narration:nth-child(2) { margin-left: 6%; }
.backstory .narration:nth-child(3) { margin-left: 12%; background: var(--ink); color: var(--paper); border-color: var(--ink); }

.traits { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .traits { grid-template-columns: 1fr 1fr; } }
.trait {
  position: relative;
  padding: 14px 14px 14px 48px;
  border: 2px solid var(--ink);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.trait:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--accent); }
.trait::before {
  content: attr(data-n);
  position: absolute;
  left: 12px;
  top: 12px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-mono);
  font-size: .7rem;
  transform: rotate(45deg);
}
.trait strong { display: block; font-size: 1rem; }
.trait span { color: var(--ink-2); font-size: .9rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; padding: 6px 12px; border: 2px solid var(--ink); border-radius: 999px; font-weight: 600; font-size: .9rem; }

@media (min-width: 900px) {
  .profile { grid-template-columns: minmax(300px, 4fr) 8fr; align-items: start; }
  .profile__card { position: sticky; top: calc(var(--topbar-h) + 16px); }
  .sheet { grid-template-columns: 1fr 1fr; }
  .sheet__block--wide { grid-column: 1 / -1; }
}

/* ============================================================= 02 · PROJECTS */
.project-page {
  display: grid;
  gap: var(--gutter);
  grid-template-columns: 1fr;
}
.pcard {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 380px;
  padding: 0;
  text-align: left;
  cursor: pointer;
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out);
}
.pcard:hover, .pcard:focus-visible { transform: translate(-4px, -4px); box-shadow: 8px 8px 0 var(--ink); }
.pcard:focus-visible { outline-offset: 6px; }
.pcard__art {
  position: relative;
  flex: 1;
  min-height: 200px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-bottom: var(--stroke) solid var(--ink);
  background: var(--paper-2);
}
.pcard__art img { width: 100%; height: 100%; object-fit: cover; object-position: left top; position: absolute; inset: 0; z-index: 1; }
.pcard__art .art { width: min(78%, 360px); height: auto; transition: transform .7s var(--ease-out); }
.pcard:hover .pcard__art .art { transform: scale(1.06) rotate(-1.5deg); }
.pcard .speedlines { opacity: 0; }
.pcard:hover .speedlines, .pcard:focus-visible .speedlines { opacity: .16; }
.pcard__no {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}
.pcard__status { position: absolute; top: 12px; right: 12px; z-index: 2; }
.pcard__body { padding: 18px 18px 20px; display: grid; gap: 10px; }
.pcard__name { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1; text-transform: uppercase; }
.pcard__sub { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pcard__tag { color: var(--ink-2); max-width: 46ch; }
.pcard__stack { display: flex; flex-wrap: wrap; gap: 6px; }
.pcard__cta {
  position: absolute;
  right: 16px;
  bottom: calc(100% - 0px);
  z-index: 3;
  font-weight: 700;
  font-size: .9rem;
  padding: 10px 16px;
  transform: scale(.4) translateY(20px);
  transform-origin: 20% 100%;
  opacity: 0;
  transition: transform .35s var(--ease-out), opacity .25s;
  pointer-events: none;
}
.pcard__body { position: relative; }
.pcard:hover .pcard__cta, .pcard:focus-visible .pcard__cta { transform: none; opacity: 1; }
@media (hover: none) {
  .pcard__cta { transform: none; opacity: 1; position: static; justify-self: start; margin-top: 10px; }
  .pcard__cta::before, .pcard__cta::after { display: none; }
  .pcard__cta { border-radius: 0; border-width: 2px; background: var(--ink); color: var(--paper); padding: 8px 14px; order: 10; }
}

.pcard--soon {
  min-height: 0;
  cursor: default;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  border-style: dashed;
  background: transparent;
}
.pcard--soon:hover { transform: none; box-shadow: none; }
.pcard--soon .pcard__name { font-size: clamp(1.4rem, 4vw, 2rem); }
.pcard--soon p { color: var(--ink-2); }
.pcard--soon .dots::after { content: "..."; animation: dots 1.6s steps(4) infinite; display: inline-block; width: 1.4em; overflow: hidden; vertical-align: bottom; white-space: nowrap; }
@keyframes dots { from { width: 0; } to { width: 1.4em; } }

@media (min-width: 720px) {
  .project-page { grid-template-columns: repeat(12, 1fr); }
  .pcard:nth-child(1) { grid-column: span 7; grid-row: span 2; min-height: 620px; }
  .pcard:nth-child(2) { grid-column: span 5; }
  .pcard:nth-child(3) { grid-column: span 5; }
  .pcard:nth-child(n+4) { grid-column: span 6; }
  .pcard.pcard--soon { grid-column: 1 / -1; grid-template-columns: auto 1fr auto; gap: 24px; }
  .pcard:nth-child(2) .pcard__art, .pcard:nth-child(3) .pcard__art { min-height: 150px; }
}

/* project art (inline SVG illustrations) */
.art { overflow: visible; }
.art .ink { fill: var(--ink); }
.art .paper { fill: var(--paper); }
.art .accent { fill: var(--accent); }
.art .line { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.art .line-thin { fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
.art .line-accent { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; }
.art .tonefill { fill: url(#art-tone); }
.art .bubble-rise { animation: rise 3.2s ease-in infinite; }
.art .bubble-rise:nth-of-type(2) { animation-delay: 1.1s; }
.art .bubble-rise:nth-of-type(3) { animation-delay: 2s; }
@keyframes rise { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-60px); opacity: 0; } }
.art .spin { transform-box: fill-box; transform-origin: center; animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.art .pulse { transform-box: fill-box; transform-origin: center; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.art .blink-caret { animation: caret 1s steps(1) infinite; }

/* ============================================================= READER */
.reader { position: fixed; inset: 0; z-index: 320; display: grid; place-items: end center; }
.reader[hidden] { display: none; }
.reader__backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--c-night) 70%, transparent);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade .35s ease both;
}
@keyframes fade { from { opacity: 0; } }
.reader__page {
  position: relative;
  width: 100%;
  max-height: 94svh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--paper);
  color: var(--ink);
  border-top: var(--stroke) solid var(--ink);
  padding: 0 16px 28px;
  animation: page-up .55s var(--ease-out) both;
}
.reader__page:focus { outline: none; }
.reader__page[data-turn="next"] { animation: turn-next .5s var(--ease-out) both; }
.reader__page[data-turn="prev"] { animation: turn-prev .5s var(--ease-out) both; }
@keyframes turn-next { from { transform: translateX(24%) rotate(1.5deg); opacity: 0; clip-path: inset(0 0 0 60%); } to { transform: none; opacity: 1; clip-path: inset(0); } }
@keyframes turn-prev { from { transform: translateX(-24%) rotate(-1.5deg); opacity: 0; clip-path: inset(0 60% 0 0); } to { transform: none; opacity: 1; clip-path: inset(0); } }
.reader__hint { display: none; }
@media (hover: none) { .reader__hint { display: inline; color: var(--muted); } }
@keyframes page-up { from { transform: translateY(40px); opacity: 0; clip-path: inset(100% 0 0 0); } to { transform: none; opacity: 1; clip-path: inset(0); } }
@media (min-width: 900px) {
  .reader { place-items: center; padding: 32px; }
  .reader__page {
    max-width: 1120px;
    max-height: calc(100svh - 64px);
    border: var(--stroke) solid var(--ink);
    box-shadow: 12px 12px 0 var(--accent);
    padding: 0 32px 36px;
  }
}
.reader__bar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  margin-bottom: 20px;
}
.reader__bar .mono { color: var(--muted); }
.reader__bar .mono b { color: var(--accent); font-weight: 600; }
.reader__nav { margin-left: auto; display: flex; gap: 6px; }
.reader__nav button {
  height: 40px;
  min-width: 40px;
  padding: 0 10px;
  border: 2px solid var(--ink);
  font-weight: 700;
  display: grid;
  place-items: center;
}
.reader__nav button:hover { background: var(--ink); color: var(--paper); }
.reader__nav button:disabled { opacity: .3; pointer-events: none; }

.rgrid { display: grid; gap: var(--gutter); grid-template-columns: 1fr; }
.rpanel { padding: 18px; }
.rhead { display: grid; gap: 10px; }
.rhead h3 { font-family: var(--f-display); font-weight: 400; font-size: clamp(2.6rem, 9vw, 5.2rem); line-height: .9; text-transform: uppercase; }
.rhead .rsub { font-family: var(--f-mono); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.rhead .rtag { font-size: 1.2rem; font-weight: 600; max-width: 34ch; }
.rart { position: relative; min-height: 240px; display: grid; place-items: center; background: var(--paper-2); overflow: hidden; }
.rart .art { width: min(80%, 380px); }
.rart img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.rlabel { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; display: block; }
.rproblem { background: var(--ink); color: var(--paper); border-color: var(--ink); font-size: 1.08rem; }
.rproblem .rlabel { color: var(--accent); }
.rfeatures ol { counter-reset: f; display: grid; gap: 10px; }
.rfeatures li { counter-increment: f; display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: baseline; padding-bottom: 10px; border-bottom: 1.5px dashed color-mix(in srgb, var(--ink) 22%, transparent); }
.rfeatures li:last-child { border-bottom: 0; padding-bottom: 0; }
.rfeatures li::before { content: counter(f, decimal-leading-zero); font-family: var(--f-mono); font-size: .75rem; color: var(--accent); font-weight: 600; }
.rlinks { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; }
.rlinks .note { font-size: .85rem; color: var(--muted); width: 100%; }
.rfooter { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.rfooter .next { font-weight: 700; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.rfooter .next:hover { text-decoration-color: var(--accent); }

@media (min-width: 900px) {
  .rgrid { grid-template-columns: repeat(12, 1fr); }
  .rhead { grid-column: span 5; align-content: end; }
  .rart { grid-column: span 7; grid-row: span 2; min-height: 360px; }
  .rproblem { grid-column: span 5; }
  .rrole { grid-column: span 4; }
  .rstack { grid-column: span 4; }
  .rlinkp { grid-column: span 4; }
  .rfeatures { grid-column: span 7; grid-row: span 2; }
  .routcome { grid-column: span 5; }
  .rrole, .rstack, .rlinkp { grid-column: span 5; }
}
@media (min-width: 900px) {
  .rgrid { grid-template-areas: none; }
}

/* ============================================================= 03 · JOURNEY */
.journey { padding-bottom: 72px; }
.journey__pin > .chapter__head { max-width: var(--maxw); margin-inline: auto; }
.journey__count { display: none; }
.journey__track {
  position: relative;
  display: grid;
  gap: var(--gutter);
  max-width: 720px;
  margin: 0 auto;
}
/* mobile: vertical "webtoon" strip — a spine down the left */
.journey__track::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: repeating-linear-gradient(to bottom, var(--ink) 0 10px, transparent 10px 18px);
}
.jcard {
  position: relative;
  margin-left: 52px;
  --stem: 24px;
}
.jcard__dot {
  position: absolute;
  left: -44px;
  top: 22px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 3px solid var(--ink);
  transform: rotate(45deg);
  z-index: 1;
  transition: background-color .35s, border-color .35s, color .35s, scale .35s var(--ease-snap);
}
.jcard__dot span { transform: rotate(-45deg); font-family: var(--f-mono); font-size: .62rem; font-weight: 600; }
.jcard.is-seen .jcard__dot { background: var(--ink); color: var(--paper); }
.jcard.is-current .jcard__dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); scale: 1.2; }
.jcard__panel { padding: 16px 18px 20px; display: grid; gap: 6px; height: 100%; box-shadow: 5px 5px 0 color-mix(in srgb, var(--ink) 16%, transparent); transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out); }
.jcard:hover .jcard__panel { transform: translate(-3px, -3px); box-shadow: 8px 8px 0 var(--accent); }
.jcard__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.jcard__kind { padding: 3px 8px; background: var(--ink); color: var(--paper); font-family: var(--f-mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; }
.jcard__ch { font-family: var(--f-mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.jcard__now { display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.jcard__now i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: onair 1.4s ease-in-out infinite; }
.jcard__when { font-family: var(--f-display); font-size: clamp(1.9rem, 3vw, 2.7rem); line-height: 1; color: transparent; -webkit-text-stroke: 1.5px var(--ink); margin-top: 2px; }
.jcard__title { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.02; text-transform: uppercase; margin-top: 6px; }
.jcard__place { font-weight: 700; font-size: .95rem; }
.jcard__text { color: var(--ink-2); font-size: .95rem; line-height: 1.45; }
.jcard.is-current .jcard__panel { background: var(--accent); color: var(--accent-ink); border-color: var(--ink); box-shadow: 6px 6px 0 var(--ink); }
.jcard.is-current .jcard__kind { background: var(--ink); color: var(--paper); }
.jcard.is-current .jcard__when { color: var(--accent-ink); -webkit-text-stroke: 0; }
.jcard.is-current .jcard__text, .jcard.is-current .jcard__place { color: var(--accent-ink); }
.jcard__go { display: inline-flex; align-items: center; min-height: 36px; margin-top: 6px; color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.journey__bar, .journey__ticks { display: none; }

/* desktop: horizontal manga read, pinned while you scroll */
@media (min-width: 1000px) {
  .journey.is-pinned { padding: 0; }
  .journey.is-pinned .journey__pin {
    position: sticky;
    top: 0;
    height: 100vh;
    max-width: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: calc(var(--topbar-h) + 12px) 0 40px;
    overflow: hidden;
  }
  .journey.is-pinned .chapter__head { padding-inline: var(--pad); width: 100%; margin-bottom: 28px; grid-template-columns: auto 1fr auto; }
  .journey.is-pinned .journey__count { display: block; font-size: .9rem; align-self: end; }
  .journey.is-pinned .journey__count span:first-child { color: var(--accent); font-weight: 600; }
  .journey.is-pinned .journey__viewport { width: 100%; }
  .journey.is-pinned .journey__track {
    display: flex;
    gap: 0;
    max-width: none;
    width: max-content;
    margin: 0;
    padding: 0 calc(var(--pad) + 40px) 0 var(--pad);
    align-items: stretch;
    will-change: transform;
  }
  .journey.is-pinned .journey__track::before {
    left: 0; right: 0; top: 36px; bottom: auto; width: auto; height: 3px;
    background: repeating-linear-gradient(to right, var(--ink) 0 10px, transparent 10px 18px);
  }
  .journey.is-pinned .jcard {
    margin: 0;
    padding-top: 76px;
    width: clamp(300px, 27vw, 380px);
    margin-right: var(--gutter);
  }
  .journey.is-pinned .jcard:nth-child(even) { padding-top: 110px; --stem: 58px; }
  .journey.is-pinned .jcard::before { content: ""; position: absolute; left: 34px; top: 52px; height: var(--stem); border-left: 2px dashed var(--ink); opacity: .6; }
  .journey.is-pinned .jcard.is-current::before { border-color: var(--accent); opacity: 1; }
  .journey.is-pinned .jcard__dot { left: 20px; top: 22px; }
  .journey.is-pinned .jcard__panel { height: auto; min-height: 270px; align-content: start; }
  .journey.is-pinned .jcard.is-current { width: clamp(340px, 32vw, 440px); }
  .journey.is-pinned .journey__bar {
    display: block;
    position: relative;
    margin: 34px var(--pad) 0;
    height: 4px;
    background: color-mix(in srgb, var(--ink) 15%, transparent);
  }
  .journey.is-pinned .journey__bar > span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
  .journey.is-pinned .journey__ticks { display: block; position: absolute; inset: 0; }
  .journey.is-pinned .journey__ticks i { position: absolute; top: -5px; width: 2px; height: 14px; background: color-mix(in srgb, var(--ink) 35%, transparent); transition: background-color .3s; }
  .journey.is-pinned .journey__ticks i.on { background: var(--accent); }
  .journey.is-pinned .journey__ticks span { position: absolute; top: 18px; left: 0; translate: -50% 0; white-space: nowrap; font-family: var(--f-mono); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); transition: color .3s; }
  .journey.is-pinned .journey__ticks i.on span { color: var(--ink); }
  .journey.is-pinned .journey__ticks i:first-child span { translate: 0 0; }
  .journey.is-pinned .journey__ticks i:last-child span { translate: -100% 0; }
  /* the pinned stage gets a faint halftone floor so the timeline has a surface to sit on */
  .journey.is-pinned .journey__pin { background-image: radial-gradient(color-mix(in srgb, var(--ink) 11%, transparent) 1.1px, transparent 1.5px); background-size: 14px 14px; -webkit-mask-image: none; }
}

/* ============================================================= 04 · SKILLS */
.skill-filter {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  margin-bottom: 10px;
  scrollbar-width: none;
}
.skill-filter::-webkit-scrollbar { display: none; }
.skill-filter button {
  flex: none;
  padding: 8px 14px;
  border: 2px solid var(--ink);
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--paper);
  transition: background-color .2s, color .2s;
}
.skill-filter button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.skill-filter button:hover { box-shadow: 3px 3px 0 var(--accent); }

.scard__chev { display: none; }
.scard__lit { color: var(--accent); font-weight: 600; }
.scard.has-lit .scard__glyph { background: var(--accent); color: var(--accent-ink); }
.skill-board {
  display: grid;
  gap: var(--gutter);
  grid-template-columns: 1fr;
}
@media (min-width: 600px) { .skill-board { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .skill-board { grid-template-columns: repeat(4, 1fr); } }
.scard { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.scard__head { display: flex; align-items: center; gap: 12px; }
.scard__glyph {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: .8rem;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.scard__name { font-family: var(--f-display); font-weight: 400; font-size: 1.2rem; line-height: 1.05; text-transform: uppercase; }
.scard__count { font-family: var(--f-mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.scard__tree { position: relative; display: grid; gap: 8px; padding-left: 18px; }
.scard__tree::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 16px; width: 2px; background: var(--ink); transform-origin: top; transform: scaleY(var(--grow, 1)); transition: transform 1s var(--ease-out); }
.js .skill-board:not(.in) .scard__tree::before { --grow: 0; }
.snode {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 2px solid var(--ink);
  background: var(--paper);
  font-weight: 600;
  font-size: .92rem;
  transition: background-color .2s, color .2s, opacity .3s, transform .3s var(--ease-out), box-shadow .2s;
}
.snode::before { content: ""; position: absolute; left: -15px; top: 50%; width: 12px; height: 2px; background: var(--ink); }
.snode::after { content: ""; position: absolute; left: -17px; top: calc(50% - 4px); width: 8px; height: 8px; background: var(--paper); border: 2px solid var(--ink); transform: rotate(45deg); }
.snode small { font-family: var(--f-mono); font-size: .64rem; letter-spacing: .06em; color: var(--muted); font-weight: 400; white-space: nowrap; }
.snode:hover { box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px, -1px); }
.snode[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.snode[aria-pressed="true"] small { color: inherit; }
.snode[aria-pressed="true"]::after { background: var(--accent); border-color: var(--accent); }
.snode.is-dim { opacity: .25; }
.snode.is-lit { background: var(--ink); color: var(--paper); }
.snode.is-lit small { color: inherit; opacity: .7; }
.js .skill-board:not(.in) .snode { opacity: 0; transform: translateX(-10px); }
.skill-board.in .snode { transition-delay: calc(var(--i) * 40ms); }
.skill-board.in.settled .snode { transition-delay: 0s; }

.skill-scan {
  margin-top: var(--gutter);
  padding: 16px 18px;
  min-height: 72px;
  display: flex;
  align-items: center;
}
.skill-scan__hint { color: var(--muted); }
.scan { display: grid; gap: 10px; width: 100%; animation: scan-in .45s var(--ease-out); }
@keyframes scan-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
.scan__top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
.scan__name { font-family: var(--f-display); font-weight: 400; font-size: 1.6rem; line-height: 1; text-transform: uppercase; }
.scan__cat { color: var(--muted); }
.scan__used { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.scan__used a, .scan__used span.tag { text-decoration: none; }
.scan__used a.tag:hover { background: var(--ink); color: var(--paper); }
@media (min-width: 900px) {
  .skill-scan.is-active { position: sticky; bottom: 16px; z-index: 5; box-shadow: 6px 6px 0 var(--ink); }
}

/* ============================================================= 05 · ARCS */
.arc-grid { display: grid; gap: var(--gutter); grid-template-columns: 1fr; perspective: 1200px; }
@media (min-width: 600px) { .arc-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .arc-grid { grid-template-columns: repeat(4, 1fr); } }
.arc {
  position: relative;
  padding: 18px 18px 20px;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform-style: preserve-3d;
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out);
}
.arc:hover { box-shadow: 8px 8px 0 var(--ink); }
.arc__kind { color: var(--muted); }
.arc__title { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.2rem, 2.2vw, 1.55rem); overflow-wrap: anywhere; line-height: 1.02; text-transform: uppercase; max-width: 15ch; padding-right: 72px; }
.arc__role { color: var(--ink-2); font-size: .92rem; margin-top: auto; }
.arc__result { font-weight: 700; }
.arc__banner {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  padding: 4px 10px;
}
.arc__banner::before { content: "✓"; color: var(--accent); font-weight: 700; }
.arc__stamp {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid var(--accent);
  color: var(--accent);
  font-family: var(--f-display);
  font-size: 1.35rem;
  line-height: 1;
  transform: rotate(-14deg);
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 5px var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.arc__stamp small { display: block; font-family: var(--f-mono); font-size: .5rem; letter-spacing: .12em; margin-top: 2px; text-align: center; }
.arc--gold .arc__stamp { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 0 0 3px var(--accent), inset 0 0 0 5px var(--accent-ink); }
.arc--gold { background-image: radial-gradient(var(--tone) 1.1px, transparent 1.4px); background-size: 6px 6px; }
.js .arc:not(.in) .arc__stamp { opacity: 0; transform: rotate(-30deg) scale(2.4); }
.arc.in .arc__stamp { animation: stamp .55s var(--ease-snap) both; animation-delay: calc(var(--i) * 90ms + .2s); }
@keyframes stamp {
  0% { opacity: 0; transform: rotate(-30deg) scale(2.4); }
  70% { opacity: 1; transform: rotate(-12deg) scale(.92); }
  100% { opacity: 1; transform: rotate(-14deg) scale(1); }
}

/* ============================================================= 06 · LAB */
.lab { background-image: linear-gradient(color-mix(in srgb, var(--ink) 7%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--ink) 7%, transparent) 1px, transparent 1px); background-size: 28px 28px; }
.lab__desk { display: grid; gap: calc(var(--gutter) * 1.6); grid-template-columns: 1fr; }
.lab__live { display: flex; flex-direction: column; }
.lab__live-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 2px solid var(--ink); }
.lab__clear { text-decoration: underline; text-underline-offset: 3px; min-height: 32px; }
#ink-canvas { width: 100%; height: 300px; touch-action: none; cursor: crosshair; background: var(--paper); }
.lab__live figcaption { padding: 12px 14px 14px; border-top: 2px solid var(--ink); font-size: .92rem; color: var(--ink-2); }
.lab__live figcaption strong { color: var(--ink); }
.lab__board { display: grid; gap: 22px var(--gutter); grid-template-columns: 1fr; }
@media (min-width: 600px) { .lab__board { grid-template-columns: 1fr 1fr; } }
.sketch {
  position: relative;
  padding: 22px 16px 16px;
  background: var(--paper);
  border: 2px solid var(--ink);
  transform: rotate(var(--r, 0deg));
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out);
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--ink) 20%, transparent);
}
.sketch:hover { transform: rotate(0deg) translateY(-4px) scale(1.02); box-shadow: 8px 8px 0 var(--ink); z-index: 2; }
.sketch::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 84px;
  height: 22px;
  transform: translateX(-50%) rotate(calc(var(--r, 0deg) * -2));
  background: color-mix(in srgb, var(--accent) 55%, var(--paper));
  opacity: .85;
  mix-blend-mode: multiply;
}
.sketch__kind { color: var(--accent); }
.sketch h3 { font-family: var(--f-display); font-weight: 400; font-size: 1.3rem; line-height: 1.05; text-transform: uppercase; margin: 6px 0 6px; }
.sketch p { color: var(--ink-2); font-size: .93rem; }
.sketch__origin { margin-top: 10px; color: var(--muted); }
@media (min-width: 1000px) {
  .lab__desk { grid-template-columns: 5fr 7fr; align-items: start; }
  .lab__live { position: sticky; top: calc(var(--topbar-h) + 16px); }
  #ink-canvas { height: 380px; }
}

/* ============================================================= 07 · NOW */
.now { overflow: hidden; }
.marquee {
  max-width: none !important;
  margin: calc(-1 * (var(--topbar-h) + 48px)) calc(-1 * var(--pad)) calc(var(--topbar-h) + 20px);
  border-bottom: 3px solid var(--ink);
  background: var(--accent);
  color: var(--accent-ink);
  overflow: hidden;
  white-space: nowrap;
  padding: 12px 0;
}
@media (min-width: 1100px) { .marquee { margin-right: calc(-1 * (var(--pad) + 40px)); } }
.marquee__inner { display: inline-flex; gap: 28px; animation: marquee 32s linear infinite; font-family: var(--f-display); font-size: 1.05rem; text-transform: uppercase; letter-spacing: .02em; }
.marquee__inner span::after { content: "✦"; margin-left: 28px; }
@keyframes marquee { to { transform: translateX(-50%); } }
.onair { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; margin-left: 8px; font-size: .7rem; padding: 6px 10px; border: 2px solid var(--accent); color: var(--accent); letter-spacing: .12em; }
.onair i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: onair 1.4s ease-in-out infinite; }
@keyframes onair { 50% { opacity: .2; } }

.now-grid { display: grid; gap: var(--gutter); grid-template-columns: 1fr; }
@media (min-width: 720px) { .now-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) {
  .now-grid { grid-template-columns: repeat(12, 1fr); }
  .now-grid > :nth-child(1) { grid-column: span 7; grid-row: span 2; }
  .now-grid > :nth-child(2) { grid-column: span 5; }
  .now-grid > :nth-child(3) { grid-column: span 5; }
  .now-grid > :nth-child(4) { grid-column: span 6; }
  .now-grid > :nth-child(5) { grid-column: span 6; }
}
.nblock { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.nblock__label { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nblock__title { font-family: var(--f-display); font-weight: 400; font-size: 1.5rem; text-transform: uppercase; line-height: 1; }
.nitem { padding: 12px 0; border-top: 1.5px dashed color-mix(in srgb, var(--ink) 30%, transparent); }
.nitem:first-of-type { border-top: 0; padding-top: 0; }
.nitem strong { display: block; font-size: 1.08rem; }
.nitem span { color: var(--ink-2); font-size: .94rem; }
.nblock--main { background-image: radial-gradient(var(--tone) 1.1px, transparent 1.4px); background-size: 6px 6px; }
.nblock--main .nitem strong { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.6rem, 4vw, 2.4rem); text-transform: uppercase; line-height: 1; margin-bottom: 6px; }
.nprog { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.nprog i { flex: 1; height: 8px; border: 2px solid var(--ink); position: relative; overflow: hidden; }
.nprog i::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, var(--accent) 0 6px, transparent 6px 12px); animation: stripes 1.2s linear infinite; background-size: 17px 17px; }
@keyframes stripes { to { background-position: 17px 0; } }
.ngoals { display: grid; gap: 10px; counter-reset: g; }
.ngoals li { display: flex; gap: 12px; align-items: center; font-weight: 600; }
.ngoals li::before { content: ""; flex: none; width: 18px; height: 18px; border: 2px solid var(--ink); }
.ngoals--ideas li::before { border-style: dashed; border-radius: 50%; }

/* ============================================================= 08 · FINAL */
.final { padding-bottom: 0; overflow: hidden; }
.speedlines--final { opacity: .12; inset: -5%; }
.final__inner { position: relative; text-align: left; padding-bottom: 40px; container-type: inline-size; }
.final__kanji { margin-bottom: 18px; }
.final__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: min(7.4rem, calc(100cqi / 10));
  line-height: .92;
  text-transform: uppercase;
  letter-spacing: -.015em;
}
.final__title span { display: block; }
.final__title em { font-style: normal; color: var(--accent); }
.final__lede { margin-top: 24px; font-size: clamp(1.05rem, 2.4vw, 1.3rem); max-width: 48ch; color: var(--ink-2); }
.final__panels { display: grid; gap: var(--gutter); grid-template-columns: 1fr; margin-top: 44px; }
@media (min-width: 600px) { .final__panels { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .final__panels { grid-template-columns: repeat(4, 1fr); } }
.fpanel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 150px;
  padding: 18px;
  text-decoration: none;
  transition: background-color .25s, color .25s, transform .35s var(--ease-out), box-shadow .35s var(--ease-out);
}
.fpanel:hover, .fpanel:focus-visible { background: var(--ink); color: var(--paper); transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--accent); }
.fpanel .mono { color: var(--accent); }
.fpanel strong { font-family: var(--f-display); font-weight: 400; font-size: 1.5rem; line-height: 1.05; text-transform: uppercase; }
.fpanel span.desc { opacity: .75; font-size: .94rem; }
.fpanel .arrow { margin-top: auto; font-size: 1.4rem; transition: transform .35s var(--ease-out); }
.fpanel:hover .arrow { transform: translateX(8px); }

.final__email { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; margin-top: 40px; }
.final__address { font-family: var(--f-display); font-size: clamp(1.1rem, 4.6vw, 2.4rem); text-decoration: none; word-break: break-all; border-bottom: 3px solid var(--accent); line-height: 1.2; }
.final__address:hover { color: var(--accent); }
.bubble--tiny { position: absolute; left: 0; top: -58px; padding: 8px 16px; font-size: .9rem; font-weight: 700; opacity: 0; transform: scale(.6); transform-origin: 20% 100%; transition: opacity .2s, transform .3s var(--ease-out); pointer-events: none; }
.bubble--tiny.is-on { opacity: 1; transform: none; }

.tbc {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-top: 64px;
  text-decoration: none;
  color: var(--paper);
  filter: drop-shadow(4px 4px 0 var(--accent));
}
.tbc__text {
  background: var(--ink);
  padding: 12px 18px 12px 20px;
  font-family: var(--f-display);
  font-size: clamp(1rem, 3.6vw, 1.5rem);
  text-transform: uppercase;
  font-style: italic;
  letter-spacing: .02em;
}
.tbc__arrow { width: 44px; align-self: stretch; background: var(--ink); clip-path: polygon(0 0, 100% 50%, 0 100%); transition: width .4s var(--ease-out); }
.tbc:hover .tbc__arrow { width: 72px; }

.credits { position: relative; height: 160px; overflow: hidden; margin-top: 40px; border-top: 2px solid color-mix(in srgb, var(--ink) 20%, transparent); mask-image: linear-gradient(transparent, #000 25%, #000 75%, transparent); -webkit-mask-image: linear-gradient(transparent, #000 25%, #000 75%, transparent); }
.credits__roll { display: grid; gap: 14px; padding: 160px 0; text-align: center; animation: roll 22s linear infinite; }
.credits__roll p { display: grid; font-weight: 700; }
.credits__roll span.cr { font: inherit; letter-spacing: normal; text-transform: none; color: inherit; }
.credits__roll span:not(.cr) { font-family: var(--f-mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
@keyframes roll { to { transform: translateY(-100%); } }

.footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 22px 0 calc(22px + env(safe-area-inset-bottom)); border-top: 2px solid var(--ink); color: var(--muted); }
.footer__replay { font-family: inherit; font-size: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; min-height: 36px; }
.footer__replay:hover { color: var(--accent); }

.noscript { padding: 40px 20px; max-width: 640px; margin: 0 auto; }

/* ============================================================= DOCK (phones) */
.dock { display: none; }
@media (max-width: 719px) {
  .topbar__chapter, .index-btn { display: none; }
  .topbar { justify-content: space-between; }
  .dock {
    position: fixed;
    left: 50%;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 115;
    display: flex;
    align-items: stretch;
    width: min(380px, calc(100vw - 32px));
    height: 54px;
    translate: -50% 0;
    background: var(--paper);
    color: var(--ink);
    border: 2.5px solid var(--ink);
    box-shadow: 4px 4px 0 var(--ink);
    transition: translate .45s var(--ease-out), background-color .3s;
  }
  body.is-locked .dock { translate: -50% 180%; }
  .dock__btn { flex: none; width: 50px; font-size: 1.7rem; line-height: 1; font-weight: 700; display: grid; place-items: center; }
  .dock__btn:active { background: var(--ink); color: var(--paper); }
  .dock__btn:disabled { opacity: .25; }
  .dock__mid {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 10px;
    border-inline: 2px solid var(--ink);
    overflow: hidden;
  }
  .dock__num { color: var(--accent); font-weight: 600; }
  .dock__name { font-family: var(--f-display); font-size: 1rem; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dock__name.swap { animation: name-swap .45s var(--ease-out); }
  .dock__mid::after { content: "▴"; font-size: .7rem; color: var(--muted); }
  .dock__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: color-mix(in srgb, var(--ink) 12%, transparent); }
  .dock__bar i { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
}

/* ============================================================= TAP INK (touch) */
.burst { position: fixed; z-index: 450; width: 0; height: 0; pointer-events: none; }
.burst i {
  position: absolute;
  left: -1.5px;
  top: 0;
  width: 3px;
  height: 15px;
  background: var(--accent);
  transform-origin: 50% 0;
  animation: spoke .5s var(--ease-out) forwards;
}
.burst i:nth-child(even) { background: var(--ink); height: 11px; }
.burst b {
  position: absolute;
  left: -20px;
  top: -20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-image: radial-gradient(var(--ink) 1.3px, transparent 1.6px);
  background-size: 6px 6px;
  animation: burst-dots .55s ease-out forwards;
}
@keyframes spoke {
  from { transform: rotate(var(--a)) translateY(8px) scaleY(1.3); opacity: 1; }
  to { transform: rotate(var(--a)) translateY(36px) scaleY(.2); opacity: 0; }
}
@keyframes burst-dots { from { scale: .2; opacity: .9; } to { scale: 1.7; opacity: 0; } }

.swipe-hint { display: none; }

/* ============================================================= PHONE LAYOUTS
   Not a shrunken desktop: panels recompose for one-thumb reading.        */
@media (max-width: 719px) {
  .chapter { padding-top: calc(var(--topbar-h) + 8px); padding-bottom: 72px; }
  .chapter__head { margin-bottom: 28px; }
  .chapter__sub { font-size: .98rem; }
  .swipe-hint { display: flex; align-items: center; gap: 8px; color: var(--muted); margin: -14px 0 14px; }
  .swipe-hint::after { content: ""; width: 34px; height: 2px; background: var(--accent); animation: nudge 1.6s ease-in-out infinite; }
  @keyframes nudge { 50% { translate: 8px 0; } }


  /* profile: portrait + name side by side */
  .profile__card { grid-template-columns: 44% 1fr; align-items: end; }
  .profile__portrait { aspect-ratio: 1 / 1.2; border-bottom: 0; border-right: var(--stroke) solid var(--ink); }
  .profile__badge { top: 8px; left: 8px; font-size: .56rem; padding: 3px 6px; }
  .profile__id { padding: 14px; }
  .profile__kata { font-size: .78rem; }
  .sheet__block { padding: 16px 14px 16px; }
  .dl div { grid-template-columns: 64px 1fr; gap: 10px; }
  .backstory .narration { font-size: .95rem; }
  .backstory .narration:nth-child(2) { margin-left: 4%; }
  .backstory .narration:nth-child(3) { margin-left: 8%; }

  /* projects */
  .pcard { min-height: 0; }
  .pcard__art { min-height: 210px; }
  .pcard__body { padding: 16px; }

  /* journey (webtoon strip) */
  .jcard__top { flex-direction: row; }
  .jcard__panel { padding: 16px; }

  /* arcs: a swipeable deck of cards */
  .arc-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: calc(-1 * var(--pad));
    padding: 8px var(--pad) 22px;
    scroll-padding-inline: var(--pad);
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }
  .arc-grid::-webkit-scrollbar { display: none; }
  .arc { flex: 0 0 82%; scroll-snap-align: center; min-height: 240px; }
  .arc:first-child { scroll-snap-align: start; }
  .arc:last-child { scroll-snap-align: end; }

  /* lab: two-up sketchbook */
  #ink-canvas { height: 240px; }
  .lab__board { grid-template-columns: 1fr 1fr; gap: 22px 10px; }
  .sketch { padding: 18px 12px 12px; }
  .sketch::before { width: 54px; height: 16px; top: -9px; }
  .sketch h3 { font-size: .98rem; }
  .sketch p { font-size: .82rem; line-height: 1.45; }
  .sketch__kind, .sketch__origin { font-size: .58rem; }

  /* current arc */
  .marquee { margin-top: calc(-1 * (var(--topbar-h) + 8px)); margin-bottom: 40px; }
  .onair { margin: 10px 0 0; display: flex; width: max-content; }
  .nblock { padding: 16px; }

  /* final chapter */
  .final__panels { grid-template-columns: repeat(3, 1fr); margin-top: 32px; }
  .fpanel { grid-column: 1 / -1; min-height: 0; padding: 16px; gap: 6px; }
  .fpanel strong { font-size: 1.3rem; }
  .fpanel .arrow { position: absolute; right: 16px; top: 50%; translate: 0 -50%; margin: 0; }
  .fpanel:nth-child(n+2) { grid-column: auto; align-items: center; text-align: center; padding: 14px 6px; }
  .fpanel:nth-child(n+2) .desc, .fpanel:nth-child(n+2) .arrow { display: none; }
  .fpanel:nth-child(n+2) strong { font-size: .92rem; }
  .final__address { font-size: calc(100cqi / 20); word-break: normal; }
  .tbc { margin-top: 44px; }
  .footer { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
}
@media (max-width: 599px) {
  /* abilities collapse into an accordion */
  .scard { padding: 0; gap: 0; }
  .scard__head { padding: 14px 16px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .scard__chev { display: block; margin-left: auto; width: 14px; height: 14px; position: relative; }
  .scard__chev::before, .scard__chev::after { content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 2.5px; background: var(--ink); transition: rotate .3s var(--ease-out); }
  .scard__chev::after { rotate: 90deg; }
  .scard.is-open .scard__chev::after { rotate: 0deg; }
  .scard:not(.is-open) .scard__tree { display: none; }
  .scard.is-open .scard__tree { margin: 0 16px 16px; animation: tree-open .45s var(--ease-out); }
  @keyframes tree-open { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 -10px 0); } }
  .skill-board { gap: 10px; }
  .skill-scan { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 5; box-shadow: 4px 4px 0 var(--ink); }
  .skill-scan:not(.is-active) { position: static; box-shadow: none; }
}

/* ---- very small phones (≤ 400px) */
@media (max-width: 400px) {
  .kv__stat { padding-left: 8px; }
  .kv__stat b { font-size: 1.55rem; }
  .kv__stat span { font-size: .52rem; letter-spacing: .06em; }
  .kv__tab[aria-selected="true"] .l { display: none; }
  .kv__tab[aria-selected="true"] .s { display: inline; }
  .kv__kicker { font-size: .64rem; }
  .kv__char { height: 42%; right: -16vw; }
  .fpanel:nth-child(n+2) strong { font-size: .78rem; letter-spacing: 0; }
  .fpanel:nth-child(n+2) .mono { font-size: .56rem; }
  .dock__name { font-size: .88rem; }
  .dock__mid { gap: 8px; padding: 0 6px; }
}

.fpanel:nth-child(n+2) strong { overflow-wrap: anywhere; }
@media (max-width: 719px) { .fpanel:nth-child(n+2) strong { font-size: .8rem; } }

/* ---- touch targets: at least ~40px on touch screens */
@media (pointer: coarse) {
  .kv__tab { min-height: 40px; padding: 10px 2px 12px; }
  .kv__class-tabs { gap: 14px; }
  .jcard__go { min-height: 40px; align-items: center; }
  .final__address { display: inline-block; padding: 8px 0; }
}


/* ============================================================= ABOUT (simplified) */
.about__bio { font-size: clamp(1.05rem, 1.6vw, 1.25rem); line-height: 1.55; margin-bottom: 18px; max-width: 60ch; }

/* ============================================================= 06 · SNAPSHOTS
   Pile (desktop): polaroids you can drag, toss and click open.
   Stack (phones): swipe the top photo away; tap to open.
   Grid: a tidy wall, toggled from either.                               */
.gal-hint-stack { display: none; }
.gal-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.gal-filter { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.gal-filter button { flex: none; min-height: 38px; padding: 0 14px; border: 2px solid var(--ink); font-family: var(--f-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; background: var(--paper); }
.gal-filter button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.gal-tools { display: flex; gap: 8px; }
.gal-tool { min-height: 38px; padding: 0 12px; border: 2px solid var(--ink); background: var(--paper); box-shadow: 3px 3px 0 var(--ink); transition: transform .15s var(--ease-out), box-shadow .15s; }
.gal-owner { display: inline-flex; align-items: center; text-decoration: none; background: var(--accent); color: var(--accent-ink); }
.gal-owner[hidden] { display: none; }
.gal-tool:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--accent); }
.gal-tool:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.gal-tool[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.gal { position: relative; height: clamp(480px, 72vh, 680px); border: 2px dashed color-mix(in srgb, var(--ink) 25%, transparent); background-image: radial-gradient(color-mix(in srgb, var(--ink) 10%, transparent) 1px, transparent 1.4px); background-size: 14px 14px; touch-action: pan-y; }
.gal__card {
  position: absolute; left: 0; top: 0; width: clamp(180px, 20vw, 260px); padding: 10px 10px 0; background: #fbf7ee; color: #141312;
  border: 2px solid #141312; box-shadow: 6px 6px 0 rgba(20, 19, 18, .35); cursor: grab; text-align: left; user-select: none; -webkit-user-select: none; touch-action: none;
}
.gal__card.is-lift { cursor: grabbing; box-shadow: 16px 18px 0 rgba(20, 19, 18, .3); }
.gal__card:hover .gal__frame img { filter: none; }
.gal__frame { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #e8e1d3; border: 1.5px solid #141312; }
.gal__frame img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.25) contrast(1.05); transition: filter .3s, opacity .35s; opacity: 0; pointer-events: none; }
.gal__cap { display: block; padding: 10px 2px 12px; font-family: var(--f-display); font-size: .9rem; line-height: 1.15; text-transform: uppercase; }
.gal__tape { position: absolute; left: 50%; top: -12px; width: 76px; height: 22px; translate: -50% 0; rotate: -4deg; background: color-mix(in srgb, var(--accent) 60%, #fbf7ee); opacity: .85; z-index: 2; }
.gal__ph { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 6px; padding: 12px; background: #141312; color: #efe9dc; overflow: hidden; }
.gal__ph .speedlines { color: #efe9dc; opacity: .14; }
.gal__ph b { position: relative; font-family: var(--f-display); font-weight: 400; font-size: 1.05rem; line-height: 1.05; text-transform: uppercase; }
.gal__ph i { position: relative; font-style: normal; font-size: .58rem; color: var(--accent); }
/* deal-in when the section appears */
.gal.is-waiting .gal__card { opacity: 0; }
.gal.is-dealt .gal__card { animation: deal .7s var(--ease-out) both; }
.gal.is-dealt .gal__card:nth-child(2) { animation-delay: .06s; } .gal.is-dealt .gal__card:nth-child(3) { animation-delay: .12s; }
.gal.is-dealt .gal__card:nth-child(4) { animation-delay: .18s; } .gal.is-dealt .gal__card:nth-child(5) { animation-delay: .24s; }
.gal.is-dealt .gal__card:nth-child(6) { animation-delay: .3s; } .gal.is-dealt .gal__card:nth-child(7) { animation-delay: .36s; }
.gal.is-dealt .gal__card:nth-child(n+8) { animation-delay: .42s; }
@keyframes deal { from { opacity: 0; translate: 40vw -30vh; rotate: 25deg; } to { opacity: 1; translate: 0 0; rotate: 0deg; } }
/* stack */
.gal[data-mode="stack"] { height: 440px; border-style: solid; overflow: hidden; }
.gal[data-mode="stack"] .gal__card { left: 50%; top: 30px; width: min(78vw, 300px); }
/* grid */
.gal[data-mode="grid"] { height: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 26px 18px; padding: 26px 18px 18px; }
.gal[data-mode="grid"] .gal__card { position: relative; width: auto; cursor: zoom-in; }
.gal[data-mode="grid"] .gal__card:hover { transform: rotate(0) translateY(-4px) !important; transition: transform .25s var(--ease-out); }
.gal-count { margin-top: 12px; color: var(--muted); }
@media (max-width: 719px) {
  .gal-hint-pile { display: none; }
  .gal-hint-stack { display: inline; }
  .gal-bar { flex-direction: column; align-items: stretch; }
  .gal-tools { justify-content: flex-end; }
  .gal[data-mode="grid"] { grid-template-columns: 1fr 1fr; gap: 18px 10px; padding: 18px 10px 10px; }
  .gal[data-mode="grid"] .gal__cap { font-size: .72rem; }
}

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 330; display: grid; place-items: center; }
.lb[hidden] { display: none; }
.lb__backdrop { position: absolute; inset: 0; background: rgba(10, 10, 9, .9); animation: fade .3s; }
.lb__fig { position: relative; margin: 0; width: min(92vw, 1100px); background: #fbf7ee; color: #141312; padding: 12px 12px 0; border: 2px solid #141312; box-shadow: 12px 12px 0 var(--accent); }
.lb__fig.swap { animation: lb-in .45s var(--ease-out); }
@keyframes lb-in { from { opacity: 0; transform: scale(.92) rotate(-2deg); } }
.lb__frame { position: relative; height: min(72vh, 680px); display: grid; place-items: center; background: #141312; overflow: hidden; }
.lb__frame img { max-width: 100%; max-height: 100%; object-fit: contain; }
.gal__ph--big b { font-size: clamp(1.6rem, 5vw, 3.4rem); }
.lb__cap { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 2px 14px; flex-wrap: wrap; }
.lb__cap b { font-family: var(--f-display); font-weight: 400; font-size: clamp(1rem, 2.4vw, 1.5rem); text-transform: uppercase; }
.lb__cap .mono { color: #6c685f; }
.lb__btn { position: absolute; z-index: 2; width: 52px; height: 52px; display: grid; place-items: center; background: #fbf7ee; color: #141312; border: 2px solid #141312; font-size: 1.6rem; font-weight: 700; box-shadow: 4px 4px 0 #141312; }
.lb__btn:hover { background: var(--accent); color: #fff8f0; }
.lb__prev { left: max(12px, calc(50% - 600px)); top: 50%; translate: 0 -50%; }
.lb__next { right: max(12px, calc(50% - 600px)); top: 50%; translate: 0 -50%; }
.lb__close { right: 16px; top: calc(16px + env(safe-area-inset-top)); font-size: 1.1rem; }
.lb__count { position: absolute; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); translate: -50% 0; color: #efe9dc; }
@media (max-width: 719px) {
  .lb__fig { padding: 8px 8px 0; box-shadow: 6px 6px 0 var(--accent); }
  .lb__frame { height: 58vh; }
  .lb__prev, .lb__next { top: auto; bottom: calc(52px + env(safe-area-inset-bottom)); translate: none; width: 48px; height: 48px; }
  .lb__prev { left: 16px; } .lb__next { right: 16px; }
}


/* ============================================================= LANDING → CHAPTER 01 (the curtain)
   The landing is pinned; Chapter 01 slides up over it along a diagonal
   edge carrying a marquee strip. Meanwhile (--leave 0→1) the robot
   launches, the moon sinks and the frame dims.                          */
.chapter.hero { position: sticky; top: 0; --leave: 0; }
.chapter.hero.is-covered { visibility: hidden; }
main > .chapter:not(.hero) { background: var(--paper); }
.chapter.about {
  --cut: clamp(26px, 6vw, 96px);
  padding-top: calc(var(--topbar-h) + 48px + var(--cut));
  clip-path: polygon(0 var(--cut), 100% 0, 100% 100%, 0 100%);
  overflow-x: clip;
  box-shadow: 0 -30px 60px rgba(0, 0, 0, .35);
}
.lift { position: absolute; left: 0; top: calc(var(--cut) + 4px); width: 102%; max-width: none !important; margin: 0 !important; height: clamp(40px, 5.2vw, 66px); display: flex; align-items: center; overflow: hidden; background: var(--accent); color: #0b0b0a; border-block: 3px solid #0b0b0a; transform-origin: 0 0; transform: rotate(calc(-1 * atan(var(--cut) / 100vw))); z-index: 2; }
.lift__run { display: flex; white-space: nowrap; animation: lift-run 22s linear infinite; }
.lift__run span { font-family: var(--f-display); font-size: clamp(1.1rem, 2.6vw, 2rem); text-transform: uppercase; letter-spacing: .01em; padding-right: 1.2em; }
@keyframes lift-run { to { transform: translateX(-50%); } }
.kv__char { transform: translate(calc(var(--leave) * 9vw), calc(var(--leave) * -80vh)) rotate(calc(var(--leave) * 16deg)); opacity: calc(1 - var(--leave) * 1.35); }
.kv__char .kv__flame { scale: calc(1 + var(--leave) * 2.2); }
.kv__orb { transform: translateY(calc(var(--leave) * 18vh)) scale(calc(1 - var(--leave) * .16)); }
.kv::after { content: ""; position: absolute; inset: 0; z-index: 6; pointer-events: none; background: color-mix(in srgb, #0b0b0a 80%, var(--accent)); opacity: calc(var(--leave) * .55); }
@media (prefers-reduced-motion: reduce) {
  .kv__char, .kv__orb { transform: none; opacity: 1; }
  .kv::after { opacity: 0; }
  .lift__run { animation: none; }
}

/* ============================================================= MOTION PREFS */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js .reveal { clip-path: none; transform: none; opacity: 1; }
  .marquee__inner { animation: none; }
  .credits__roll { animation: none; padding: 20px 0; }
  .credits { height: auto; mask-image: none; -webkit-mask-image: none; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
.gal__frame img.is-in, .no-js .gal__frame img { opacity: 1; }
