
/* ── fonts (self-hosted; deploy CSP blocks third-party scripts) ───────── */
@font-face { font-family: "Prata"; src: url(../fonts/prata.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "BrushKo"; src: url(../fonts/brush-ko.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "BrushJa"; src: url(../fonts/brush-ja.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "BrushTw"; src: url(../fonts/brush-tw.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "BrushCn"; src: url(../fonts/brush-cn.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "BrushDecor"; src: url(../fonts/brush-decor.woff2) format("woff2"); font-display: block; }
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(../fonts/eb-normal-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(../fonts/eb-normal-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(../fonts/eb-normal-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "EB Garamond"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(../fonts/eb-italic-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "EB Garamond"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(../fonts/eb-italic-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "EB Garamond"; font-style: italic; font-weight: 400; font-display: swap;
  src: url(../fonts/eb-italic-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

/* ── tokens ─────────────────────────────────────────────────────────── */
:root {
  --paper: #ece5d6;
  --paper-deep: #ddd3bf;
  --ink: #161412;
  --ink-soft: #3a3530;
  --ash: #776e63;
  --seal: #b2221e;
  --spirit: #9cc6ff;

  --f-display: "Prata", serif;
  --f-brush: "Prata", serif;
  --f-hanja: "BrushDecor", serif;
  --f-body: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --f-ui: "EB Garamond", Georgia, serif;

  --ease-brush: cubic-bezier(.62, .02, .32, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --nav-h: 72px;
}
/* CJK: hand brush display face where it has coverage, native serif for body */
:lang(ko) { --f-display: "BrushKo", serif; --f-brush: "BrushKo", serif; --f-body: "Noto Serif KR", "Nanum Myeongjo", "AppleMyungjo", "Batang", serif; --f-ui: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; }
:lang(ja) { --f-display: "BrushJa", serif; --f-brush: "BrushJa", serif; --f-body: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif; --f-ui: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif; }
:lang(zh-TW) { --f-display: "BrushTw", serif; --f-brush: "BrushTw", serif; --f-body: "Noto Serif TC", "Songti TC", "PMingLiU", serif; --f-ui: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif; }
:lang(zh-CN) { --f-display: "BrushCn", serif; --f-brush: "BrushCn", serif; --f-body: "Noto Serif SC", "Songti SC", "SimSun", serif; --f-ui: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; }

/* ── base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  background: var(--paper) url(../img/hanji.webp) repeat;
  background-size: 768px;
  color: var(--ink);
  font: 400 1.125rem/1.7 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
html.is-intro, html.is-intro body { overflow: hidden; }
:lang(ko) { word-break: keep-all; }
:lang(ja), :lang(zh-CN), :lang(zh-TW) { word-break: auto-phrase; line-break: strict; }
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--seal); outline-offset: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── nav ────────────────────────────────────────────────────────────── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 2rem;
  padding: 0 clamp(1rem, 3vw, 2.75rem);
  transition: background .5s, box-shadow .5s, transform .6s var(--ease-out);
}
.nav.is-solid { background: rgba(236, 229, 214, .86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 1px 0 rgba(22, 20, 18, .08); }
.nav__brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.nav__brand img:first-child { width: 30px; height: 30px; }
.nav__brand img:last-child { height: 22px; width: auto; }
.nav__links { display: flex; gap: clamp(1rem, 2.4vw, 2.4rem); margin: 0 auto; list-style: none; padding: 0; }
.nav__links a {
  position: relative; text-decoration: none;
  font: 500 .95rem/1 var(--f-ui); letter-spacing: .08em;
  padding: .5rem 0;
}
:lang(en) .nav__links a, :lang(fr) .nav__links a, :lang(de) .nav__links a, :lang(it) .nav__links a,
:lang(es) .nav__links a, :lang(ru) .nav__links a, :lang(pt-BR) .nav__links a { text-transform: uppercase; font-size: .82rem; letter-spacing: .16em; }
.nav__links a::after { /* brush underline */
  content: ""; position: absolute; left: -6%; right: -6%; bottom: -2px; height: 7px;
  background: url(../img/ink-swipe.webp) center / 100% 100% no-repeat;
  transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease-brush);
  opacity: .85;
}
.nav__links a:hover::after, .nav__links a[aria-current="true"]::after { transform: scaleX(1); }
.nav__right { display: flex; align-items: center; gap: 1.6rem; padding-right: .6rem; }

/* mobile menu */
.menu-btn { display: none; width: 44px; height: 44px; place-items: center; margin-right: -.5rem; }
.menu-btn i { display: block; width: 24px; height: 2px; background: currentColor; position: relative; transition: transform .4s var(--ease-out), background .3s; }
.menu-btn i::before, .menu-btn i::after { content: ""; position: absolute; left: 0; width: 100%; height: 2px; background: currentColor; transition: transform .4s var(--ease-out); }
.menu-btn i::before { transform: translateY(-7px); } .menu-btn i::after { transform: translateY(7px); width: 70%; }
.is-menu .menu-btn i { background: transparent; }
.is-menu .menu-btn i::before { transform: rotate(45deg); } .is-menu .menu-btn i::after { transform: rotate(-45deg); width: 100%; }
.drawer {
  position: fixed; inset: 0; z-index: 45; display: flex; flex-direction: column; justify-content: center; gap: 2.4rem;
  padding: calc(var(--nav-h) + 2rem) 2rem calc(2rem + env(safe-area-inset-bottom));
  background: var(--paper) url(../img/hanji.webp) 0 0 / 768px repeat; color: var(--ink);
  clip-path: circle(0% at calc(100% - 2.2rem) 2.2rem); visibility: hidden;
  transition: clip-path .7s var(--ease-brush), visibility 0s .7s;
}
.is-menu .drawer { clip-path: circle(150% at calc(100% - 2.2rem) 2.2rem); visibility: visible; transition: clip-path .8s var(--ease-brush); }
.is-menu { overflow: hidden; }
.drawer ol { list-style: none; margin: 0; padding: 0; counter-reset: d; }
.drawer li { counter-increment: d; border-bottom: 1px solid rgba(22, 20, 18, .1); }
.drawer li a { display: flex; align-items: baseline; gap: 1rem; padding: 1rem 0; text-decoration: none; font: 400 clamp(1.7rem, 7vw, 2.3rem)/1.1 var(--f-display); }
.drawer li a::before { content: counter(d, cjk-ideographic); font: 400 1rem/1 var(--f-hanja); color: var(--seal); width: 1.4rem; }
.drawer__langs { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font: 400 .95rem/1.6 system-ui, sans-serif; }
.drawer__langs button { padding: .25rem 0; color: var(--ash); }
.drawer__langs button[aria-selected="true"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--seal); text-underline-offset: .3em; }
.drawer .btn { align-self: flex-start; margin-left: 14px; }
.is-menu .nav { color: var(--ink) !important; background: transparent !important; box-shadow: none !important; }
.is-menu .nav .nav__brand img:last-child { filter: none !important; }

/* language picker */
.lang { position: relative; }
.lang__btn { display: flex; align-items: center; gap: .45rem; font: 500 .85rem/1 var(--f-ui); letter-spacing: .06em; padding: .55rem .4rem; }
.lang__btn svg { width: 16px; height: 16px; }
.lang__list {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px;
  margin: 0; padding: .5rem; list-style: none;
  background: var(--paper) url(../img/hanji.webp); background-size: 768px;
  border: 1px solid rgba(22, 20, 18, .14); box-shadow: 0 18px 40px -18px rgba(22, 20, 18, .45);
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .25s var(--ease-out);
}
.lang.is-open .lang__list { opacity: 1; visibility: visible; transform: none; }
.lang__list button { width: 100%; text-align: left; padding: .5rem .75rem; font: 400 .95rem/1.2 system-ui, sans-serif; }
.lang__list button:hover, .lang__list button[aria-selected="true"] { background: rgba(22, 20, 18, .07); }
.lang__list button[aria-selected="true"]::before { content: "●"; color: var(--seal); font-size: .55em; margin-right: .6em; vertical-align: .25em; }

/* buttons */
.btn {
  --h: 54px;
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: .7rem;
  height: var(--h); padding: 0 1.9rem;
  font: 500 1rem/1 var(--f-ui); letter-spacing: .06em; text-decoration: none; white-space: nowrap;
  color: var(--paper);
  transition: transform .35s var(--ease-out), color .3s;
}
.btn::before { /* brushed ink slab */
  content: ""; position: absolute; inset: -6px -14px; z-index: -1;
  background: url(../img/ink-swipe.webp) center / 100% 100% no-repeat;
  transition: transform .45s var(--ease-brush), filter .3s;
}
.btn:hover { transform: translateY(-2px); }
.btn:hover::before { transform: scaleX(1.06) scaleY(1.08); }
.btn--seal::before { background-image: url(../img/ink-swipe-red.webp); }
.btn--ghost { color: var(--ink); }
.btn--ghost::before { background-image: url(../img/ink-swipe-light.webp); opacity: .88; inset: -2px -8px; }
.btn--ghost::after {
  content: ""; position: absolute; left: 1.2rem; right: 1.2rem; bottom: 10px; height: 6px;
  background: url(../img/ink-swipe.webp) center / 100% 100% no-repeat; opacity: .8;
  transform-origin: left; transition: transform .45s var(--ease-brush);
}
.btn--ghost:hover::after { transform: scaleX(1.08); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn--sm { --h: 40px; padding: 0 1.2rem; font-size: .85rem; }

/* ── hero / intro stage ─────────────────────────────────────────────── */
.hero {
  position: relative; height: 100vh; height: 100svh; min-height: 640px;
  overflow: hidden; isolation: isolate;
  background: var(--paper) url(../img/hanji.webp) 0 0 / 768px repeat;
}
.hero__realm, .hero__fog, .hero__motes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero__realm { mix-blend-mode: multiply; z-index: 1; }
.js .soak-blob { transform: scale(0); }
.fog-on .hero__fog { background-image: url(../img/fog.webp); }
@media (max-width: 900px) { .fog-on .hero__fog { background-image: url(../img/fog-720.webp); } }
.hero__fog {
  z-index: 3; opacity: .55;
  background: 0 100% / 120% auto repeat-x;
  animation: fog-drift 90s linear infinite;
  mask-image: linear-gradient(to top, transparent 0%, #000 35%, #000 60%, transparent 95%);
  -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 35%, #000 60%, transparent 95%);
}
@keyframes fog-drift { to { background-position: -120vw 100%; } }
.hero__motes { z-index: 5; }

.hero__muyu {
  position: absolute; z-index: 4;
  left: 72.5%; bottom: 6vh; height: min(52vh, 580px); width: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 26px 22px rgba(22, 20, 18, .18));
}
.hero__muyu img { height: 100%; width: auto; max-width: none; }

.hero__title {
  position: absolute; z-index: 6; left: 50%; top: calc(var(--nav-h) + 4vh);
  width: min(46vw, 680px); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.logo { position: relative; width: 100%; aspect-ratio: 2009 / 677; transform-origin: 50% 40%; }
.logo svg, .logo img { position: absolute; inset: 0; width: 100%; height: 100%; }
.logo__full { opacity: 0; }
.logo .logo__seal { position: absolute; inset: auto; width: 5.6%; height: auto; right: -11%; bottom: -3%; transform: rotate(-3deg); opacity: 0; }
.hero__tag {
  margin: clamp(1rem, 2.4vh, 1.6rem) 0 0;
  font: 400 clamp(1.05rem, 1.55vw, 1.4rem)/1.45 var(--f-body);
  font-style: italic; letter-spacing: .01em; color: var(--ink-soft);
  max-width: 34ch;
}
:lang(ko) .hero__tag, :lang(ja) .hero__tag, :lang(zh-CN) .hero__tag, :lang(zh-TW) .hero__tag { font-style: normal; letter-spacing: .04em; font-family: var(--f-brush); font-size: clamp(1.1rem, 1.6vw, 1.45rem); }
.hero__tag { text-wrap: balance; }
:lang(ko) .hero__tag, :lang(ja) .hero__tag, :lang(zh-CN) .hero__tag, :lang(zh-TW) .hero__tag { max-width: 15em; }
.hero__tag em { font-style: normal; color: var(--ink); background: linear-gradient(transparent 62%, rgba(178, 34, 30, .16) 0); padding: 0 .1em; }
.hero__cta { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin-top: clamp(1.2rem, 3vh, 2rem); }

/* vertical brush captions flanking the stage */
.hero__vert {
  position: absolute; z-index: 6; top: 50%; transform: translateY(-50%);
  writing-mode: vertical-rl; font: 400 clamp(1.6rem, 2.4vw, 2.3rem)/1 var(--f-hanja);
  letter-spacing: .5em; color: rgba(22, 20, 18, .5); user-select: none;
}
/* Muyu's name, brushed vertically beside her shoulder */
.hero__name { position: absolute; top: 52%; left: 88%; writing-mode: vertical-rl;
  font: 400 clamp(1.5rem, 2.2vw, 2.2rem)/1 var(--f-hanja); letter-spacing: .32em; color: rgba(22, 20, 18, .62); user-select: none; }
.hero__name::after { content: ""; position: absolute; top: calc(100% + .2em); left: 50%; width: .28em; height: .28em; margin-left: -.14em; background: var(--seal); transform: rotate(45deg); }
.hero__vert--r { right: clamp(1rem, 3vw, 3rem); font-size: clamp(.8rem, .9vw, .95rem); letter-spacing: .4em; font-family: var(--f-ui); color: var(--ash); }
.hero__vert--r::after { content: ""; display: block; width: 1px; height: 64px; margin: 1.2rem auto 0; background: currentColor; transform-origin: top; animation: cue 2.4s var(--ease-brush) infinite; }
@keyframes cue { 0% { transform: scaleY(0); } 55% { transform: scaleY(1); transform-origin: top; } 56% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

.skip {
  position: fixed; z-index: 60; right: clamp(1rem, 3vw, 2.5rem); bottom: clamp(1rem, 3vh, 2rem);
  font: 500 .8rem/1 var(--f-ui); letter-spacing: .2em; text-transform: uppercase; color: var(--ash);
  padding: .7rem .2rem; transition: opacity .4s;
}
.skip:hover { color: var(--ink); }

/* intro choreography states (JS drives the motion; these are rest states) */
.is-intro .nav, .is-intro .hero__cta, .is-intro .hero__vert, .is-intro .hero__fog { opacity: 0; }
.is-intro .hero__muyu { opacity: 0; }
.is-intro .hero__tag { opacity: 0; }
html:not(.is-intro) .skip { opacity: 0; pointer-events: none; }
html:not(.is-intro) .logo__full, html:not(.is-intro) .logo__seal { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════════
   SECTIONS — the page descends from paper (the living world) to ink
   (the depths of the afterlife).
   ═══════════════════════════════════════════════════════════════════ */
section[id] { scroll-margin-top: calc(var(--nav-h) - 1px); }
.sec { position: relative; padding: clamp(6rem, 13vw, 11rem) clamp(1.25rem, 5vw, 4rem); }
.wrap { width: min(1240px, 100%); margin: 0 auto; position: relative; }
.ink-theme { color: #e9e2d3; background: #121110; }
.ink-theme::before { /* hanji fibre showing through the ink */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url(../img/hanji.webp) 0 0 / 768px repeat; mix-blend-mode: overlay; opacity: .09;
}

/* section heading */
.kicker {
  display: inline-flex; align-items: center; gap: .8rem;
  font: 500 .8rem/1 var(--f-ui); letter-spacing: .28em; text-transform: uppercase; color: var(--ash);
}
:lang(ko) .kicker, :lang(ja) .kicker, :lang(zh-CN) .kicker, :lang(zh-TW) .kicker { letter-spacing: .3em; font-size: .9rem; }
.kicker::before { content: ""; width: 9px; height: 9px; background: var(--seal); transform: rotate(45deg); }
.ink-theme .kicker { color: #a39a8c; }
.h2 {
  margin: 1.1rem 0 0; font: 400 clamp(2.1rem, 4.4vw, 3.9rem)/1.12 var(--f-display);
  letter-spacing: -.005em; text-wrap: balance;
}
:lang(ko) .h2, :lang(ja) .h2, :lang(zh-CN) .h2, :lang(zh-TW) .h2 { line-height: 1.3; letter-spacing: .02em; }
.lede { font-size: clamp(1.1rem, 1.35vw, 1.28rem); color: var(--ink-soft); max-width: 38em; text-wrap: pretty; }
.ink-theme .lede { color: #bdb4a5; }
:lang(ko) .lede, :lang(ja) .lede, :lang(zh-CN) .lede, :lang(zh-TW) .lede { line-height: 1.95; }

/* far-away sections hold their heavy CSS art until they come near (JS only) */
.js .sec:not(.is-near) .descent, .js .sec:not(.is-near) .tale__land,
.js .sec:not(.is-near) .badges li::before, .js .sec:not(.is-near) .bestiary li::after { background-image: none; }
.js .sec:not(.is-near) .wish__bg, .js .sec:not(.is-near) .beasts__sheet { -webkit-mask: none; mask: none; }
.js .sec:not(.is-near) .wish__bg video { visibility: hidden; }

/* reveal primitives (only when JS is running; content stays visible otherwise) */
.js [data-r] { opacity: 0; }
.js [data-r="ink"] { filter: blur(10px); transform: translateY(14px); transition: opacity 1.2s var(--ease-out), filter 1.4s var(--ease-out), transform 1.4s var(--ease-out); transition-delay: var(--d, 0s); }
.js [data-r="wipe"] {
  opacity: 1;
  -webkit-mask-image: linear-gradient(100deg, #000 40%, transparent 60%); mask-image: linear-gradient(100deg, #000 40%, transparent 60%);
  -webkit-mask-size: 300% 100%; mask-size: 300% 100%; -webkit-mask-position: 100% 0; mask-position: 100% 0;
  transition: -webkit-mask-position 1.8s var(--ease-brush), mask-position 1.8s var(--ease-brush); transition-delay: var(--d, 0s);
}
.js [data-r="fade"] { transition: opacity 1.4s var(--ease-out); transition-delay: var(--d, 0s); }
.js [data-r].is-in { opacity: 1; filter: none; transform: none; -webkit-mask-position: 0 0; mask-position: 0 0; }

/* ensō drawn with a sweeping conic mask */
@property --sweep { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.enso { position: relative; aspect-ratio: 1; }
.enso > img.enso__ring {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  -webkit-mask-image: conic-gradient(from -100deg, #000 var(--sweep), transparent calc(var(--sweep) + 14deg));
  mask-image: conic-gradient(from -100deg, #000 var(--sweep), transparent calc(var(--sweep) + 14deg));
  transition: --sweep 2.2s var(--ease-brush); transition-delay: var(--d, 0s);
}
.js .enso.is-in > img.enso__ring, html:not(.js) .enso > img.enso__ring { --sweep: 380deg; }

/* brushed media frame */
.framed {
  position: relative; overflow: hidden;
  -webkit-mask: url(../img/brush-frame.webp) center / 100% 100% no-repeat;
  mask: url(../img/brush-frame.webp) center / 100% 100% no-repeat;
}
.framed img, .framed video { width: 100%; height: 100%; object-fit: cover; }

/* ── TALE OF THE NAMELESS ───────────────────────────────────────────── */
.tale { padding-bottom: clamp(9rem, 18vw, 15rem); overflow: hidden; }
.tale__grid { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(260px, 380px); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.tale__vtitle { display: flex; flex-direction: column; align-items: center; gap: 1.4rem; font: 400 clamp(3.4rem, 6.2vw, 5.8rem)/1 var(--f-hanja); color: var(--ink); padding-top: .3rem; }
.tale__vtitle span { writing-mode: vertical-rl; letter-spacing: .14em; }
.tale__vtitle img { width: .62em; height: auto; transform: rotate(-4deg); }
.tale__lines { margin-top: 1.6rem; }
.tale__line { margin: 0 0 1.35rem; font: 400 clamp(1.25rem, 1.9vw, 1.7rem)/1.6 var(--f-body); text-wrap: pretty; max-width: 30em; }
.tale__line--big { font: 400 clamp(1.7rem, 2.9vw, 2.6rem)/1.35 var(--f-display); margin: 2.4rem 0; }
:lang(ko) .tale__line, :lang(ja) .tale__line, :lang(zh-CN) .tale__line, :lang(zh-TW) .tale__line { line-height: 1.9; }
:lang(ko) .tale__line--big, :lang(ja) .tale__line--big, :lang(zh-CN) .tale__line--big, :lang(zh-TW) .tale__line--big { line-height: 1.55; }
.tale__line q { quotes: none; color: var(--seal); font-style: normal; }
.tale__coda { margin-top: 2.8rem; color: var(--ash); font-style: italic; }
:lang(ko) .tale__coda, :lang(ja) .tale__coda, :lang(zh-CN) .tale__coda, :lang(zh-TW) .tale__coda { font-style: normal; }
.tale__name { position: sticky; top: calc(var(--nav-h) + 6vh); text-align: center; }
.tale__name .enso { width: 100%; }
.tale__name .enso b {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 400 clamp(4rem, 8vw, 7.4rem)/1 var(--f-hanja); writing-mode: vertical-rl; letter-spacing: .05em;
}
.tale__name figcaption { margin-top: 1.4rem; }
.tale__name strong { display: block; font: 400 1.7rem/1.2 var(--f-display); letter-spacing: .04em; }
.tale__name span { display: block; margin-top: .4rem; color: var(--ash); font-style: italic; font-size: 1.02rem; }
.tale__land { position: absolute; left: 0; right: 0; bottom: 0; height: clamp(160px, 26vw, 360px); mix-blend-mode: multiply; opacity: .9; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 45%); mask-image: linear-gradient(to bottom, transparent, #000 45%);
  background: url(../img/scroll-2.webp) center bottom / cover no-repeat; }

/* ── CINEMATIC BAND ─────────────────────────────────────────────────── */
.band { position: relative; width: min(100% - 2rem, 1280px); aspect-ratio: 1138 / 284; margin: clamp(-4rem, -6vw, -2rem) auto 0; }
.band__media {
  position: absolute; inset: 0;
  -webkit-mask: url(../img/ink-swipe.webp) center / 104% 112% no-repeat; mask: url(../img/ink-swipe.webp) center / 104% 112% no-repeat;
}
.band__media video, .band__media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.7) contrast(1.05) brightness(.62); }
.band__line {
  position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 0 1rem;
  font: 400 clamp(1.6rem, 3.6vw, 3.2rem)/1.2 var(--f-display); color: #f4eee2; text-align: center;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .65), 0 0 2px rgba(0, 0, 0, .4);
}

/* ── KARMIC SOULS ───────────────────────────────────────────────────── */
.souls { background: linear-gradient(to bottom, transparent 0%, rgba(221, 211, 191, .55) 40%, rgba(205, 195, 176, .7) 100%); padding-bottom: 0; }
.souls__top { display: grid; grid-template-columns: minmax(260px, 420px) minmax(0, 1fr); gap: clamp(3rem, 7vw, 7rem); align-items: center; }
.mirror { position: relative; margin: 0; }
.mirror__frame { position: relative; }
.mirror__frame > img { width: 100%; height: auto; filter: contrast(1.05); mix-blend-mode: multiply; }
.mirror__glass {
  position: absolute; left: 24.6%; top: 19.6%; width: 41.1%; aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  background: #2b2a2a; box-shadow: inset 0 0 30px rgba(0, 0, 0, .7);
}
.mirror__glass video { display: block; width: 100%; height: 100%; object-fit: cover; opacity: .9; filter: grayscale(.35) sepia(.25) contrast(1.1) brightness(.9);
  -webkit-mask-image: radial-gradient(circle, #000 58%, transparent 72%); mask-image: radial-gradient(circle, #000 58%, transparent 72%); }
.mirror__glass::after { /* glass sheen + ripple */
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, .22), transparent 38%, transparent 70%, rgba(255, 255, 255, .08));
  animation: sheen 7s ease-in-out infinite;
}
@keyframes sheen { 50% { opacity: .55; } }
.mirror figcaption { position: absolute; right: -1.6rem; top: 6%; writing-mode: vertical-rl; display: flex; gap: .9rem; align-items: center; color: var(--ash); font: 400 .9rem/1 var(--f-ui); letter-spacing: .3em; }
.mirror figcaption b { font: 400 1.9rem/1 var(--f-hanja); color: var(--ink); letter-spacing: .1em; }
.souls__text p { margin: 1.4rem 0 0; }

.after { position: relative; margin-top: clamp(5rem, 10vw, 9rem); padding-bottom: clamp(17rem, 32vw, 32rem); }
.after__stage { position: relative; height: clamp(340px, 46vw, 600px); --spread: 0; }
.after__fig { position: absolute; left: 50%; bottom: 0; height: 100%; width: auto; transform: translateX(-50%); }
.after__fig img { height: 100%; width: auto; max-width: none; }
.after__ghost { opacity: calc(var(--o) * (.25 + var(--spread) * .75)); filter: grayscale(1) contrast(.85) brightness(1.08) blur(calc((1 - var(--spread)) * 6px));
  transform: translateX(calc(-50% + var(--x) * var(--spread) * var(--reach, 1) * 1%)) scale(calc(1 - var(--spread) * .04)); mix-blend-mode: multiply; }
.after__ghost img { -webkit-mask-image: linear-gradient(to top, transparent, #000 30%); mask-image: linear-gradient(to top, transparent, #000 30%); }
.after__text { text-align: center; max-width: 40em; margin: clamp(2.4rem, 4vw, 3.4rem) auto 0; }
.after__text p { margin: 0 0 1rem; }
.after__text p:last-child { font: 400 clamp(1.35rem, 2vw, 1.75rem)/1.5 var(--f-display); color: var(--ink); text-wrap: balance; }
:lang(ko) .after__text p:last-child, :lang(ja) .after__text p:last-child, :lang(zh-CN) .after__text p:last-child, :lang(zh-TW) .after__text p:last-child { line-height: 1.7; }
.after { z-index: 1; overflow-x: clip; }
.descent { position: absolute; left: 0; right: 0; bottom: -1px; height: clamp(260px, 38vw, 600px); pointer-events: none; z-index: 0;
  background: linear-gradient(to bottom, rgba(18, 17, 16, 0) 0%, rgba(18, 17, 16, .35) 45%, #121110 96%), url(../img/scroll-4.webp) center 70% / cover no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 35%); mask-image: linear-gradient(to bottom, transparent, #000 35%); }

/* ── BRAVE OR CAREFUL ───────────────────────────────────────────────── */
.style__head { text-align: center; }
.style__head .lede { margin: 1.4rem auto 0; }
.split { display: flex; gap: clamp(.6rem, 1.4vw, 1.2rem); margin-top: clamp(3rem, 6vw, 5rem); height: clamp(320px, 42vw, 560px); }
.split__pane { position: relative; flex: 1; transition: flex 1s var(--ease-out); cursor: default; }
.split__pane:hover { flex: 1.45; }
.split__pane .framed { position: absolute; inset: 0; }
.split__pane img { transition: transform 1.4s var(--ease-out), filter .8s; filter: saturate(.8) brightness(.78); }
.split__pane:hover img { transform: scale(1.04); filter: saturate(1) brightness(.92); }
.split__label { position: absolute; left: clamp(1.4rem, 3vw, 2.6rem); bottom: clamp(1.4rem, 3vw, 2.4rem); z-index: 2; text-shadow: 0 2px 18px rgba(0, 0, 0, .7); }
.split__pane--r .split__label { left: auto; right: clamp(1.4rem, 3vw, 2.6rem); text-align: right; }
.split__label b { display: block; font: 400 clamp(4rem, 8vw, 7.5rem)/1 var(--f-hanja); color: #f2ece0; }
.split__label b::after { content: ""; display: inline-block; width: .16em; height: .16em; margin-left: .12em; background: var(--seal); vertical-align: top; transform: rotate(45deg); }
.split__label strong { display: block; margin-top: .4rem; font: 400 clamp(1.3rem, 2vw, 1.8rem)/1.1 var(--f-display); color: #f2ece0; }
.split__label span { display: block; margin-top: .3rem; color: #cfc6b6; font-style: italic; }
:lang(ko) .split__label span, :lang(ja) .split__label span, :lang(zh-CN) .split__label span, :lang(zh-TW) .split__label span { font-style: normal; }
.split__or { align-self: center; flex: none; font: 400 1.4rem/1 var(--f-hanja); color: #8d8476; writing-mode: vertical-rl; }
.style__body { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem); max-width: 980px; margin: clamp(3rem, 5vw, 4.5rem) auto 0; }
.style__body p { margin: 0; color: #bdb4a5; }
.style__body p:first-child::first-letter { font: 400 3.2em/.85 var(--f-display); float: left; margin: .08em .12em 0 0; color: #f2ece0; }
:lang(ko) .style__body p:first-child::first-letter, :lang(ja) .style__body p:first-child::first-letter,
:lang(zh-CN) .style__body p:first-child::first-letter, :lang(zh-TW) .style__body p:first-child::first-letter { font: inherit; float: none; margin: 0; color: inherit; }

/* ── ARSENAL ────────────────────────────────────────────────────────── */
.arsenal { padding-top: 0; }
.arsenal__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(2rem, 5vw, 5rem); align-items: end; }
.arsenal__head .lede { margin: 0; }
.badges { list-style: none; margin: clamp(3rem, 6vw, 5rem) 0 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: clamp(.6rem, 2vw, 2rem); }
.badges li { position: relative; aspect-ratio: 1; display: grid; place-items: center; }
.badges li::before { /* light ink bloom on hover */
  content: ""; position: absolute; inset: -40%; background: url(../img/ink-bloom.webp) center / contain no-repeat;
  filter: invert(1); opacity: 0; transform: scale(.4) rotate(0deg); transition: opacity .6s, transform 1s var(--ease-out);
}
.badges li:hover::before, .badges li.fx-on::before { opacity: .07; transform: scale(1) rotate(25deg); }
.badges li > img { position: relative; width: 82%; height: auto; opacity: .85; transition: transform .8s var(--ease-out), opacity .4s; }
.badges li:hover > img, .badges li.fx-on > img { transform: translateY(-6px) scale(1.06); opacity: 1; }
.js .badges li { opacity: 0; transform: translateY(16px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); transition-delay: calc(var(--i) * 80ms); }
.js .badges.is-in li { opacity: 1; transform: none; }
.arsenal .band { margin-top: clamp(4rem, 8vw, 7rem); }
/* weapon hover effects (in-game sprites) — decorative, played while hovered / tapped */
.badges li { cursor: default; z-index: 1; }
.badges li.fx-on { z-index: 4; }
.badges li > img { z-index: 2; }
.fx { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .35s var(--ease-out); z-index: 1; }
.fx--front { z-index: 3; }
.fx-on .fx { opacity: 1; }
.fx * { position: absolute; animation-play-state: paused !important; }
.fx-on .fx * { animation-play-state: running !important; }
.fx img { max-width: none; }
/* 朱雀 — flame wings beating behind the emblem */
.fx .wing { bottom: 36%; width: 118%; height: auto; opacity: .42; filter: saturate(.65) blur(.4px); mix-blend-mode: screen; }
.fx .wing--l { right: 46%; transform-origin: 100% 100%; animation: flap-l 1.4s ease-in-out infinite alternate; }   /* shoulder at the emblem */
.fx .wing--r { left: 46%; transform-origin: 0% 100%; animation: flap-r 1.4s ease-in-out infinite alternate; }
@keyframes flap-l { from { transform: rotate(14deg) scale(.92); } to { transform: rotate(-6deg) scale(1); } }
@keyframes flap-r { from { transform: rotate(-14deg) scale(.92); } to { transform: rotate(6deg) scale(1); } }
/* 이무기 chain lightning — the dragon sweeps through, bolts crackle */
.fx .dragon { left: 50%; top: 46%; width: 300%; height: auto; animation: sweep 2s cubic-bezier(.3,.1,.3,1) infinite; mix-blend-mode: screen; filter: saturate(.6) blur(.4px); }
@keyframes sweep { 0% { transform: translate(-95%, -50%); opacity: 0; } 22% { opacity: .42; } 75% { opacity: .42; } 100% { transform: translate(-5%, -50%); opacity: 0; } }
@keyframes bolt { to { background-position: 133.33% 0; } }
@keyframes flicker { 0%, 100% { opacity: .5; } 30% { opacity: 0; } 55% { opacity: .45; } 70% { opacity: 0; } }
/* 신검 divine blades — four blades orbiting */
.fx .orbit { inset: -38%; animation: spin 2.4s linear infinite; }
.fx .orbit--rev { animation-direction: reverse; animation-duration: 3.2s; }
.fx .arm { inset: 0; transform: rotate(var(--a)); }
.fx .blade { left: 50%; top: -2%; width: 68%; height: auto; transform: translateX(-50%) rotate(180deg) scaleY(.31); }   /* slim, like in game */
@keyframes spin { to { transform: rotate(360deg); } }
/* 玄武 — the turtle walks back and forth above the emblem */
.fx .turtle { left: 50%; bottom: 82%; width: 66%; aspect-ratio: 1; margin-left: -33%; background: url(../img/fx-turtle.webp) 0 0 / 400% 100% no-repeat;
  animation: steps4 .6s steps(4) infinite, walk 4.4s linear infinite; }
@keyframes steps4 { to { background-position: 133.33% 0; } }
@keyframes walk { 0% { transform: translateX(-62%) scaleX(1); } 48% { transform: translateX(62%) scaleX(1); } 50% { transform: translateX(62%) scaleX(-1); } 98% { transform: translateX(-62%) scaleX(-1); } 100% { transform: translateX(-62%) scaleX(1); } }   /* faces the way it walks */
/* 太極 — the trigram ring turning */
.fx .ring { left: 50%; top: 50%; width: 200%; height: auto; transform: translate(-50%, -50%); animation: turn 14s linear infinite; opacity: .9; }
@keyframes turn { from { transform: translate(-50%, -50%) rotate(0); } to { transform: translate(-50%, -50%) rotate(360deg); } }
/* 월광탄 — moonlight bullets fired outward from a pale glow */
.fx .moonglow { left: 50%; top: 50%; width: 210%; height: auto; transform: translate(-50%, -50%); animation: moonpulse 1.6s ease-in-out infinite alternate; mix-blend-mode: screen; }
@keyframes moonpulse { from { opacity: .45; transform: translate(-50%, -50%) scale(.85); } to { opacity: .8; transform: translate(-50%, -50%) scale(1.05); } }
.fx .bullet { left: 50%; top: 50%; width: 92%; height: auto; transform-origin: 0 50%; margin-top: -6%; animation: fire .9s cubic-bezier(.25,.8,.35,1) infinite; animation-delay: var(--d); }
@keyframes fire { 0% { transform: rotate(var(--a)) translateX(-8%) scaleX(.25); opacity: 0; } 14% { opacity: 1; }
  100% { transform: rotate(var(--a)) translateX(115%) scaleX(1); opacity: 0; } }
/* 부채 boomerang — the spinning fan loops round */
.fx .fan { left: 50%; top: 0; width: 48%; height: auto; margin-left: -24%; animation: spin .45s linear infinite; }
/* 창 spear — a glowing thrust through the emblem */
.fx .spear { left: 50%; top: 50%; width: 250%; height: auto; transform-origin: 50% 50%; animation: thrust 1.3s cubic-bezier(.2,.9,.25,1) infinite; }
@keyframes thrust { 0% { transform: translate(-50%, -50%) rotate(-32deg) translateX(-34%); opacity: 0; } 12% { opacity: .95; }
  30% { transform: translate(-50%, -50%) rotate(-32deg) translateX(10%); } 62% { transform: translate(-50%, -50%) rotate(-32deg) translateX(10%); opacity: .95; }
  100% { transform: translate(-50%, -50%) rotate(-32deg) translateX(-20%); opacity: 0; } }

/* 청룡 — real chain-lightning arcs (Lightning_Spark_002) crackling round the emblem */
.fx .arcs { inset: -46%; animation: spin 7s linear infinite; }
.fx .arc { left: 0; top: 0; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: screen;
  transform: rotate(var(--a)) scale(var(--s)); animation: crackle .5s steps(1) infinite; animation-delay: var(--d); }
@keyframes crackle { 0% { opacity: .95; transform: rotate(var(--a)) scale(var(--s)); } 25% { opacity: .15; } 40% { opacity: .85; transform: rotate(calc(var(--a) + 18deg)) scale(calc(var(--s) * .92)); }
  65% { opacity: 0; } 80% { opacity: .7; transform: rotate(calc(var(--a) - 12deg)) scale(var(--s)); } }
/* 월광탄 — thin blue bullets fired outward */
.fx .mbolt { left: 50%; top: 50%; width: 80%; height: auto; margin-top: -4%; transform-origin: 0 50%; mix-blend-mode: screen;
  animation: boltfly .75s cubic-bezier(.2,.8,.3,1) infinite; animation-delay: var(--d); }
@keyframes boltfly { 0% { transform: rotate(var(--a)) translateX(-10%) scaleX(.2); opacity: 0; } 15% { opacity: 1; } 100% { transform: rotate(var(--a)) translateX(150%) scaleX(1); opacity: 0; } }
@keyframes orbfly { 0% { transform: rotate(var(--a)) translateX(0) scale(.35); opacity: 0; } 15% { opacity: 1; } 100% { transform: rotate(var(--a)) translateX(210%) scale(1); opacity: 0; } }
/* 현무 — StrafeProjectile: flame shots fired the way the turtle faces */
.fx .flame { left: 38%; top: -6%; width: 130%; aspect-ratio: 1; mix-blend-mode: screen; background: url(../img/fx-flameshot.webp) 0 0 / 400% 100% no-repeat;
  animation: steps4 .28s steps(4) infinite, flamefly 1.2s cubic-bezier(.3,.7,.4,1) infinite; }
.fx .flame + .flame { animation-delay: 0s, .6s; }
@keyframes flamefly { 0% { transform: translateX(0) scale(.4); opacity: 0; } 12% { opacity: 1; } 100% { transform: translateX(190%) scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .fx * { animation: none !important; } }
/* ── visual pass ─────────────────────────────────────────────────── */
/* other nameless ones: faint ink silhouettes standing in the hero mist */
.hero__sils { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.hero__sils img { position: absolute; left: var(--x); bottom: var(--b, 16vh); height: var(--h); width: auto; max-width: none; transform: translateX(-50%);
  opacity: var(--o); filter: blur(.9px); animation: sway 9s ease-in-out infinite alternate; }
.hero__sils img:nth-child(even) { animation-duration: 12s; animation-delay: -4s; }
@keyframes sway { to { transform: translateX(-50%) translateY(-6px); filter: blur(1.8px); } }
.is-intro .hero__sils { opacity: 0; }
.hero__sils { transition: opacity 3s 1.2s; }
/* brushed edge where the paper world gives way to ink */
.ink-edge { position: absolute; left: 0; right: 0; bottom: -2px; height: clamp(70px, 9vw, 150px); z-index: 1; pointer-events: none;
  background: url(../img/ink-edge.webp) center bottom / 100% 100% no-repeat; }
/* headings: a brush stroke underlines each title as it inks in */
.h2 { position: relative; }
.h2::after { content: ""; display: block; width: min(4.6em, 46%); height: .2em; margin-top: .35em;
  background: url(../img/ink-swipe-red.webp) left center / 100% 100% no-repeat; opacity: .85;
  transform: scaleX(0); transform-origin: left; transition: transform 1.1s var(--ease-brush) .35s; }
.style__head .h2::after, .wish .h2::after { margin-inline: auto; transform-origin: center; }
.js .h2.is-in::after, html:not(.js) .h2::after { transform: scaleX(1); }
/* prop accents */
.accent { position: absolute; pointer-events: none; height: auto; }
.accent--tale { left: clamp(1rem, 6vw, 6rem); bottom: clamp(5rem, 12vw, 10rem); width: clamp(70px, 8vw, 120px); mix-blend-mode: multiply; opacity: .75; z-index: 1; }
.beasts .wrap { position: relative; }
.accent--reeds-l, .accent--reeds-r { bottom: -2.2rem; width: clamp(120px, 16vw, 230px); z-index: 2; filter: invert(1) brightness(.75); opacity: .55; }
.accent--reeds-l { left: -2.5rem; } .accent--reeds-r { right: -2.5rem; transform: scaleX(-1); }
.wish .wrap { position: relative; }
@media (max-width: 900px) {
  .hero__sils img { bottom: calc(var(--b, 16vh) + 4svh); }
  .hero__sils img:nth-child(2), .hero__sils img:nth-child(4) { display: none; }
    .accent--reeds-l, .accent--reeds-r { width: 110px; bottom: -1.4rem; }
  .map__runner { width: 9%; }
}



/* ── MIDDLE REALM: chapters on a horizontal scroll ──────────────────── */
.realm { padding-bottom: 0; }
.realm__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(2rem, 5vw, 5rem); align-items: end; }
.realm__head .lede { margin: 0; }
/* map of the Middle Realm — not interactive: places ink in as the route reaches them */
.map {
  position: relative; margin-top: clamp(2.5rem, 5vw, 4rem); color: var(--ink);
  padding: clamp(1.4rem, 3vw, 2.6rem);
  background: var(--paper) url(../img/hanji.webp) 0 0 / 768px repeat;
  -webkit-mask: url(../img/sheet-frame.webp) center / 100% 100% no-repeat; mask: url(../img/sheet-frame.webp) center / 100% 100% no-repeat;
}
/* each chapter's own ground (concept art), blended, printed onto the hanji */
.map__ground { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; mix-blend-mode: multiply; opacity: .85; pointer-events: none; }
/* landmark props from the chapter concepts — ink-wash miniatures */
.map__prop { position: absolute; z-index: 1; height: auto; transform: translate(-50%, -100%); mix-blend-mode: multiply; filter: saturate(.55) contrast(.95); opacity: .82; pointer-events: none; }
/* Muyu runs the route (in-game hero_run cycle) */
.map__runner { position: absolute; width: 7%; aspect-ratio: 1; transform: translate(-50%, -82%) scaleX(var(--dir, 1)); background: url(../img/muyu-run.webp) 0 0 / 800% 100% no-repeat;
  pointer-events: none; z-index: 3; opacity: 0; transition: opacity .3s; filter: drop-shadow(0 3px 2px rgba(22, 20, 18, .25)); }
.map__runner.is-on { opacity: 1; }
.map__runner.is-running { animation: run8 .62s steps(8) infinite; }
@keyframes run8 { to { background-position: 114.2857% 0; } }
.place { z-index: 2; }
.map__canvas { position: relative; aspect-ratio: 1200 / 700; }
.map__route { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; overflow: visible; }
.map__route--m { display: none; }
.route-base { fill: none; stroke: rgba(22, 20, 18, .28); stroke-width: 2.4; stroke-dasharray: 1 11; stroke-linecap: round; }
.route-ink { fill: none; stroke: var(--ink); stroke-width: 4.5; stroke-linecap: round; stroke-dasharray: 1 1.02; stroke-dashoffset: 1; }
.map__walker { display: none; }
.place { position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); width: 12%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
.place .enso { width: 100%; }
.place .enso::before { content: ""; position: absolute; inset: 7%; border-radius: 50%; background: var(--paper) url(../img/hanji.webp) center / 768px; }   /* hides the route behind the place */
.place .enso__art { position: absolute; inset: 9%; width: 82%; height: 82%; border-radius: 50%;
  filter: grayscale(1) contrast(.8); opacity: .32; transition: opacity 1.2s var(--ease-out), filter 1.6s var(--ease-out); }
.place.is-on .enso__art { filter: contrast(1.22) saturate(1.15) brightness(.97); opacity: 1; }
.place__no { position: absolute; top: 4%; left: calc(100% + .35rem); writing-mode: vertical-rl; font: 400 clamp(.95rem, 1.35vw, 1.25rem)/1 var(--f-hanja);
  letter-spacing: .12em; opacity: .35; transition: opacity 1s; }
.place.is-on .place__no { opacity: 1; }
.place__label { margin-top: .4rem; font: 500 .68rem/1 var(--f-ui); letter-spacing: .26em; text-transform: uppercase; color: var(--ash); opacity: .5; transition: opacity 1s; }
.place.is-on .place__label { opacity: 1; }
.map__title { position: absolute; right: clamp(1rem, 2.4vw, 2.2rem); top: clamp(1rem, 2.4vw, 2rem); display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.map__title span { writing-mode: vertical-rl; font: 400 clamp(1.4rem, 2.4vw, 2.2rem)/1 var(--f-hanja); letter-spacing: .2em; }
.map__title img { width: clamp(18px, 2vw, 28px); height: auto; transform: rotate(-2deg); }

/* ── BESTIARY: a hanji catalogue unrolled over the ink ──────────────── */
.beasts__sheet {
  position: relative; color: var(--ink); padding: clamp(3rem, 6vw, 5.5rem) clamp(1.5rem, 5vw, 5rem);
  background: var(--paper) url(../img/hanji.webp) 0 0 / 768px repeat;
  -webkit-mask: url(../img/sheet-frame.webp) center / 100% 100% no-repeat; mask: url(../img/sheet-frame.webp) center / 100% 100% no-repeat;
}
.beasts__sheet .lede { color: var(--ink-soft); }
.beasts__sheet .kicker { color: var(--ash); }
.beasts__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; align-items: end; }
.emblems { display: flex; gap: clamp(.6rem, 1.6vw, 1.4rem); }
.emblems img { width: clamp(70px, 9vw, 128px); height: auto; mix-blend-mode: multiply; transition: transform .8s var(--ease-out); }
.emblems img:hover { transform: rotate(-6deg) scale(1.08); }
.bestiary { list-style: none; margin: clamp(2.5rem, 5vw, 4rem) 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(1rem, 2.6vw, 2.6rem) clamp(.6rem, 2vw, 2rem); }
.bestiary li { position: relative; aspect-ratio: 1; display: grid; place-items: end center; }
.bestiary li::after { content: ""; position: absolute; left: 14%; right: 14%; bottom: -4%; height: 16%; background: url(../img/ink-pool.webp) center / 100% 100% no-repeat; opacity: .28; z-index: -1; transition: transform .8s var(--ease-out); }
.bestiary img { max-height: 100%; width: auto; max-width: 100%; object-fit: contain; animation: bob 5.5s ease-in-out infinite; animation-delay: calc(var(--i) * -.7s); transition: scale .6s var(--ease-out); }
.bestiary li:hover img { scale: 1.12; }
.bestiary li:hover::after { transform: scaleX(1.25); }
@keyframes bob { 50% { translate: 0 -7px; } }
/* last cell: a slowly turning ensō — more to come */
.bestiary li.more { place-items: center; }
.bestiary li.more::after { display: none; }
.bestiary li.more img { grid-area: 1 / 1; width: 78%; opacity: .385; mix-blend-mode: multiply; animation: turn-slow 24s linear infinite; }
.bestiary li.more span { grid-area: 1 / 1; font: 500 clamp(.62rem, .8vw, .78rem)/1.35 var(--f-ui); letter-spacing: .08em; color: var(--ash); opacity: .7; text-align: center; max-width: 56%; text-wrap: balance; word-break: keep-all; }
@keyframes turn-slow { to { rotate: 360deg; } }

/* ── MEDIA ──────────────────────────────────────────────────────────── */
.media { padding-top: clamp(4rem, 8vw, 7rem); }
.media__head { display: flex; justify-content: space-between; align-items: end; gap: 2rem; flex-wrap: wrap; }
.trailer { position: relative; display: block; width: 100%; margin-top: clamp(2.5rem, 5vw, 4rem); aspect-ratio: 16 / 9; }
.trailer .framed { position: absolute; inset: 0; }
.trailer img { transition: transform 1.6s var(--ease-out), filter .8s; filter: brightness(.75); }
.trailer:hover img { transform: scale(1.03); filter: brightness(.9); }
.trailer__play { position: absolute; left: 50%; top: 50%; width: clamp(110px, 12vw, 170px); aspect-ratio: 1; transform: translate(-50%, -50%); display: grid; place-items: center; }
.trailer__play img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: invert(1); transition: transform 1.4s var(--ease-out); }
.trailer:hover .trailer__play img { transform: rotate(40deg) scale(1.06); }
.trailer__play svg { width: 28%; color: #f4eee2; margin-left: 6%; }
.trailer__cap { position: absolute; left: clamp(1.4rem, 3vw, 2.6rem); bottom: clamp(1.2rem, 2.6vw, 2.2rem); font: 500 .82rem/1 var(--f-ui); letter-spacing: .26em; text-transform: uppercase; color: #e9e2d3; }
.gal { position: relative; margin-top: clamp(3rem, 6vw, 5rem); }
.gal__pin { position: relative; }
.gal__sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 2rem; }
.gallery { list-style: none; margin: 0; padding: 0 8vw; display: flex; gap: clamp(1rem, 3vw, 3rem); will-change: transform; }
.gallery li { flex: none; width: min(62vw, 1040px); }
.gallery button { display: block; width: 100%; aspect-ratio: 16 / 9; }
.gallery .framed { width: 100%; height: 100%; }
.gallery img { transition: transform 1.2s var(--ease-out), filter .6s; filter: saturate(.85) brightness(.9); }
.gallery button:hover img, .gallery button:focus-visible img { transform: scale(1.03); filter: none; }
.gal__meta { display: flex; align-items: center; gap: 1.2rem; padding: 0 8vw; font: 500 .8rem/1 var(--f-ui); letter-spacing: .24em; color: #a39a8c; }
.gal__bar { flex: 0 1 260px; height: 2px; background: rgba(233, 226, 211, .15); position: relative; }
.gal__bar i { position: absolute; inset: 0; background: var(--seal); transform-origin: left; transform: scaleX(var(--p, 0)); }

/* ── WISHLIST ───────────────────────────────────────────────────────── */
.wish { text-align: center; overflow: hidden; padding-top: clamp(5rem, 9vw, 8rem); padding-bottom: clamp(6rem, 12vw, 10rem); }
.wish__bg { position: absolute; inset: 0; pointer-events: none;
  -webkit-mask: url(../img/ink-bloom.webp) center / min(1500px, 140%) auto no-repeat; mask: url(../img/ink-bloom.webp) center / min(1500px, 140%) auto no-repeat; }
.wish__bg video { width: 100%; height: 100%; object-fit: cover; opacity: .13; filter: grayscale(.7) blur(2px); }
.wish__logo { width: min(420px, 66vw); height: auto; margin: 0 auto; }
.wish .h2 { font-size: clamp(1.7rem, 3.2vw, 2.8rem); margin-top: 2.4rem; }
.wish .lede { margin: 1rem auto 0; }
.wish__cta { margin-top: 2.6rem; display: flex; justify-content: center; gap: 1.6rem; flex-wrap: wrap; }
.wish .btn--seal { --h: 62px; font-size: 1.1rem; padding: 0 2.6rem; }
.btn--light { color: var(--ink); }
.btn--light::before { background-image: url(../img/ink-swipe-light.webp); }
/* Steam widget: always laid out at its native 646×190, scaled down as a whole on narrow screens (no inner scrollbars) */
.steam-wrap { margin: 3.4rem auto 0; width: min(646px, 100%); aspect-ratio: 646 / 190; position: relative; overflow: hidden; }
.steam-widget { position: absolute; left: 0; top: 0; width: 646px; height: 190px; border: 0; display: block; opacity: .92;
  transform: scale(var(--s, 1)); transform-origin: 0 0; }
.share { margin-top: 3rem; display: flex; justify-content: center; align-items: center; gap: .6rem; color: #a39a8c; font: 500 .8rem/1 var(--f-ui); letter-spacing: .22em; text-transform: uppercase; }
.share .share__main { width: auto; height: 42px; padding: 0 1.1rem 0 .9rem; margin-right: .6rem; gap: .6rem; display: inline-flex; align-items: center; border-radius: 21px;
  border: 1px solid rgba(233, 226, 211, .2); font: inherit; letter-spacing: inherit; text-transform: inherit; color: #e9e2d3; }
.share a, .share button { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #e9e2d3; transition: background .3s, color .3s; }
.share a:hover, .share button:hover { background: rgba(233, 226, 211, .1); color: #fff; }
.share svg { width: 18px; height: 18px; }
.toast { position: fixed; left: 50%; bottom: 2rem; transform: translate(-50%, 20px); background: var(--ink); color: var(--paper); padding: .8rem 1.4rem; font: 500 .9rem/1 var(--f-ui); opacity: 0; transition: .4s var(--ease-out); z-index: 90; pointer-events: none; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ── FOOTER ─────────────────────────────────────────────────────────── */
.foot { padding: 3.2rem clamp(1.25rem, 5vw, 4rem) 3.6rem; border-top: 1px solid rgba(233, 226, 211, .08); }
.foot .wrap { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.foot__brand { display: flex; align-items: center; gap: 1.6rem; }
.foot__brand img { height: 38px; width: auto; opacity: .9; }
.foot__brand .foot__logo { height: 30px; }
.foot__brand span { width: 1px; height: 26px; background: rgba(233, 226, 211, .2); }
.foot small { color: #8a8174; font: 400 .88rem/1.5 var(--f-ui); letter-spacing: .04em; }

/* ── nav on ink ─────────────────────────────────────────────────────── */
.nav.is-dark { color: #e9e2d3; }
.nav.is-dark.is-solid { background: rgba(18, 17, 16, .82); box-shadow: 0 1px 0 rgba(233, 226, 211, .06); }
.nav.is-dark .nav__brand img:last-child { filter: invert(1); }
.nav.is-dark .nav__links a::after { filter: invert(1); }
.nav.is-dark .lang__list { color: var(--ink); }

/* ── dialogs: trailer + lightbox ────────────────────────────────────── */
dialog.modal { padding: 0; border: 0; background: transparent; max-width: none; max-height: none; width: 100vw; height: 100vh; height: 100dvh; margin: 0; color: #e9e2d3; }
dialog.modal::backdrop { background: rgba(10, 9, 8, .92); backdrop-filter: blur(6px); }
dialog.modal[open] { display: grid; place-items: center; animation: modal-in .5s var(--ease-out); }
@keyframes modal-in { from { opacity: 0; } }
.modal__body { width: min(92vw, calc(84vh * 16 / 9)); aspect-ratio: 16 / 9; position: relative; }
.modal__body video, .modal__body iframe, .modal__body img { width: 100%; height: 100%; border: 0; background: #000; object-fit: contain; }
.modal__close { position: fixed; top: 1.2rem; right: 1.4rem; width: 48px; height: 48px; display: grid; place-items: center; z-index: 2; }
.modal__close svg { width: 26px; height: 26px; }
.modal__nav { position: fixed; top: 50%; width: 56px; height: 56px; display: grid; place-items: center; transform: translateY(-50%); opacity: .7; }
.modal__nav:hover { opacity: 1; }
.modal__nav svg { width: 30px; height: 30px; }
.modal__nav--prev { left: 1rem; } .modal__nav--next { right: 1rem; }
.modal__count { position: fixed; bottom: 1.4rem; left: 50%; transform: translateX(-50%); font: 500 .8rem/1 var(--f-ui); letter-spacing: .25em; color: #a39a8c; }

/* ── responsive ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .menu-btn { display: grid; }
  .nav .lang { display: none; }
  .nav { padding-top: env(safe-area-inset-top); height: calc(var(--nav-h) + env(safe-area-inset-top)); }
  .band { width: 100%; aspect-ratio: 3 / 1; }
  .band__line { font-size: clamp(1.25rem, 6vw, 1.8rem); }
  .nav { justify-content: space-between; }
  .hero__title { width: min(84vw, 520px); top: calc(var(--nav-h) + env(safe-area-inset-top) + 2.5vh); bottom: calc(env(safe-area-inset-bottom) + 3vh); pointer-events: none; }
  .hero__title > * { pointer-events: auto; }
  .hero__cta { margin-top: auto; gap: .2rem; }
  .hero__muyu { height: min(46svh, 460px); bottom: calc(env(safe-area-inset-bottom) + 11svh); left: 54%; }
  .hero__tag { margin-top: .9rem; }
  .logo .logo__seal { width: 5.4%; right: -6.5%; }
  .hero { min-height: 520px; }
  .hero__name { font-size: 1.2rem; top: 58%; left: 84%; }
  .hero__vert--r { display: none; }
  .btn { --h: 48px; padding: 0 1.4rem; }

  .tale__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .tale__vtitle { flex-direction: row; font-size: clamp(2.6rem, 11vw, 3.6rem); gap: .3em; }
  .tale__vtitle span { writing-mode: horizontal-tb; }
  .tale__vtitle img { width: .7em; }
  .tale__name { position: relative; top: 0; max-width: 300px; margin: 0 auto; }
  .souls__top { grid-template-columns: 1fr; }
  .after__stage { --reach: .42; }   /* afterimages spread less so they stay on screen */
  .mirror { max-width: 340px; margin: 0 auto; }
  .mirror { max-width: 300px; }
  .mirror figcaption { right: -1.6rem; top: 4%; }
  .split { flex-direction: column; height: auto; }
  .split__pane { height: 300px; flex: none; }
  .split__pane:hover { flex: none; }
  .split__or { writing-mode: horizontal-tb; }
  .style__body, .arsenal__head, .realm__head { grid-template-columns: 1fr; }
  .badges { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* phones: the same wide map, just scaled down */
  .map { padding: .7rem .5rem; }
  .place__no { font-size: .5rem; left: calc(100% + .1rem); }
  .place__label { font-size: .38rem; letter-spacing: .12em; margin-top: .15rem; }
  .map__title { top: .5rem; right: .6rem; gap: .25rem; }
  .map__title span { font-size: .8rem; }
  .map__title img { width: 10px; }
  .route-ink { stroke-width: 3; } .map__walker { r: 5; }
  .gal__pin { height: auto !important; }
  .gal__sticky { position: relative; height: auto; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: .5rem 0 1rem; }
  .gal__sticky::-webkit-scrollbar { display: none; }
  .gallery { transform: none !important; padding: 0 6vw; }
  .gallery li { width: 76vw; scroll-snap-align: center; }
  .gal__meta { display: none; }
  .beasts__head { grid-template-columns: 1fr; }
  .bestiary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .emblems img { width: 22vw; }
  .modal__nav { display: none; }
}
@media (max-width: 900px) and (max-height: 700px) {   /* short phones (iPhone SE…): keep Muyu clear of the tagline */
  .hero__muyu { height: min(36svh, 300px); bottom: calc(env(safe-area-inset-bottom) + 15svh); }
  .hero__title { width: min(76vw, 420px); }
}
@media (max-width: 560px) {
  .nav__right .btn { display: none; }
  .hero__cta { gap: .6rem; }
  .foot .wrap { flex-direction: column; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}
/* ── anonymous statistics notice ─────────────────────────────────────── */
.foot__stats { background: none; border: 0; padding: 0; color: #8a8174; font: 400 .88rem/1.5 var(--f-ui); letter-spacing: .04em; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.foot__stats:hover { color: var(--paper); }
.an { position: fixed; z-index: 95; left: clamp(.75rem, 2vw, 1.5rem); bottom: clamp(.75rem, 2vw, 1.5rem); width: min(24rem, calc(100vw - 1.5rem)); background: var(--paper); color: var(--ink); padding: 1.1rem 1.2rem 1.15rem; border: 1px solid rgba(22, 20, 18, .25); box-shadow: 0 10px 40px rgba(0, 0, 0, .45); }
.an[hidden] { display: none; }
.an__t { margin: 0 0 .4rem; font: 700 .95rem/1.3 var(--f-ui); letter-spacing: .06em; }
.an__p { margin: 0 0 .9rem; font: 400 .92rem/1.5 var(--f-ui); color: var(--ink-soft); }
.an__b { display: flex; gap: .6rem; flex-wrap: wrap; }
.an__btn { font: 600 .85rem/1 var(--f-ui); letter-spacing: .08em; padding: .65rem 1.1rem; border: 1px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer; }
.an__btn:hover { background: rgba(22, 20, 18, .08); }
.an__btn--yes { background: var(--seal); border-color: var(--seal); color: #fff; }
.an__btn--yes:hover { background: #8f1a17; }
.an__btn[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 2px; }
