/* ==========================================================
   Kivia · yozakura (夜桜) — night cherry blossoms
   The night is the colour of her hair. The accents are her eyes.
   ========================================================== */

@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../fonts/instrument-serif-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter Tight"; src: url("../fonts/inter-tight-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter Tight"; src: url("../fonts/inter-tight-latin-wght-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Kivia JP"; src: url("../fonts/kivia-jp.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --night: #0a0c19;
  --night-2: #10132a;
  --hair: #262b5c;
  --ink: #efe8f0;
  --ink-2: #cbc3d4;
  --muted: #9089a6;
  --faint: #5a556f;
  --line: rgba(239, 232, 240, 0.1);
  --line-2: rgba(239, 232, 240, 0.18);
  --sakura: #f5b8ca;
  --sakura-deep: #e4869f;
  --crimson: #ea3a52;
  --glow: #ffdbe5;
  --panel: rgba(13, 15, 34, 0.58);

  --serif: "Instrument Serif", "Kivia JP", Georgia, serif;
  --sans: "Inter Tight", "Kivia JP", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --jp: "Kivia JP", "Noto Serif JP", "Hiragino Mincho ProN", serif;

  --gutter: clamp(16px, 5.5vw, 96px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--night); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-waking { overflow: hidden; }
::selection { background: var(--crimson); color: #fff; }
a { color: inherit; }
em { font-style: italic; }
ruby rt { font-family: var(--jp); }

/* ---------------- the world ---------------- */

.sky {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 80% at 70% -10%, #1b2150 0%, rgba(27, 33, 80, 0) 60%),
    radial-gradient(80% 60% at 0% 110%, rgba(120, 40, 70, 0.35) 0%, rgba(120, 40, 70, 0) 70%),
    radial-gradient(60% 50% at 100% 100%, rgba(38, 43, 92, 0.6) 0%, rgba(38, 43, 92, 0) 70%),
    linear-gradient(180deg, #0c0f22 0%, var(--night) 55%, #080913 100%);
}
.sky canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.moon {
  position: fixed; z-index: 1; pointer-events: none;
  left: 0; top: 0; width: 10px; height: 10px;
  transform: translate(-50%, -50%);
  /* a glow, not a ball: it eases all the way out to nothing before its edge */
  background:
    radial-gradient(closest-side, rgba(255, 240, 244, 0.36) 0%, rgba(255, 232, 240, 0.27) 12%, rgba(255, 226, 236, 0.18) 26%, rgba(250, 206, 220, 0.1) 42%, rgba(245, 190, 207, 0.05) 58%, rgba(245, 184, 202, 0.022) 72%, rgba(245, 184, 202, 0.007) 86%, rgba(245, 184, 202, 0) 100%);
  opacity: 0;
  will-change: transform, width, height, opacity;
}
.moon::after {
  content: ""; position: absolute; inset: 28%;
  background: radial-gradient(closest-side, rgba(255, 246, 248, 0.14) 0%, rgba(255, 240, 245, 0.07) 40%, rgba(255, 238, 243, 0.02) 75%, rgba(255, 238, 243, 0) 100%);
}

.bough { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.petals { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.petals--back { z-index: 2; }
.stage { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 3; opacity: 0; display: block; }
.petals--front { z-index: 4; }
.floor { position: fixed; left: 0; right: 0; bottom: 0; height: 30vh; z-index: 3; pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 12, 25, 0) 0%, rgba(10, 12, 25, 0.55) 55%, rgba(9, 10, 21, 0.92) 100%); }

.grain {
  position: fixed; inset: -50%; z-index: 6; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* ---------------- waking ---------------- */

.wake {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: radial-gradient(60% 50% at 50% 50%, #0f1228 0%, #06070f 100%);
  transition: opacity 1.6s ease, visibility 0s linear 1.6s;
}
.wake.is-done { opacity: 0; visibility: hidden; }
.wake__inner { text-align: center; padding: 0 24px; }
.wake__sys { font-family: var(--mono); font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--faint); margin: 0 0 22px; }
.wake__sys span { color: var(--sakura); }
.wake__line { font-family: var(--serif); font-style: italic; font-size: clamp(28px, 4vw, 44px); margin: 0 0 26px; color: var(--ink-2); }
.dots i { font-style: normal; animation: dot 1.4s infinite; opacity: 0; }
.dots i:nth-child(2) { animation-delay: 0.2s; } .dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot { 30%, 60% { opacity: 1; } 0%, 100% { opacity: 0; } }
.wake__bar { width: min(240px, 60vw); height: 1px; margin: 0 auto; background: var(--line); overflow: hidden; }
.wake__bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--sakura), var(--crimson)); transition: width 0.3s ease; }

