/* base.css — tokens, typography, the castle bar, buttons, dividers, dialogs, toasts,
   the Town Crier ribbon, the parchment route transition and the torch cursor. */

:root {
  --obsidian: #0b0a0d;
  --obsidian-2: #121016;
  --obsidian-3: #1a1620;
  --stone: #2a2530;
  --stone-2: #3a3340;
  --gold: #c9a24a;
  --gold-hi: #f1d58a;
  --gold-lo: #7a5a1e;
  --purple: #4b1f6f;
  --purple-hi: #8b52c9;
  --purple-lo: #220d36;
  --parchment: #e8dab9;
  --parchment-2: #d6c294;
  --ink: #2b1d10;
  --ink-2: #5a4128;
  --mint: #14F195;
  --blood: #a3283a;
  --up: #3ff0a6;
  --down: #ff8a8a;

  --text: #ecdfc6;
  --text-dim: #b8aa90;
  --text-faint: #978a72;

  --f-display: 'Cinzel Decorative', 'Cinzel', Georgia, serif;
  --f-caps: 'Cinzel', Georgia, serif;
  --f-black: 'UnifrakturCook', 'Cinzel Decorative', Georgia, serif;
  --f-body: 'Cormorant Garamond', Garamond, Georgia, serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;

  --gutter: max(16px, 4vw);
  --bar-h: 64px;
  --crier-h: 40px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .3  0 0 0 0 .2  0 0 0 0 .08  0 0 0 .55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  --crown-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><path d='M8 46L4 16l14 12 14-20 14 20 14-12-4 30zM7 49h50v8H7z'/></svg>");
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(75, 31, 111, .35), transparent 70%),
    radial-gradient(900px 500px at 100% 100%, rgba(201, 162, 74, .07), transparent 70%),
    var(--obsidian);
  color: var(--text);
  font: 500 1.125rem/1.6 var(--f-body);
  overflow-x: hidden; overflow-x: clip;
  padding-bottom: var(--crier-h);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body::before { /* faint grain over everything */
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: var(--noise); opacity: .18; mix-blend-mode: overlay;
}
body.is-locked { overflow: hidden; }
#view { position: relative; z-index: 1; outline: none; min-height: 60vh; }

