/* SPDX-License-Identifier: GPL-3.0-or-later
   megulit.com. Grimoire palette from the app: wine-black ink, crimson, gold leaf. No framework, no external fonts. */

@font-face {
  font-family: "MeguLit Serif";
  src: url("/assets/fonts/megulit-serif.woff2?v=3e722a376f") format("woff2");
  font-weight: 600;
  font-display: swap;
}
/* Same file without the curly quotes: the CJK font draws them full-width, which looks broken in English. */
@font-face {
  font-family: "MeguLit Serif Latin";
  src: url("/assets/fonts/megulit-serif.woff2?v=3e722a376f") format("woff2");
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0000-2017, U+2020-FFFF;
}

:root {
  --bg: #170f11;
  --bg-2: #1e1417;
  --surface: #241a1d;
  --text: #efe5da;
  --muted: #b7a69c;
  --faint: #a08e84;
  --crimson: #c8323f;
  --crimson-ink: #e35a63;
  --gold: #dcab55;
  --gold-soft: rgba(220, 171, 85, .16);
  --line: rgba(220, 171, 85, .2);
  --line-2: rgba(239, 229, 218, .09);
  --glow: rgba(200, 50, 63, .32);
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, .7), 0 0 0 1px rgba(220, 171, 85, .14);
  --btn-text: #fff6ee;
  --page: var(--bg);
  --top-h: 4rem;

  --serif: "MeguLit Serif", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "Noto Serif JP", "Yu Mincho", serif;
  --serif-ja: "Noto Serif JP", "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "MeguLit Serif", serif;
  --sans: system-ui, "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Hiragino Sans", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 75rem;
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f8f1ee;
  --bg-2: #f2e8e4;
  --surface: #fffaf8;
  --text: #2a1518;
  --muted: #5b4542;
  --faint: #66524e;
  --crimson: #a51d2d;
  --crimson-ink: #a51d2d;
  --gold: #82540c;
  --gold-soft: rgba(130, 84, 12, .1);
  --line: rgba(122, 22, 38, .16);
  --line-2: rgba(42, 21, 24, .08);
  --glow: rgba(165, 29, 45, .16);
  --shadow: 0 30px 70px -34px rgba(74, 20, 28, .45), 0 0 0 1px rgba(122, 22, 38, .12);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f8f1ee;
    --bg-2: #f2e8e4;
    --surface: #fffaf8;
    --text: #2a1518;
    --muted: #5b4542;
    --faint: #66524e;
    --crimson: #a51d2d;
    --crimson-ink: #a51d2d;
    --gold: #82540c;
    --gold-soft: rgba(130, 84, 12, .1);
    --line: rgba(122, 22, 38, .16);
    --line-2: rgba(42, 21, 24, .08);
    --glow: rgba(165, 29, 45, .16);
    --shadow: 0 30px 70px -34px rgba(74, 20, 28, .45), 0 0 0 1px rgba(122, 22, 38, .12);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: clamp(16px, .3vw + 12px, 20px); scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.75 var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
:lang(ja) body, html:lang(ja) body { font-family: system-ui, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: .2em; }
a:hover { text-decoration-color: currentColor; }
code, kbd { font-family: var(--mono); font-size: .88em; }
code { background: var(--gold-soft); padding: .1em .35em; border-radius: 4px; }
kbd { font-weight: 600; padding: .1em .5em; border-radius: 6px; background: var(--gold-soft); color: var(--text); border: 1px solid var(--line); box-shadow: inset 0 -1px 0 var(--line); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--crimson); color: #fff; }
.mono { font-family: var(--mono); }
.small { font-size: .875rem; color: var(--muted); }
.wrap { width: 100%; max-width: calc(var(--maxw) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: calc(48rem + 2 * var(--gutter)); }
.skip-link { position: absolute; left: -999px; top: 0; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 50; background: var(--surface); padding: .5rem 1rem; }

/* ---- top bar ---------------------------------------------------------------------------------------------------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line-2);
}
.top-row { display: flex; align-items: center; gap: 1.5rem; height: 4rem; }
.brand img { height: 2.6rem; width: auto; }
.nav { display: flex; gap: 1.6rem; margin-right: auto; font-size: .9375rem; }
.nav a { text-decoration: none; color: var(--muted); transition: color .15s; white-space: nowrap; }
.nav a:hover { color: var(--text); }
.tools { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.lang button, .seg button {
  font: inherit; font-size: .8125rem; color: var(--muted); background: none; border: 0; cursor: pointer;
  padding: .2rem .6rem; border-radius: 999px; min-height: 2rem; min-width: 2.2rem;
  transition: color .15s, background-color .15s;
}
.lang button[aria-pressed="true"], .seg button[aria-pressed="true"] { background: var(--gold-soft); color: var(--text); }
.icon-btn {
  display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 999px;
  color: var(--muted); background: none; border: 1px solid transparent; cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--line); }
.icon-btn svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#theme .moon { display: none; }
:root[data-theme="light"] #theme .sun { display: none; }
:root[data-theme="light"] #theme .moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) #theme .sun { display: none; }
  :root:not([data-theme="dark"]) #theme .moon { display: block; }
}

/* ---- type ------------------------------------------------------------------------------------------------------- */
.display, .h2, .h3, .h4, .steps h3, .dl-version { font-family: var(--serif); font-weight: 600; letter-spacing: -.005em; text-wrap: balance; }
:lang(ja) .display, :lang(ja) .h2, :lang(ja) .h3, :lang(ja) .h4, :lang(ja) .steps h3 { font-family: var(--serif-ja); }
/* CJK headings break at punctuation and spaces, not inside a word; anywhere still prevents overflow */
:lang(zh) :is(.display, .h2, .h3), :lang(ja) .display { word-break: keep-all; overflow-wrap: anywhere; }
.display { font-size: clamp(2.3rem, 4.6vw + .4rem, 4.4rem); line-height: 1.12; margin: 0 0 1.4rem; }
:lang(ja) .display { font-size: clamp(1.6rem, 3.4vw + .3rem, 3.5rem); }
html:lang(en) { --serif: "MeguLit Serif Latin", Georgia, "Times New Roman", serif; }
.h2 { font-size: clamp(1.8rem, 2.4vw + .6rem, 2.75rem); line-height: 1.2; margin: 0 0 .8rem; }
.h3 { font-size: 1.3rem; line-height: 1.35; margin: 0 0 .6rem; }
.h4 { font-size: 1.05rem; margin: 0 0 .6rem; }
.lede { font-size: clamp(1.05rem, .5vw + .9rem, 1.25rem); color: var(--muted); max-width: 34em; margin: 0 0 2rem; text-wrap: pretty; }
.sec-lede { color: var(--muted); max-width: 40em; margin: 0 0 3rem; font-size: 1.0625rem; }
p { text-wrap: pretty; }

/* ---- buttons ---------------------------------------------------------------------------------------------------- */
.cta { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 3rem; padding: .7rem 1.4rem; border-radius: 999px;
  font: 600 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: transform .12s ease, background-color .15s, box-shadow .2s, border-color .15s;
}
.btn:active { transform: scale(.97); }
.btn svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.btn-primary {
  position: relative; isolation: isolate; overflow: hidden; border: 0;
  color: #fff6ee; letter-spacing: .02em;
  background: linear-gradient(135deg, #cc3747, #a81c30 52%, #750e1e);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -2px 0 rgba(0, 0, 0, .28), 0 14px 34px -14px rgba(176, 31, 51, .85);
  font-size: 1.0625rem; min-height: 3.4rem; padding: .8rem 1.9rem;
}
/* a gold beam runs round the edge; a shine crosses on hover */
.btn-primary::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--ang), transparent 0 64%, rgba(255, 225, 160, .2) 72%, #ffe3a6 82%, #e8b85c 88%, transparent 96%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: beam 3.6s linear infinite;
}
.btn-primary::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -70%; width: 45%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .38), transparent);
  transform: skewX(-20deg); transition: left .7s cubic-bezier(.2, .7, .2, 1);
}
.btn-primary:hover::after { left: 130%; }
.btn-primary:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .32), inset 0 -2px 0 rgba(0, 0, 0, .28), 0 18px 44px -14px rgba(200, 40, 60, .95); }
@keyframes beam { to { --ang: 360deg; } }
.btn-xl { min-height: 3.9rem; padding: .95rem 2.3rem; font-size: 1.125rem; }
.btn-quiet {
  color: var(--text); border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 35%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.btn-quiet:hover { border-color: var(--gold); background: var(--gold-soft); }
.btn-wide { width: 100%; margin-top: 1.5rem; }
.cta-meta { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin: 1rem 0 0; color: var(--faint); font-size: .875rem; }
.cta-meta span + span::before { content: ""; display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--gold); opacity: .6; vertical-align: middle; margin: 0 1.1rem 0 -.55rem; transform: translateY(-2px); }

/* ---- hero ------------------------------------------------------------------------------------------------------- */
/* The hero is always dark: it sits on the video, in either theme. The same tokens dress the top bar over it. */
.hero, .top.over {
  --bg: #120a0c; --bg-2: #1a1013; --surface: #241619; --text: #f5ebe0; --muted: #d2c2b6; --faint: #ad9b90;
  --crimson: #d23a48; --crimson-ink: #ff6f78; --gold: #eabb5f; --gold-soft: rgba(234, 187, 95, .16);
  --line: rgba(234, 187, 95, .3); --line-2: rgba(245, 235, 224, .12);
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(234, 187, 95, .16);
  color: var(--text);
}
.top.over { background: linear-gradient(180deg, rgba(12, 6, 8, .7), rgba(12, 6, 8, 0)); border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.hero {
  position: relative; isolation: isolate; overflow: clip; background: #120a0c;
  margin-top: calc(-1 * var(--top-h)); padding: calc(var(--top-h) + clamp(2.5rem, 7vh, 6rem)) 0 1.5rem;
  min-height: min(100svh, 72rem); display: grid; grid-template-rows: 1fr auto; align-items: center; padding-bottom: 5.5rem;
}
.hero-media { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: contrast(1.06) saturate(1.2) brightness(.86); transform: scale(1.06); }
.hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(120deg, rgba(150, 20, 40, .28), transparent 50%),
    linear-gradient(90deg, rgba(18, 10, 12, .55) 0%, rgba(18, 10, 12, .25) 45%, rgba(18, 10, 12, 0) 75%),
    linear-gradient(180deg, rgba(18, 10, 12, .7) 0%, transparent 22%, transparent 70%, rgba(18, 10, 12, .85) 100%);
}
/* the dark hero melts into the page (light or dark) below the chips */
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4.5rem; z-index: -1; pointer-events: none; background: linear-gradient(180deg, transparent, var(--page)); }
.grain {
  position: absolute; inset: -50%; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0%, 100% { transform: translate(0, 0); } 33% { transform: translate(-4%, 3%); } 66% { transform: translate(3%, -5%); } }