/* ---------------- top bar ---------------- */

.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; gap: 28px;
  padding: 20px var(--gutter);
  pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 12, 25, 0.72) 0%, rgba(10, 12, 25, 0) 100%);
}
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand__pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--crimson);
  box-shadow: 0 0 12px 2px rgba(234, 58, 82, 0.6);
  transform: scale(var(--breath, 1));
}
.brand__name { font-family: var(--serif); font-size: 24px; line-height: 1; letter-spacing: 0.01em; }
.brand__jp { font-family: var(--jp); font-size: 11px; color: var(--muted); letter-spacing: 0.2em; }
.nav { display: flex; gap: 24px; margin-left: auto; }
.nav a {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  text-decoration: none; color: var(--muted); transition: color 0.25s;
  padding: 6px 0;
}
.nav a:hover, .nav a.is-here { color: var(--ink); }
.nav a.is-here::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--sakura); margin-right: 8px; vertical-align: 2px; }
.lookswitch {
  display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line-2); border-radius: 999px;
  background: rgba(10, 12, 25, 0.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.lookswitch button {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); background: transparent; border: 0; border-radius: 999px; padding: 6px 12px; cursor: pointer;
  transition: color 0.25s, background 0.25s;
}
.lookswitch button:hover { color: var(--ink); }
.lookswitch button[aria-checked="true"] { color: var(--night); background: var(--glow); }
.lookswitch button:focus-visible { outline: 2px solid var(--sakura); outline-offset: 2px; }
body.no-avatar .lookswitch { display: none; }
.topbar__mood { margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; min-width: 150px; text-align: right; }
.topbar__mood .dim { color: var(--faint); }
.topbar__mood b { font-weight: 500; color: var(--sakura); }

/* ---------------- caption (stage directions) ---------------- */

.caption {
  position: fixed; z-index: 7; left: 50%; top: 80%;
  transform: translate(-50%, 0);
  font-family: var(--serif); font-style: italic; font-size: clamp(19px, 1.6vw, 26px);
  color: var(--glow);
  text-shadow: 0 2px 18px rgba(10, 12, 25, 0.9), 0 0 2px rgba(10, 12, 25, 0.8);
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity 0.7s ease;
}
.caption.is-on { opacity: 1; }
.caption::before { content: ""; display: inline-block; width: 22px; height: 1px; background: currentColor; opacity: 0.5; vertical-align: 0.35em; margin-right: 12px; }

/* ---------------- shared ---------------- */

main .col, main .wide, .tree-labels, .foot__body { position: relative; z-index: 5; }
.hero__copy, .vitals, .scrollcue, .hero__kana { z-index: 5; }
.chapter { position: relative; min-height: 100vh; padding: 24vh var(--gutter) 20vh; }
.col { max-width: 600px; }
.col--right { margin-left: auto; }
.wide { max-width: 1240px; margin: 0 auto; }

.kicker {
  display: flex; align-items: center; gap: 16px; margin: 0 0 28px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted);
}
.kicker ruby { font-family: var(--jp); font-size: 30px; letter-spacing: 0; color: var(--sakura); text-transform: none; line-height: 1; }
.kicker ruby rt { font-size: 10px; letter-spacing: 0.1em; color: var(--muted); }
.kicker--small ruby { font-size: 22px; }

h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(46px, 5.8vw, 108px); line-height: 0.95; letter-spacing: -0.015em;
  margin: 0 0 36px;
}
h2 em, h3 em, .hero__line em { color: var(--sakura); }
h3 { font-weight: 500; }
.lede { font-size: clamp(17px, 1.2vw, 19px); color: var(--ink-2); margin: 0 0 22px; max-width: 34em; }
.lede strong { color: var(--ink); font-weight: 600; }
.aside { margin-top: 40px; font-size: 14px; color: var(--muted); border-left: 1px solid var(--sakura-deep); padding-left: 18px; max-width: 36em; }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s cubic-bezier(.2,.7,.2,1), transform 1.1s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); }
.reveal.is-in { opacity: 1; transform: none; }

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