img, svg { max-width: 100%; }
a { color: var(--gold-hi); text-decoration-color: rgba(241, 213, 138, .4); text-underline-offset: 3px; }
a:hover { color: #fff3c9; }
button { font: inherit; color: inherit; }
input, textarea, select { font: inherit; }
h1, h2, h3 { line-height: 1.12; margin: 0; font-weight: 700; }
p { margin: 0 0 1em; }
b, strong { font-weight: 700; color: #f6ead0; }
small { font-size: .78em; }
sub { font-size: .7em; vertical-align: -.25em; line-height: 0; }
.mono { font-family: var(--f-mono); font-weight: 500; letter-spacing: -.01em; }

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

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 16px; top: -60px; z-index: 300; padding: 10px 16px; background: var(--gold-hi); color: var(--ink); font: 700 .9rem var(--f-caps); border-radius: 6px; transition: top .2s; }
.skip:focus { top: 12px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- shared type ---------- */
.kicker {
  font: 600 .72rem/1.4 var(--f-caps); text-transform: uppercase; letter-spacing: .32em;
  color: var(--gold); margin: 0 0 .9em; display: inline-flex; align-items: center; gap: .8em;
}
.kicker::before, .kicker::after { content: ''; width: 6px; height: 6px; transform: rotate(45deg); border: 1px solid currentColor; flex: none; opacity: .8; }
.sec-title, .page-title {
  font-family: var(--f-display); font-weight: 700; letter-spacing: .02em;
  font-size: clamp(2rem, 5vw, 3.4rem);
  background: linear-gradient(180deg, #fff3c4 0%, #e9c36a 40%, #a8741f 75%, #e6be62 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .7)) drop-shadow(0 0 18px rgba(201, 162, 74, .18));
}
.sec-title--sm { font-size: clamp(1.35rem, 3vw, 1.8rem); }
.sec-title--ink { background: none; color: var(--gold-hi); filter: none; text-shadow: 0 1px 0 #000; }
.sec-head { text-align: center; max-width: 760px; margin: 0 auto clamp(28px, 5vw, 56px); padding-inline: var(--gutter); }
.sec-lede, .page-lede { color: var(--text-dim); font-size: 1.15rem; margin: 1em auto 0; max-width: 62ch; }
.page-head { text-align: center; padding: clamp(40px, 8vw, 88px) var(--gutter) clamp(24px, 4vw, 40px); max-width: 860px; margin: 0 auto; }
.page-error, .loading-line { text-align: center; padding: 120px var(--gutter); color: var(--text-dim); font-style: italic; }

/* ---------- the castle bar ---------- */
.bar { position: sticky; top: 0; z-index: 50; }
.bar__inner {
  height: var(--bar-h); display: flex; align-items: center; gap: 24px;
  padding-inline: var(--gutter);
  background: linear-gradient(180deg, rgba(18, 14, 22, .96), rgba(11, 10, 13, .9));
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(201, 162, 74, .28);
}
.bar__battlements { /* crenellated lower edge */
  height: 9px; margin-top: -1px;
  background: linear-gradient(180deg, rgba(14, 11, 17, .95), rgba(11, 10, 13, .9));
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 22px, transparent 22px 34px);
  mask: repeating-linear-gradient(90deg, #000 0 22px, transparent 22px 34px);
  border-bottom: 1px solid rgba(201, 162, 74, .2);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand__crest { width: 42px; height: 42px; display: block; }
.crest, .crest svg, .crest .art-img { width: 100%; height: 100%; display: block; object-fit: contain; }
.brand__word {
  font: 900 1.3rem/1 var(--f-display); letter-spacing: .04em;
  background: linear-gradient(180deg, #fff1bf, #d9a845 60%, #9c6a1c); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav { flex: 1; display: flex; justify-content: center; }
.nav__list { list-style: none; margin: 0; padding: 0; display: flex; gap: clamp(14px, 3vw, 40px); }
.nav__list a {
  position: relative; display: inline-flex; align-items: baseline; gap: 6px; padding: 8px 2px;
  font: 600 .82rem/1 var(--f-caps); letter-spacing: .2em; text-transform: uppercase; color: var(--text-dim); text-decoration: none;
  transition: color .25s;
}
.nav__num { font-size: .62rem; color: var(--gold-lo); letter-spacing: .05em; }
.nav__list a::after {
  content: ''; position: absolute; left: 50%; right: 50%; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-hi), transparent); transition: left .3s var(--ease), right .3s var(--ease);
}
.nav__list a:hover, .nav__list a[aria-current] { color: var(--gold-hi); }
.nav__list a:hover::after, .nav__list a[aria-current]::after { left: 0; right: 0; }
.nav__list a[aria-current] .nav__num { color: var(--mint); }
.bar__right { display: flex; align-items: center; gap: 12px; margin-left: auto; flex: none; }
.mock-badge {
  font: 500 .66rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .14em; color: var(--mint);
  border: 1px dashed rgba(20, 241, 149, .6); padding: 5px 7px; border-radius: 4px; cursor: help;
}
.sworn { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid rgba(201, 162, 74, .35); background: rgba(75, 31, 111, .25); transition: background .25s, border-color .25s; }
.sworn:hover, .sworn[aria-current] { background: rgba(75, 31, 111, .5); border-color: var(--gold); }
.sworn__ins, .sworn .insignia { width: 34px; height: 34px; }
.sworn__ins--none { display: grid; place-items: center; border-radius: 50%; border: 1px dashed var(--gold-lo); color: var(--gold); font-family: var(--f-display); }
.sworn__txt { display: flex; flex-direction: column; line-height: 1.1; }
.sworn__txt b { font: 700 .8rem var(--f-caps); letter-spacing: .1em; text-transform: uppercase; color: var(--gold-hi); }
.sworn__txt small { font: 400 .68rem var(--f-mono); color: var(--text-faint); }

.menu-toggle { display: none; width: 42px; height: 42px; border: 1px solid rgba(201, 162, 74, .35); border-radius: 8px; background: transparent; cursor: pointer; padding: 10px 9px; flex-direction: column; justify-content: space-between; }
.menu-toggle span { display: block; height: 2px; background: var(--gold-hi); border-radius: 2px; transition: transform .3s, opacity .3s; }
.menu-open .menu-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
.menu-open .menu-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.drop { display: none; }

@media (max-width: 860px) {
  .nav { display: none; }
  .menu-toggle { display: flex; }
  .brand__word { font-size: 1.1rem; }
  .drop {
    display: block; position: absolute; top: calc(100% - 9px); right: var(--gutter); width: min(300px, calc(100vw - 32px));
    padding: 18px 20px 46px; background: linear-gradient(180deg, #3d1760, #22093a); border: 1px solid var(--gold-lo); border-top: 0;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 28px), 0 100%);
    transform: translateY(-120%); visibility: hidden; transition: transform .45s var(--ease), visibility 0s .45s;
  }
  .menu-open .drop { transform: none; visibility: visible; transition: transform .45s var(--ease); }
  .drop ul { list-style: none; margin: 0; padding: 0; }
  .drop a { display: block; padding: 12px 4px; text-align: center; font: 600 .95rem var(--f-caps); letter-spacing: .12em; text-transform: uppercase; color: var(--gold-hi); text-decoration: none; border-bottom: 1px solid rgba(201, 162, 74, .2); }
  .drop a[aria-current] { color: var(--mint); }
}
@media (max-width: 520px) {
  .sworn__txt small { display: none; }
  .brand__word { display: none; }
  .bar__inner { gap: 10px; }
  .seal-btn--sm { padding-right: 12px; }
}

/* ---------- wax-seal buttons ---------- */
.seal-btn {
  --wax: radial-gradient(circle at 36% 30%, #d4465b, #8a1426 55%, #4a0712);
  display: inline-flex; align-items: center; gap: .85em; cursor: pointer; text-decoration: none;
  padding: .55em 1.5em .55em .55em; min-height: 48px;
  font: 700 .86rem/1.1 var(--f-caps); letter-spacing: .16em; text-transform: uppercase; color: var(--gold-hi);
  background: linear-gradient(180deg, #2f1347, #180826);
  border: 1px solid rgba(201, 162, 74, .55); border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), inset 0 -2px 0 rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .45);
  transition: transform .2s var(--ease), box-shadow .3s, border-color .3s, color .3s;
}
.seal-btn__wax {
  position: relative; flex: none; width: 2.6em; height: 2.6em;
  background: var(--wax); border-radius: 52% 48% 55% 45% / 48% 54% 46% 52%;
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .18), inset 2px 3px 4px rgba(255, 190, 190, .3), 0 2px 4px rgba(0, 0, 0, .5);
  transition: transform .5s var(--ease);
}
.seal-btn__wax::after {
  content: ''; position: absolute; inset: 26%; background: #f2b8a8; opacity: .85;
  -webkit-mask: var(--crown-mask) center / contain no-repeat; mask: var(--crown-mask) center / contain no-repeat;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .5));
}
.seal-btn:hover { color: #fff6d8; border-color: var(--gold-hi); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 0 0 4px rgba(201, 162, 74, .12), 0 10px 30px rgba(0, 0, 0, .5), 0 0 30px rgba(201, 162, 74, .25); }
.seal-btn:hover .seal-btn__wax { transform: rotate(-16deg) scale(1.06); }
.seal-btn:active { transform: translateY(1px) scale(.98); }
.seal-btn[disabled] { opacity: .6; cursor: progress; }
.seal-btn--lg { font-size: .98rem; min-height: 60px; padding-right: 2em; }
.seal-btn--sm { font-size: .72rem; min-height: 40px; padding: .35em 1.1em .35em .35em; gap: .6em; }
.seal-btn--sm .seal-btn__wax { width: 2.4em; height: 2.4em; }
.seal-btn--wide { width: 100%; justify-content: center; }

.ghost-link {
  display: inline-flex; align-items: center; gap: .4em; padding: .5em 0; min-height: 44px; cursor: pointer;
  font: 600 .78rem var(--f-caps); letter-spacing: .18em; text-transform: uppercase; color: var(--gold-hi);
  background: none; border: 0; text-decoration: none; border-bottom: 1px dashed rgba(201, 162, 74, .5);
  transition: color .2s, border-color .2s, gap .3s var(--ease);
}
.ghost-link:hover { color: #fff; border-bottom-color: var(--gold-hi); gap: .8em; }

/* ---------- engraved divider ---------- */
.divider { display: flex; align-items: center; gap: 18px; max-width: 900px; margin: 0 auto; padding: 12px var(--gutter); }
.divider__line { flex: 1; height: 3px; border-top: 1px solid rgba(201, 162, 74, .45); border-bottom: 1px solid rgba(201, 162, 74, .18); }
.divider__line:first-child { -webkit-mask: linear-gradient(90deg, transparent, #000 70%); mask: linear-gradient(90deg, transparent, #000 70%); }
.divider__line:last-child { -webkit-mask: linear-gradient(270deg, transparent, #000 70%); mask: linear-gradient(270deg, transparent, #000 70%); }
.divider__fleur { width: 30px; height: 30px; flex: none; filter: drop-shadow(0 0 8px rgba(201, 162, 74, .35)); }

/* ---------- vellum panels (leather-bound, double gilt frame) ---------- */
.vellum {
  position: relative; border-radius: 6px;
  background: linear-gradient(180deg, rgba(30, 24, 36, .96), rgba(17, 14, 21, .98)), var(--noise);
  border: 1px solid rgba(201, 162, 74, .38);
  box-shadow: inset 0 0 0 5px rgba(11, 10, 13, .9), inset 0 0 0 6px rgba(201, 162, 74, .18), 0 24px 60px rgba(0, 0, 0, .55);
}
.vellum::before, .vellum::after {
  content: ''; position: absolute; width: 22px; height: 22px; border: 2px solid var(--gold); pointer-events: none;
}
.vellum::before { top: 9px; left: 9px; border-right: 0; border-bottom: 0; }
.vellum::after { bottom: 9px; right: 9px; border-left: 0; border-top: 0; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 16px; }
.modal__backdrop { position: absolute; inset: 0; background: radial-gradient(circle at 50% 40%, rgba(34, 13, 54, .75), rgba(5, 4, 7, .92)); opacity: 0; transition: opacity .25s; }
.modal__card { position: relative; width: min(440px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 32px 28px 28px; transform: translateY(16px) scale(.97); opacity: 0; transition: transform .35s var(--ease), opacity .25s; }
.modal.is-open .modal__backdrop { opacity: 1; }
.modal.is-open .modal__card { transform: none; opacity: 1; }
.modal__title { font: 700 1.5rem var(--f-display); color: var(--gold-hi); text-align: center; margin-bottom: .4em; }
.modal__lede { text-align: center; color: var(--text-dim); font-style: italic; }
.modal__x { position: absolute; top: 12px; right: 14px; width: 40px; height: 40px; border: 0; background: none; color: var(--gold); font-size: 1.6rem; cursor: pointer; border-radius: 50%; }
.modal__x:hover { color: #fff; background: rgba(201, 162, 74, .12); }
.wallet-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.wallet-opt {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px 14px; min-height: 56px; cursor: pointer; text-decoration: none; color: var(--text);
  background: linear-gradient(90deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .01)); border: 1px solid rgba(201, 162, 74, .3); border-radius: 8px;
  transition: border-color .2s, background .2s, transform .2s var(--ease);
}
.wallet-opt:hover { border-color: var(--hue); background: rgba(255, 255, 255, .07); transform: translateX(4px); }
.wallet-opt__sigil { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--hue); color: #120d16; font: 700 1rem var(--f-caps); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25); }
.wallet-opt__name { font: 700 1rem var(--f-caps); letter-spacing: .06em; flex: 1; text-align: left; }
.wallet-opt__tag { font: 500 .68rem var(--f-mono); text-transform: uppercase; color: var(--mint); letter-spacing: .08em; }
.wallet-opt.is-missing { opacity: .7; }
.wallet-opt.is-missing .wallet-opt__tag { color: var(--text-faint); }

/* ---------- toasts: pinned parchment slips ---------- */
.toasts { position: fixed; right: 16px; bottom: calc(var(--crier-h) + 16px); z-index: 160; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px 40px 14px 16px;
  background: linear-gradient(180deg, #efe3c4, #dccaa0); color: var(--ink); border-radius: 3px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5), inset 0 0 30px rgba(120, 80, 30, .25);
  font-size: 1.02rem; line-height: 1.35; transform: translateX(120%) rotate(2deg); transition: transform .45s var(--ease);
}
.toast.is-in { transform: rotate(-.6deg); }
.toast a { color: #5b1fa0; font-weight: 700; }
.toast__wax { flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 52% 48% 55% 45%; background: radial-gradient(circle at 35% 30%, #d4465b, #7a1020); }
.toast--ok .toast__wax { background: radial-gradient(circle at 35% 30%, #5fffc0, #0a8a55); }
.toast--err .toast__wax { background: radial-gradient(circle at 35% 30%, #ff9b6b, #8a2a10); }
.toast__x { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: 0; background: none; color: var(--ink-2); font-size: 1.3rem; cursor: pointer; }

/* ---------- the Town Crier: a herald's ribbon ---------- */
.crier {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: var(--crier-h);
  display: flex; align-items: stretch;
  background: linear-gradient(180deg, #e9dcba 0%, #d8c393 55%, #bea36c 100%);
  color: var(--ink); border-top: 2px solid #7a5a1e;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.crier::before { content: ''; position: absolute; inset: 0; background-image: var(--noise); opacity: .5; pointer-events: none; mix-blend-mode: multiply; }
.crier__cap {
  position: relative; z-index: 2; flex: none; display: flex; align-items: center; padding: 0 22px 0 16px;
  background: linear-gradient(180deg, #a3283a, #6e0f1e); color: #ffe3c9;
  font: 700 .72rem var(--f-caps); letter-spacing: .26em; text-transform: uppercase;
  clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 50%, 100% 100%, 0 100%);
}
.crier__window { position: relative; flex: 1; overflow: hidden; -webkit-mask: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); mask: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.crier__track { display: flex; width: max-content; height: 100%; align-items: center; animation: crier var(--dur, 60s) linear infinite; }
.crier.is-paused .crier__track, .crier:hover .crier__track, .crier:focus-within .crier__track { animation-play-state: paused; }
.crier__run { display: flex; align-items: center; flex: none; }
@keyframes crier { to { transform: translateX(-50%); } }
.cr-item { display: inline-flex; align-items: center; gap: 8px; padding: 0 6px; white-space: nowrap; color: var(--ink); text-decoration: none; font-size: 1rem; font-weight: 600; }
a.cr-item:hover .cr-text { text-decoration: underline; }
.cr-time { font: 400 .7rem var(--f-mono); color: var(--ink-2); }
.cr-sep { color: #8a1426; padding: 0 12px; font-size: .8rem; }
.cr-ico { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex: none; color: #fff; background: #5a4128; }
.cr-ico .ico { width: 13px; height: 13px; }
.cr-ico--buy { background: #0d7a4f; }
.cr-ico--sell { background: #8a1426; }
.cr-ico--launch { background: #5a4128; }
.cr-ico--rankup { background: #4b1f6f; }
.cr-ico--reward { background: #a8741f; }
.cr-ico--migrate { background: #2a0f40; color: var(--gold-hi); }
.crier__toggle { position: relative; z-index: 2; flex: none; width: 44px; border: 0; border-left: 1px solid rgba(90, 65, 40, .4); background: rgba(90, 65, 40, .12); color: var(--ink); cursor: pointer; font-size: .7rem; }
.crier__toggle:hover { background: rgba(90, 65, 40, .25); }
@media (max-width: 520px) { .crier__cap { padding: 0 16px 0 10px; font-size: .62rem; letter-spacing: .14em; } }

/* ---------- footer ---------- */
.foot { position: relative; z-index: 1; padding: 64px var(--gutter) 48px; text-align: center; border-top: 1px solid rgba(201, 162, 74, .15); margin-top: 80px; background: linear-gradient(180deg, transparent, rgba(34, 13, 54, .25)); }
.foot__motto { font: 400 1.5rem var(--f-black); color: var(--gold); margin-bottom: .6em; }
.foot__fine { max-width: 64ch; margin: 0 auto .6em; color: var(--text-faint); font-size: .95rem; }

/* ---------- waking loader ---------- */
.waking { display: grid; place-items: center; gap: 18px; min-height: 70vh; color: var(--text-dim); font-style: italic; }
.waking__seal { width: 56px; height: 56px; border-radius: 52% 48% 55% 45%; background: radial-gradient(circle at 36% 30%, #d4465b, #8a1426 55%, #4a0712); animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.88) rotate(-8deg); opacity: .7; } }

/* ---------- parchment route transition ---------- */
.scroll-sheet { position: fixed; inset: 0; z-index: 200; pointer-events: none; }
.scroll-sheet__paper {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: radial-gradient(ellipse at center, #e9dbb6 0%, #d3bd8a 70%, #a98a52 100%);
}
.scroll-sheet__paper::before { content: ''; position: absolute; inset: 0; background-image: var(--noise); opacity: .7; mix-blend-mode: multiply; }
.scroll-sheet__title { position: relative; font: 700 clamp(2rem, 7vw, 4.4rem) var(--f-black); color: #3b2410; text-align: center; padding: 0 16px; text-shadow: 0 1px 0 rgba(255, 255, 255, .4); }
.scroll-sheet__rod {
  position: absolute; left: -10px; right: -10px; top: -13px; height: 26px; border-radius: 13px;
  background: linear-gradient(180deg, #a06a32 0%, #5a3418 45%, #2c180c 100%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .6), inset 0 2px 0 rgba(255, 220, 160, .35);
}
.scroll-sheet__rod::before, .scroll-sheet__rod::after { content: ''; position: absolute; top: -4px; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff1bf, #c9952f 50%, #6b4a10); }
.scroll-sheet__rod::before { left: 4px; }
.scroll-sheet__rod::after { right: 4px; }

/* ---------- torch cursor ---------- */
.torch-cursor {
  position: fixed; left: 0; top: 0; z-index: 90; width: 420px; height: 420px; margin: -210px 0 0 -210px; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 170, 80, .13) 0%, rgba(255, 140, 60, .06) 30%, transparent 62%);
  mix-blend-mode: screen; opacity: 0; transition: opacity .6s; will-change: transform;
}
.torch-cursor.is-on { opacity: 1; }

/* ---------- reveal on scroll ---------- */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
[data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