/* Megumin's magic circle, drawn in SVG and turning behind the copy */
.circle {
  position: absolute; z-index: 1; width: min(92vmin, 54rem); right: max(-12rem, -10vw); top: 50%;
  translate: var(--px, 0px) calc(-50% + var(--py, 0px)); opacity: .62; mix-blend-mode: screen; overflow: visible;
  transition: translate .6s cubic-bezier(.2, .7, .2, 1);
}
.kana-fx { position: absolute; inset: 0; width: 100%; height: 100%; }
.circle g { transform-box: fill-box; transform-origin: center; }
.c-core { display: none; }
.c-line { fill: none; stroke: var(--gold); stroke-width: 1.2; opacity: .75; }
.c-ticks { fill: none; stroke: var(--gold); stroke-width: 12; stroke-dasharray: 1.4 9; opacity: .5; }
.c-dash { fill: none; stroke: var(--crimson-ink); stroke-width: 1.6; stroke-dasharray: 16 9; }
.c-star { fill: none; stroke: var(--crimson-ink); stroke-width: 1.4; opacity: .5; }
.c-runes { fill: var(--gold); font: 600 15px var(--serif-ja); letter-spacing: 7px; opacity: .9; }
.c-dot { fill: var(--gold); }
@media (prefers-reduced-motion: no-preference) {
  .c-outer { animation: spin 90s linear infinite; }
  .c-inner { animation: spin 56s linear infinite reverse; }
  .c-core { animation: pulse 3.2s ease-in-out infinite; }
}
@keyframes spin { to { rotate: 360deg; } }
@keyframes pulse { 50% { scale: 1.18; opacity: .6; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

.hero-grid { display: grid; grid-template-columns: minmax(0, 46rem); align-items: center; }
.spec-row { max-width: 44rem; margin: 0 0 clamp(4rem, 8vw, 6rem); }
.tilt { transform: perspective(1300px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s cubic-bezier(.2, .7, .2, 1); transform-style: preserve-3d; }

/* 3D type: a crimson extrusion under every glyph, a chromatic flash as it lands */
.hero .display {
  font-size: clamp(2.5rem, 5.4vw + .3rem, 5.4rem); line-height: 1.08; letter-spacing: -.01em;
  text-shadow: 0 1px 0 #8f1d2b, 0 2px 0 #7f1926, 0 3px 0 #6e1521, 0 4px 0 #5d111c, 0 5px 0 #4c0e17, 0 14px 26px rgba(0, 0, 0, .55);
}
:lang(ja) .hero .display { font-size: clamp(1.9rem, 3.5vw + .3rem, 4rem); }
.kinetic .wd { display: inline-block; white-space: nowrap; }
.kinetic .ch { display: inline-block; white-space: pre; }
@media (prefers-reduced-motion: no-preference) {
  .js .kinetic .ch { animation: flip-in 1s cubic-bezier(.16, .8, .2, 1) both; animation-delay: calc(var(--i) * 38ms + .15s); transform-origin: 50% 80%; }
  .js .kinetic.split { animation: chroma 1.4s calc(var(--n, 12) * 38ms + .5s) ease-out both; }
}
@keyframes flip-in {
  from { opacity: 0; transform: perspective(500px) translate3d(0, .4em, -1.2em) rotateX(-100deg); filter: blur(8px); }
  55% { filter: blur(0); }
  to { opacity: 1; transform: none; }
}
@keyframes chroma {
  0% { text-shadow: -4px 0 rgba(255, 40, 70, .9), 4px 0 rgba(70, 220, 255, .8), 0 14px 26px rgba(0, 0, 0, .55); }
  25% { text-shadow: 3px 0 rgba(255, 40, 70, .8), -3px 0 rgba(70, 220, 255, .7), 0 14px 26px rgba(0, 0, 0, .55); }
}
.hero .lede { color: var(--muted); }
.hero .page { background: rgba(30, 17, 20, .58); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); }

.hero-bar { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: clamp(2rem, 6vh, 4rem); }
.chip {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 2.5rem; padding: .4rem 1rem; border-radius: 999px;
  font: 500 .875rem/1 var(--sans); color: var(--text); text-decoration: none; cursor: pointer;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .06);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: border-color .15s, background-color .15s;
}
.chip:hover { border-color: var(--gold); background: var(--gold-soft); }
.chip svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.js-sound[aria-pressed="false"] .s-on, .js-sound[aria-pressed="true"] .s-off { display: none; }

/* GMV ticker: a crimson band and an outlined band running against each other */
.ticker { position: relative; overflow: clip; padding: 1.4rem 0 .6rem; }
.tk { white-space: nowrap; overflow: hidden; margin: 0 -3rem; }
.tk-a { background: linear-gradient(90deg, #8e1527, var(--crimson), #8e1527); color: #fff3ea; transform: rotate(-2.2deg); padding: .6rem 0; box-shadow: 0 16px 34px -16px rgba(0, 0, 0, .6); position: relative; z-index: 1; }
.tk-b { transform: rotate(1.4deg); margin-top: .9rem; padding: .5rem 0; background: var(--bg-2); border-block: 1px solid var(--line); }
.tk-track { display: inline-flex; align-items: center; gap: 2rem; padding-right: 2rem; }
.tk-a .tk-track { font: italic 800 clamp(1.15rem, 1.8vw, 1.7rem)/1.1 var(--sans); letter-spacing: .01em; }
.tk-b .tk-track { font: 700 clamp(1.3rem, 2.2vw, 2rem)/1.1 var(--serif-ja); color: transparent; -webkit-text-stroke: 1px var(--gold); }
.tk-track i { font-style: normal; color: var(--gold); -webkit-text-stroke: 0; font-size: .7em; }
.tk-a .tk-track i { color: #ffd98f; }
@media (prefers-reduced-motion: no-preference) {
  .tk-a .tk-track { animation: marquee 46s linear infinite; }
  .tk-b .tk-track { animation: marquee 62s linear infinite reverse; }
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* The specimen: one line of a game, typeset like a page of the grimoire. */
.specimen { margin: 0; }
.page {
  position: relative; padding: clamp(1.6rem, 3vw, 2.6rem) clamp(1.4rem, 3vw, 2.6rem) 1.6rem;
  background: linear-gradient(160deg, color-mix(in srgb, var(--surface) 92%, var(--crimson) 8%), var(--surface));
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.page::before {
  content: ""; position: absolute; inset: 8px; border: 1px solid var(--line); border-radius: calc(var(--r-lg) - 6px); pointer-events: none;
}
.jp {
  font-family: var(--serif-ja); font-weight: 600; margin: .4em 0 .2em; line-height: 2.1;
  font-size: clamp(1.6rem, 1.2vw + .8rem, 2.3rem); letter-spacing: .02em;
}
.jp .b, .tb-line .b, :lang(zh) .display .b { white-space: nowrap; }
.jp rt { font-size: max(11px, .38em); color: var(--gold); letter-spacing: .08em; font-weight: 500; }
.jp .w { border-radius: 6px; cursor: help; transition: background-color .15s; padding: 0 .04em; }
.jp .w:hover, .jp .w:focus-visible, .jp .w.on { background: var(--gold-soft); outline: none; }
.tr { font-family: var(--serif); color: var(--crimson-ink); font-size: clamp(1.05rem, .8vw + .8rem, 1.35rem); margin: 0 0 1.4rem; }
.gloss {
  display: grid; grid-template-columns: auto 1fr; gap: .35rem 1.2rem; margin: 0; padding-top: 1.1rem;
  border-top: 1px solid var(--line); font-size: .9rem;
}
.gloss dt { font-family: var(--serif-ja); font-weight: 600; white-space: nowrap; transition: color .15s; }
.gloss dt span { font-family: var(--sans); font-weight: 400; color: var(--faint); font-size: .85em; margin-left: .3em; }
.gloss dd { margin: 0; color: var(--muted); transition: color .15s; }
.gloss.focus dt, .gloss.focus dd { color: var(--faint); }
.gloss.focus dt.on, .gloss.focus dd.on { color: var(--text); }
.specimen figcaption, .textbox figcaption { margin-top: .9rem; font-size: .8125rem; color: var(--faint); }

.shot-hero { margin-top: clamp(2rem, 5vw, 4rem); perspective: 1600px; }
.shot-hero img, .pane img, .care-update img {
  border-radius: var(--r-md); box-shadow: var(--shadow); background: #1a1214;
}
.shot-hero img { width: 100%; }

/* page-load: the ruby rises in, then the translation. The only unprompted motion on the page. */
@media (prefers-reduced-motion: no-preference) {
  .js .jp rt { opacity: 0; transform: translateY(.5em); animation: rise .6s cubic-bezier(.2, .7, .2, 1) forwards; }
  .js .jp [data-gloss="0"] rt { animation-delay: .35s; }
  .js .jp [data-gloss="1"] rt { animation-delay: .5s; }
  .js .jp [data-gloss="2"] rt { animation-delay: .65s; }
  .js .tr { opacity: 0; animation: fade .8s ease forwards 1s; }
  .js .gloss { opacity: 0; animation: fade .8s ease forwards 1.3s; }
}
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes fade { to { opacity: 1; } }

/* ---- sections --------------------------------------------------------------------------------------------------- */
.sec { padding: clamp(4.5rem, 10vw, 8rem) 0 0; }
#features { padding-top: clamp(5rem, 11vw, 9rem); }

.embed { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.embed-copy p { color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin-top: .6rem; }
.seg button { font-size: .875rem; padding: .3rem 1rem; }
.seg-sm button { font-size: .8125rem; padding: .15rem .7rem; min-height: 1.8rem; }

.textbox { margin: 0; position: relative; }
.tb-scene {
  aspect-ratio: 16 / 9; border-radius: var(--r-lg);
  background:
    radial-gradient(60% 50% at 70% 30%, rgba(220, 171, 85, .35), transparent 70%),
    radial-gradient(70% 60% at 20% 80%, rgba(200, 50, 63, .45), transparent 70%),
    linear-gradient(180deg, #3b2026, #1b1012);
  box-shadow: var(--shadow);
}
.tb-window {
  position: absolute; left: 4%; right: 4%; bottom: calc(4% + 2.2rem);
  padding: 1.5rem 1.5rem 1.1rem; border-radius: var(--r-md);
  background: rgba(16, 9, 11, .78); color: #f3e9de;
  border: 1px solid rgba(220, 171, 85, .3);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.tb-name {
  position: absolute; top: -.9rem; left: 1.2rem; padding: .1rem .9rem; border-radius: 999px;
  background: #5a1b25; border: 1px solid rgba(220, 171, 85, .5); font-size: .8rem; color: #f7e3c5;
}
.tb-line { font-family: var(--serif-ja); font-size: clamp(1rem, 1.3vw + .5rem, 1.45rem); line-height: 2; margin: 0; }
.tb-line rt { font-size: max(11px, .45em); color: #e6b866; transition: opacity .25s, transform .25s; }
.tb-tr { margin: .2rem 0 0; color: #f08d92; font-family: var(--serif); font-size: clamp(.9rem, .8vw + .55rem, 1.1rem); transition: opacity .25s, transform .25s; }
.textbox[data-state="before"] .tb-line rt { opacity: 0; transform: translateY(.3em); }
.textbox[data-state="before"] .tb-tr { opacity: 0; transform: translateY(-.3em); }

.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 3vw, 3rem); margin-top: clamp(4rem, 8vw, 6rem); padding-top: 2.5rem; border-top: 1px solid var(--line); }
.trio p { color: var(--muted); margin: 0; }
.trio article { padding: 1.6rem 1.5rem; border-radius: var(--r-lg); border: 1px solid var(--line-2); background: color-mix(in srgb, var(--surface) 55%, transparent); }

.tabs { display: flex; gap: .25rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 1.6rem; }
.tabs button {
  font: 500 1rem/1 var(--sans); color: var(--muted); background: none; border: 0; cursor: pointer;
  padding: .9rem 1.1rem; position: relative; min-height: 2.75rem;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: .8rem; right: .8rem; bottom: -1px; height: 2px; background: var(--crimson); border-radius: 2px; }
.pane > p { color: var(--muted); margin: 0 0 1.4rem; max-width: 44em; }

.care { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; margin-top: 2.5rem; }
.care p { color: var(--muted); }
.care-update img { margin-top: 1.6rem; }
.ticks { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: .8rem; }
.ticks li { position: relative; padding-left: 1.6rem; }
.ticks li::before { content: ""; position: absolute; left: .15rem; top: .62em; width: .5rem; height: .5rem; transform: rotate(45deg); background: var(--gold); }

/* engines & games */
.adapters { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); border-top: 1px solid var(--line); }
.adapters li { padding: 1rem 1rem 1rem 0; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: .15rem; }
.adapters b { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; }
.adapters span { color: var(--faint); font-size: .875rem; }
.games-h { margin-top: 3.5rem; }
.games { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.games li { border: 1px solid var(--line); border-radius: 999px; padding: .45rem 1rem; display: flex; gap: .6rem; align-items: baseline; }
.games b { font-family: var(--serif-ja); font-weight: 600; }
.games span { color: var(--faint); font-size: .8125rem; }
.more { margin-top: 2.5rem; border-top: 1px solid var(--line-2); padding-top: 1rem; }
.more summary, .faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: .6rem; min-height: 2.75rem; }
.more summary::-webkit-details-marker, .faq summary::-webkit-details-marker { display: none; }
.more summary::before, .faq summary::before {
  content: ""; flex: none; width: .5rem; height: .5rem; border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold);
  transform: rotate(-45deg); transition: transform .2s;
}
.more[open] summary::before, .faq details[open] summary::before { transform: rotate(45deg); }
.chips { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.chips li { font-size: .8125rem; color: var(--muted); background: var(--gold-soft); border-radius: 6px; padding: .2rem .6rem; }

/* steps: a real sequence, so numbered */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 2.5rem 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.5rem; }
.steps li { counter-increment: s; padding-top: 1.2rem; border-top: 1px solid var(--line); position: relative; }
.steps li::before { content: counter(s); font-family: var(--serif); font-size: 2.4rem; line-height: 1; color: var(--crimson-ink); display: block; margin-bottom: .9rem; }
.steps h3 { font-size: 1.1rem; margin: 0 0 .4rem; }
.steps p { margin: 0; color: var(--muted); font-size: .9375rem; }
.steps code { word-break: break-all; }

/* download */
.sec-dl .dl-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem);
}
.dl-main {
  padding: clamp(1.5rem, 3vw, 2.5rem); border-radius: var(--r-lg);
  background: linear-gradient(170deg, color-mix(in srgb, var(--surface) 90%, var(--crimson) 10%), var(--surface));
  box-shadow: var(--shadow); align-self: start;
}
.dl-version { font-size: clamp(1.5rem, 1.5vw + 1rem, 2.1rem); margin: 0 0 1.4rem; color: var(--gold); }
.facts { margin: 0; display: grid; gap: .7rem; }
.facts > div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 1rem; align-items: baseline; border-bottom: 1px solid var(--line-2); padding-bottom: .7rem; }
.facts dt { color: var(--faint); font-size: .875rem; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts .sha dd { display: flex; gap: .6rem; align-items: flex-start; }
.facts .sha code { background: none; padding: 0; font-size: .78rem; line-height: 1.6; word-break: break-all; color: var(--muted); }
.copy { flex: none; font: 500 .8125rem var(--sans); color: var(--text); background: var(--gold-soft); border: 1px solid var(--line); border-radius: 6px; padding: .2rem .6rem; cursor: pointer; min-height: 2rem; }
.copy:hover { border-color: var(--gold); }
.alt { margin-top: 1.6rem; }
.alt ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.alt a { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem .9rem; border-radius: var(--r-sm); border: 1px solid var(--line-2); text-decoration: none; }
.alt a:hover { border-color: var(--line); background: var(--gold-soft); }
.alt a span:last-child { color: var(--faint); font-size: .875rem; overflow-wrap: anywhere; text-align: right; }
.dl-side { display: grid; gap: 2.2rem; align-content: start; }
.notes-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .6rem; }
.notes-head .seg { margin: 0; }
.notes-body { max-height: 22rem; overflow: auto; padding-right: .5rem; font-size: .9375rem; color: var(--muted); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-top: .6rem; padding-bottom: .6rem; margin-bottom: .8rem; overscroll-behavior: contain; }
.notes-body h4, .rel h4 { font-family: var(--serif); color: var(--text); font-size: 1rem; margin: 1rem 0 .3rem; }
.notes-body ul, .rel ul { margin: 0; padding-left: 1.2rem; }
.notes-body li, .rel li { margin: .25rem 0; }
.link { color: var(--gold); }
.req ul { margin: 0; padding-left: 1.2rem; color: var(--muted); }
.req li { margin: .3rem 0; }
.smart { border-left: 2px solid var(--gold); padding-left: 1.2rem; }
.smart p { margin: 0; color: var(--muted); }

/* faq */
.faq { margin-top: 2rem; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line-2); padding: .4rem 0; }
.faq summary { font-size: 1.0625rem; padding: .5rem 0; }
.faq p { margin: 0 0 1rem 1.1rem; color: var(--muted); }

/* support */
.sec-support { padding-bottom: clamp(4rem, 8vw, 7rem); }
.support { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.support p { color: var(--muted); max-width: 30em; }
.support .cta { margin-top: 1.6rem; }
.btn-quiet svg { stroke: var(--crimson-ink); }
.support-card { border-radius: var(--r-md); box-shadow: var(--shadow); }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 2.5rem 0 3rem; background: var(--bg-2); }
.foot-row { display: grid; grid-template-columns: auto 1fr; gap: 1rem 2.5rem; align-items: center; }
.foot-row img { height: 2.4rem; width: auto; }
.foot nav { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; justify-content: flex-end; font-size: .9375rem; }
.foot nav a { text-decoration: none; color: var(--muted); }
.foot nav a:hover { color: var(--text); }
.foot .small { grid-column: 1 / -1; margin: 0; }

/* changelog page */
.page-head { padding: clamp(3rem, 7vw, 5rem) 0 1rem; }
.releases { list-style: none; padding: 0; margin: 2rem 0 5rem; }
.rel { display: grid; grid-template-columns: 12rem minmax(0, 1fr); gap: 1.5rem 3rem; padding: 2rem 0; border-top: 1px solid var(--line); }
.rel-meta h2 { font-family: var(--serif); font-size: 1.5rem; margin: 0; color: var(--gold); }
.rel-meta p { margin: .2rem 0; color: var(--faint); font-size: .875rem; }
.rel-body { color: var(--muted); font-size: .9375rem; min-width: 0; }
.rel-body h4:first-child { margin-top: 0; }
.rel-latest { font-size: .75rem; color: var(--btn-text); background: var(--crimson); border-radius: 999px; padding: .05rem .55rem; margin-left: .5rem; vertical-align: middle; font-family: var(--sans); }

/* ---- responsive ------------------------------------------------------------------------------------------------- */
@media (max-width: 68rem) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 60rem) {
  .nav { display: none; }
  .hero-grid, .embed, .care, .sec-dl .dl-grid, .support { grid-template-columns: minmax(0, 1fr); }
  .trio { grid-template-columns: minmax(0, 1fr); }
  .rel { grid-template-columns: minmax(0, 1fr); gap: .8rem; }
}
@media (max-width: 40rem) {
  .top-row { gap: .6rem; height: 3.5rem; }
  .brand img { height: 2.1rem; }
  .tools { gap: .25rem; }
  .lang button { min-width: 2rem; padding: .2rem .45rem; }
  .icon-btn { width: 2.2rem; height: 2.2rem; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .btn-primary { width: 100%; }
  .facts > div { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
  .tb-window { position: relative; left: auto; right: auto; bottom: auto; margin: -3.5rem .6rem 0; padding: 1.3rem 1rem .9rem; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs button { flex: none; padding: .9rem .8rem; }
  .foot-row { grid-template-columns: minmax(0, 1fr); }
  .foot nav { justify-content: flex-start; }
  .gloss { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .cta-meta { gap: .2rem 1rem; }
  .cta-meta span + span::before { display: none; }
  .gloss dd { margin-bottom: .5rem; }
}
@media (min-width: 120rem) {
  :root { --maxw: 84rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-delay: 0s !important; }
}

/* ---- motion layer ---------------------------------------------------------------------------------------------- */
/* big outlined kanji behind each section, drifting against the scroll */
section[data-kanji] { position: relative; isolation: isolate; overflow-x: clip; }
section[data-kanji]::before {
  content: attr(data-kanji); position: absolute; z-index: -1; pointer-events: none;
  right: max(var(--gutter), calc(50% - 42rem)); top: clamp(2rem, 7vw, 6rem);
  font: 700 clamp(5.5rem, 15vw, 15rem)/1 var(--serif-ja); writing-mode: vertical-rl; letter-spacing: .04em;
  color: transparent; -webkit-text-stroke: 1px var(--line);
}
/* spotlight cards: a soft glow follows the pointer */
.spot { position: relative; isolation: isolate; }
.spot::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1; opacity: 0; transition: opacity .3s;
  background: radial-gradient(22rem circle at var(--mx, 50%) var(--my, 50%), var(--gold-soft), transparent 65%);
}
.spot:hover::after { opacity: 1; }
.trio .spot { transition: border-color .2s; }
.trio .spot:hover { border-color: var(--line); }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .rise3d { animation: rise3d linear both; animation-timeline: view(); animation-range: entry 0% cover 38%; transform-origin: 50% 100%; }
    section[data-kanji]::before { animation: drift linear both; animation-timeline: view(); }
    .card, .steps li, .adapters li, .fs { animation: pop linear both; animation-timeline: view(); animation-range: entry 0% cover 25%; }
  }
}
@keyframes rise3d { from { opacity: .15; transform: perspective(1400px) rotateX(28deg) translateY(5rem) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes drift { from { transform: translateY(7rem); } to { transform: translateY(-7rem); } }
@keyframes pop { from { opacity: 0; transform: perspective(900px) translateY(2.5rem) rotateX(18deg); } to { opacity: 1; transform: none; } }

@media (max-width: 60rem) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .circle { width: 120vmin; right: -40vmin; top: 30%; }
  .circle { opacity: .4; }
  .hero-scrim { background: linear-gradient(120deg, rgba(150, 20, 40, .32), transparent 55%), linear-gradient(180deg, rgba(18, 10, 12, .55) 0%, rgba(18, 10, 12, .2) 40%, rgba(18, 10, 12, .7) 100%); }
  .hero-video { filter: brightness(.8) saturate(1.15); }
}
@media (max-width: 40rem) {
  :root { --top-h: 3.5rem; }
  .hero { min-height: auto; }
  .hero .display { font-size: clamp(2.2rem, 10vw, 3rem); }
  :lang(ja) .hero .display { font-size: clamp(1.6rem, 7.6vw, 2.4rem); }
  .chip { font-size: .8125rem; }
  section[data-kanji]::before { font-size: 5rem; opacity: .7; }
}
@media (prefers-reduced-motion: reduce) {
  .tk-track, .grain, .circle g, .js .kinetic, .js .kinetic .ch, .btn-primary::before { animation: none !important; }
}

/* ---- anime.js layer ---------------------------------------------------------------------------------------------- */
/* hidden until the intro timeline brings them in; a CSS fallback shows them if the script never runs */
@media (prefers-reduced-motion: no-preference) {
  .js .hero .lede, .js .foot-rule, .js .dl-box, .js .hud-dl, .js .hud-tl, .js .hero-vert, .js .hero-type { opacity: 0; animation: fx-fallback 0s 8s forwards; }
}
@keyframes fx-fallback { to { opacity: 1; } }
.rays-fx { position: absolute; inset: 0; width: 100%; height: 100%; mix-blend-mode: screen; opacity: .7; }
.sparks { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 80; }

/* Aceternity-style hero parallax: a wall of real screens tilted in 3D, straightening as you scroll */
.hp { position: relative; padding: clamp(4rem, 9vw, 7rem) 0 0; height: 230vh; overflow: clip; }
.hp-head { position: relative; z-index: 2; }
.hp-stage { position: sticky; top: 0; height: 100vh; perspective: 1000px; perspective-origin: 50% 0; overflow: visible; }
.hp-rows { display: grid; gap: clamp(1rem, 2.4vw, 2.2rem); padding-top: 6vh; transform-style: preserve-3d; transform-origin: 50% 0; will-change: transform, opacity; }
.hp-row { display: flex; gap: clamp(1rem, 2.4vw, 2.2rem); width: max-content; will-change: transform; }
.hp-row:nth-child(2) { margin-left: -14rem; }
.hp-card {
  margin: 0; position: relative; width: clamp(15rem, 30vw, 30rem); aspect-ratio: 16 / 9; border-radius: var(--r-md); overflow: hidden;
  box-shadow: var(--shadow); background: #1a1214; transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}
.hp-card img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.hp-card figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 2.4rem 1rem .8rem; font: 600 .9375rem/1.2 var(--serif);
  color: #f5ebe0; background: linear-gradient(transparent, rgba(12, 6, 8, .88)); opacity: 0; transition: opacity .25s;
}
.hp-card:hover { transform: translateY(-.6rem) scale(1.02); }
.hp-card:hover figcaption, .hp-card:focus-within figcaption { opacity: 1; }
@media (hover: none) { .hp-card figcaption { opacity: 1; } }
@media (max-width: 40rem) {
  .hp { height: 170vh; }
  .hp-row:nth-child(2) { margin-left: -8rem; }
}
@media (prefers-reduced-motion: reduce) {
  .hp { height: auto; }
  .hp-stage { position: relative; height: auto; overflow-x: auto; padding-bottom: 2rem; }
  .hp-row:nth-child(2) { margin-left: 0; }
}

/* ---- depth of field + glass --------------------------------------------------------------------------------------- */
/* The video stays sharp in a focal pocket and melts into blur toward the edges, like a shallow lens. */
.dof {
  position: absolute; inset: 0;
  backdrop-filter: blur(14px) saturate(1.15); -webkit-backdrop-filter: blur(14px) saturate(1.15);
  -webkit-mask-image: radial-gradient(ellipse 42% 58% at 66% 46%, transparent 35%, rgba(0, 0, 0, .55) 62%, #000 88%);
  mask-image: radial-gradient(ellipse 42% 58% at 66% 46%, transparent 35%, rgba(0, 0, 0, .55) 62%, #000 88%);
}
/* The copy sits on frosted glass with a lit edge, so the video can stay bright behind it. */
.hero-copy {
  position: relative; padding: clamp(1.4rem, 3vw, 2.6rem); border-radius: 28px;
  background: linear-gradient(145deg, rgba(40, 18, 24, .5), rgba(18, 10, 12, .34));
  backdrop-filter: blur(22px) saturate(1.5); -webkit-backdrop-filter: blur(22px) saturate(1.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 40px 90px -40px rgba(0, 0, 0, .8);
}
.hero-copy::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, rgba(255, 236, 200, .55), rgba(234, 187, 95, .18) 30%, rgba(255, 255, 255, .05) 60%, rgba(210, 58, 72, .45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.hero-copy .display { margin-bottom: 1.1rem; }
.hero-copy .lede { margin-bottom: 1.6rem; }
.hero .circle { opacity: .5; }
.hero-bar .chip { background: rgba(30, 14, 18, .38); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); }
@media (max-width: 60rem) {
  .dof { -webkit-mask-image: radial-gradient(ellipse 70% 40% at 50% 22%, transparent 30%, #000 85%); mask-image: radial-gradient(ellipse 70% 40% at 50% 22%, transparent 30%, #000 85%); }
}
@media (max-width: 40rem) {
  .hero-copy { padding: 1.3rem 1.1rem; border-radius: 22px; margin-inline: -.25rem; }
}

/* ---- entrance: the screen is a page of the grimoire, and it turns ---------------------------------------------- */
/* Two full-screen sheets hinged on the left edge: the leather cover turns first, a parchment page follows, and the
   site is underneath. Shading follows --turn (0 flat, 1 on edge), set by intro.js. */
.intro { display: none; }
.intro-on .intro {
  display: block; position: fixed; inset: 0; z-index: 100; cursor: pointer;
  perspective: 2600px; perspective-origin: 0% 50%;
  animation: intro-failsafe .5s 6s forwards; /* if the script never runs, the page gets out of the way */
}
@keyframes intro-failsafe { to { opacity: 0; visibility: hidden; } }
.under-shade { position: absolute; inset: 0; background: #0c0607; opacity: .55; pointer-events: none; }
.sheet { position: absolute; inset: 0; transform-origin: 0 50%; transform-style: preserve-3d; will-change: transform; --turn: 0; }
.sheet .face { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.sheet .back { transform: rotateY(180deg); }
/* light falls off as the page lifts, darkest toward the hinge */
.sheet .face::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, calc(var(--turn) * .55)), rgba(0, 0, 0, calc(var(--turn) * .15)) 55%, rgba(255, 240, 210, calc(var(--turn) * .18)));
}
.sheet .back::after { background: linear-gradient(270deg, rgba(0, 0, 0, calc(var(--turn) * .5)), rgba(0, 0, 0, .05) 60%); }
/* the gutter: the page curves into the spine */
.sheet .front::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: min(9vw, 120px); z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, .18) 45%, transparent);
}

.leather {
  display: grid; place-items: center;
  background:
    radial-gradient(70% 60% at 30% 22%, rgba(255, 140, 140, .2), transparent 55%),
    radial-gradient(80% 70% at 85% 100%, rgba(0, 0, 0, .55), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .32 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(160deg, #8a1b2c, #560c19 55%, #2a050b);
}
.leather::after { content: ""; }
.leather > .corner { z-index: 2; }
.leather .cover-art { position: relative; z-index: 2; display: grid; justify-items: center; gap: 1.2rem; }
.leather img { width: min(62vw, 46rem); height: auto; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .55)) drop-shadow(0 0 24px rgba(234, 187, 95, .35)); }
.leather .tag { font: 600 clamp(1rem, 2.2vw, 1.8rem)/1 var(--serif-ja); color: #e7bf6a; letter-spacing: .6em; padding-left: .6em; text-shadow: 0 1px 0 rgba(0, 0, 0, .6); }
/* gold frame on the cover */
.leather { box-shadow: inset 0 0 0 clamp(14px, 2.4vmin, 28px) transparent; }
.leather .cover-art::before { content: none; }
.leather .frame {
  position: absolute; inset: clamp(16px, 3vmin, 36px) clamp(16px, 3vmin, 36px) clamp(16px, 3vmin, 36px) clamp(40px, 7vmin, 90px);
  border: 2px solid #d9a957; border-radius: 8px; z-index: 2; pointer-events: none;
  box-shadow: inset 0 0 0 7px transparent, inset 0 0 0 8px rgba(217, 169, 87, .5), 0 0 0 1px rgba(0, 0, 0, .35);
}
.leather .corner { position: absolute; width: clamp(40px, 7vmin, 90px); aspect-ratio: 1; border-top: 2px solid #e2b462; border-left: 2px solid #e2b462; border-top-left-radius: 40% 40%; }
.leather .corner::after { content: ""; position: absolute; left: 22%; top: 22%; width: 16%; aspect-ratio: 1; background: #e2b462; transform: rotate(45deg); box-shadow: 0 0 8px rgba(234, 187, 95, .6); }
.leather .c1 { top: clamp(26px, 4.6vmin, 56px); left: clamp(50px, 8.6vmin, 110px); }
.leather .c2 { top: clamp(26px, 4.6vmin, 56px); right: clamp(26px, 4.6vmin, 56px); transform: scaleX(-1); }
.leather .c3 { bottom: clamp(26px, 4.6vmin, 56px); left: clamp(50px, 8.6vmin, 110px); transform: scaleY(-1); }
.leather .c4 { bottom: clamp(26px, 4.6vmin, 56px); right: clamp(26px, 4.6vmin, 56px); transform: scale(-1); }
/* a sweep of light across the gilt */
.glint {
  position: absolute; top: -20%; bottom: -20%; left: 0; width: 22%; z-index: 3; pointer-events: none; transform: translateX(-120%) skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 236, 196, .28), transparent); mix-blend-mode: screen;
}

.parchment {
  background:
    radial-gradient(120% 100% at 0% 50%, rgba(80, 40, 20, .3), transparent 38%),
    radial-gradient(90% 70% at 70% 30%, #fbf1df, #ecdcbf 70%, #d6be95);
}
.parchment .page-ink { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 4vmin; }
.sigil { width: min(48vmin, 30rem); fill: none; stroke: #9e1b2d; stroke-width: 1.2; }
.sigil .t { stroke-dasharray: 1.5 4; stroke-width: 6; opacity: .6; }
.parchment p { margin: 0; font: 600 clamp(1.6rem, 4.4vmin, 3.4rem)/1.7 var(--serif-ja); color: #3a1418; letter-spacing: .1em; }
.parchment rt { font-size: max(11px, .4em); color: #7e1423; }
.endpaper { background: radial-gradient(80% 60% at 60% 40%, #6d1424, #3a0811); }
.endpaper::before { content: ""; position: absolute; inset: 4vmin; border: 1px solid rgba(217, 169, 87, .4); border-radius: 8px; }

.intro .skip {
  position: absolute; right: max(1rem, 3vw); bottom: max(1rem, 3vh); z-index: 4;
  font: 500 .875rem/1 var(--sans); color: rgba(245, 235, 224, .8); background: rgba(0, 0, 0, .25);
  border: 1px solid rgba(245, 235, 224, .22); border-radius: 999px; padding: .6rem 1.1rem; cursor: pointer;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.intro .skip:hover { color: #fff; border-color: rgba(234, 187, 95, .6); }
/* the headline waits behind the closed cover */
.intro-on .kinetic .ch, .intro-on .kinetic.split { animation-play-state: paused !important; }

/* ---- bento ------------------------------------------------------------------------------------------------------ */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(1rem, 1.8vw, 1.5rem); }
.card {
  position: relative; isolation: isolate; border-radius: 26px; padding: clamp(1.4rem, 2.4vw, 2.2rem);
  background: linear-gradient(160deg, color-mix(in srgb, var(--surface) 82%, var(--crimson) 18%), color-mix(in srgb, var(--surface) 70%, transparent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 30px 70px -40px rgba(0, 0, 0, .7);
  transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .45s cubic-bezier(.2, .7, .2, 1);
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 1;
  background: linear-gradient(140deg, color-mix(in srgb, var(--gold) 70%, transparent), transparent 35%, transparent 65%, color-mix(in srgb, var(--crimson) 60%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.card p { color: var(--muted); }
.card-spec { grid-column: span 5; }
.card-embed { grid-column: span 7; }
.card-sm { grid-column: span 4; padding-top: 5.6rem; }
.card-sm p { margin: 0; }
.glyph {
  position: absolute; top: .6rem; right: 1.2rem; font: 700 5.2rem/1 var(--serif-ja);
  background: linear-gradient(160deg, var(--gold), var(--crimson-ink)); -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: .9; filter: drop-shadow(0 6px 18px color-mix(in srgb, var(--crimson) 40%, transparent));
}
.card .specimen { margin-top: 1.2rem; }
.card .page { background: color-mix(in srgb, var(--bg) 55%, transparent); box-shadow: inset 0 0 0 1px var(--line-2); }
.card-embed .seg { margin: .4rem 0 1.4rem; }
.card-embed .textbox { margin: 0; }
.card-embed .tb-window { bottom: calc(4% + 2.2rem); }

/* ---- facts strip -------------------------------------------------------------------------------------------------- */
.facts-strip { padding: clamp(3rem, 7vw, 5rem) 0 0; }
.fs-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; border-block: 1px solid var(--line); padding: 2rem var(--gutter); }
.fs { display: grid; gap: .3rem; }
.fs b {
  font: 600 clamp(2.8rem, 5vw, 4.6rem)/1 var(--serif); font-variant-numeric: tabular-nums;
  background: linear-gradient(170deg, var(--text) 30%, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.fs span { color: var(--muted); font-size: .9375rem; }

/* ---- steps: a line drawn as you scroll ------------------------------------------------------------------------------ */
.steps { position: relative; }
.steps::after {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px; transform-origin: left; pointer-events: none;
  background: linear-gradient(90deg, var(--crimson), var(--gold)); box-shadow: 0 0 14px color-mix(in srgb, var(--crimson) 60%, transparent);
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .steps::after { animation: grow linear both; animation-timeline: view(); animation-range: entry 30% cover 55%; }
  }
}
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (max-width: 68rem) {
  .card-spec, .card-embed { grid-column: span 12; }
  .card-sm { grid-column: span 4; }
}
@media (max-width: 60rem) {
  .card-sm { grid-column: span 12; }
  .fs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 40rem) {
  .card-embed .tb-window { position: relative; bottom: auto; }
  .glyph { font-size: 4rem; }
  .card-sm { padding-top: 4.6rem; }
}
.card-sm { padding-top: 6.6rem; }
.glyph { font-size: 4.4rem; top: 1rem; }
.card-spec { display: flex; flex-direction: column; }
.card-spec .specimen { flex: 1; display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 40rem) { .card-sm { padding-top: 5.4rem; } .glyph { font-size: 3.6rem; } }
/* the specimen inside its card is type on the card, not a second card */
.card .page { background: none; box-shadow: none; padding: .4rem 0 0; }
.card .page::before { display: none; }

/* ---- sound toggle: a round glass button in the hero's corner, like a video player ------------------------------- */
.sound-fab {
  position: absolute; z-index: 3; right: max(var(--gutter), calc(50% - 37.5rem)); bottom: 6.5rem;
  display: inline-flex; align-items: center; gap: .6rem; height: 3.2rem; min-width: 3.2rem; padding: 0 1.05rem;
  border-radius: 999px; border: 1px solid rgba(245, 235, 224, .22); color: #f5ebe0; cursor: pointer;
  background: rgba(24, 12, 15, .42); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 14px 34px -16px rgba(0, 0, 0, .8);
  font: 500 .875rem/1 var(--sans); transition: border-color .2s, background-color .2s;
}
.sound-fab:hover { border-color: #eabb5f; background: rgba(60, 22, 30, .5); }
.sound-fab svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sound-fab .label { max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; transition: max-width .35s cubic-bezier(.2, .7, .2, 1), opacity .25s; }
.sound-fab:hover .label, .sound-fab:focus-visible .label { max-width: 10rem; opacity: 1; }
.sound-fab .eq { display: none; align-items: flex-end; gap: 3px; height: 16px; }
.sound-fab .eq i { width: 3px; height: 100%; border-radius: 2px; background: linear-gradient(#ffd98f, #ff6f78); transform-origin: bottom; animation: eq 1s ease-in-out infinite; }
.sound-fab .eq i:nth-child(2) { animation-delay: -.35s; } .sound-fab .eq i:nth-child(3) { animation-delay: -.7s; } .sound-fab .eq i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.sound-fab[aria-pressed="true"] .eq { display: inline-flex; }
.sound-fab[aria-pressed="true"] svg { display: none; }
.sound-fab[aria-pressed="true"] { border-color: rgba(234, 187, 95, .6); }
@media (hover: none) { .sound-fab .label { max-width: none; opacity: 1; } }
@media (max-width: 40rem) { .sound-fab { position: relative; right: auto; bottom: auto; justify-self: end; margin: 1.2rem var(--gutter) 0 0; height: 2.8rem; } }
@media (prefers-reduced-motion: reduce) { .sound-fab .eq i { animation: none; } }

/* ---- chapters: real footage, one feature at a time -------------------------------------------------------------- */
.chapters .sec-lede { margin-bottom: clamp(3rem, 7vw, 6rem); }
.chap {
  display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: clamp(2rem, 5vw, 5.5rem); align-items: center;
  margin-bottom: clamp(5rem, 11vw, 9rem);
}
.chap:nth-of-type(even) { grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr); }
.chap:nth-of-type(even) .chap-copy { order: 2; }
.chap-copy { position: relative; isolation: isolate; }
.chap-copy::before {
  content: attr(data-k); position: absolute; z-index: -1; left: -.1em; top: -.55em; pointer-events: none; white-space: nowrap;
  font: 700 clamp(4.5rem, 9vw, 8.5rem)/1 var(--serif-ja); color: transparent; -webkit-text-stroke: 1px var(--line); opacity: .9;
}
.chap-n { display: flex; align-items: baseline; gap: .8rem; margin: 0 0 .9rem; color: var(--crimson-ink); }
.chap-n b { font: 600 2.2rem/1 var(--serif); }
.chap-n span { font: 500 .9375rem/1 var(--serif-ja); color: var(--gold); letter-spacing: .2em; }
.chap-t { font-size: clamp(1.9rem, 2.8vw + .5rem, 3.1rem); margin-bottom: 1rem; }
.chap-copy p:last-child { color: var(--muted); font-size: 1.0625rem; max-width: 30em; }
.chap-media {
  position: relative; margin: 0; border-radius: 20px; padding: 10px; isolation: isolate;
  background: linear-gradient(150deg, color-mix(in srgb, var(--surface) 80%, var(--crimson) 20%), color-mix(in srgb, var(--surface) 70%, transparent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 50px 100px -40px rgba(0, 0, 0, .75), 0 30px 80px -50px color-mix(in srgb, var(--crimson) 70%, transparent);
  transform: perspective(1400px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .45s cubic-bezier(.2, .7, .2, 1);
}
.chap-media::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, color-mix(in srgb, var(--gold) 75%, transparent), transparent 40%, transparent 60%, color-mix(in srgb, var(--crimson) 65%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.clip { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 12px; background: #1a1214; object-fit: cover; }
.chap-duo .chap-media { padding-bottom: 18%; }
.chap-duo .clip:first-child { width: 88%; }
.chap-duo .clip-2 { position: absolute; width: 62%; right: -4%; bottom: -6%; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8), 0 0 0 1px var(--line); }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .chap-media { animation: chap-in linear both; animation-timeline: view(); animation-range: entry 0% cover 40%; }
    .chap:nth-of-type(even) .chap-media { animation-name: chap-in-r; }
    .chap-copy::before { animation: drift linear both; animation-timeline: view(); }
  }
}
@keyframes chap-in { from { opacity: .2; transform: perspective(1400px) rotateY(-24deg) rotateX(10deg) translateX(4rem) scale(.9); } to { opacity: 1; transform: perspective(1400px); } }
@keyframes chap-in-r { from { opacity: .2; transform: perspective(1400px) rotateY(24deg) rotateX(10deg) translateX(-4rem) scale(.9); } to { opacity: 1; transform: perspective(1400px); } }
@media (max-width: 60rem) {
  .chap, .chap:nth-of-type(even) { grid-template-columns: minmax(0, 1fr); gap: 1.8rem; }
  .chap:nth-of-type(even) .chap-copy { order: 0; }
}
/* the bento is now 2 x 2 */
.card-spec { grid-column: span 6; }
.card-sm { grid-column: span 6; }
@media (max-width: 60rem) { .card-spec, .card-sm { grid-column: span 12; } }
.hp-card img { aspect-ratio: 16 / 9; }

/* ---- statement: sharpens word by word with the scroll ------------------------------------------------------------- */
.statement { padding: clamp(5rem, 12vw, 10rem) 0 clamp(2rem, 5vw, 4rem); }
.reveal-words {
  margin: 0; max-width: 22em; font: 600 clamp(1.7rem, 3.4vw + .4rem, 3.6rem)/1.35 var(--serif); letter-spacing: -.005em; text-wrap: pretty;
}
:lang(ja) .reveal-words { font-family: var(--serif-ja); }
.reveal-words .rw { transition: color .4s; }
.reveal-words .rw.hot { color: var(--gold); }

/* ---- chapters: sticky stage + tracing beam on wide screens; stacked on phones ------------------------------------- */
.chap-flow { position: relative; }
.chap-stage, .chap-rail { display: none; }
@media (min-width: 60.01rem) {
  .chap-flow { display: grid; grid-template-columns: 2.5rem minmax(0, .78fr) minmax(0, 1.22fr); gap: 0 clamp(2rem, 4vw, 4rem); }
  .chap-rail { display: block; position: relative; }
  .chap-rail::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--line); }
  .chap-rail .beam {
    position: absolute; left: calc(50% - 1px); top: 0; width: 3px; height: calc(var(--p, 0) * 100%); border-radius: 3px;
    background: linear-gradient(180deg, transparent, var(--gold) 30%, var(--crimson-ink));
    box-shadow: 0 0 14px color-mix(in srgb, var(--crimson) 70%, transparent);
  }
  .chap-rail .beam::after {
    content: ""; position: absolute; left: 50%; bottom: -7px; width: 14px; height: 14px; translate: -50% 0; border-radius: 50%;
    background: radial-gradient(circle, #fff3d6 0 30%, var(--gold) 45%, transparent 72%); box-shadow: 0 0 18px var(--gold);
  }
  .chap-list .chap { display: flex; align-items: center; min-height: 82vh; margin: 0; grid-template-columns: none; }
  .chap-list .chap:nth-of-type(even) .chap-copy { order: 0; }
  .chap-list .chap-copy { opacity: .28; transition: opacity .5s; }
  .chap-list .chap.is-on .chap-copy { opacity: 1; }
  .chap-inline { display: none; }
  .chap-stage { display: block; position: relative; }
  .stage-sticky { position: sticky; top: calc(50vh - min(19vw, 17rem) - 2rem); height: calc(min(38vw, 34rem) + 4rem); perspective: 1600px; }
  .stage-item {
    position: absolute; inset: 0 0 auto; opacity: 0; pointer-events: none; animation: none !important;
    transform: perspective(1600px) rotateY(-18deg) rotateX(8deg) translate3d(2rem, 2rem, -6rem) scale(.92);
    transition: opacity .6s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.2, .7, .2, 1);
  }
  .stage-item.on { opacity: 1; pointer-events: auto; transform: none; }
}

/* ---- Anki deck ------------------------------------------------------------------------------------------------------ */
.deck-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.deck { position: relative; height: clamp(22rem, 34vw, 27rem); touch-action: pan-y; outline: none; }
.deck:focus-visible { outline: 2px solid var(--gold); outline-offset: 8px; border-radius: 24px; }
.dcard { position: absolute; left: 6%; top: 8%; width: min(26rem, 82%); aspect-ratio: 5 / 6.2; cursor: grab; perspective: 1400px; user-select: none; -webkit-user-select: none; }
.dcard[data-top] { cursor: grab; }
.dcard:active { cursor: grabbing; }
.dc-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.2, .8, .2, 1); }
.dc-inner.flipped { transform: rotateY(180deg); }
.dc-face {
  position: absolute; inset: 0; border-radius: 24px; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden;
  display: grid; align-content: center; justify-items: center; gap: .8rem; padding: 2rem 1.6rem; text-align: center;
  background: linear-gradient(160deg, color-mix(in srgb, var(--surface) 78%, var(--crimson) 22%), var(--surface));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 30px 60px -24px rgba(0, 0, 0, .7), 0 0 0 1px var(--line);
}
.dc-back { transform: rotateY(180deg); align-content: start; padding: 0 0 1.4rem; }
.dc-back img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.dc-tag { position: absolute; top: 1rem; left: 1rem; font: 600 .75rem/1 var(--sans); color: #fff; background: var(--crimson); padding: .3rem .6rem; border-radius: 999px; }
.dc-word { margin: 0; font: 700 clamp(2.2rem, 4vw, 3rem)/1.6 var(--serif-ja); }
.dc-word rt { font-size: max(11px, .36em); color: var(--crimson-ink); }
.dc-ex { margin: 0; color: var(--muted); font: 500 .9375rem/1.7 var(--serif-ja); max-width: 18em; }
.dc-flip { position: absolute; bottom: 1rem; font-size: .8125rem; color: var(--faint); }
.dc-mean { margin: .4rem 1.4rem 0; font: 600 1.25rem/1.5 var(--serif); }
@media (max-width: 60rem) { .deck-grid { grid-template-columns: minmax(0, 1fr); } .deck { height: 26rem; } .dcard { left: 4%; } }

/* ---- lamp over the download section -------------------------------------------------------------------------------- */
.sec-dl { isolation: isolate; }
.lamp { position: absolute; z-index: -1; left: 50%; top: 0; width: min(64rem, 100vw); height: 30rem; translate: -50% 0; pointer-events: none; }
.lamp::before {
  content: ""; position: absolute; inset: 0;
  background: conic-gradient(from 148deg at 50% 0%, transparent 0deg, color-mix(in srgb, var(--crimson) 55%, transparent) 18deg, color-mix(in srgb, var(--gold) 35%, transparent) 32deg, color-mix(in srgb, var(--crimson) 55%, transparent) 46deg, transparent 64deg);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%); mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  filter: blur(6px); transform-origin: 50% 0;
}
.lamp::after {
  content: ""; position: absolute; left: 32%; right: 32%; top: 0; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, #ffe3a6, transparent); box-shadow: 0 0 24px 6px color-mix(in srgb, var(--gold) 60%, transparent), 0 0 80px 20px color-mix(in srgb, var(--crimson) 40%, transparent);
}
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .lamp::before { animation: lamp-open linear both; animation-timeline: view(); animation-range: entry 0% cover 35%; }
    .lamp::after { animation: lamp-bar linear both; animation-timeline: view(); animation-range: entry 0% cover 35%; }
  }
}
@keyframes lamp-open { from { transform: scaleX(.35); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes lamp-bar { from { left: 44%; right: 44%; } to { left: 30%; right: 30%; } }

/* ---- glowing edge following the pointer ------------------------------------------------------------------------------ */
.glow-edge {
  position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none; z-index: 2;
  background: conic-gradient(from calc(var(--glow-a, 0deg) - 50deg), transparent 0deg, var(--gold) 30deg, var(--crimson-ink) 50deg, var(--gold) 70deg, transparent 100deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: var(--glow-o, 0); transition: opacity .35s;
}

/* ---- ticker: driven by script when motion is on; soft edges ---------------------------------------------------------- */
.fx-vel .tk-track { animation: none !important; will-change: transform; }
.ticker { cursor: grab; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.ticker:active { cursor: grabbing; }
.tk { -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }

/* ---- hero as a poster: type as the artwork, a download seal, no panel ---------------------------------------------- */
.hero-stage { position: relative; display: grid; grid-template-rows: 1fr auto; gap: 2rem; min-height: calc(100svh - var(--top-h) - 7rem); padding: 0 var(--gutter); }
/* the headline inverts against the video (difference blend), so it reads on bright and dark frames alike */
.hero-type { margin: 0; align-self: center; color: #fff; mix-blend-mode: difference; font-family: var(--serif); font-weight: 700; line-height: .86; }
.ht-pre { display: block; margin: 0 0 1.2vw .5vw; font: italic 500 clamp(1.4rem, 3vw, 2.9rem)/1.1 var(--serif); letter-spacing: .01em; }
.ht-big { display: block; font-size: clamp(5.6rem, 21vw, 23rem); letter-spacing: -.045em; white-space: nowrap; }
.ht-big ruby { ruby-position: over; }
.ht-big rt { font: 600 .11em/1 var(--sans); letter-spacing: .32em; text-indent: .32em; opacity: .9; }
.ht-big small { font-size: .28em; letter-spacing: 0; margin-left: .1em; }
:lang(ja) .ht-big { font-size: clamp(4.4rem, 16vw, 17rem); font-family: var(--serif-ja); letter-spacing: -.02em; }
:lang(en) .ht-big { font-size: clamp(3.4rem, 11vw, 12rem); white-space: normal; line-height: .88; letter-spacing: -.035em; }
.hero-type .wd { white-space: nowrap; }
.hero-vert {
  position: absolute; right: var(--gutter); top: 0; margin: 0; writing-mode: vertical-rl; pointer-events: none;
  font: 700 clamp(1.6rem, 3.4vw, 3.3rem)/1 var(--serif-ja); letter-spacing: .3em;
  color: transparent; -webkit-text-stroke: 1px var(--gold); filter: drop-shadow(0 0 18px rgba(234, 187, 95, .25));
}
.hero-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem 3rem; flex-wrap: wrap; }
.hero .lede { max-width: 25em; margin: 0; color: var(--text); font-size: clamp(1rem, .4vw + .85rem, 1.15rem); text-shadow: 0 1px 14px rgba(0, 0, 0, .65); }
.hero .lede::before { content: ""; display: block; width: 3.2rem; height: 2px; margin-bottom: 1rem; background: linear-gradient(90deg, var(--gold), var(--crimson-ink)); }

/* download seal: a crimson core inside a ring of turning rune text */
.hero-dl { display: flex; align-items: center; gap: 1.4rem; }
.dl-orb { position: relative; display: grid; place-items: center; width: clamp(8.5rem, 11.5vw, 11.5rem); aspect-ratio: 1; border-radius: 50%; color: #fff; text-decoration: none; }
.orb-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.orb-ring text { fill: var(--gold); font: 600 13px var(--sans); }
:lang(zh) .orb-ring text, :lang(ja) .orb-ring text { font-size: 14px; }
@media (prefers-reduced-motion: no-preference) {
  .orb-ring { animation: spin 16s linear infinite; }
  .dl-orb:hover .orb-ring, .dl-orb:focus-visible .orb-ring { animation-duration: 4s; }
  .dl-orb::after { content: ""; position: absolute; inset: 19%; border-radius: 50%; border: 1px solid rgba(255, 200, 150, .7); animation: orb-pulse 2.6s cubic-bezier(.2, .7, .2, 1) infinite; pointer-events: none; }
}
@keyframes orb-pulse { from { transform: scale(1); opacity: .9; } to { transform: scale(1.75); opacity: 0; } }
.orb-core {
  position: relative; width: 62%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; align-content: center; gap: .15rem;
  background: radial-gradient(circle at 34% 28%, #e4485a, #b8243a 46%, #6a0d1b);
  box-shadow: inset 0 0 0 1px rgba(255, 222, 176, .55), inset 0 -8px 16px rgba(0, 0, 0, .35), 0 20px 44px -12px rgba(200, 30, 50, .8), 0 0 0 9px rgba(210, 58, 72, .14);
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), box-shadow .3s;
}
.orb-core svg { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.orb-core b { font: 700 .95rem/1 var(--sans); text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
:lang(ja) .orb-core b { font-size: .85rem; }
.dl-orb:hover .orb-core { transform: scale(1.08); box-shadow: inset 0 0 0 1px rgba(255, 222, 176, .8), inset 0 -8px 16px rgba(0, 0, 0, .35), 0 26px 56px -12px rgba(220, 40, 60, .95), 0 0 0 12px rgba(234, 187, 95, .2); }
.dl-orb:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; }
.hero-dl-meta { display: grid; gap: .6rem; }
.hero-dl-meta .cta-meta { display: grid; gap: .25rem; margin: 0; color: var(--muted); }
.hero-dl-meta .cta-meta span + span::before { display: none; }
.alt-link { color: var(--gold); font-size: .9375rem; text-underline-offset: .3em; text-decoration-color: color-mix(in srgb, var(--gold) 50%, transparent); }
.alt-link:hover { text-decoration-color: var(--gold); }

@media (max-width: 60rem) {
  .hero-stage { min-height: auto; padding-top: 4vh; }
  .hero-vert { top: -1rem; font-size: 1.5rem; }
}
@media (max-width: 40rem) {
  .ht-big { font-size: 27vw; }
  :lang(ja) .ht-big { font-size: 20vw; }
  :lang(en) .ht-big { font-size: 15vw; }
  .ht-pre { font-size: 1.35rem; margin-bottom: .6rem; }
  .hero-vert { font-size: 1.2rem; right: .4rem; }
  .hero-foot { flex-direction: column; align-items: stretch; }
  .hero-dl { justify-content: space-between; }
  .dl-orb { width: 8.5rem; }
}

/* ---- hero, round 2: crimson duotone video, solid type, sound toggle up top ---------------------------------------- */
.hero-video { filter: grayscale(1) contrast(1.3) brightness(.78) !important; }
.hero-tint { position: absolute; inset: 0; background: linear-gradient(135deg, #d9374a, #a3182c 55%, #5c0b18); mix-blend-mode: multiply; }
.hero-scrim { background: radial-gradient(120% 90% at 70% 40%, transparent 30%, rgba(14, 6, 8, .55) 100%), linear-gradient(180deg, rgba(14, 6, 8, .55), transparent 25%, transparent 70%, rgba(14, 6, 8, .8)) !important; }
.dof { -webkit-mask-image: radial-gradient(ellipse 60% 70% at 62% 45%, transparent 40%, #000 90%); mask-image: radial-gradient(ellipse 60% 70% at 62% 45%, transparent 40%, #000 90%); }
.hero-type { mix-blend-mode: normal; color: #fbeedd; }
.ht-big { padding-top: .14em; text-shadow: 0 .02em 0 #7a1424, 0 .04em 0 #5e0f1c, 0 .08em .18em rgba(0, 0, 0, .45); }
.ht-big rt { color: var(--gold); text-shadow: none; }
.ht-pre { color: #f3d9b8; }
.hero-type .ch:has(ruby) { display: inline-block; }
.sound-fab { top: calc(var(--top-h) + 1.4rem); bottom: auto; left: var(--gutter); right: auto; }
@media (max-width: 40rem) { .sound-fab { position: absolute; top: calc(var(--top-h) + .8rem); left: auto; right: 3.2rem; margin: 0; } }
.ht-big ruby, .ht-big rt { ruby-align: center; }
.ht-big rt { letter-spacing: .12em; text-indent: 0; }
.ticker { overflow: hidden; }
html { overflow-x: clip; }

/* ---- feature switcher (replaces the long chapter scroll) ------------------------------------------------------------ */
.feat { display: grid; grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
.feat-tabs { display: grid; gap: .25rem; }
.ft {
  position: relative; display: grid; gap: .35rem; text-align: left; padding: 1rem 1.1rem 1.1rem; border: 0; border-radius: 16px; cursor: pointer;
  background: transparent; color: var(--muted); font: inherit; transition: background-color .25s, color .25s;
}
.ft:hover { color: var(--text); background: color-mix(in srgb, var(--surface) 50%, transparent); }
.ft[aria-selected="true"] { color: var(--text); background: color-mix(in srgb, var(--surface) 80%, var(--crimson) 8%); box-shadow: inset 0 0 0 1px var(--line-2); }
.ft-head { display: flex; align-items: baseline; gap: .6rem; }
.ft-n { font: 600 1.05rem/1 var(--serif); color: var(--crimson-ink); min-width: 1.6rem; }
.ft-k { font: 500 .8125rem/1 var(--serif-ja); color: var(--gold); letter-spacing: .18em; }
.ft-t { font: 600 clamp(1.1rem, .6vw + .9rem, 1.35rem)/1.35 var(--serif); }
:lang(ja) .ft-t { font-family: var(--serif-ja); }
.ft-d { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s cubic-bezier(.2, .7, .2, 1); }
.ft-d > span { overflow: hidden; font-size: .9375rem; line-height: 1.7; color: var(--muted); }
.ft[aria-selected="true"] .ft-d { grid-template-rows: 1fr; }
.ft-bar { position: absolute; left: 1.1rem; right: 1.1rem; bottom: .45rem; height: 2px; border-radius: 2px; background: var(--line-2); opacity: 0; transition: opacity .3s; }
.ft-bar i { position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--crimson-ink), var(--gold)); border-radius: inherit; }
.ft[aria-selected="true"] .ft-bar { opacity: 1; }
.feat-stage {
  position: sticky; top: calc(var(--top-h) + 2rem); aspect-ratio: 16 / 9.4; border-radius: 22px; padding: 10px; isolation: isolate;
  background: linear-gradient(150deg, color-mix(in srgb, var(--surface) 80%, var(--crimson) 20%), color-mix(in srgb, var(--surface) 70%, transparent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 50px 100px -40px rgba(0, 0, 0, .75), 0 30px 80px -50px color-mix(in srgb, var(--crimson) 70%, transparent);
}
.feat-stage::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, color-mix(in srgb, var(--gold) 75%, transparent), transparent 40%, transparent 60%, color-mix(in srgb, var(--crimson) 65%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.feat-item { position: absolute; inset: 10px; margin: 0; opacity: 0; transform: scale(.97); transition: opacity .55s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.feat-item.on { opacity: 1; transform: none; }
.feat-item .clip { width: 100%; height: 100%; border-radius: 13px; }
.feat-item.duo .clip:first-child { width: 86%; height: auto; }
.feat-item.duo .clip-2 { position: absolute; width: 58%; height: auto; right: -2%; bottom: -4%; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8), 0 0 0 1px var(--line); }
@media (max-width: 60rem) {
  .feat { grid-template-columns: minmax(0, 1fr); }
  .feat-stage { order: -1; position: relative; top: auto; }
}

/* ---- entrance, round 3: one parchment page that curls as it turns -------------------------------------------------- */
.intro-on .intro { perspective: 2200px; perspective-origin: 0% 50%; }
.intro .curl { position: absolute; inset: 0; transform-style: preserve-3d; }
.intro .strip { position: absolute; top: 0; height: 100%; transform-origin: 0 50%; transform-style: preserve-3d; --d: 0; }
.intro .sf { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background-repeat: no-repeat; }
.intro .sf::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(40, 18, 10, var(--d0, 0)), rgba(40, 18, 10, var(--d1, 0))); }
.intro .back { transform: rotateY(180deg); }
.intro .back::after { background: linear-gradient(270deg, rgba(40, 18, 10, calc(var(--d0, 0) * .8 + .06)), rgba(40, 18, 10, calc(var(--d1, 0) * .8 + .06))); }
/* fibres and a soft grain, so it reads as paper and not as a board */
.intro .front::before, .intro .back::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .9' numOctaves='3' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 .45  0 0 0 0 .32  0 0 0 0 .2  0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
}
/* skip sits on light parchment now */
.intro .skip { color: #3a1418; background: rgba(255, 248, 236, .55); border-color: rgba(58, 20, 24, .35); }
.intro .skip:hover { color: #1a0a0c; border-color: #9e1b2d; }

/* ---- hero, round 3: the megu-edit look -------------------------------------------------------------------------------
   two poles (black #000 / paper #f4f4f2), mono footage, one accent (#c8323c), lowercase tracked mono micro-text,
   a roman/han serif headline with a soft glow, dashed rules, a running number, barcode stripes, focus pull to open. */
@font-face { font-family: "MeguLit Mono"; src: url("/assets/fonts/plex-mono.woff2?v=a586e0a3f4") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "MeguLit Cormorant"; src: url("/assets/fonts/cormorant-italic.woff2?v=1ea903835d") format("woff2"); font-style: italic; font-display: swap; }
@font-face { font-family: "MeguLit Han"; src: url("/assets/fonts/han-serif-hero.woff2?v=dfe4d6db28") format("woff2"); font-weight: 600; font-display: swap; }
.hero { --paper: #f4f4f2; --accent: #c8323c; --dim: #8a8a8a; background: #000; }
.hero-tint, .rays-fx { display: none; }
.hero-video {
  filter: grayscale(1) contrast(1.12) brightness(.5) blur(14px) !important; scale: 1.12;
  transition: filter 1.8s cubic-bezier(.16, 1, .3, 1), scale 2.6s cubic-bezier(.16, 1, .3, 1);
  animation: vdrift 38s ease-in-out infinite alternate;
}
.hero.focused .hero-video { filter: grayscale(1) contrast(1.12) brightness(.5) !important; scale: 1.04; }
@keyframes vdrift { to { translate: -1.6% -1.2%; } }
.hero-scrim { background: radial-gradient(ellipse 85% 75% at 55% 45%, transparent 35%, rgba(0, 0, 0, .78) 100%), linear-gradient(180deg, rgba(0, 0, 0, .5), transparent 22%, transparent 70%, rgba(0, 0, 0, .85)) !important; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: 5; background: var(--paper); opacity: 0; pointer-events: none; }
.hero.flash::before { opacity: .9; }

.hud { display: flex; flex-wrap: wrap; gap: .4rem 1.6em; margin: 0; font: 300 .75rem/1.6 "MeguLit Mono", var(--mono); letter-spacing: .35em; color: var(--dim); text-transform: lowercase; }
.hud-tl { position: absolute; top: .2rem; right: calc(var(--gutter) + 3.6rem); }
.typed { margin: 0 0 2.4rem; font: 300 .8125rem/1 "MeguLit Mono", var(--mono); letter-spacing: .5em; color: #bdbdbd; text-transform: lowercase; }
.caret { color: var(--accent); font-weight: 400; margin-left: .2em; animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

.hero-type { color: var(--paper) !important; font-family: "MeguLit Han", var(--serif); }
.ht-big { font-family: "MeguLit Han", var(--serif); font-weight: 600; text-shadow: 0 0 .22em rgba(255, 255, 255, .16), 0 0 1.1em rgba(255, 255, 255, .07) !important; letter-spacing: -.02em; }
:lang(ja) .ht-big { font-family: "MeguLit Han", var(--serif-ja); }
:lang(en) .ht-big { font-family: "MeguLit Cormorant", "Cormorant Garamond", Georgia, serif; font-style: italic; font-weight: 500; letter-spacing: -.01em; }
.ht-big rt { color: var(--dim) !important; font: 300 .09em/1 "MeguLit Mono", var(--mono) !important; letter-spacing: .4em !important; text-shadow: none; }
.ht-pre { font: italic 500 clamp(1.3rem, 2.4vw, 2.3rem)/1.1 "MeguLit Cormorant", "MeguLit Han", var(--serif); color: #bdbdbd !important; letter-spacing: .02em; }
.hero-vert {
  color: #bdbdbd; -webkit-text-stroke: 0; filter: none; font: 600 clamp(1rem, 1.3vw, 1.25rem)/1 "MeguLit Han", var(--serif-ja);
  letter-spacing: .45em; top: 3rem;
}
.hero-vert::after { content: "▮"; color: var(--accent); margin-top: .3em; }

.hero-foot { flex-wrap: wrap; row-gap: 1.6rem; }
.foot-rule {
  flex: 1 0 100%; display: flex; align-items: center; gap: 1.6rem; padding-top: .9rem; border-top: 1px dashed rgba(244, 244, 242, .28);
  font: 300 .75rem/1 "MeguLit Mono", var(--mono); letter-spacing: .35em; color: var(--dim); text-transform: lowercase;
}
.barcode {
  margin-left: auto; width: 7.5rem; height: .85rem; opacity: .7;
  background: repeating-linear-gradient(90deg, var(--paper) 0 2px, transparent 2px 4px, var(--paper) 4px 5px, transparent 5px 8px, var(--paper) 8px 11px, transparent 11px 12px, var(--paper) 12px 13px, transparent 13px 17px);
}
.hero .lede { color: #c9c9c6; font-size: .9375rem; letter-spacing: .04em; text-shadow: none; max-width: 28em; }
.hero .lede::before { display: none; }

.hero-dl { align-items: flex-end; gap: 1.6rem; }
.dl-box {
  position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .55rem 2rem; min-width: 19rem;
  padding: 1rem 1.3rem 1.1rem; border: 1px solid var(--paper); background: rgba(0, 0, 0, .35); color: var(--paper); text-decoration: none;
}
.db-hud { grid-column: 1 / -1; display: flex; align-items: center; gap: .7rem; font: 300 .75rem/1 "MeguLit Mono", var(--mono); letter-spacing: .45em; color: var(--dim); }
.db-hud::before { content: ""; width: .5rem; height: .5rem; background: var(--accent); }
.db-main { font: 600 1.2rem/1.2 "MeguLit Han", var(--serif); letter-spacing: .04em; }
.db-arrow { font: 300 1.4rem/1 "MeguLit Mono", var(--mono); }
/* hover: a hard invert to paper, the way the user cuts on accents */
.dl-box:hover, .dl-box:focus-visible { background: var(--paper); color: #000; outline: none; }
.dl-box:hover .db-hud, .dl-box:focus-visible .db-hud { color: #111; }
.dl-box:active { scale: .98; }
.hud-dl { display: grid; gap: .25rem; }
.hud-dl .alt-link { color: var(--paper); letter-spacing: .1em; text-decoration: underline dashed rgba(244, 244, 242, .5); text-underline-offset: .35em; margin-top: .4rem; }
.sound-fab { background: rgba(0, 0, 0, .5); border-color: rgba(244, 244, 242, .25); border-radius: 0; }
.sound-fab .eq i { background: var(--accent); }
.sound-fab[aria-pressed="true"] { border-color: var(--accent); }
@media (max-width: 40rem) {
  .hud-tl { display: none; }
  .typed { letter-spacing: .3em; margin-bottom: 1.6rem; font-size: .75rem; }
  .dl-box { min-width: 0; width: 100%; }
  .hero-dl { flex-direction: column; align-items: stretch; }
  .foot-rule span:nth-child(2) { display: none; }
}
@media (prefers-reduced-motion: reduce) { .hero-video { filter: grayscale(1) contrast(1.12) brightness(.5) !important; scale: 1.04; } }
/* hero round 3 fixes: sound toggle top-right beside the hud; phone stacks the foot */
.hero .sound-fab { top: calc(var(--top-h) + .9rem); left: auto; right: var(--gutter); bottom: auto; }
.hud-tl { top: .9rem; right: calc(var(--gutter) + 4.6rem); }
.hero-vert { top: 4.8rem; }
@media (max-width: 40rem) {
  .hero-foot { display: grid; gap: 1.4rem; }
  .foot-rule { flex: none; }
  .hero-vert { display: none; }
  .hero .sound-fab { position: absolute; top: calc(var(--top-h) + .6rem); right: var(--gutter); margin: 0; }
  .typed { margin-top: 3.4rem; }
}
/* download, round 4: a solid paper slab (the paper pole), black type, the arrow on a black block */
.dl-box {
  grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: .5rem 1.4rem; min-width: min(24rem, 100%);
  padding: 1.05rem .9rem 1.05rem 1.4rem; border: 0; background: var(--paper); color: #0b0b0b;
  box-shadow: 0 0 0 1px var(--paper), 0 24px 60px -28px rgba(0, 0, 0, .9);
  transition: background-color 0s, color 0s;
}
.db-hud { grid-column: 1; grid-row: 1; gap: 1.1rem; color: #6b6b6b; }
.db-hud > span + span { position: relative; }
.db-hud::before { background: var(--accent); }
.db-main { grid-column: 1; grid-row: 2; font-size: clamp(1.35rem, 1.2vw + .9rem, 1.7rem); letter-spacing: .02em; }
.db-arrow { grid-column: 2; grid-row: 1 / 3; align-self: stretch; display: grid; place-items: center; width: 3.6rem; background: #0b0b0b; color: var(--paper); }
.db-arrow svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: square; transition: transform .35s cubic-bezier(.16, 1, .3, 1); }
.dl-box:hover, .dl-box:focus-visible { background: #0b0b0b; color: var(--paper); box-shadow: 0 0 0 1px var(--paper); }
.dl-box:hover .db-hud, .dl-box:focus-visible .db-hud { color: #9a9a9a; }
.dl-box:hover .db-arrow, .dl-box:focus-visible .db-arrow { background: var(--accent); }
.dl-box:hover .db-arrow svg, .dl-box:focus-visible .db-arrow svg { transform: translateY(4px); }
.hud-dl .js-size { display: none; }

/* download slab: arrow block flush to the edge; phones let the small line wrap */
.dl-box { padding: 0 0 0 1.4rem; }
.db-hud { padding-top: 1.05rem; flex-wrap: wrap; row-gap: .2rem; }
.db-main { padding-bottom: 1.1rem; }
.hero-foot > * { min-width: 0; }
@media (max-width: 40rem) { .dl-box { min-width: 0; } .db-hud { letter-spacing: .3em; } }

/* sound toggle + volume, together in the hero's top-right corner */
.sound-ctl { position: absolute; z-index: 3; top: calc(var(--top-h) + .9rem); right: var(--gutter); display: flex; align-items: center; gap: .6rem; flex-direction: row-reverse; }
.hero .sound-ctl .sound-fab { position: static; margin: 0; }
.vol {
  display: flex; align-items: center; gap: .7rem; height: 3.2rem; padding: 0 1rem; color: var(--paper);
  background: rgba(0, 0, 0, .5); border: 1px solid rgba(244, 244, 242, .25);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  font: 300 .75rem/1 "MeguLit Mono", var(--mono); letter-spacing: .3em; text-transform: lowercase;
}
.vol-k { color: var(--dim); }
.vol-v { min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; letter-spacing: .1em; }
#hero-volume { --fill: 5%; -webkit-appearance: none; appearance: none; width: 8.5rem; height: 2px; margin: 0; cursor: pointer; background: linear-gradient(90deg, var(--accent) var(--fill), rgba(244, 244, 242, .25) var(--fill)); }
#hero-volume::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; background: var(--paper); border: 0; }
#hero-volume::-moz-range-thumb { width: 12px; height: 12px; background: var(--paper); border: 0; border-radius: 0; }
#hero-volume:focus-visible { outline: 1px solid var(--paper); outline-offset: 6px; }
@media (max-width: 40rem) {
  .sound-ctl { top: calc(var(--top-h) + .6rem); flex-direction: column; align-items: flex-end; }
  .vol { height: 2.6rem; }
  #hero-volume { width: 6.5rem; }
}
/* nothing highlights on double-click or drag; copyable things stay selectable */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
code, .js-sha, .facts dd, .notes-body, .rel-body, .faq details p, input, textarea { -webkit-user-select: text; user-select: text; }
img, video, canvas, svg { -webkit-user-drag: none; user-drag: none; }

/* floating kana with depth of field over the whole page; the hero copy stays above it */
.kana-sky { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 1; pointer-events: none; }
.hero-stage { position: relative; z-index: 2; }
.top { z-index: 20; }
.vol[hidden] { display: none; }
/* Chinese hero title in a brush hand (Zhi Mang Xing, OFL); Japanese and English keep their serif faces */
@font-face { font-family: "MeguLit Black"; src: url("/assets/fonts/hero-black.woff2?v=b047ecb4f8") format("woff2"); font-weight: 900; font-display: swap; }
:lang(zh) .ht-big { font-family: "MeguLit Black", "MeguLit Han", var(--serif); font-weight: 900; letter-spacing: .01em; font-size: clamp(5.5rem, 21vw, 23rem); line-height: 1; text-shadow: 0 0 .25em rgba(244, 244, 242, .22); }
:lang(zh) .ht-big rt { font-size: max(11px, .08em) !important; }
@media (max-width: 40rem) { :lang(zh) .ht-big { font-size: 30vw; } }
/* round: no lamp, a shorter screen wall, less air around the deck */
.lamp { display: none; }
.hp { height: 150vh; }
@media (max-width: 40rem) { .hp { height: 120vh; } }
.deck-sec { padding-top: clamp(2rem, 5vw, 4rem); }

/* ---- entrance, round 4: glitch (photosensitive-safe: displacement and colour fringes, no flashing) ------------------ */
.intro-on .intro { background: transparent; perspective: none; }
.intro .gl-tear { position: absolute; inset: 0; overflow: hidden; }
.intro .gl-tear i { position: absolute; left: 0; width: 100%; background: #000; }
.intro .gl-tear i:nth-child(3n) { background: #050505; }
.intro .gl-stage { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 2.2rem; }
.intro .gl-logo { position: relative; width: min(32vw, 23rem); aspect-ratio: 720 / 279; }
.intro .gl-band { position: absolute; inset: 0; --fx: 2px; }
.intro .gl-band img { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro .gl-band .ch-r { transform: translateX(calc(var(--fx) * -1)); filter: grayscale(1) brightness(1.1) sepia(1) hue-rotate(-50deg) saturate(6); mix-blend-mode: screen; opacity: .55; }
.intro .gl-band .ch-b { transform: translateX(var(--fx)); filter: grayscale(1) brightness(1.1) sepia(1) hue-rotate(150deg) saturate(5); mix-blend-mode: screen; opacity: .45; }
.intro .gl-line { margin: 0; font: 300 .8125rem/1 "MeguLit Mono", var(--mono); letter-spacing: .5em; color: #9a9a9a; text-transform: lowercase; min-height: 1em; }
.intro .gl-scan {
  position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 3px);
}
.intro .skip { color: rgba(244, 244, 242, .75); background: rgba(255, 255, 255, .05); border-color: rgba(244, 244, 242, .22); }
.intro .skip:hover { color: #fff; border-color: rgba(244, 244, 242, .6); }

.intro .gl-tear i:nth-child(3n) { background: #000; }
/* the screen wall eases in instead of poking into the section above: lower start, softer tilt, faded top edge */
.hp { padding-top: clamp(5rem, 10vw, 8rem); }
.hp-stage { -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%); mask-image: linear-gradient(180deg, transparent 0, #000 22%); }

/* ---- entrance, beat 1: the cape unfurls before the glitch -------------------------------------------------------- */
.intro .gl-logo.gl-hold .gl-band { visibility: hidden; }
.intro .gl-cape { position: absolute; left: -10%; top: -60%; width: 120%; height: 220%; pointer-events: none; }
.intro .gl-rest { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; will-change: transform, filter, opacity; }
.intro .gl-line { color: #c8323c; }
/* channel fringes only on the bands that jump, so the logo keeps its own colours between hits */
.intro .gl-band { --fa: 0; }
.intro .gl-band .ch-r { opacity: calc(var(--fa) * .55); }
.intro .gl-band .ch-b { opacity: calc(var(--fa) * .45); }
.intro .gl-line { white-space: nowrap; }
@media (max-width: 600px) { .intro .gl-line { letter-spacing: .28em; font-size: .6875rem; } }

/* ---- Anki deck, round 2: index cards in the two poles. Paper front (word, the line it came from), black back
   (the scene, reading, numbered meanings, the line with the game's own translation) ----------------------------------- */
.deck { height: clamp(32rem, 44vw, 36rem); }
.dcard { top: 6%; width: min(25rem, 84%); aspect-ratio: 5 / 7; }
.dc-face {
  border-radius: 2px; padding: 0; gap: 0; text-align: left; justify-items: stretch; align-content: stretch;
  box-shadow: 0 0 0 1px rgba(244, 244, 242, .14), 0 34px 70px -30px rgba(0, 0, 0, .95);
}
.dc-front { background: #f4f4f2; color: #0b0b0b; display: flex; flex-direction: column; padding: 1.3rem 1.4rem; }
.dc-front::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(180deg, transparent 0 2.3rem, rgba(11, 11, 11, .06) 2.3rem calc(2.3rem + 1px));
}
.dc-top { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.dc-deck { font: 300 .6875rem/1 "MeguLit Mono", var(--mono); letter-spacing: .3em; color: #6b6b6b; text-transform: lowercase; }
.dc-pos { font: 300 .6875rem/1.2 "MeguLit Mono", var(--mono); letter-spacing: .12em; color: #c8323c; border: 1px solid currentColor; padding: .25rem .45rem; white-space: nowrap; }
.dc-front .dc-word { position: relative; margin: auto 0 0; font: 600 clamp(2.4rem, 4.2vw, 3.3rem)/1.5 var(--serif-ja); color: #0b0b0b; text-align: left; }
.dc-front .dc-word rt { color: #c8323c; font-size: max(11px, .32em); letter-spacing: .1em; }
.dc-front .dc-ex { position: relative; margin: .6rem 0 auto; max-width: none; color: #3a3a3a; font: 500 1rem/1.75 var(--serif-ja); }
.dc-ex mark { background: linear-gradient(transparent 62%, rgba(200, 50, 60, .28) 62%); color: inherit; padding: 0 .05em; }
.dc-flip { position: relative; bottom: auto; align-self: flex-start; font: 300 .6875rem/1 "MeguLit Mono", var(--mono); letter-spacing: .3em; color: #5e5e5e; text-transform: lowercase; }
.dc-flip::before { content: "↻  "; color: #c8323c; }
.dc-back { background: #0b0b0b; color: #f4f4f2; display: flex; flex-direction: column; padding: 0; }
.dc-back img { flex: none; display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 1px solid rgba(244, 244, 242, .12); }
.dc-body { display: flex; flex-direction: column; gap: .75rem; padding: 1rem 1.2rem 1.1rem; min-height: 0; flex: 1; }
.dc-head { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem .7rem; font: 600 1.5rem/1.2 var(--serif-ja); }
.dc-kana { font: 500 .9375rem/1 var(--serif-ja); color: #c8323c; letter-spacing: .08em; }
.dc-head .dc-pos { margin-left: auto; align-self: center; }
.dc-means { margin: 0; padding: 0; list-style: none; counter-reset: m; display: grid; gap: .35rem; font: 500 .9375rem/1.45 var(--sans); }
.dc-means li { counter-increment: m; display: grid; grid-template-columns: 1.4rem 1fr; }
.dc-means li::before { content: counter(m); font: 300 .75rem/1.9 "MeguLit Mono", var(--mono); color: #c8323c; }
.dc-means li + li { color: #a8a8a8; }
.dc-src { margin: auto 0 0; padding-top: .7rem; border-top: 1px dashed rgba(244, 244, 242, .18); display: grid; gap: .2rem; font-size: .8125rem; line-height: 1.55; color: #8a8a8a; }
.dc-src [lang="ja"] { font-family: var(--serif-ja); color: #cfcfcf; }
@media (max-width: 60rem) { .deck { height: 34rem; } .dcard { left: 3%; width: min(23rem, 86%); } }
@media (max-width: 400px) { .dc-means { font-size: .875rem; } .dc-body { gap: .55rem; padding: .85rem 1rem .9rem; } .dc-head { font-size: 1.3rem; } }

/* download slab: the colour change on hover / focus / tap wipes in instead of switching at once */
.dl-box {
  background: linear-gradient(#0b0b0b, #0b0b0b) no-repeat left / 0% 100%, var(--paper);
  transition: background-size .5s cubic-bezier(.65, 0, .35, 1), color .3s ease .2s, box-shadow .4s ease, scale .2s ease;
}
.dl-box .db-hud { transition: color .35s ease .08s; }
.dl-box .db-arrow { transition: background-color .4s ease; }
.dl-box:hover, .dl-box:focus-visible { background: linear-gradient(#0b0b0b, #0b0b0b) no-repeat left / 100% 100%, var(--paper); }

/* sound control: while the sound is on it follows the reader down the page */
.sound-ctl.floating { position: fixed; z-index: 60; top: auto; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); right: max(1rem, env(safe-area-inset-right, 0px)); flex-direction: row-reverse; align-items: center; animation: sound-in .35s cubic-bezier(.2, .7, .2, 1); }
@keyframes sound-in { from { opacity: 0; translate: 0 .6rem; } }
@media (max-width: 40rem) { .sound-ctl.floating .vol { display: none; } }
.sound-ctl { --paper: #f4f4f2; --accent: #c8323c; --dim: #8a8a8a; }
.sound-ctl.floating .sound-fab { position: static; margin: 0; }
/* text turns once the black is past it, never white on paper mid-wipe */
.dl-box, .dl-box .db-hud { transition-delay: 0s, .2s, 0s, 0s; }
.dl-box .db-hud { transition: color .3s ease .2s; }
.dcard { aspect-ratio: 5 / 6.4; }
.deck:focus-visible { outline: 1px solid rgba(244, 244, 242, .5); outline-offset: 10px; border-radius: 0; }

/* entrance, round 5: no glitch. The overlay is black from the first paint so the page never shows first; the strips
   take over the black when it parts */
.intro-on .intro { background: #000; }
.intro-on .intro.parting { background: transparent; }
.intro .gl-scan, .intro .gl-band { display: none; }

/* foreground kana: a few large, out-of-focus glyphs drifting over everything on the page (under the top bar and the
   floating sound control), never catching the pointer */
.kana-top { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 15; pointer-events: none; }

/* ---- the two bands, round 2: the two poles instead of crimson + gold. A paper slab with black Japanese and small
   lowercase glosses, a black strip with hairlines carrying the game's own lines, numbered like a script ------------- */
.ticker { padding: 2.4rem 0 1.6rem; --tk-paper: #f4f4f2; --tk-red: #c8323c; }
.tk-a, .tk-b { box-shadow: none; }
.tk-a { background: var(--tk-paper); color: #0b0b0b; transform: rotate(-1.6deg); padding: .85rem 0; box-shadow: 0 22px 50px -26px rgba(0, 0, 0, .9); }
.tk-b { background: #050505; color: var(--tk-paper); transform: rotate(.8deg); margin-top: 1.1rem; padding: .7rem 0; border-block: 1px solid rgba(244, 244, 242, .16); }
.tk-track { gap: 1.6rem; padding-right: 1.6rem; }
.tk-a .tk-track, .tk-b .tk-track { font: 600 clamp(1.05rem, 1.5vw, 1.45rem)/1.2 var(--serif-ja); letter-spacing: .06em; color: inherit; -webkit-text-stroke: 0; }
.tk-b .tk-track { font-weight: 500; font-size: clamp(.95rem, 1.25vw, 1.2rem); letter-spacing: .12em; }
.tk-item { display: inline-flex; align-items: baseline; gap: .7rem; white-space: nowrap; }
.tk-sub { font: 300 .6875rem/1 "MeguLit Mono", var(--mono); letter-spacing: .32em; color: #6b6b6b; text-transform: lowercase; }
.tk-no { font: 300 .6875rem/1 "MeguLit Mono", var(--mono); letter-spacing: .2em; color: var(--tk-red); }
.tk-sep { width: .42rem; height: .42rem; background: var(--tk-red); align-self: center; font-size: 0; }
.tk-b .tk-sep { width: 1px; height: 1.1rem; background: rgba(244, 244, 242, .28); }
.tk-track i.tk-sep { color: transparent; }

/* back to top: a small square in the corner once the hero is behind you; sits above the floating sound control */
.to-top {
  position: fixed; z-index: 60; right: max(1rem, env(safe-area-inset-right, 0px)); bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  display: grid; place-items: center; width: 2.9rem; height: 2.9rem; color: #f4f4f2; background: rgba(0, 0, 0, .55);
  border: 1px solid rgba(244, 244, 242, .25); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  opacity: 0; translate: 0 .6rem; pointer-events: none; transition: opacity .3s ease, translate .3s ease, border-color .2s, background-color .2s;
}
.to-top.on { opacity: 1; translate: 0 0; pointer-events: auto; }
.to-top:hover, .to-top:focus-visible { border-color: #c8323c; background: rgba(200, 50, 60, .25); outline: none; }
.to-top svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: square; }
body:has(.sound-ctl.floating) .to-top { bottom: calc(4.6rem + env(safe-area-inset-bottom, 0px)); }
/* the Chinese title reads as Chinese: no furigana over 学日语, and a smaller size */
:lang(zh) .ht-big rt { display: none; }
:lang(zh) .ht-big { font-size: clamp(4.25rem, 15vw, 16rem); }

/* desktop scale: the whole site at the size it reads best (what a 75% browser zoom gave). Everything is sized in rem,
   so the root size carries it; phones keep the full size */
@media (min-width: 64em) { html { font-size: clamp(12px, .225vw + 9px, 15px); } }
/* the top bar spans the full width: brand and links at the left edge, tools at the right edge */
.top .top-row { max-width: none; }

/* steps line, driven by the script: fills with the scroll and lights each number as it passes */
.steps.js-steps::after { animation: none; transform: scaleX(var(--fill, 0)); transition: transform .12s linear; }
.steps.js-steps li::before { color: var(--muted); transition: color .35s ease, text-shadow .35s ease; }
.steps.js-steps li.lit::before { color: var(--crimson-ink); text-shadow: 0 0 18px color-mix(in srgb, var(--crimson) 45%, transparent); }
.steps.js-steps li h3 { transition: color .35s ease; }
.steps.js-steps li:not(.lit) h3 { color: var(--muted); }

/* scrollbars in the site's colours: the page, the release notes and every other scrolling box */
html { scrollbar-color: color-mix(in srgb, var(--crimson) 55%, var(--line)) transparent; scrollbar-width: thin; }
.notes-body, .rel-body { scrollbar-color: color-mix(in srgb, var(--crimson) 50%, transparent) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--crimson) 50%, var(--line)); border: 3px solid transparent; background-clip: padding-box; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background-color: var(--crimson); }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.notes-body::-webkit-scrollbar { width: 6px; }
.notes-body::-webkit-scrollbar-thumb { border-width: 1px; }

/* file check under the SmartScreen note */
.verify { margin: .4rem 0 0; padding-left: 1.3rem; display: grid; gap: .35rem; color: var(--muted); font-size: .9375rem; }
.verify code { word-break: break-all; }
.smart .h4 + .verify { margin-top: .4rem; }
.smart p + .h4 { margin-top: 1.2rem; }

/* screenshots open full size */
.hp-card, .feat-item { cursor: zoom-in; }
.lightbox { border: 0; padding: 0; margin: auto; background: transparent; max-width: min(94vw, 1600px); max-height: 92vh; overflow: visible; color: #f4f4f2; }
.lightbox::backdrop { background: rgba(0, 0, 0, .82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.lightbox[open] { animation: lb-in .28s cubic-bezier(.2, .7, .2, 1); }
@keyframes lb-in { from { opacity: 0; scale: .97; } }
.lb-body img, .lb-body video { display: block; max-width: min(94vw, 1600px); max-height: 84vh; width: auto; height: auto; box-shadow: 0 0 0 1px rgba(244, 244, 242, .16), 0 40px 90px -30px #000; }
.lb-cap { margin: .8rem 0 0; font: 300 .75rem/1 "MeguLit Mono", var(--mono); letter-spacing: .3em; text-transform: lowercase; color: #9a9a9a; text-align: center; }
.lb-close { position: fixed; top: max(1rem, env(safe-area-inset-top, 0px)); right: max(1rem, env(safe-area-inset-right, 0px)); width: 2.8rem; height: 2.8rem; display: grid; place-items: center; font: 300 1.6rem/1 var(--sans); color: #f4f4f2; background: rgba(0, 0, 0, .55); border: 1px solid rgba(244, 244, 242, .3); cursor: pointer; }
.lb-close:hover, .lb-close:focus-visible { border-color: #c8323c; outline: none; }
@media (prefers-reduced-motion: reduce) { .lightbox[open] { animation: none; } }

/* now playing: title, artist and the current lyric line beside the sound control */
.np { order: 3; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .15rem .7rem; max-width: 22rem; padding: .55rem .9rem; color: #f4f4f2;
  background: rgba(0, 0, 0, .5); border: 1px solid rgba(244, 244, 242, .18); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); animation: np-in .4s cubic-bezier(.2, .7, .2, 1); }
.np[hidden] { display: none; }
@keyframes np-in { from { opacity: 0; translate: 0 -.4rem; } }
.np-eq { grid-row: 1 / span 2; display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.np-eq i { width: 2px; height: 100%; background: #c8323c; transform-origin: bottom; animation: eq 1s ease-in-out infinite; }
.np-eq i:nth-child(2) { animation-delay: -.35s; } .np-eq i:nth-child(3) { animation-delay: -.7s; }
.np-meta { display: flex; align-items: baseline; gap: .6rem; min-width: 0; white-space: nowrap; overflow: hidden; }
.np-title { font: 600 .9rem/1.2 var(--serif); letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; }
.np-artist { font: 300 .6875rem/1 "MeguLit Mono", var(--mono); letter-spacing: .25em; text-transform: lowercase; color: #9a9a9a; overflow: hidden; text-overflow: ellipsis; }
.np-lyric { grid-column: 2; position: relative; margin: 0; height: 0; overflow: hidden; font: 500 .8125rem/1.5 var(--serif-ja); color: #d8d8d6; }
.np.has-lyrics .np-lyric { height: 1.5em; }
.np-line { position: absolute; inset: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-line > span { display: inline-block; opacity: 0; filter: blur(4px); translate: 0 .35em; animation: np-ch .5s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: calc(var(--i) * 32ms); white-space: pre; }
.np-line.out { animation: np-out .45s ease forwards; }
@keyframes np-ch { to { opacity: 1; filter: none; translate: 0 0; } }
@keyframes np-out { to { opacity: 0; translate: 0 -.8em; filter: blur(3px); } }
.np { position: absolute; top: calc(100% + .6rem); right: 0; width: max-content; }
.sound-ctl.floating .np { top: auto; bottom: 0; right: calc(100% + .6rem); max-width: min(18rem, 55vw); }
@media (max-width: 40rem) { .np { max-width: 70vw; } }
@media (prefers-reduced-motion: reduce) { .np-line > span { animation: none; opacity: 1; filter: none; translate: none; } .np-eq i { animation: none; } }
.np.has-lyrics { width: min(22rem, 80vw); }
.sound-ctl.floating .np.has-lyrics { width: min(20rem, 60vw); }
/* long lyric lines wrap to a second line instead of being cut */
.np.has-lyrics .np-lyric { height: 3em; }
.np-line { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.np-line > span { white-space: pre-wrap; }
.np-meta { flex-direction: column; align-items: flex-start; gap: .25rem; }
.np-title, .np-artist { max-width: 100%; }
.np-eq { grid-row: 1; align-self: start; margin-top: .3rem; }

/* song credit: CC BY-NC asks for author, source, licence and changes, in the label and in the footer */
.np-credit { grid-column: 1 / -1; margin: .35rem 0 0; padding-top: .35rem; border-top: 1px solid rgba(244, 244, 242, .12);
  font: 400 .6875rem/1.5 var(--sans); color: #8a8a8a; white-space: normal; }
.np-credit a { color: #c8c8c6; text-decoration: underline; text-decoration-color: rgba(244, 244, 242, .3); text-underline-offset: 2px; }
.np-credit a:hover { color: #fff; text-decoration-color: #c8323c; }
.np { width: min(22rem, 80vw); }
.bgm-credit { margin: 0; }
.bgm-credit a { color: inherit; }

/* ---- welcome notice + feedback form: one dialog, megu-edit poles (black card, paper type, one red accent) ---------- */
.notice { width: min(36rem, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 1px solid rgba(244, 244, 242, .2); background: #0b0b0b; color: #f4f4f2;
  box-shadow: 0 0 0 1px rgba(200, 50, 60, .25), 0 50px 120px -40px #000; overflow: auto; }
.notice::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.notice[open] { animation: lb-in .32s cubic-bezier(.2, .7, .2, 1); }
.nt-pane { display: grid; gap: 1rem; padding: clamp(1.4rem, 3vw, 2.2rem); }
.nt-pane[hidden] { display: none; }
.nt-hud { margin: 0; display: flex; justify-content: space-between; gap: 1rem; font: 300 .6875rem/1 "MeguLit Mono", var(--mono); letter-spacing: .3em; text-transform: lowercase; color: #8a8a8a; }
.nt-hud span:first-child { color: #c8323c; }
.nt-title { margin: 0; font: 600 clamp(1.5rem, 2.6vw, 2rem)/1.2 var(--serif); letter-spacing: .01em; }
.nt-lede, .nt-more { margin: 0; color: #c8c8c6; line-height: 1.75; }
.nt-more { font-size: .875rem; color: #9a9a9a; }
.nt-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.nt-input { width: 100%; min-width: 0; padding: .85rem 1rem; font: inherit; color: #f4f4f2; background: #141414; border: 1px solid rgba(244, 244, 242, .22); border-radius: 0; outline: none; transition: border-color .2s; }
.nt-input::placeholder { color: #6b6b6b; }
.nt-input:focus { border-color: #c8323c; }
.nt-area { resize: vertical; min-height: 7.5rem; line-height: 1.6; }
.nt-submit { padding: 0 1.4rem; min-height: 2.9rem; font: 600 1rem/1 var(--serif); color: #0b0b0b; background: #f4f4f2; border: 1px solid #f4f4f2; border-radius: 0; cursor: pointer; transition: background-color .25s, color .25s; }
.nt-submit:hover, .nt-submit:focus-visible { background: #c8323c; border-color: #c8323c; color: #fff; outline: none; }
.nt-submit:disabled { opacity: .55; cursor: progress; }
.nt-status { margin: 0; min-height: 1.4em; font-size: .875rem; color: #9a9a9a; }
.nt-status.ok { color: #e8e8e6; }
.nt-status.err { color: #e35a63; }
.nt-status a { color: inherit; text-underline-offset: 3px; }
.nt-updates { margin: 0; padding: .75rem 0 0; list-style: none; display: grid; gap: .35rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .875rem; line-height: 1.6; color: #c8c8c6; }
.nt-updates[hidden] { display: none; }
.nt-updates li::before { content: ""; display: inline-block; width: .4em; height: .4em; margin: 0 .6em .15em 0; border-radius: 50%; background: #c8323c; }
.nt-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.nt-link, .nt-close { font: 300 .75rem/1 "MeguLit Mono", var(--mono); letter-spacing: .25em; text-transform: lowercase; color: #c8c8c6; background: none; border: 0; padding: .6rem 0; cursor: pointer; }
.nt-link { text-decoration: underline; text-decoration-color: rgba(244, 244, 242, .3); text-underline-offset: 4px; }
.nt-close { padding: .7rem 1.2rem; border: 1px solid rgba(244, 244, 242, .3); }
.nt-link:hover, .nt-close:hover, .nt-link:focus-visible, .nt-close:focus-visible { color: #fff; border-color: #c8323c; text-decoration-color: #c8323c; outline: none; }
.nt-feedback .nt-actions .nt-submit { min-width: 7rem; }
.nt-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
:lang(ja) .nt-title { font-family: var(--serif-ja); }
@media (max-width: 30rem) { .nt-row { grid-template-columns: 1fr; gap: .6rem; } .nt-row .nt-submit { min-height: 2.9rem; } }
/* a big notice, not a toast: larger on desktop, where the root size is scaled down */
@media (min-width: 64em) {
  .notice { width: min(50rem, calc(100vw - 4rem)); }
  .nt-pane { gap: 1.3rem; padding: 2.8rem 3rem; }
  .nt-title { font-size: clamp(2.2rem, 2.6vw, 3rem); }
  .nt-lede { font-size: 1.2rem; }
  .nt-more { font-size: 1rem; }
  .nt-input, .nt-submit { font-size: 1.1rem; }
  .nt-input { padding: 1.05rem 1.2rem; }
  .nt-submit { min-height: 3.6rem; padding: 0 2rem; }
  .nt-hud, .nt-link, .nt-close { font-size: .8125rem; }
}

/* contrast: small red text on black uses the lighter red (#e35a63, 5:1 on #0b0b0b); #c8323c stays for marks, bars and
   large type. Placeholders and the title's furigana get readable floors */
.nt-hud span:first-child, .tk-no, .dc-back .dc-pos, .dc-kana, .dc-means li::before, .intro .gl-line { color: #e35a63; }
.nt-input::placeholder { color: #8a8a8a; }
.ht-big rt { font-size: max(11px, .09em) !important; }

/* bottom layer: z-index -1 puts it just above the page background (body, propagated to the canvas) and under every section, card and line of text */
.kana-deep { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; }
/* lyrics switches in the now-playing label */
.np-switches { grid-column: 2; margin: .2rem 0 0; display: flex; gap: .4rem; flex-wrap: wrap; }
.np-sw { font: 300 .6875rem/1 "MeguLit Mono", var(--mono); letter-spacing: .12em; color: #9a9a9a; background: none; border: 1px solid rgba(244, 244, 242, .2); padding: .3rem .5rem; cursor: pointer; transition: color .2s, border-color .2s, background-color .2s; }
.np-sw[aria-pressed="true"] { color: #f4f4f2; border-color: #c8323c; background: rgba(200, 50, 60, .18); }
.np-sw:hover, .np-sw:focus-visible { color: #fff; outline: none; border-color: #e35a63; }
.np-sw[hidden] { display: none; }
.np.lyrics-off .np-lyric { height: 0 !important; }

/* floating player, compact: down the page it is one small strip (title + current line), so it never covers what you
   read; the volume, the switches and the credit open on hover or keyboard focus (tap on phones) */
.sound-ctl.floating .vol { display: none; }
.sound-ctl.floating.hov .vol, .sound-ctl.floating:focus-within .vol { display: flex; }
.sound-ctl.floating .np, .sound-ctl.floating .np.has-lyrics { width: min(16rem, 52vw); max-width: none; padding: .45rem .7rem; gap: .1rem .55rem; background: rgba(0, 0, 0, .62); }
.sound-ctl.floating .np-artist, .sound-ctl.floating .np-switches, .sound-ctl.floating .np-credit { display: none; }
.sound-ctl.floating .np-title { font-size: .8125rem; }
.sound-ctl.floating .np.has-lyrics .np-lyric { height: 1.5em; font-size: .75rem; }
.sound-ctl.floating .np-line { -webkit-line-clamp: 1; }
.sound-ctl.floating.hov .np, .sound-ctl.floating:focus-within .np { width: min(22rem, 70vw); }
.sound-ctl.floating.hov .np-artist, .sound-ctl.floating:focus-within .np-artist { display: inline; }
.sound-ctl.floating.hov .np-switches, .sound-ctl.floating:focus-within .np-switches { display: flex; }
.sound-ctl.floating.hov .np-credit, .sound-ctl.floating:focus-within .np-credit { display: block; }
.sound-ctl.floating.hov .np.has-lyrics .np-lyric, .sound-ctl.floating:focus-within .np.has-lyrics .np-lyric { height: 3em; font-size: .8125rem; }
.sound-ctl.floating.hov .np-line, .sound-ctl.floating:focus-within .np-line { -webkit-line-clamp: 2; }
.sound-ctl.floating .np { cursor: default; }
@media (max-width: 40rem) { .sound-ctl.floating .np, .sound-ctl.floating .np.has-lyrics { width: min(13rem, 58vw); } }

/* ---- now-playing label, final layout: equaliser in a narrow left column, everything else lined up in the right one;
   down the page it is one strip that opens in place on hover/focus, with every part sliding and fading, not popping -- */
.np { grid-template-columns: 14px minmax(0, 1fr); column-gap: .75rem; row-gap: 0; align-items: start; width: min(22rem, 80vw); padding: .75rem .95rem .8rem;
  transition: width .38s cubic-bezier(.2, .7, .2, 1), padding .38s cubic-bezier(.2, .7, .2, 1), background-color .3s; }
.np-eq { grid-column: 1; grid-row: 1; align-self: center; margin: 0; }
.np-meta { grid-column: 2; grid-row: 1; gap: .2rem; }
.np-title { font-size: .875rem; }
.np-lyric { grid-column: 2; margin-top: .45rem; transition: height .38s cubic-bezier(.2, .7, .2, 1), margin .38s, font-size .3s; }
.np-switches { grid-column: 2; margin: .6rem 0 0; gap: .35rem; }
.np-sw { padding: .32rem .6rem; border-radius: 999px; }
.np-credit { grid-column: 1 / -1; margin: .65rem 0 0; padding-top: .6rem; line-height: 1.6; }
/* floating: collapsed strip */
.sound-ctl.floating .np, .sound-ctl.floating .np.has-lyrics { width: min(16rem, 52vw); padding: .5rem .75rem; }
.sound-ctl.floating .np-artist, .sound-ctl.floating .np-switches, .sound-ctl.floating .np-credit {
  display: block; max-height: 0; opacity: 0; overflow: hidden; margin-top: 0; padding-top: 0; border-top-color: transparent;
  transition: max-height .38s cubic-bezier(.2, .7, .2, 1), opacity .25s ease, margin .38s, padding .38s, border-color .3s; }
.sound-ctl.floating .np-switches { display: flex; }
.sound-ctl.floating .np.has-lyrics .np-lyric { margin-top: .2rem; }
/* floating: open */
.sound-ctl.floating.hov .np, .sound-ctl.floating:focus-within .np { width: min(22rem, 70vw); padding: .75rem .95rem .8rem; }
.sound-ctl.floating.hov .np-artist, .sound-ctl.floating:focus-within .np-artist { max-height: 1.4rem; opacity: 1; }
.sound-ctl.floating.hov .np-switches, .sound-ctl.floating:focus-within .np-switches { max-height: 3rem; opacity: 1; margin-top: .6rem; }
.sound-ctl.floating.hov .np-credit, .sound-ctl.floating:focus-within .np-credit { max-height: 6rem; opacity: 1; margin-top: .65rem; padding-top: .6rem; border-top-color: rgba(244, 244, 242, .12); }
.sound-ctl.floating.hov .np.has-lyrics .np-lyric, .sound-ctl.floating:focus-within .np.has-lyrics .np-lyric { margin-top: .45rem; }
/* floating: the volume bar slides open beside the button instead of appearing */
.sound-ctl.floating .vol { display: flex; max-width: 0; opacity: 0; padding: 0; border-width: 0; overflow: hidden; white-space: nowrap;
  transition: max-width .38s cubic-bezier(.2, .7, .2, 1), opacity .25s ease, padding .38s; }
.sound-ctl.floating.hov .vol, .sound-ctl.floating:focus-within .vol { max-width: 20rem; opacity: 1; padding: 0 1rem; border-width: 1px; }
@media (max-width: 40rem) { .sound-ctl.floating .vol { display: none; } }
@media (prefers-reduced-motion: reduce) { .np, .np *, .sound-ctl.floating .vol { transition: none !important; } }

/* ---- try it: reader, before/after, kana challenge (megu-edit poles: black stages, paper type, one red accent) ------- */
.try .try-k { margin: 0 0 .8rem; display: flex; gap: 1rem; font: 300 .75rem/1 "MeguLit Mono", var(--mono); letter-spacing: .3em; text-transform: lowercase; color: var(--muted); }
.try .try-k span:first-child { color: #e35a63; }
.try-reader { margin-top: 2rem; }
.tr-reader { position: relative; }
.tr-scene { position: relative; overflow: hidden; border: 1px solid rgba(244, 244, 242, .14); background: #0b0b0b; cursor: pointer; aspect-ratio: 16 / 9; max-height: 34rem; width: 100%; }
.tr-scene > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tr-box { position: absolute; left: 0; right: 0; bottom: 3%; top: 72.5%; padding: 2.2% 9% 0; display: grid; align-content: start; gap: .4rem; }
.tr-line { margin: 0; font: 500 clamp(1rem, 2.3vw, 1.65rem)/2.3 "Noto Sans JP", "Yu Gothic UI", "Hiragino Sans", system-ui, sans-serif; color: #fff; letter-spacing: .08em; text-shadow: 0 1px 2px rgba(0, 0, 0, .55); }
.tr-line.enter { animation: tr-in .45s cubic-bezier(.2, .7, .2, 1); }
@keyframes tr-in { from { opacity: 0; filter: blur(4px); } }
.tr-line rt { font-size: .5em; letter-spacing: .05em; color: #fff3d6; }
.tr-trans { margin: 0; font: 500 clamp(.8rem, 1.5vw, 1.05rem)/1.5 var(--sans); color: #f1ecff; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.tr-w { font: inherit; color: inherit; background: none; border: 0; padding: 0 .02em; cursor: pointer; border-radius: 3px; transition: background-color .2s, box-shadow .2s; text-shadow: inherit; }
.tr-w:hover, .tr-w:focus-visible { background: rgba(255, 255, 255, .16); outline: none; }
.tr-w.on { background: rgba(200, 50, 60, .55); }
.tr-w.in-deck { box-shadow: inset 0 -2px 0 #f0c36a; }
.tr-card { position: absolute; z-index: 2; width: min(19rem, 86%); padding: .9rem 1rem 1rem; background: #0b0b0b; color: #f4f4f2; border: 1px solid rgba(244, 244, 242, .2); box-shadow: 0 0 0 1px rgba(200, 50, 60, .25), 0 24px 50px -20px #000; cursor: default; }
.tc-head { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem .7rem; }
.tc-word { font: 700 1.5rem/1.2 var(--serif-ja); }
.tc-read { font: 500 .9375rem/1 var(--serif-ja); color: #e35a63; }
.tc-pos { margin-left: auto; font: 300 .6875rem/1.2 "MeguLit Mono", var(--mono); letter-spacing: .12em; color: #e35a63; border: 1px solid currentColor; padding: .2rem .4rem; }
.tc-base { margin: .4rem 0 0; font: 300 .75rem/1.4 "MeguLit Mono", var(--mono); color: #9a9a9a; letter-spacing: .08em; }
.tc-means { margin: .6rem 0 .8rem; padding: 0; list-style: none; counter-reset: m; display: grid; gap: .3rem; font: 500 .9375rem/1.45 var(--sans); }
.tc-means li { counter-increment: m; display: grid; grid-template-columns: 1.3rem 1fr; }
.tc-means li::before { content: counter(m); font: 300 .75rem/1.9 "MeguLit Mono", var(--mono); color: #e35a63; }
.tc-add { width: 100%; padding: .6rem; font: 600 .9375rem/1 var(--serif); color: #0b0b0b; background: #f4f4f2; border: 0; cursor: pointer; transition: background-color .2s, color .2s; }
.tc-add:hover, .tc-add:focus-visible { background: #c8323c; color: #fff; outline: none; }
.tc-add:disabled { background: #2a2a2a; color: #9a9a9a; cursor: default; }
.tr-bar { margin-top: .9rem; display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.2rem; }
.tr-hint { margin: 0; flex: 1 1 18rem; font-size: .875rem; color: var(--muted); }
.tr-next { padding: .55rem 1rem; font: 300 .75rem/1 "MeguLit Mono", var(--mono); letter-spacing: .25em; color: var(--text); background: none; border: 1px solid var(--line-2, rgba(128, 128, 128, .4)); cursor: pointer; }
.tr-next:hover, .tr-next:focus-visible { border-color: #c8323c; outline: none; }
.tr-deck { display: flex; align-items: center; gap: .7rem; padding: .4rem .8rem; border: 1px solid var(--line-2, rgba(128, 128, 128, .4)); }
.tr-stack { position: relative; width: 2.2rem; height: 1.8rem; }
.tr-mini { position: absolute; left: calc(var(--i) * 3px); top: calc(var(--i) * -2px); width: 1.6rem; height: 1.9rem; display: grid; place-items: center; font: 600 .5rem/1 var(--serif-ja); color: #0b0b0b; background: #f4f4f2; border: 1px solid rgba(0, 0, 0, .2); overflow: hidden; }
.tr-deck-n { font: 300 .75rem/1 "MeguLit Mono", var(--mono); letter-spacing: .15em; color: var(--muted); }
.tr-fly { position: fixed; left: 0; top: 0; z-index: 80; pointer-events: none; padding: .5rem .8rem; font: 700 1.1rem/1 var(--serif-ja); color: #0b0b0b; background: #f4f4f2; box-shadow: 0 10px 30px -10px #000; }
.try-grid { margin-top: 2.6rem; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.ba { --x: 50%; position: relative; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid rgba(244, 244, 242, .14); background: #0b0b0b; cursor: ew-resize; touch-action: pan-y; user-select: none; }
.ba > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ba-layer { position: absolute; inset: 0; }
.ba-after { clip-path: inset(0 0 0 var(--x)); }
.ba-before { clip-path: inset(0 calc(100% - var(--x)) 0 0); }
.ba-box { position: absolute; left: 0; right: 0; top: 72.5%; bottom: 3%; padding: 2.4% 6% 0; display: grid; align-content: start; gap: .2rem; }
.ba-text { margin: 0; font: 500 clamp(.75rem, 1.4vw, 1.05rem)/2.3 "Noto Sans JP", "Yu Gothic UI", "Hiragino Sans", system-ui, sans-serif; color: #fff; letter-spacing: .06em; text-shadow: 0 1px 2px rgba(0, 0, 0, .55); white-space: nowrap; }
.ba-text rt { font-size: .5em; color: #fff3d6; }
.ba-tr { margin: 0; font: 500 clamp(.65rem, 1.1vw, .85rem)/1.4 var(--sans); color: #f1ecff; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
.ba-tag { position: absolute; top: .7rem; padding: .35rem .6rem; font: 300 .6875rem/1 "MeguLit Mono", var(--mono); letter-spacing: .2em; color: #f4f4f2; background: rgba(0, 0, 0, .55); }
.ba-before .ba-tag { left: .7rem; }
.ba-after .ba-tag { right: .7rem; background: #c8323c; }
.ba-handle { position: absolute; top: 0; bottom: 0; left: var(--x); width: 2px; margin-left: -1px; background: #f4f4f2; box-shadow: 0 0 12px rgba(0, 0, 0, .5); pointer-events: none; }
.ba-handle i { position: absolute; top: 50%; left: 50%; width: 2.2rem; height: 2.2rem; translate: -50% -50%; background: #f4f4f2; border: 2px solid #0b0b0b; display: grid; place-items: center; }
.ba-handle i::before { content: "‹ ›"; font: 600 .9rem/1 var(--sans); color: #0b0b0b; letter-spacing: .1em; }
.ba-range { position: absolute; inset: auto 0 0 0; width: 100%; opacity: 0; height: 2rem; cursor: ew-resize; }
.ba-range:focus-visible + .ba-handle, .ba:focus-within .ba-handle i { outline: 2px solid #c8323c; }
.kq { position: relative; display: grid; gap: .9rem; justify-items: center; padding: 1.4rem 1.2rem 1.3rem; min-height: 100%; background: #0b0b0b; color: #f4f4f2; border: 1px solid rgba(244, 244, 242, .14); aspect-ratio: auto; }
.kq-bar { width: 100%; height: 2px; background: rgba(244, 244, 242, .12); }
.kq-bar i { display: block; height: 100%; background: #c8323c; transform-origin: left; transform: scaleX(0); }
.kq-info { margin: 0; width: 100%; display: flex; justify-content: space-between; gap: 1rem; font: 300 .75rem/1.4 "MeguLit Mono", var(--mono); letter-spacing: .12em; color: #9a9a9a; }
.kq-streak { color: #f0c36a; }
.kq-kana { position: relative; font: 600 clamp(4rem, 9vw, 6rem)/1 var(--serif-ja); text-shadow: 0 0 .25em rgba(244, 244, 242, .25); }
.kq-kana[data-note]::after { content: attr(data-note); position: absolute; left: 50%; bottom: -1.2rem; translate: -50% 0; white-space: nowrap; font: 300 .6875rem/1 "MeguLit Mono", var(--mono); letter-spacing: .2em; color: #e35a63; }
.kq-opts { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.kq-opt { padding: .7rem; font: 300 1.05rem/1 "MeguLit Mono", var(--mono); letter-spacing: .1em; color: #f4f4f2; background: rgba(244, 244, 242, .05); border: 1px solid rgba(244, 244, 242, .18); cursor: pointer; transition: background-color .2s, border-color .2s, color .2s; }
.kq-opt:hover:not(:disabled), .kq-opt:focus-visible { border-color: #f4f4f2; outline: none; }
.kq-opt.right { background: #f4f4f2; color: #0b0b0b; border-color: #f4f4f2; }
.kq-opt.wrong { border-color: #c8323c; color: #e35a63; }
.kq:not(.playing) .kq-opts, .kq:not(.playing) .kq-bar { visibility: hidden; }
.kq.done .kq-kana { display: none; }
.kq-end { text-align: center; display: grid; gap: .5rem; }
.kq-end[hidden] { display: none; }
.kq-score { margin: 0; font: 600 1.3rem/1.3 var(--serif); }
.kq-msg { margin: 0; color: #c8c8c6; font-size: .9375rem; }
.kq-cta { justify-self: center; margin-top: .3rem; padding: .6rem 1rem; font: 600 .9375rem/1 var(--serif); color: #0b0b0b; background: #f4f4f2; text-decoration: none; }
.kq-cta:hover, .kq-cta:focus-visible { background: #c8323c; color: #fff; outline: none; }
.kq-start { padding: .7rem 1.4rem; font: 600 1rem/1 var(--serif); color: #fff; background: #c8323c; border: 0; cursor: pointer; }
.kq-start:hover, .kq-start:focus-visible { background: #e04b55; outline: none; }
.kq-start[hidden] { display: none; }
@media (max-width: 60rem) { .try-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 40rem) { .tr-box { padding: 2% 5% 0; } .tr-line { line-height: 2.1; } .tr-scene { aspect-ratio: 4 / 3; } .tr-scene > img { object-position: 50% 100%; } .tr-box { top: 64%; } }
@media (prefers-reduced-motion: reduce) { .tr-line.enter { animation: none; } }

/* ---- phones: the player never covers the first screen. Icon-only sound button, the label is a small one-line strip
   under it; a tap on the strip opens volume, switches and credit (.open), a tap elsewhere closes them ------------------- */
@media (max-width: 40rem) {
  .sound-ctl .sound-fab .label { display: none; }
  .sound-ctl .sound-fab { width: 2.6rem; height: 2.6rem; padding: 0; justify-content: center; }
  .sound-ctl .vol { display: none; }
  .sound-ctl.open .vol { display: flex; }
  .sound-ctl .np, .sound-ctl .np.has-lyrics { width: min(13.5rem, 62vw); padding: .45rem .65rem; gap: 0 .55rem; background: rgba(0, 0, 0, .55); }
  .sound-ctl .np-artist, .sound-ctl .np-switches, .sound-ctl .np-credit {
    display: block; max-height: 0; opacity: 0; overflow: hidden; margin-top: 0; padding-top: 0; border-top-color: transparent;
    transition: max-height .35s cubic-bezier(.2, .7, .2, 1), opacity .25s, margin .35s, padding .35s; }
  .sound-ctl .np-switches { display: flex; }
  .sound-ctl .np-title { font-size: .75rem; }
  .sound-ctl .np.has-lyrics .np-lyric { height: 1.5em; margin-top: .15rem; font-size: .6875rem; }
  .sound-ctl .np-line { -webkit-line-clamp: 1; }
  .sound-ctl.open .np, .sound-ctl.open .np.has-lyrics { width: min(20rem, 86vw); padding: .7rem .85rem; }
  .sound-ctl.open .np-artist { max-height: 1.4rem; opacity: 1; }
  .sound-ctl.open .np-switches { max-height: 3rem; opacity: 1; margin-top: .55rem; }
  .sound-ctl.open .np-credit { max-height: 7rem; opacity: 1; margin-top: .6rem; padding-top: .55rem; border-top-color: rgba(244, 244, 242, .12); }
  .sound-ctl.open .np.has-lyrics .np-lyric { height: 3em; font-size: .8125rem; }
  .sound-ctl.open .np-line { -webkit-line-clamp: 2; }
  /* hover sticks after a tap on phones; only .open opens things there */
  .sound-ctl.floating.hov .vol { display: none; }
  .sound-ctl.floating.open .vol { display: flex; max-width: 20rem; opacity: 1; padding: 0 .8rem; border-width: 1px; }
}

/* player controls: previous / play-pause / next, a seek bar and the time, under the lyric line */
.np-ctl { grid-column: 2; margin-top: .55rem; display: grid; grid-template-columns: auto auto auto minmax(0, 1fr) auto; align-items: center; gap: .35rem .45rem; }
.np-b { width: 1.9rem; height: 1.9rem; display: grid; place-items: center; padding: 0; color: #f4f4f2; background: none; border: 1px solid rgba(244, 244, 242, .2); cursor: pointer; transition: border-color .2s, background-color .2s; }
.np-b svg { width: .95rem; height: .95rem; fill: currentColor; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.np-b:hover, .np-b:focus-visible { border-color: #c8323c; outline: none; }
.np-play { background: #f4f4f2; color: #0b0b0b; border-color: #f4f4f2; }
.np-play:hover, .np-play:focus-visible { background: #c8323c; color: #fff; border-color: #c8323c; }
.np-seek { --fill: 0%; -webkit-appearance: none; appearance: none; width: 100%; min-width: 0; height: 2px; margin: 0 .2rem; cursor: pointer; background: linear-gradient(90deg, #c8323c var(--fill), rgba(244, 244, 242, .25) var(--fill)); }
.np-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 10px; background: #f4f4f2; border: 0; }
.np-seek::-moz-range-thumb { width: 10px; height: 10px; background: #f4f4f2; border: 0; border-radius: 0; }
.np-seek:focus-visible { outline: 1px solid #f4f4f2; outline-offset: 4px; }
.np-time { font: 300 .6875rem/1 "MeguLit Mono", var(--mono); letter-spacing: .06em; color: #9a9a9a; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* compact strip (down the page, and on phones): the controls fold away with the other extras */
.sound-ctl.floating .np-ctl { display: grid; max-height: 0; opacity: 0; overflow: hidden; margin-top: 0; transition: max-height .38s cubic-bezier(.2, .7, .2, 1), opacity .25s, margin .38s; }
.sound-ctl.floating.hov .np-ctl, .sound-ctl.floating:focus-within .np-ctl { max-height: 3rem; opacity: 1; margin-top: .55rem; }
@media (max-width: 40rem) {
  .sound-ctl .np-ctl { display: grid; max-height: 0; opacity: 0; overflow: hidden; margin-top: 0; transition: max-height .35s, opacity .25s, margin .35s; }
  .sound-ctl.open .np-ctl { max-height: 3rem; opacity: 1; margin-top: .55rem; }
  .sound-ctl.floating.hov .np-ctl { max-height: 0; opacity: 0; margin-top: 0; }
  .sound-ctl.floating.open .np-ctl { max-height: 3rem; opacity: 1; margin-top: .55rem; }
}

/* player controls, round 2: quiet glyph buttons around one round play button; the seek bar on its own row with the
   elapsed and total time at its ends; the switches as small lowercase toggles with a dot */
.np-ctl { display: grid; grid-template-columns: minmax(0, 1fr); gap: .45rem; margin-top: .6rem; }
.np-btns { display: flex; align-items: center; gap: .9rem; }
.np-b { width: 1.6rem; height: 1.6rem; border: 0; color: #c8c8c6; background: none; transition: color .2s, transform .15s; }
.np-b:hover, .np-b:focus-visible { color: #fff; border: 0; outline: none; }
.np-b:active { transform: scale(.9); }
.np-b svg { width: .9rem; height: .9rem; }
.np-play { width: 2.1rem; height: 2.1rem; border-radius: 50%; color: #0b0b0b; background: #f4f4f2; border: 0; box-shadow: 0 0 0 4px rgba(244, 244, 242, .08); }
.np-play svg { width: .8rem; height: .8rem; }
.np-play:hover, .np-play:focus-visible { background: #c8323c; color: #fff; box-shadow: 0 0 0 4px rgba(200, 50, 60, .25); }
.np-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .6rem; }
.np-now, .np-dur { font: 300 .625rem/1 "MeguLit Mono", var(--mono); letter-spacing: .06em; color: #8a8a8a; font-variant-numeric: tabular-nums; }
.np-seek { height: 2px; margin: 0; }
.np-seek::-webkit-slider-thumb { width: 9px; height: 9px; border-radius: 50%; }
.np-seek::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; }
.np-switches { gap: .9rem; margin-top: .55rem; }
.np-sw { position: relative; padding: .15rem 0 .15rem .9rem; border: 0; border-radius: 0; background: none; font: 300 .6875rem/1.2 "MeguLit Mono", var(--mono); letter-spacing: .14em; color: #8a8a8a; }
.np-sw::before { content: ""; position: absolute; left: 0; top: 50%; width: .42rem; height: .42rem; translate: 0 -50%; border-radius: 50%; border: 1px solid currentColor; }
.np-sw[aria-pressed="true"] { color: #f4f4f2; background: none; border: 0; }
.np-sw[aria-pressed="true"]::before { background: #c8323c; border-color: #c8323c; }
.np-sw:hover, .np-sw:focus-visible { color: #fff; border: 0; outline: none; }
.sound-ctl.floating.hov .np-ctl, .sound-ctl.floating:focus-within .np-ctl { max-height: 5rem; }
@media (max-width: 40rem) { .sound-ctl.open .np-ctl, .sound-ctl.floating.open .np-ctl { max-height: 5rem; } }

/* SoundCloud's own mini player inside the label (the music streams from there) */
.np .sc-frame { grid-column: 1 / -1; display: block; width: 100%; height: 20px; margin-top: .6rem; border: 0; color-scheme: normal; }
.sc-frame { position: fixed; left: -9999px; width: 300px; height: 20px; }
.np .sc-frame { position: static; left: auto; }
.sound-ctl.floating .np .sc-frame { max-height: 0; opacity: 0; margin-top: 0; overflow: hidden; transition: max-height .38s, opacity .25s, margin .38s; }
.sound-ctl.floating.hov .np .sc-frame, .sound-ctl.floating:focus-within .np .sc-frame { max-height: 20px; opacity: 1; margin-top: .6rem; }
@media (max-width: 40rem) {
  .sound-ctl .np .sc-frame { max-height: 0; opacity: 0; margin-top: 0; }
  .sound-ctl.open .np .sc-frame { max-height: 20px; opacity: 1; margin-top: .6rem; }
}

/* ---- player panel, round 3: wider, no empty gap, our controls first; SoundCloud's own bar is a slim source strip at
   the bottom (left as SoundCloud draws it), separated by a rule; the credit sits right above it ------------------------ */
.np, .np.has-lyrics { width: min(24rem, 86vw); padding: .85rem 1rem .75rem; }
.np-title { font-size: .9375rem; }
.np.has-lyrics .np-lyric { height: auto; min-height: 1.5em; max-height: 3em; margin-top: .4rem; }
.np-line { position: relative; inset: auto; }
.np-lyric .np-line.out { position: absolute; inset: 0; }
.np-ctl { margin-top: .7rem; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 1rem; }
.np-btns { gap: .6rem; }
.np-bar { gap: .5rem; }
.np-switches { margin-top: .7rem; }
.np-credit { margin-top: .7rem; padding-top: .65rem; font-size: .6875rem; }
.np-src { grid-column: 1 / -1; margin-top: .6rem; padding-top: .6rem; border-top: 1px solid rgba(244, 244, 242, .1); }
.np .np-src .sc-frame { margin: 0; height: 20px; opacity: .92; transition: opacity .2s; }
.np .np-src .sc-frame:hover { opacity: 1; }
/* compact strip: the source strip folds away with the other extras */
.sound-ctl.floating .np-src { max-height: 0; opacity: 0; overflow: hidden; margin-top: 0; padding-top: 0; border-top-color: transparent; transition: max-height .38s, opacity .25s, margin .38s, padding .38s; }
.sound-ctl.floating.hov .np-src, .sound-ctl.floating:focus-within .np-src { max-height: 3rem; opacity: 1; margin-top: .6rem; padding-top: .6rem; border-top-color: rgba(244, 244, 242, .1); }
.sound-ctl.floating .np .sc-frame { max-height: none; opacity: .92; margin: 0; }
@media (max-width: 40rem) {
  .sound-ctl .np-src { max-height: 0; opacity: 0; overflow: hidden; margin-top: 0; padding-top: 0; border-top-color: transparent; }
  .sound-ctl.open .np-src { max-height: 3rem; opacity: 1; margin-top: .6rem; padding-top: .6rem; border-top-color: rgba(244, 244, 242, .1); }
  .sound-ctl .np .sc-frame, .sound-ctl.open .np .sc-frame { max-height: none; opacity: .92; margin: 0; }
  .np-ctl { grid-template-columns: minmax(0, 1fr); row-gap: .5rem; }
}

/* SoundCloud dock: the widget's iframe never moves in the DOM (that would reload it); this fixed layer is laid over
   the label's bottom strip (.np-src, which only reserves the space) and goes off screen when the strip is folded */
.np-src { height: 20px; box-sizing: content-box; }
.sc-dock { position: fixed; z-index: 75; left: 0; top: 0; width: 300px; height: 20px; }
.sc-dock .sc-frame { position: static; display: block; width: 100%; height: 20px; border: 0; opacity: .92; }
.sc-dock.away { left: -10000px !important; top: 0 !important; }

/* ---- player, round 4: geometric and minimal. Flat frosted rectangles with one hairline edge, square corners; the
   controls are bare glyphs, a ring around play, hairline tracks with a square thumb, square ticks for the switches; red
   is the only accent. SoundCloud's strip is a flat glass bar at the bottom ------------------------------------------ */
.sound-ctl { --g-bg: rgba(14, 10, 11, .62); --g-edge: rgba(244, 244, 242, .14); --g-blur: blur(18px) saturate(1.3); }
.sound-ctl .np, .sound-ctl .np.has-lyrics, .sound-ctl.floating .np, .sound-ctl.floating .np.has-lyrics,
.sound-ctl .vol, .sound-ctl.floating .vol {
  background: var(--g-bg); border: 1px solid var(--g-edge); border-radius: 0; box-shadow: none;
  -webkit-backdrop-filter: var(--g-blur); backdrop-filter: var(--g-blur); }
.sound-ctl .sound-fab { border-radius: 0; border: 1px solid #c8323c; background: var(--g-bg); box-shadow: none; -webkit-backdrop-filter: var(--g-blur); backdrop-filter: var(--g-blur); }
.sound-ctl .sound-fab:hover, .sound-ctl .sound-fab:focus-visible { border-color: #f4f4f2; background: rgba(200, 50, 60, .22); }
/* tracks: a hairline, red up to the position, a small square thumb */
.sound-ctl .vol input[type="range"], .np-seek { -webkit-appearance: none; appearance: none; height: 1px; border-radius: 0; margin: 0;
  background: linear-gradient(90deg, #c8323c var(--fill, 20%), rgba(244, 244, 242, .22) var(--fill, 20%)); }
.sound-ctl .vol input[type="range"]::-webkit-slider-thumb, .sound-ctl #hero-volume::-webkit-slider-thumb, .np-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 7px; height: 7px; border-radius: 0; background: #f4f4f2; border: 0; box-shadow: none; transition: transform .15s; }
.sound-ctl .vol input[type="range"]::-moz-range-thumb, .np-seek::-moz-range-thumb { width: 7px; height: 7px; border-radius: 0; background: #f4f4f2; border: 0; box-shadow: none; }
.sound-ctl .vol input[type="range"]:hover::-webkit-slider-thumb, .np-seek:hover::-webkit-slider-thumb { transform: rotate(45deg); background: #c8323c; }
/* buttons: bare glyphs; play is a hairline ring that fills red */
.np-btns { gap: .5rem; }
.np-b { display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 0; color: rgba(244, 244, 242, .6); background: none; transition: color .2s, transform .15s; }
.np-b:hover, .np-b:focus-visible { color: #fff; background: none; }
.np-b:active { transform: scale(.9); }
.np-play { width: 2.2rem; height: 2.2rem; border-radius: 50%; color: #f4f4f2; background: none; border: 1px solid rgba(244, 244, 242, .55); box-shadow: none; transition: color .2s, background-color .2s, border-color .2s; }
.np-play svg { width: .75rem; height: .75rem; }
.np-play:hover, .np-play:focus-visible { color: #fff; background: #c8323c; border-color: #c8323c; box-shadow: none; }
.np-now, .np-dur { color: rgba(244, 244, 242, .5); }
/* switches: a square tick and a word */
.np-sw { padding: .2rem 0 .2rem 1rem; border: 0; border-radius: 0; background: none; color: rgba(244, 244, 242, .5); transition: color .2s; }
.np-sw::before { left: 0; width: .45rem; height: .45rem; border-radius: 0; border: 1px solid currentColor; background: none; }
.np-sw[aria-pressed="true"] { color: #f4f4f2; background: none; border: 0; }
.np-sw[aria-pressed="true"]::before { background: #c8323c; border-color: #c8323c; }
.np-sw:hover, .np-sw:focus-visible { color: #fff; border: 0; }
.np-credit, .sound-ctl.floating.hov .np-credit, .sound-ctl.floating:focus-within .np-credit { border-top-color: rgba(244, 244, 242, .1); }
.np-src, .sound-ctl.floating.hov .np-src, .sound-ctl.floating:focus-within .np-src { border-top-color: transparent; }
/* SoundCloud's strip: a flat glass bar; SoundCloud draws a white bar, so it is inverted (hue kept) and screened: its
   white turns into the glass and its marks show light on it (still fully visible and live) */
.np-src { height: 32px; }
.sc-dock { height: 32px; box-sizing: border-box; padding: 6px 10px 6px 6px; border-radius: 0;
  background: rgba(244, 244, 242, .05); border: 1px solid rgba(244, 244, 242, .12); box-shadow: none;
  -webkit-backdrop-filter: var(--g-blur, blur(18px)); backdrop-filter: blur(18px) saturate(1.3); overflow: hidden; isolation: isolate; }
/* (in grey: SoundCloud keeps its own orange after a song change, whatever colour is asked for) */
.sc-dock .sc-frame { opacity: .8; filter: grayscale(1) invert(1) contrast(1.1); mix-blend-mode: screen; transition: opacity .2s; }
.sc-dock:hover .sc-frame { opacity: 1; }

/* ---- player layout, round 5: everything on one left edge. Title block; the lyric; the seek bar across the full width
   with the times at its ends; under it the transport (left) and the two switches (right) on one line; then the
   credit and SoundCloud's strip. Square shapes only: the play button is a hairline square */
.np, .np.has-lyrics { row-gap: 0; }
.np-ctl { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 1rem; row-gap: .55rem; margin-top: .8rem; }
.np-bar { grid-row: 1; grid-column: 1 / -1; gap: .6rem; }
.np-btns { grid-row: 2; grid-column: 1; gap: .25rem; margin-left: -.35rem; }
.np-ctl .np-switches { grid-row: 2; grid-column: 2; justify-self: end; margin: 0; gap: .9rem; }
.np-lyric { grid-column: 2; }
.np-play { border-radius: 0; width: 2rem; height: 2rem; }
.np-b { width: 1.9rem; height: 1.9rem; }
.np-credit { margin-top: .8rem; padding-top: .7rem; }
.np-src { margin-top: .7rem; padding-top: 0; }
/* compact floating strip: the controls row folds with the switches; it opens as one block */
.sound-ctl.floating .np-ctl { max-height: 0; opacity: 0; overflow: hidden; margin-top: 0; transition: max-height .38s cubic-bezier(.2, .7, .2, 1), opacity .25s, margin .38s; }
.sound-ctl.floating.hov .np-ctl, .sound-ctl.floating:focus-within .np-ctl { max-height: 6rem; opacity: 1; margin-top: .8rem; }
.sound-ctl.floating .np-ctl .np-switches, .sound-ctl.floating.hov .np-ctl .np-switches { max-height: none; opacity: 1; margin: 0; overflow: visible; }
@media (max-width: 40rem) {
  .sound-ctl .np-ctl { max-height: 0; opacity: 0; overflow: hidden; margin-top: 0; }
  .sound-ctl.open .np-ctl, .sound-ctl.floating.open .np-ctl { max-height: 6rem; opacity: 1; margin-top: .7rem; }
  .sound-ctl .np-ctl .np-switches { max-height: none; opacity: 1; margin: 0; }
  .np-ctl { grid-template-columns: auto minmax(0, 1fr); }
}

/* equalisers driven by the song's spectrum (spectrum.js): no loop animation, each bar's height is its bands' level */
.sound-fab .eq.live i, .np-eq.live i { animation: none !important; transform: scaleY(var(--l, .18)); }
/* the page's scrollbar as a spectrum (spectrum.js draws it; the native one is hidden only when it is there) */
html.spec-on { scrollbar-width: none; }
html.spec-on::-webkit-scrollbar { width: 0; height: 0; }
.spec-scroll { position: fixed; z-index: 70; top: 0; right: 0; width: 14px; height: 100vh; cursor: default; touch-action: none; }

/* the line after each version's notes: small and grey */
.notes-caveat { margin: 1.1rem 0 0; padding-top: .7rem; border-top: 1px dashed color-mix(in srgb, currentColor 18%, transparent); font-size: .75rem; line-height: 1.6; color: var(--muted, #8a8a8a); }

.nt-updates-note { margin: .55rem 0 0; font-size: .8125rem; line-height: 1.6; color: #8a8a8a; }

/* SoundCloud strip, trimmed: only its waveform and logo show (its play button is cut off at the left: our own
   controls do that job); a strong contrast turns its grey grounds black, which the screen blend makes clear glass */
.sc-dock { padding: 6px 10px 6px 4px; background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
.sc-dock .sc-frame { width: calc(100% - 6px) !important; margin-left: -25px; /* (narrow enough that SoundCloud shows its cloud alone, no wordmark) */ filter: grayscale(1) invert(1) brightness(1.15) contrast(1.6); opacity: .8; }

/* the hero leads with the games: "Galgame" sits on a solid red block (upright, flat, square), a line of its own
   above 学日语 */
.hero .ht-pre { font: 600 clamp(2.2rem, 5.4vw, 6.2rem)/1.15 "MeguLit Han", var(--serif) !important; margin: 0 0 .12em; color: #f4f4f2 !important; letter-spacing: .01em; }
.ht-gal { font: inherit; font-style: normal; display: inline-block; margin: 0 .08em; padding: .02em .22em .08em; background: #c8323c; color: #fff; line-height: 1; }
:root[data-theme="light"] .hero .ht-pre { color: inherit !important; }
:lang(en) .hero .ht-pre { font-family: "MeguLit Cormorant", "Cormorant Garamond", var(--serif) !important; }
@media (max-width: 40rem) { .hero .ht-pre { font-size: 11vw !important; } }

/* devices where a page cannot set the volume (iOS): a hint instead of the slider */
.vol.fixed input, .vol.fixed .vol-v { display: none; }
.vol-hint { font: 300 .75rem/1.3 "MeguLit Mono", var(--mono); letter-spacing: .06em; color: #8a8a8a; }

/* the headline as a galgame text box (heroplay.js): click to type the next line; a ▼ prompt under it */
.ht-play { cursor: pointer; -webkit-user-select: none; user-select: none; }
.ht-play.saying { display: flex; align-items: flex-end; }
.ht-say { display: block; max-width: 15em; font: 600 clamp(2.2rem, 5.2vw, 6rem)/1.35 "MeguLit Han", var(--serif); color: #f4f4f2; letter-spacing: .02em; text-wrap: balance; }
.ht-say:lang(en) { font-family: "MeguLit Cormorant", "Cormorant Garamond", var(--serif); line-height: 1.1; }
.ht-say ruby { ruby-position: over; }
.ht-say rt { font: 400 .3em/1 "MeguLit Han", var(--sans); color: #e35a63; letter-spacing: .08em; }
.ht-next { display: inline-flex; align-items: center; gap: .6rem; margin: .8rem 0 0; padding: .35rem 0; border: 0; background: none; cursor: pointer;
  font: 300 .875rem/1 "MeguLit Mono", var(--mono); letter-spacing: .3em; text-transform: lowercase; color: #9a9a9a; transition: color .2s; }
.ht-next i { font-style: normal; color: #c8323c; font-size: .7rem; animation: ht-bob 1.1s ease-in-out infinite; }
.ht-next:hover, .ht-next:focus-visible { color: #f4f4f2; outline: none; }
@keyframes ht-bob { 50% { transform: translateY(3px); opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .ht-next i { animation: none; } }

/* the clickable word in the hero dialogue and its lookup card (dark gold, like MeguLit's own) */
.ht-play { position: relative; }
.ht-word { position: relative; cursor: help; outline: none; border-bottom: .045em dashed rgba(240, 195, 106, .75); }
.ht-word.ready { animation: ht-glint 1.6s ease-in-out infinite; }
.ht-word.on, .ht-word:hover, .ht-word:focus-visible { animation: none; color: #f0c36a; border-bottom-style: solid; }
@keyframes ht-glint { 50% { color: #f6dca0; text-shadow: 0 0 .25em rgba(240, 195, 106, .45); } }
.ht-hint { position: absolute; left: 100%; top: -.2em; margin-left: .15em; white-space: nowrap; font: 300 max(11px, .16em)/1 "MeguLit Mono", var(--mono); letter-spacing: .2em; color: #f0c36a; }
.ht-card { position: absolute; z-index: 5; display: grid; gap: .45rem; width: max-content; max-width: min(20rem, 86vw); padding: .85rem 1rem .9rem; cursor: default;
  background: rgba(16, 12, 8, .94); border: 1px solid rgba(240, 195, 106, .45); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .9);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); text-align: left; animation: hc-in .22s cubic-bezier(.2, .7, .2, 1); }
@keyframes hc-in { from { opacity: 0; transform: translateY(-4px); } }
.hc-head { display: flex; align-items: baseline; gap: .55rem; }
.hc-head b { font: 700 1.5rem/1 "MeguLit Han", var(--serif-ja); color: #f0c36a; }
.hc-head i { font: 400 .875rem/1 "MeguLit Han", var(--serif-ja); font-style: normal; color: #d8c49a; }
.hc-head em { margin-left: auto; padding-left: .8rem; font: 300 .6875rem/1 "MeguLit Mono", var(--mono); font-style: normal; letter-spacing: .12em; color: #9a8a6a; }
.hc-mean { font: 500 .9375rem/1.5 var(--sans); color: #f4f4f2; letter-spacing: 0; }
.hc-ex { display: grid; gap: .15rem; padding-top: .45rem; border-top: 1px solid rgba(240, 195, 106, .18); }
.hc-ex span { font: 400 .875rem/1.4 "MeguLit Han", var(--serif-ja); color: #e8dcc0; }
.hc-ex small { font: 400 .75rem/1.4 var(--sans); color: #9a8a6a; }
@media (prefers-reduced-motion: reduce) { .ht-word.ready, .ht-card { animation: none; } }
/* the card sits above the hero's foot line and reads at the page's scale on large screens */
.ht-play { z-index: 4; }
.ht-card { max-width: min(28rem, 86vw); padding: clamp(.85rem, 1vw, 1.2rem) clamp(1rem, 1.2vw, 1.4rem); gap: clamp(.45rem, .55vw, .7rem); }
.hc-head b { font-size: clamp(1.5rem, 2.1vw, 2.5rem); }
.hc-head i { font-size: clamp(.875rem, 1vw, 1.2rem); }
.hc-head em { font-size: clamp(.6875rem, .75vw, .875rem); }
.hc-mean { font-size: clamp(.9375rem, 1.15vw, 1.35rem); }
.hc-ex span { font-size: clamp(.875rem, 1.05vw, 1.2rem); }
.hc-ex small { font-size: clamp(.75rem, .85vw, 1rem); }
.ht-hint { font-size: max(11px, .14em); }
.hc-note { font: 300 clamp(.6875rem, .75vw, .875rem)/1.4 "MeguLit Mono", var(--mono); letter-spacing: .08em; color: #c8323c; }

/* typing reveals pieces of an already laid-out line */
.ht-hide { visibility: hidden; }
.ht-say { max-width: none; text-wrap: wrap; }
/* the last line's arrow down to the features */
.ht-down { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; margin: .4rem 0 0 1.2rem; vertical-align: middle; border: 1px solid rgba(244, 244, 242, .35); color: #f4f4f2; animation: ht-drop 1.3s ease-in-out infinite; transition: background-color .2s, border-color .2s; }
.ht-down svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.6; }
.ht-down:hover, .ht-down:focus-visible { background: #c8323c; border-color: #c8323c; outline: none; }
.ht-down[hidden] { display: none; }
@keyframes ht-drop { 50% { transform: translateY(5px); } }
@media (prefers-reduced-motion: reduce) { .ht-down { animation: none; } }
.ht-card { background: #120d09; }

/* the word you can click: a gold box that pulses, and a "click me" tag pointing at it */
.ht-word { padding: 0 .06em; margin: 0 .02em; border-bottom: 0; background: rgba(240, 195, 106, .1); box-shadow: inset 0 0 0 .025em rgba(240, 195, 106, .7); color: #f0c36a; cursor: pointer; }
.ht-word.ready { animation: ht-ring 1.4s ease-out infinite; }
.ht-word.on, .ht-word:hover, .ht-word:focus-visible { animation: none; background: rgba(240, 195, 106, .2); box-shadow: inset 0 0 0 .03em #f0c36a; }
@keyframes ht-ring { 0% { box-shadow: inset 0 0 0 .025em rgba(240, 195, 106, .7), 0 0 0 0 rgba(240, 195, 106, .55); } 100% { box-shadow: inset 0 0 0 .025em rgba(240, 195, 106, .7), 0 0 0 .22em rgba(240, 195, 106, 0); } }
.ht-hint { left: auto; right: -.2em; top: auto; bottom: calc(100% + .45em); margin: 0; padding: .35em .6em; font: 600 max(12px, .2em)/1 "MeguLit Han", var(--sans); letter-spacing: .12em;
  background: #f0c36a; color: #120d09; animation: ht-tag 1.1s ease-in-out infinite; pointer-events: none; }
.ht-hint::after { content: ""; position: absolute; left: 50%; top: 100%; translate: -50% 0; border: .4em solid transparent; border-top-color: #f0c36a; border-bottom: 0; }
.ht-word.on .ht-hint { display: none; }
@keyframes ht-tag { 50% { transform: translateY(-.25em); } }
@media (prefers-reduced-motion: reduce) { .ht-word.ready, .ht-hint { animation: none; } }
/* softer invitation: a slow gold glow breathing out of the box, the tag drifting gently */
.ht-word.ready { animation: ht-ring 2.2s ease-out infinite; }
@keyframes ht-ring { 0% { box-shadow: inset 0 0 0 .025em rgba(240, 195, 106, .7), 0 0 0 0 rgba(240, 195, 106, .35); } 70%, 100% { box-shadow: inset 0 0 0 .025em rgba(240, 195, 106, .7), 0 0 0 .18em rgba(240, 195, 106, 0); } }
.ht-hint { animation: ht-tag 2.2s ease-in-out infinite; }
@keyframes ht-tag { 50% { transform: translateY(-.15em); } }
/* the headline itself invites a click: a slow, soft breathing glow on 学日语 (not while a line plays), a brighter
   prompt under it, and a lift on hover */
.ht-play:not(.saying) .ht-big { animation: ht-breathe 3.6s ease-in-out infinite; }
@keyframes ht-breathe { 50% { text-shadow: 0 0 .18em rgba(244, 244, 242, .4), 0 0 .6em rgba(240, 195, 106, .22); } }
.ht-play:not(.saying):hover .ht-big { animation: none; text-shadow: 0 0 .2em rgba(244, 244, 242, .45), 0 0 .7em rgba(240, 195, 106, .3); }
.ht-next { font-size: 1rem; color: #c9c9c7; letter-spacing: .25em; }
.ht-next i { font-size: .8rem; animation-duration: 1.8s; }
@media (prefers-reduced-motion: reduce) { .ht-play .ht-big { animation: none !important; } }
/* the explanation under the clicked word: smaller, a step down from it */
.ht-after { display: block; margin-top: .35em; font-size: .62em; line-height: 1.45; color: #d9d6cf; letter-spacing: .04em; }
.ht-card { z-index: 8; }

/* ---- the headline as a galgame text box: frame, name tag, ▼ in the corner; the whole box answers the pointer ---- */
.ht-box { position: relative; align-self: center; justify-self: start; max-width: 100%; padding: clamp(1.4rem, 2.2vw, 2.6rem) clamp(1.2rem, 2.4vw, 3rem) clamp(2.6rem, 3.4vw, 3.6rem);
  border: 1px solid rgba(244, 244, 242, .2); background: linear-gradient(180deg, rgba(10, 6, 8, .25), rgba(10, 6, 8, .62));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); cursor: pointer; transition: border-color .25s, background-color .25s; }
.ht-box:hover { border-color: rgba(200, 50, 60, .75); }
.ht-box .hero-type { align-self: auto; }
.ht-name { position: absolute; left: -1px; top: 0; translate: 0 -50%; padding: .45rem .9rem; background: #c8323c; color: #fff; font: 600 .875rem/1 "MeguLit Han", var(--serif); letter-spacing: .14em; }
.ht-box .ht-next { position: absolute; right: clamp(.9rem, 1.6vw, 1.8rem); bottom: clamp(.8rem, 1.2vw, 1.3rem); margin: 0; font-size: .9375rem; color: #e8e6e1; }
.ht-box .ht-next i { font-size: 1.15rem; color: #e0505c; animation: ht-blink 1.1s steps(2, jump-none) infinite, ht-bob 1.1s ease-in-out infinite; }
@keyframes ht-blink { 50% { opacity: .25; } }
.ht-box:hover .ht-next { color: #fff; }
@media (max-width: 40rem) { .ht-box { padding: 1.5rem 1rem 3rem; } .ht-name { font-size: .75rem; } }
@media (prefers-reduced-motion: reduce) { .ht-box .ht-next i { animation: none; } }

/* the text box: one width for every line (wide enough for 学日语), its height slides between lines; every line is
   set at one size, centred in the box's height */
.ht-box { width: min(100%, calc(46vw + 2 * clamp(1.2rem, 2.4vw, 3rem))); box-sizing: border-box; display: flex; flex-direction: column; justify-content: center;
  transition: height .5s cubic-bezier(.2, .7, .2, 1), border-color .25s; }
.ht-box.resizing { overflow: hidden; }
.ht-box .hero-type { width: 100%; }
:lang(zh) .ht-box .ht-big { font-size: min(15vw, 15rem); white-space: nowrap; }
:lang(en) .ht-box .ht-big { white-space: normal; }
.ht-play.saying { display: block; }
.ht-say { font-size: clamp(1.9rem, 3.9vw, 4.6rem); line-height: 1.42; letter-spacing: .03em; }
.ht-say:lang(en) { font-size: clamp(2rem, 4.2vw, 5rem); line-height: 1.12; }
@media (max-width: 40rem) { .ht-box { width: 100%; } .ht-say { font-size: 8.4vw; } .ht-say:lang(en) { font-size: 9vw; } :lang(zh) .ht-box .ht-big { font-size: 24vw; } :lang(ja) .ht-box .ht-big { font-size: 15vw; } :lang(en) .ht-box .ht-big { font-size: 13vw; } }
:lang(ja) .ht-box .ht-big { font-size: min(10.5vw, 11rem); }
:lang(en) .ht-box .ht-big { font-size: min(8vw, 9rem); }

/* E425 the update list keeps every entry and scrolls inside a fixed-size notice */
.nt-welcome .nt-updates { height: min(34vh, 300px); overflow-y: auto; overscroll-behavior: contain; align-content: start; padding-right: .6rem; scrollbar-width: thin; scrollbar-color: rgba(200,50,60,.6) transparent; }
.nt-welcome .nt-updates::-webkit-scrollbar { width: 6px; }
.nt-welcome .nt-updates::-webkit-scrollbar-thumb { background: rgba(200,50,60,.55); border-radius: 3px; }
.nt-welcome .nt-updates::-webkit-scrollbar-thumb:hover { background: #c8323c; }

.nt-title-2 { margin-top: .35rem; color: #e8b4b8; }

.nt-title-2 { font-size: clamp(1rem, 1.4vw, 1.2rem); font-weight: 500; line-height: 1.5; }
/* the name tag sits inside the box so a resized window never cuts it in half; the box is a little smaller */
.ht-box { padding-top: calc(clamp(1.4rem, 2.2vw, 2.6rem) + 1.6rem); zoom: .88; }
.ht-name { translate: 0 0; }

/* ---- usage guide: the "how to tell it works" box in the notice, the guide pane, and the cards under Get started -- */
.nt-ok { margin: .2rem 0 0; padding: .85rem 1rem; border: 1px solid rgba(240, 195, 106, .45); border-left: 3px solid #f0c36a; background: rgba(240, 195, 106, .07);
  font-size: .9375rem; line-height: 1.7; color: #ece7dc; }
.nt-ok b { color: #f0c36a; font-weight: 600; }
.nt-ok b:first-child { display: block; margin-bottom: .2rem; }
.nt-ok kbd, .gd-body kbd, .gd-card kbd { padding: .05em .4em; border: 1px solid rgba(244, 244, 242, .35); border-bottom-width: 2px; font: 500 .85em/1.4 "MeguLit Mono", var(--mono); color: #fff; background: rgba(255, 255, 255, .06); }
.nt-act-r { display: inline-flex; gap: .6rem; align-items: center; }
.nt-guide-btn { padding: .55rem 1rem; border: 1px solid #f0c36a; background: rgba(240, 195, 106, .12); color: #f0c36a; font: 600 .8125rem/1 "MeguLit Han", var(--sans); letter-spacing: .08em; cursor: pointer; transition: background-color .2s, color .2s; }
.nt-guide-btn:hover, .nt-guide-btn:focus-visible { background: #f0c36a; color: #120d09; outline: none; }
.gd-dots { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.gd-dots button { padding: .4rem .7rem; border: 1px solid rgba(244, 244, 242, .18); background: none; color: #9a9a9a; font: 400 .75rem/1 "MeguLit Han", var(--sans); cursor: pointer; }
.gd-dots button[aria-current="true"] { border-color: #c8323c; background: rgba(200, 50, 60, .2); color: #fff; }
.gd-dots button:hover { color: #fff; }
.gd-title { margin: .6rem 0 0; font: 600 1.25rem/1.3 "MeguLit Han", var(--serif); color: #f4f4f2; }
.gd-body { margin: 0; padding-left: 1.2rem; display: grid; gap: .55rem; font-size: .9375rem; line-height: 1.7; color: #d9d6cf; min-height: 11rem; }
.gd-body b { color: #f0c36a; font-weight: 600; }
.gd-body li::marker { color: #c8323c; }
.gd-after { margin: 3rem 0 1rem; font: 600 1.3rem/1.3 var(--serif); }
.gd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; }
.gd-card { padding: 1.1rem 1.2rem; border: 1px solid var(--line, rgba(244, 244, 242, .15)); }
.gd-card h3 { margin: 0 0 .6rem; display: flex; gap: .6rem; align-items: baseline; font: 600 1.05rem/1.3 var(--serif); }
.gd-no { font: 300 .75rem/1 "MeguLit Mono", var(--mono); color: #c8323c; letter-spacing: .1em; }
.gd-card ul { margin: 0; padding-left: 1.1rem; display: grid; gap: .4rem; font-size: .875rem; line-height: 1.65; color: var(--muted, #b8b5ae); }
.gd-card b { color: var(--text, #f4f4f2); }
.gd-card kbd { color: inherit; border-color: currentColor; }
@media (max-width: 30rem) { .nt-actions { flex-wrap: wrap; } }
/* E456 game-request rule under the field: full exact title, no abbreviations */
.nt-req { margin: .8rem 0 0; padding: .7rem .95rem; border-left: 3px solid #c8323c; background: rgba(200, 50, 60, .1); color: #f4f4f2; font-size: 1.02rem; font-weight: 600; line-height: 1.7; }