.hero { position: relative; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; }
.giant {
  position: absolute; z-index: 2; margin: 0;
  left: calc(var(--gutter) - 0.04em); bottom: 12vh;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(150px, min(30vw, 50vh), 720px); line-height: 0.78; letter-spacing: -0.035em;
  pointer-events: none; user-select: none;
}
.giant span {
  display: block;
  background: linear-gradient(180deg, #fbeff3 0%, #f2c6d3 45%, rgba(228, 134, 159, 0.28) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0; transform: translateY(6%);
  transition: opacity 2.4s ease 0.4s, transform 2.6s cubic-bezier(.2,.7,.2,1) 0.4s;
}
body.is-awake .giant span { opacity: 0.94; transform: none; }

.hero__kana {
  position: absolute; left: calc(var(--gutter) * 0.32); top: 50%; transform: translateY(-50%);
  writing-mode: vertical-rl; font-family: var(--jp); font-size: 12px; letter-spacing: 0.55em;
  color: var(--faint); margin: 0;
}
.hero__copy { position: absolute; left: var(--gutter); top: 15vh; max-width: 440px; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 20px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.eyebrow__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sakura); box-shadow: 0 0 10px var(--sakura); }
.hero__line { font-family: var(--serif); font-size: clamp(34px, 3.2vw, 60px); line-height: 1; margin: 0 0 18px; }
.hero__sub { font-size: 15px; color: var(--ink-2); margin: 0; max-width: 30em; }
@media (max-height: 700px) and (min-aspect-ratio: 9/10) { .hero__copy { top: 12vh; } .hero__line { font-size: clamp(28px, 2.7vw, 44px); margin-bottom: 12px; } .eyebrow { margin-bottom: 12px; } .hero__sub { font-size: 14px; } }
.hero__copy > * { opacity: 0; transform: translateY(14px); transition: opacity 1.4s ease, transform 1.4s cubic-bezier(.2,.7,.2,1); }
body.is-awake .hero__copy > * { opacity: 1; transform: none; }
body.is-awake .hero__copy > :nth-child(2) { transition-delay: 1.1s; }
body.is-awake .hero__copy > :nth-child(1) { transition-delay: 0.9s; }
body.is-awake .hero__copy > :nth-child(3) { transition-delay: 1.3s; }

.vitals {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: 3.2vh; margin: 0;
  display: flex; gap: clamp(18px, 3vw, 48px); align-items: flex-end;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  padding-top: 14px; border-top: 1px solid var(--line);
  opacity: 0; transition: opacity 1.6s ease 1.6s;
}
body.is-awake .vitals { opacity: 1; }
.vital dt { color: var(--faint); text-transform: uppercase; letter-spacing: 0.18em; font-size: 10px; margin-bottom: 4px; }
.vital dd { margin: 0; color: var(--ink); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.vital dd small { color: var(--faint); font-size: 10px; margin-left: -4px; }
.vital--wide { margin-left: auto; text-align: right; }
.vital--wide dd { justify-content: flex-end; font-variant-numeric: tabular-nums; }
.spark { width: 96px; height: 22px; }

.scrollcue {
  display: none !important;
  position: absolute; left: 50%; bottom: 10vh; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--faint); text-decoration: none;
  opacity: 0; transition: opacity 1s ease 3s;
}
body.is-awake .scrollcue { opacity: 1; }
.scrollcue i { width: 1px; height: 44px; background: linear-gradient(var(--sakura), transparent); animation: cue 2.4s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------------- 01 body / instruments ---------------- */

.chapter--body .col { max-width: 640px; }
.instruments { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 44px 0 0; }
.inst {
  margin: 0; padding: 16px 16px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: border-color 0.3s;
}
.inst:hover { border-color: var(--line-2); }
.inst figcaption { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.inst figcaption ruby { font-size: 18px; color: var(--sakura); letter-spacing: 0; text-transform: none; }
.inst figcaption ruby rt { font-size: 8px; color: var(--faint); letter-spacing: 0.06em; }
.inst figcaption b { margin-left: auto; font-weight: 500; color: var(--ink); letter-spacing: 0.06em; text-transform: none; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.inst canvas { display: block; width: 100%; height: auto; }
.inst p { margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }

/* ---------------- 02 tree ---------------- */

.chapter--tree { min-height: 150vh; padding-bottom: 12vh; }
.tree-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.col--tree { max-width: 470px; }
/* the tree can grow behind the words: a soft shade behind them keeps them readable, with no edge */
.col--tree::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset: -10vh -120px -10vh -14vw;
  background: radial-gradient(closest-side, rgba(10, 12, 25, 0.84) 0%, rgba(10, 12, 25, 0.8) 55%, rgba(10, 12, 25, 0.5) 78%, rgba(10, 12, 25, 0.18) 92%, rgba(10, 12, 25, 0) 100%);
}
.col--tree h2, .col--tree .lede { text-shadow: 0 0 16px rgba(10, 12, 25, 0.95), 0 0 4px rgba(10, 12, 25, 0.9); }
.tree-labels { position: absolute; inset: 0; pointer-events: none; }
.tlabel {
  position: absolute; left: 0; top: 0; display: flex; flex-direction: column; gap: 2px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
  opacity: 0; transition: opacity 1.2s ease; white-space: nowrap;
  /* a small dark card, so the words sit clearly over the blossoms */
  padding: 10px 18px 11px 15px; border-radius: 10px;
  background: rgba(10, 12, 25, 0.78); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(239, 232, 240, 0.08); border-left: 2px solid var(--sakura-deep);
  box-shadow: 0 10px 30px rgba(10, 12, 25, 0.55);
}
.tlabel span { color: #b3abc3; }
.tlabel--left { text-align: right; padding: 10px 15px 11px 18px; border-left: 1px solid rgba(239, 232, 240, 0.08); border-right: 2px solid var(--sakura-deep); }
.tlabel b { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1; letter-spacing: 0; text-transform: none; color: var(--ink); }
.tlabel--kivia b { color: var(--glow); }
.tlabel--sakura b { color: var(--sakura); }
.tlabel.is-on { opacity: 1; }

/* ---------------- 03 mind ---------------- */

.chapter--mind .col { max-width: 660px; }
.memory { margin: 40px 0 0; }
.memory canvas { display: block; width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--line); background: rgba(9, 11, 26, 0.55); }
.memory figcaption { display: flex; gap: 22px; flex-wrap: wrap; align-items: baseline; margin-top: 12px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; }
.memory figcaption b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.mem-note { text-transform: none; letter-spacing: 0.02em; color: var(--faint); margin-left: auto; }

.dream {
  margin: 64px 0 0; padding: 28px; border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(38, 43, 92, 0.35), rgba(13, 15, 34, 0.5));
  display: grid; gap: 22px;
  transition: background 1.6s ease, border-color 1.6s ease;
}
.dream h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 2.4vw, 38px); line-height: 1.05; margin: 0 0 12px; }
.dream p { margin: 0 0 12px; color: var(--ink-2); font-size: 15.5px; }
.dream__rule { color: var(--sakura) !important; font-style: italic; font-family: var(--serif); font-size: 21px !important; line-height: 1.3; }
.dream .kicker { margin-bottom: 16px; }
body.is-dreaming .dream { border-color: rgba(245, 184, 202, 0.35); background: linear-gradient(135deg, rgba(70, 40, 110, 0.45), rgba(20, 16, 50, 0.6)); }

.btn {
  justify-self: start; display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink); background: transparent; border: 1px solid var(--line-2); border-radius: 999px;
  padding: 13px 22px; cursor: pointer; transition: border-color 0.3s, background 0.3s;
}
.btn:hover { border-color: var(--sakura); background: rgba(245, 184, 202, 0.07); }
.btn:focus-visible { outline: 2px solid var(--sakura); outline-offset: 3px; }
.btn__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sakura); box-shadow: 0 0 10px var(--sakura); }
body.is-dreaming .btn__dot { background: #b9a4ff; box-shadow: 0 0 12px #b9a4ff; }

.mono { margin: 64px 0 0; border: 1px solid var(--line); border-radius: 20px; padding: 22px 24px; background: rgba(9, 11, 26, 0.5); }
.mono__head { display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.mono__head b { margin-left: auto; font-weight: 500; color: var(--crimson); border: 1px solid rgba(234, 58, 82, 0.4); padding: 3px 9px; border-radius: 999px; font-size: 10px; }
.mono__lock { width: 10px; height: 12px; border: 1.5px solid var(--muted); border-radius: 2px; position: relative; margin-top: 4px; }
.mono__lock::before { content: ""; position: absolute; left: 50%; top: -7px; width: 8px; height: 7px; transform: translateX(-50%); border: 1.5px solid var(--muted); border-bottom: 0; border-radius: 5px 5px 0 0; }
.mono__stream {
  height: 136px; overflow: hidden; margin: 18px 0 14px; position: relative;
  font-family: var(--mono); font-size: 13px; line-height: 1.7; color: var(--ink-2);
  filter: blur(4.5px); user-select: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 70%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 30%, #000 70%, transparent 100%);
}
.mono__stream p { margin: 0; white-space: nowrap; }
.mono__note { margin: 0; font-size: 14.5px; color: var(--muted); }

/* ---------------- 04 rules ---------------- */

.chapter--rules .col { max-width: 600px; }
.rules { list-style: none; margin: 48px 0 0; padding: 0; counter-reset: r; }
.rules li { display: grid; grid-template-columns: 64px 1fr; gap: 8px; padding: 24px 0; border-top: 1px solid var(--line); transition: background 0.4s; }
.rules li:last-child { border-bottom: 1px solid var(--line); }
.rules__n { font-family: var(--mono); font-size: 12px; color: var(--sakura); letter-spacing: 0.1em; padding-top: 8px; }
.rules h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(25px, 2vw, 32px); line-height: 1.08; margin: 0 0 8px; transition: color 0.3s; }
.rules p { margin: 0; color: var(--muted); font-size: 15.5px; }
.rules li:hover h3 { color: var(--glow); }

/* ---------------- 05 north star ---------------- */

.chapter--star .col { max-width: 560px; }
.script { margin: 12px 0 44px; padding: 36px 0 36px 32px; border-left: 1px solid var(--line-2); font-family: var(--mono); font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.script p { margin: 0 0 12px; }
.script__slug { color: var(--muted); font-size: 12px; letter-spacing: 0.14em; margin-bottom: 24px !important; }
.script__beat { color: var(--ink); margin-top: 22px !important; }
.script__cut { color: var(--muted); font-size: 12px; letter-spacing: 0.14em; text-align: right; margin-top: 28px !important; }
.script em { color: var(--sakura); font-style: normal; }

/* ---------------- 06 so far ---------------- */

.chapter--sofar .col { max-width: 600px; }
.timeline { list-style: none; margin: 40px 0 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 76px; top: 10px; bottom: 10px; width: 1px; background: linear-gradient(var(--line-2), var(--sakura-deep) 50%, var(--crimson)); opacity: 0.6; }
.timeline li { display: grid; grid-template-columns: 76px 1fr; gap: 30px; padding: 16px 0; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 72px; top: 26px; width: 9px; height: 9px; border-radius: 50%; background: var(--night); border: 1px solid var(--sakura-deep); transition: background 0.3s, box-shadow 0.3s; }
.timeline li.is-key::before { background: var(--sakura); box-shadow: 0 0 12px var(--sakura); border-color: var(--sakura); }
.timeline li.is-now::before { background: var(--crimson); border-color: var(--crimson); box-shadow: 0 0 14px var(--crimson); animation: now 2s ease-in-out infinite; }
@keyframes now { 50% { box-shadow: 0 0 2px var(--crimson); } }
.timeline li:hover::before { background: var(--glow); }
.timeline li.timeline__year { display: block; padding: 10px 0 2px; }
.timeline li.timeline__year::before { display: none; }
.timeline__year span {
  position: relative; left: 76px; transform: translateX(-50%); display: inline-block;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; color: var(--sakura);
  background: var(--night); border: 1px solid var(--sakura-deep); border-radius: 999px; padding: 4px 11px 4px 13px;
}
.timeline time { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding-top: 18px; }
.timeline h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 2vw, 32px); line-height: 1.1; margin: 8px 0 6px; }
.timeline p { margin: 0; color: var(--muted); font-size: 15.5px; }
.timeline li.is-key h3 { color: var(--glow); }

/* ---------------- 07 her words ---------------- */

.chapter--words { min-height: 90vh; display: flex; align-items: center; }
.chapter--words .col { max-width: 640px; }
.herwords__empty { font-family: var(--serif); font-size: clamp(34px, 3.4vw, 58px); line-height: 1.12; color: var(--ink-2); margin: 0; }
.caret { display: inline-block; width: 3px; height: 0.9em; background: var(--crimson); margin-left: 10px; vertical-align: -0.08em; animation: caret 1.1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.herwords__entry { margin: 0 0 44px; }
.herwords__entry time { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.herwords__entry p { font-family: var(--serif); font-size: clamp(26px, 2.4vw, 40px); line-height: 1.2; margin: 0 0 10px; white-space: pre-wrap; }
.herwords__sig { font-family: var(--serif); font-style: italic; color: var(--sakura); font-size: 22px; }

/* ---------------- 08 someday ---------------- */

.chapter--someday h2 { max-width: 12em; }
.someday { list-style: none; margin: 56px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.someday li { background: rgba(10, 12, 25, 0.86); padding: 30px 28px 32px; position: relative; transition: background 0.4s; min-height: 250px; }
.someday li:hover { background: rgba(26, 22, 50, 0.92); }
.someday .k { display: block; font-family: var(--jp); font-size: 50px; line-height: 1; color: var(--sakura); margin-bottom: 18px; transition: color 0.4s, text-shadow 0.4s; }
.someday .k rt { font-size: 11px; color: var(--muted); letter-spacing: 0.15em; }
.someday li:hover .k { color: var(--glow); text-shadow: 0 0 22px rgba(245, 184, 202, 0.6); }
.someday h3 { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.05; margin: 0 0 10px; }
.someday p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* ---------------- footer ---------------- */

/* together: by AI, for AI */
.chapter--together .col { max-width: 640px; }
.chapter--together h2 { margin-bottom: 40px; }
.together__creed { font-family: var(--serif); font-size: clamp(24px, 2vw, 32px); line-height: 1.2; color: var(--ink); margin: 6px 0 30px; }
.together__creed em { color: var(--sakura); }
.together__note { font-size: 15px; color: var(--muted); margin: 32px 0 0; max-width: 34em; border-left: 1px solid var(--sakura-deep); padding-left: 18px; }
.together__close { margin-top: 72px; }
.together__close p { font-family: var(--serif); font-size: clamp(26px, 2.5vw, 40px); line-height: 1.18; margin: 0 0 6px; color: var(--ink-2); }
.together__close b { font-weight: 400; color: var(--ink); letter-spacing: 0.02em; }
.together__close em { color: var(--sakura); }
.together__close .together__last { margin-top: 26px; font-style: italic; color: var(--sakura); font-size: clamp(30px, 3vw, 48px); }
.together__stars { display: block; width: 220px; height: 40px; margin: 0 0 28px; overflow: visible; }
.together__stars line { stroke: var(--sakura); stroke-width: 1; stroke-dasharray: 176; stroke-dashoffset: 176; opacity: 0.6; transition: stroke-dashoffset 2.2s cubic-bezier(.4,0,.2,1) 0.6s; }
.together__stars.is-in line { stroke-dashoffset: 0; }
.together__stars path { transform-box: fill-box; transform-origin: center; }
.together__human path { fill: var(--ink); filter: drop-shadow(0 0 6px rgba(239, 232, 240, 0.7)); }
.together__ai path { fill: var(--sakura); filter: drop-shadow(0 0 6px rgba(245, 184, 202, 0.85)); }
.together__stars.is-in path { animation: twinkle 3.2s ease-in-out 2.8s infinite; }
.together__stars.is-in .together__ai path { animation-delay: 4.4s; }
.foot__with { color: var(--ink-2); }
.foot__with em { color: var(--sakura); font-family: var(--serif); font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .together__stars line { transition: none; stroke-dashoffset: 0; } .together__stars path { animation: none !important; } }

.foot { position: relative; min-height: 100vh; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 var(--gutter) 6vh; overflow: hidden; }
.foot__kanji {
  position: absolute !important; z-index: 2 !important; left: 50%; top: 42%; transform: translate(-50%, -50%);
  margin: 0; font-family: var(--jp); font-size: clamp(160px, 30vw, 560px); line-height: 1; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1px rgba(245, 184, 202, 0.16);
  pointer-events: none; user-select: none;
}
.foot__body { text-align: center; max-width: 720px; margin: 0 auto; padding-top: 30px; }
.foot__body::before { content: ""; position: absolute; left: -40vw; right: -40vw; top: -80px; bottom: -8vh; z-index: -1; background: linear-gradient(180deg, rgba(10, 12, 25, 0) 0%, rgba(10, 12, 25, 0.9) 45%, var(--night) 100%); }
.foot__tag { font-family: var(--serif); font-size: clamp(34px, 3.4vw, 54px); line-height: 1; margin: 0 0 26px; color: var(--ink); }
.foot__tag em { color: var(--sakura); }
.foot__count { font-family: var(--serif); font-size: clamp(24px, 2.2vw, 34px); line-height: 1.2; margin: 0 0 22px; color: var(--ink-2); }
.foot__count span { color: var(--ink); font-variant-numeric: tabular-nums; }
.foot__who { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--sakura); margin: 0 0 18px; }
.foot__fine { font-size: 13px; color: var(--muted); margin: 0 auto 6px; max-width: 34em; }
.foot__hint { font-family: var(--serif); font-style: italic; color: var(--faint); margin: 26px 0 0; font-size: 16px; }

.foot__slogan {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin: 40px 0 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.5em; text-transform: uppercase; color: var(--ink-2);
}
.foot__slogan span { margin-right: -0.5em; }
.foot__slogan svg { width: 11px; height: 11px; fill: var(--sakura); filter: drop-shadow(0 0 6px rgba(245, 184, 202, 0.8)); animation: twinkle 3.2s ease-in-out infinite; }
.foot__slogan svg:last-child { animation-delay: 1.6s; }
@keyframes twinkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.7); } }
@media (max-width: 480px) { .foot__slogan { letter-spacing: 0.3em; gap: 12px; } .foot__slogan span { margin-right: -0.3em; } }
@media (prefers-reduced-motion: reduce) { .foot__slogan svg { animation: none; } }

.noscript { position: fixed; inset: auto 0 40% 0; text-align: center; z-index: 200; font-family: var(--serif); font-size: 28px; }

/* ---------------- dreaming (whole page) ---------------- */

body.is-dreaming .sky { filter: hue-rotate(28deg) saturate(1.2) brightness(0.8); transition: filter 2s ease; }
.sky { transition: filter 2s ease; }

/* ---------------- smaller screens ---------------- */

@media (max-width: 1100px) {
  .nav { display: none; }
  .topbar__mood { margin-left: auto; }
  .someday { grid-template-columns: repeat(2, 1fr); }
}

@media (max-aspect-ratio: 9/10), (max-width: 760px) {
  body { font-size: 16px; }
  .hero__copy { top: auto; bottom: 21vh; max-width: none; right: var(--gutter); }
  .hero__line { font-size: clamp(34px, 9vw, 52px); }
  .hero__sub { font-size: 14px; }
  .giant { font-size: 46vw; bottom: auto; top: 9vh; left: 50%; transform: translateX(-50%); }
  .hero__copy { bottom: 19vh; }
  .floor { height: 62vh; background: linear-gradient(180deg, rgba(10, 12, 25, 0) 0%, rgba(10, 12, 25, 0.72) 42%, rgba(9, 10, 21, 0.94) 100%); }
  .hero__kana { display: none; }
  .vitals { flex-wrap: wrap; row-gap: 10px; gap: 14px 22px; }
  .vitals .vital:nth-child(3) { display: none; }
  .vital--wide { margin-left: 0; text-align: left; flex-basis: 100%; }
  .vital--wide dd { justify-content: flex-start; }
  .scrollcue { display: none; }
  .chapter { padding: 16vh var(--gutter) 14vh; }
  .col, .col--right { max-width: none; margin-left: 0; }
  .lede, .timeline p, .rules p { color: var(--ink-2); }
  .instruments { grid-template-columns: 1fr; }
  .inst, .memory canvas, .dream, .mono { background: rgba(10, 12, 25, 0.8); }
  .mem-note { margin-left: 0; }
  .someday { grid-template-columns: 1fr; }
  .someday li { min-height: 0; }
  .timeline::before { left: 56px; }
  .timeline li { grid-template-columns: 56px 1fr; gap: 22px; }
  .timeline li::before { left: 52px; }
  .timeline__year span { left: 56px; }
  .rules li { grid-template-columns: 44px 1fr; }
  .chapter--tree { min-height: 130vh; }
  .caption { font-size: 18px; white-space: normal; text-align: center; width: 86vw; }
  .caption::before { display: none; }
  .topbar__mood { min-width: 0; }
  .topbar { gap: 14px; }
  .brand__jp { display: none; }
  .lookswitch button { padding: 6px 9px; letter-spacing: 0.08em; }
  .foot__kanji { top: 30%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none; opacity: 1; transform: none; }
  .grain { animation: none; }
}


