/* Cleaven: black and forged gold, the app's own palette and type. */

@font-face { font-family: 'Cinzel'; src: url('../fonts/Cinzel.ttf') format('truetype'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('../fonts/Fraunces-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('../fonts/Fraunces-MediumItalic.ttf') format('truetype'); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('../fonts/Manrope-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('../fonts/Manrope-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #0B0906;
  --bg-2: #100C07;
  --surface: #14100A;
  --ink: #F3EADB;
  --ink-2: #B9AD96;
  --ink-3: #8A7F68;
  --gold: #E9B04D;
  --gold-soft: #F6D28A;
  --gold-dim: #8A6A2C;
  --gold-hi: #FFEBB8;
  --on-gold: #1B1304;
  --line: rgba(233, 176, 77, 0.16);
  --line-2: rgba(233, 176, 77, 0.32);

  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --caps: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --gutter: clamp(18px, 5vw, 56px);
  --max: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: rgba(233, 176, 77, 0.35); color: var(--gold-hi); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

/* Film grain over everything, very faint. */
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: 100;
  opacity: 0.05;
  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='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }

/* ------------------------------------------------------------ type */

.caps {
  font-family: var(--caps);
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}
.eyebrow {
  font: 700 11.5px/1 var(--sans);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}
.display {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0;
}
.lede { color: var(--ink-2); font-size: clamp(16px, 1.6vw, 19px); max-width: 34em; text-wrap: pretty; }
.gold-text {
  background: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 55%, var(--gold-dim) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* ------------------------------------------------------------ buttons */

.btn {
  --h: 54px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 28px;
  border-radius: 999px;
  font: 700 15px/1 var(--sans);
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  border: 0;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), background 0.4s var(--ease), color 0.3s;
  white-space: nowrap;
}
.btn-gold {
  color: var(--on-gold);
  background: linear-gradient(180deg, var(--gold-soft), var(--gold) 60%, #C88E2E);
  box-shadow: 0 0 0 1px rgba(255, 235, 184, 0.35) inset, 0 10px 40px -10px rgba(233, 176, 77, 0.6);
  position: relative; overflow: hidden;
}
.btn-gold::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.9s var(--ease);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255, 235, 184, 0.5) inset, 0 18px 50px -12px rgba(233, 176, 77, 0.8); }
.btn-gold:hover::after { transform: translateX(120%); }
.btn-ghost { color: var(--gold-soft); background: transparent; box-shadow: 0 0 0 1px var(--line-2) inset; }
.btn-ghost:hover { background: rgba(233, 176, 77, 0.08); transform: translateY(-2px); }

/* ------------------------------------------------------------ nav */

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  transition: background 0.5s var(--ease), backdrop-filter 0.5s, box-shadow 0.5s;
}
.nav.scrolled {
  background: rgba(11, 9, 6, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { height: 34px; width: auto; filter: drop-shadow(0 0 10px rgba(233, 176, 77, 0.45)); }
.brand span { font: 600 17px/1 var(--caps); letter-spacing: 0.3em; color: var(--gold-soft); }
.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a { font-size: 14px; color: var(--ink-2); text-decoration: none; transition: color 0.3s; }
.nav-links a:hover { color: var(--gold-soft); }
.nav .btn { --h: 42px; padding: 0 20px; font-size: 14px; }
@media (max-width: 820px) { .nav-links { display: none; } .nav .btn { margin-left: auto; } }
@media (max-width: 380px) { .brand span { display: none; } }

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

.hero {
  position: relative;
  min-height: min(100svh, 980px);
  display: grid; place-items: center;
  text-align: center;
  padding: calc(110px + env(safe-area-inset-top, 0px)) 0 90px;
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: ''; position: absolute; inset: -20% -10% auto; height: 120%;
  background:
    radial-gradient(42% 38% at 50% 40%, rgba(233, 176, 77, 0.22), transparent 70%),
    radial-gradient(60% 50% at 50% 110%, rgba(180, 90, 20, 0.16), transparent 70%);
  z-index: -2;
}
.embers { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

.loop-ring {
  position: absolute; left: 50%; top: 44%;
  width: min(1100px, 150vw); aspect-ratio: 1; max-width: none;
  transform: translate(-50%, -50%);
  z-index: -1; opacity: 0.55; pointer-events: none;
}
.loop-ring text { font: 600 15px var(--caps); letter-spacing: 0.4em; fill: rgba(233, 176, 77, 0.22); }
.loop-ring .spin { transform-origin: 500px 500px; animation: spin 90s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.sigil {
  position: relative;
  width: clamp(150px, 22vw, 230px);
  margin: 0 auto 26px;
  animation: float 7s ease-in-out infinite;
}
.sigil img { width: 100%; height: auto; position: relative; filter: drop-shadow(0 0 30px rgba(233, 176, 77, 0.35)); }
.sigil::before {
  content: ''; position: absolute; inset: -40% -60%;
  background: radial-gradient(closest-side, rgba(233, 176, 77, 0.35), transparent);
  animation: breathe 5s ease-in-out infinite;
}
/* Light running down the blade, through the mark's own shape. */
.sigil .sheen {
  position: absolute; inset: 0;
  -webkit-mask: url('../img/mark.png') center / contain no-repeat; mask: url('../img/mark.png') center / contain no-repeat;
  background: linear-gradient(180deg, transparent 0%, transparent 40%, rgba(255, 246, 220, 0.95) 50%, transparent 60%, transparent 100%);
  background-size: 100% 300%;
  mix-blend-mode: screen;
  animation: cut 5.5s var(--ease) 0.8s infinite;
}
@keyframes cut { 0% { background-position: 0 100%; } 45%, 100% { background-position: 0 0%; } }
@keyframes float { 50% { translate: 0 -10px; } }
@keyframes breathe { 50% { opacity: 0.55; transform: scale(1.08); } }

.wordmark {
  font: 600 clamp(44px, 9vw, 112px)/1 var(--caps);
  letter-spacing: 0.22em;
  margin: 0 0 18px;
  padding-left: 0.22em; /* balance the trailing tracking */
}
.wordmark span { display: inline-block; }
.tagline {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  font: italic 500 clamp(20px, 2.6vw, 30px)/1.2 var(--display);
  color: var(--ink);
  margin: 0 0 22px;
}
.tagline::before, .tagline::after { content: ''; width: clamp(28px, 6vw, 70px); height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.tagline::after { transform: scaleX(-1); }
.hero .lede { margin: 0 auto 36px; }
.cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.platform { margin-top: 22px; font-size: 13px; color: var(--ink-3); display: inline-flex; gap: 10px; align-items: center; }
.platform i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px var(--gold); animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

/* The hero answers the cursor: a light follows it, the mark leans toward
   it, and the mark flares when you touch it. */
.spot {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 40%), rgba(255, 214, 140, 0.13), transparent 70%);
  opacity: var(--spot, 0); transition: opacity 0.8s var(--ease);
}
.sigil-tilt { perspective: 900px; width: max-content; margin: 0 auto; }
.hero-sigil {
  transform: rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg));
  transition: transform 0.6s var(--ease), filter 0.6s var(--ease);
  cursor: pointer;
}
.hero-sigil img { transition: filter 0.6s var(--ease), transform 0.6s var(--ease); }
.hero-sigil:hover img, .hero-sigil.flare img { filter: drop-shadow(0 0 46px rgba(255, 196, 90, 0.75)) brightness(1.18); transform: scale(1.04); }
.hero-sigil:hover::before, .hero-sigil.flare::before { animation: none; opacity: 1; transform: scale(1.25); transition: transform 0.6s var(--ease); }
.hero-sigil:hover .sheen, .hero-sigil.flare .sheen { animation-duration: 1.6s; animation-delay: 0s; }
.hero-sigil .wave {
  position: absolute; left: 50%; top: 50%; width: 100%; aspect-ratio: 1; border-radius: 50%;
  border: 1px solid rgba(255, 220, 150, 0.7);
  transform: translate(-50%, -50%) scale(0.4); opacity: 0; pointer-events: none;
}
.hero-sigil.pulse .wave { animation: shock 1.1s var(--ease); }
@keyframes shock { 0% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.4); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(2.4); } }
.hero .wordmark { transform: translate(calc(var(--px, 0) * -6px), calc(var(--py, 0) * -4px)); transition: transform 0.8s var(--ease); }
.hero .loop-ring { translate: calc(var(--px, 0) * 18px) calc(var(--py, 0) * 12px); transition: translate 1s var(--ease); }

.scroll-cue { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); width: 1px; height: 54px; background: linear-gradient(var(--gold), transparent); opacity: 0.6; }
.scroll-cue::after { content: ''; position: absolute; left: -2px; top: 0; width: 5px; height: 5px; border-radius: 50%; background: var(--gold-hi); animation: drip 2.2s var(--ease) infinite; }
@keyframes drip { from { transform: translateY(0); opacity: 1; } to { transform: translateY(50px); opacity: 0; } }

/* Intro, played once on load (only when JS marks the page ready). */
.js .intro { opacity: 0; transform: translateY(24px); filter: blur(6px); }
.js.loaded .intro { opacity: 1; transform: none; filter: none; transition: opacity 1.2s var(--ease), transform 1.2s var(--ease), filter 1.2s var(--ease); transition-delay: var(--d, 0s); }
.js .wordmark span { opacity: 0; transform: translateY(0.4em); }
.js.loaded .wordmark span { opacity: 1; transform: none; transition: opacity 1s var(--ease), transform 1.2s var(--ease); transition-delay: calc(0.35s + var(--i) * 0.07s); }

/* ------------------------------------------------------------ sections */

section { position: relative; }
.section { padding: clamp(90px, 14vw, 170px) 0; }
.section-head { max-width: 940px; margin: 0 0 clamp(40px, 6vw, 70px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head .eyebrow { display: inline-block; margin-bottom: 18px; }
.section-head h2 { font-size: clamp(38px, 6vw, 76px); }
.section-head p { margin-top: 20px; }
.section-head.center p { margin-inline: auto; }

.ornament { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 0 auto; width: max-content; }
.ornament::before, .ornament::after { content: ''; width: 90px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-dim)); }
.ornament::after { transform: scaleX(-1); }
.ornament i { width: 7px; height: 7px; transform: rotate(45deg); background: var(--gold-dim); }

/* Reveal on scroll. Visible by default; hidden only when JS can show it. */
.js [data-reveal] { opacity: 0; transform: translateY(40px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); transition-delay: var(--d, 0s); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ------------------------------------------------------------ the loop */

.loop { height: 320vh; }
.loop-stage {
  position: sticky; top: 0; height: 100svh;
  display: grid; place-items: center;
  overflow: hidden;
}
.loop-stage::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(50% 45% at 50% 50%, rgba(233, 176, 77, calc(0.04 + var(--p, 0) * 0.16)), transparent 70%);
}
.cleave { position: relative; width: min(560px, 86vw, 58svh); aspect-ratio: 1; margin-top: -8svh; }
.cleave svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cleave .half text { font: 700 21px var(--caps); letter-spacing: 0.28em; }
.cleave .half { transition: transform 0.2s linear; }
.cleave .left { transform: translateX(calc(var(--split, 0) * -70px)) rotate(calc(var(--split, 0) * -6deg)); transform-origin: 300px 300px; }
.cleave .right { transform: translateX(calc(var(--split, 0) * 70px)) rotate(calc(var(--split, 0) * 6deg)); transform-origin: 300px 300px; }
.cleave .spinning { transform-origin: 300px 300px; animation: spin 40s linear infinite; animation-play-state: var(--spin, running); }
.cleave .blade { transform: translateY(calc((1 - var(--drop, 0)) * -130%)); opacity: var(--drop, 0); filter: drop-shadow(0 0 24px rgba(233, 176, 77, 0.7)); }
.cleave .flash { opacity: calc(var(--split, 0) * (1 - var(--split, 0)) * 4); mix-blend-mode: screen; }
.loop-lines { position: absolute; left: 0; right: 0; bottom: clamp(40px, 10vh, 110px); text-align: center; padding-inline: var(--gutter); }
.loop-lines p { position: absolute; left: 0; right: 0; margin: 0; font: italic 500 clamp(26px, 4.2vw, 50px)/1.15 var(--display); opacity: 0; transform: translateY(14px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); text-wrap: balance; padding-inline: var(--gutter); }
.loop-lines p.on { opacity: 1; transform: none; }
.loop-lines small { display: block; margin-top: 10px; font: 400 15px/1.5 var(--sans); color: var(--ink-2); font-style: normal; }
.loop-lines { height: 7em; }
.loop-lines p { bottom: 0; }
.loop-top { position: absolute; top: clamp(90px, 14vh, 130px); left: 0; right: 0; text-align: center; opacity: calc(1 - var(--drop, 0)); }

/* ------------------------------------------------------------ the climb */

.climb { height: 520vh; }
.climb-stage {
  position: sticky; top: 0; height: 100svh;
  display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; gap: 4vw;
  overflow: hidden;
}
.climb-stage::before {
  content: ''; position: absolute; left: 50%; top: 55%; width: 900px; height: 900px; transform: translate(-30%, -50%);
  background: radial-gradient(closest-side, var(--tier-glow, rgba(233, 176, 77, 0.18)), transparent);
  transition: background 0.8s var(--ease);
  pointer-events: none;
}
.climb-copy { position: relative; z-index: 1; }
.climb-copy h2 { font-size: clamp(36px, 5vw, 66px); }
.climb-copy .lede { margin-top: 18px; }
.readout { margin-top: 38px; display: grid; gap: 4px; }
.readout .stage-num { font: 600 clamp(64px, 9vw, 120px)/0.9 var(--caps); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.readout .tier { font: 700 12.5px/1 var(--sans); letter-spacing: 0.34em; text-transform: uppercase; color: var(--tier, var(--ink-3)); transition: color 0.6s; }
.readout .meta { display: flex; gap: 22px; margin-top: 16px; color: var(--ink-2); font-size: 14px; flex-wrap: wrap; }
.readout .meta b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.readout .chapter { margin-top: 18px; font: italic 500 20px/1.3 var(--display); color: var(--gold-soft); min-height: 1.3em; }
.ticks { display: flex; gap: 6px; margin-top: 26px; }
.ticks i { flex: 1; height: 3px; border-radius: 3px; background: rgba(233, 176, 77, 0.14); transition: background 0.4s, box-shadow 0.4s; max-width: 34px; }
.ticks i.on { background: var(--tier, var(--gold)); box-shadow: 0 0 10px var(--tier, var(--gold)); }

.figure { position: relative; height: min(80svh, 760px); }
.figure .layer { position: absolute; inset: 0; opacity: 0; transition: opacity 0.55s ease, transform 0.9s var(--ease); transform: scale(0.98); }
.figure .layer.on { opacity: 1; transform: none; }
.figure img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }
.figure img.bloom { mix-blend-mode: screen; filter: blur(4px) brightness(1.3); animation: pulse 3.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }
.figure::after { content: ''; position: absolute; left: 10%; right: 10%; bottom: -2%; height: 40px; background: radial-gradient(closest-side, rgba(0, 0, 0, 0.8), transparent); }

@media (max-width: 860px) {
  .climb-stage { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-items: stretch; padding: 84px 0 16px; gap: 6px; }
  .climb-copy { padding-right: var(--gutter); }
  .climb-copy .lede { display: none; }
  .climb-copy h2 { font-size: 30px; }
  .readout { margin-top: 14px; grid-template-columns: auto 1fr; column-gap: 18px; align-items: end; }
  .readout .stage-num { font-size: 56px; grid-row: span 2; }
  .readout .tier { font-size: 10.5px; letter-spacing: 0.2em; }
  .readout .meta { margin-top: 6px; gap: 14px; font-size: 13px; }
  .readout .chapter { grid-column: 1 / -1; font-size: 17px; margin-top: 10px; }
  .ticks { grid-column: 1 / -1; margin-top: 12px; }
  .figure { height: auto; min-height: 0; padding-left: var(--gutter); }
}

/* ------------------------------------------------------------ sagas */

.seals { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(14px, 2vw, 26px); }
@media (max-width: 980px) { .seals { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .seals { gap: 10px; } }

.seal {
  --accent: var(--gold);
  position: relative;
  padding: clamp(26px, 3vw, 38px) clamp(16px, 2vw, 24px) 26px;
  border-radius: 22px;
  text-align: center;
  background:
    radial-gradient(70% 50% at 50% 28%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    linear-gradient(180deg, #100C08, #070604);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent) inset;
  overflow: hidden;
  cursor: default;
  transition: box-shadow 0.6s var(--ease), transform 0.6s var(--ease);
  outline: none;
}
.seal::after {
  /* A glint passing over the crest now and then. */
  content: ''; position: absolute; inset: -40% -60%;
  background: linear-gradient(115deg, transparent 42%, color-mix(in srgb, var(--accent) 22%, transparent) 50%, transparent 58%);
  transform: translateX(-60%);
  animation: glint 7s var(--ease) infinite;
  animation-delay: calc(var(--d, 0s) * 6);
  pointer-events: none;
}
@keyframes glint { 0%, 70% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }
.seal:hover, .seal:focus-visible, .seal.near {
  transform: translateY(-4px);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent) inset, 0 30px 70px -30px color-mix(in srgb, var(--accent) 60%, transparent);
}

.crest { position: relative; width: clamp(92px, 9vw, 120px); aspect-ratio: 1; margin: 0 auto 20px; }
.crest svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.crest .c1 { fill: none; stroke: color-mix(in srgb, var(--accent) 55%, transparent); stroke-width: 1.5; stroke-dasharray: 340; stroke-dashoffset: 340; transition: stroke-dashoffset 2s var(--ease); transition-delay: calc(var(--d, 0s) + 0.2s); }
.crest .c2 { fill: color-mix(in srgb, var(--accent) 8%, #0B0906); stroke: color-mix(in srgb, var(--accent) 30%, transparent); stroke-width: 1; stroke-dasharray: 3 5; transform-origin: 60px 60px; animation: spin 50s linear infinite; }
.crest .crack { fill: none; stroke: color-mix(in srgb, var(--accent) 90%, white); stroke-width: 1.6; stroke-dasharray: 120; stroke-dashoffset: 120; filter: drop-shadow(0 0 4px var(--accent)); transition: stroke-dashoffset 1.2s var(--ease); }
.seal.in .c1, .js .seal:not([data-reveal]) .c1 { stroke-dashoffset: 0; }
.seal:hover .crack, .seal:focus-visible .crack, .seal.near .crack, .seal.open .crack { stroke-dashoffset: 0; }
.crest .numeral {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 600 clamp(26px, 2.6vw, 34px)/1 var(--caps); letter-spacing: 0.06em;
  color: color-mix(in srgb, var(--accent) 70%, white);
  text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 70%, transparent);
}
.seal .state { display: inline-block; font: 700 10px/1 var(--sans); letter-spacing: 0.26em; text-transform: uppercase; color: var(--ink-3); padding: 7px 11px; border-radius: 99px; border: 1px solid var(--line); }
.seal.open .state { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.seal h3 { margin: 16px 0 4px; font: 600 clamp(19px, 2vw, 23px)/1.2 var(--display); }
.seal .realm { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.seal .whisper {
  margin: 16px 0 0; font: italic 500 15px/1.45 var(--display); color: color-mix(in srgb, var(--accent) 40%, var(--ink));
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height 0.8s var(--ease), opacity 0.8s var(--ease);
}
.seal:hover .whisper, .seal:focus-visible .whisper, .seal.near .whisper { max-height: 8em; opacity: 1; }
@media (max-width: 520px) { .seal .whisper { font-size: 13px; } .seal .realm { font-size: 12px; } .seal .state { font-size: 9px; letter-spacing: 0.18em; } }

.saga-next {
  margin: clamp(18px, 2vw, 26px) auto 0;
  display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap;
  padding: 22px; border-radius: 22px;
  border: 1px dashed var(--line-2);
  color: var(--ink-3);
}
.saga-next .caps { font-size: 13px; color: var(--gold-soft); }
.saga-next .soon { font-size: 13px; }
.redact { display: inline-flex; gap: 8px; }
.redact i, .redline i {
  display: inline-block; width: var(--w); height: 0.9em; border-radius: 4px;
  background: linear-gradient(90deg, rgba(233, 176, 77, 0.12), rgba(233, 176, 77, 0.28), rgba(233, 176, 77, 0.12));
  background-size: 200% 100%;
  animation: shimmer 2.6s linear infinite;
  vertical-align: middle;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ------------------------------------------------------------ climb seal */

.figure .layer.sealed img.fig { filter: none; }
.seal-note {
  position: absolute; left: 0; right: 0; top: 46%; z-index: 2;
  display: grid; gap: 8px; justify-items: center; text-align: center;
  opacity: 0; transform: translateY(10px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  pointer-events: none;
}
.seal-note .caps { font-size: 13px; color: var(--tier, var(--gold)); letter-spacing: 0.5em; padding-left: 0.5em; }
.seal-note em { font: italic 500 clamp(20px, 2.4vw, 28px)/1.2 var(--display); color: var(--ink); }
.climb.is-sealed .seal-note { opacity: 1; transform: none; }
.readout .chapter.hidden { color: transparent; position: relative; }
.readout .chapter.hidden::after { content: ''; position: absolute; left: 0; top: 0.25em; height: 0.9em; width: 11ch; border-radius: 4px; background: linear-gradient(90deg, rgba(233, 176, 77, 0.12), rgba(233, 176, 77, 0.3), rgba(233, 176, 77, 0.12)); background-size: 200% 100%; animation: shimmer 2.6s linear infinite; }
.ticks i.locked { background: transparent; box-shadow: 0 0 0 1px rgba(233, 176, 77, 0.18) inset; }
.ticks i.locked.on { background: transparent; box-shadow: 0 0 0 1px var(--tier) inset, 0 0 8px var(--tier); }

/* ------------------------------------------------------------ ritual glyphs */

.glyph { margin-top: 30px; min-height: 96px; }
.intention { padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: rgba(233, 176, 77, 0.03); }
.intention .label { display: block; font: 700 10.5px/1 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.intention .typed { font: italic 500 19px/1.3 var(--display); color: var(--gold-soft); }
.intention .caret { display: inline-block; width: 2px; height: 1.1em; background: var(--gold); vertical-align: -0.15em; margin-left: 3px; animation: blink 1s steps(1) infinite; }

.phone-glyph { position: relative; height: 120px; perspective: 600px; display: grid; place-items: center; }
.phone {
  width: 62px; height: 112px; border-radius: 14px; position: relative;
  background: linear-gradient(160deg, #2A2218, #120E09);
  box-shadow: 0 0 0 1px var(--line-2) inset, 0 20px 30px -16px #000;
  transform-style: preserve-3d;
}
.phone .screen { position: absolute; inset: 6px; border-radius: 10px; background: #0B0906; display: grid; place-items: center; overflow: hidden; backface-visibility: hidden; }
.phone .screen svg { position: absolute; width: 44px; height: 44px; }
.phone .track { fill: none; stroke: rgba(233, 176, 77, 0.15); stroke-width: 3; }
.phone .arc { fill: none; stroke: var(--gold); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 151; stroke-dashoffset: 151; transform: rotate(-90deg); transform-origin: 30px 30px; }
.phone .clock { position: relative; font: 700 9px/1 var(--sans); color: var(--gold-soft); font-variant-numeric: tabular-nums; }
.phone-glyph .table { position: absolute; bottom: 2px; width: 120px; height: 10px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, 0.7), transparent); }
.rite.in .phone { animation: facedown 6s var(--ease) 0.6s infinite; }
.rite.in .phone .arc { animation: fillarc 6s linear 0.6s infinite; }
@keyframes facedown {
  0%, 12% { transform: rotateX(0deg) translateY(0); }
  26%, 82% { transform: rotateX(180deg) translateY(-6px); }
  96%, 100% { transform: rotateX(360deg) translateY(0); }
}
@keyframes fillarc { 0% { stroke-dashoffset: 151; } 90%, 100% { stroke-dashoffset: 0; } }

.rise-glyph { display: flex; align-items: flex-end; gap: 18px; }
.rise-glyph .flame { width: 46px; height: 62px; transform-origin: 50% 100%; transform: scale(0.35); opacity: 0.4; transition: transform 2.2s var(--ease), opacity 2.2s; filter: drop-shadow(0 0 14px rgba(233, 176, 77, 0.6)); }
.rite.in .rise-glyph .flame { transform: scale(1); opacity: 1; animation: flicker 2.4s ease-in-out 2.2s infinite; }
@keyframes flicker { 25% { transform: scale(1.04, 0.97); } 50% { transform: scale(0.97, 1.05); } 75% { transform: scale(1.02, 0.99); } }
.rise-glyph .ember-count { margin: 0; }

/* ------------------------------------------------------------ inside */

.feat::before { width: 0; transition: width 1.2s var(--ease); transition-delay: calc(var(--d, 0s) + 0.3s); }
.feat.in::before, .no-js .feat::before { width: 48px; }
.feat .stat b { color: var(--gold-soft); font-variant-numeric: tabular-nums; }

.secrets { margin-top: clamp(60px, 8vw, 100px); padding: clamp(34px, 5vw, 56px); border-radius: 26px; text-align: center; border: 1px solid var(--line); position: relative; overflow: hidden; background: radial-gradient(60% 80% at 50% 0%, rgba(233, 176, 77, 0.08), transparent 70%); }
.secrets .k { font-size: 12px; color: var(--gold); }
.secrets .display { font-size: clamp(30px, 4.4vw, 54px); margin: 14px 0 20px; }
.redline { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; color: var(--ink-3); font-size: 14px; }
.redline span { margin-right: 6px; font-style: italic; font-family: var(--display); font-size: 16px; color: var(--ink-2); }

/* ------------------------------------------------------------ line reveals */

.js [data-lines] .ln { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.js [data-lines] .ln > span { display: inline-block; transform: translateY(105%); transition: transform 1.1s var(--ease); }
.js [data-lines].in .ln > span { transform: none; }
.js [data-lines].in .ln:nth-child(2) > span { transition-delay: 0.14s; }

/* The vow: each line underlined in gold as it lights. */
.vow-list li { position: relative; }
.vow-list li::after { content: ''; position: absolute; left: 50%; bottom: -1px; width: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); transition: width 1.4s var(--ease), left 1.4s var(--ease); }
.vow-list li.in::after { left: 10%; width: 80%; }

/* ------------------------------------------------------------ ritual */

.ritual { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); }
@media (max-width: 860px) { .ritual { grid-template-columns: 1fr; } }
.rite { padding: 40px clamp(10px, 2.4vw, 34px) 20px; border-left: 1px solid var(--line); position: relative; }
.rite:first-child { border-left: 0; }
@media (max-width: 860px) { .rite { border-left: 0; border-bottom: 1px solid var(--line); padding: 32px 0; } }
.rite .roman { font: 600 15px/1 var(--caps); letter-spacing: 0.3em; color: var(--gold); }
.rite h3 { margin: 18px 0 12px; font: italic 500 clamp(26px, 2.6vw, 34px)/1.15 var(--display); }
.rite p { margin: 0; color: var(--ink-2); }

.ember-count { display: flex; align-items: baseline; gap: 12px; margin-top: 26px; }
.ember-count b { font: 600 44px/1 var(--caps); font-variant-numeric: tabular-nums; }
.ember-count span { color: var(--ink-3); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; }

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

.world { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(26px, 4vw, 56px) clamp(20px, 4vw, 60px); }
@media (max-width: 860px) { .world { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .world { grid-template-columns: 1fr; } }
.feat { position: relative; padding-top: 26px; }
.feat::before { content: ''; position: absolute; top: 0; left: 0; width: 48px; height: 1px; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.feat .k { font: 600 12px/1 var(--caps); letter-spacing: 0.3em; color: var(--gold-soft); }
.feat h3 { margin: 14px 0 10px; font: 600 23px/1.2 var(--display); }
.feat p { margin: 0; color: var(--ink-2); font-size: 15px; }
.feat .stat { display: block; margin-top: 14px; font: 600 13px/1 var(--sans); color: var(--ink-3); letter-spacing: 0.06em; }

/* ------------------------------------------------------------ vow */

.vow { text-align: center; }
.vow-list { list-style: none; margin: 0 auto; padding: 0; max-width: 980px; }
.vow-list li {
  font: 600 clamp(28px, 5.4vw, 64px)/1.15 var(--display);
  padding: clamp(14px, 2vw, 22px) 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
  transition: color 0.8s var(--ease);
  text-wrap: balance;
}
.vow-list li.in { color: var(--ink); }
.vow-list li em { font-style: italic; font-weight: 500; }
.vow-list li.in em { color: var(--gold-soft); }
.vow-note { margin: 36px auto 0; max-width: 40em; color: var(--ink-2); }

/* ------------------------------------------------------------ final */

.final { text-align: center; overflow: hidden; isolation: isolate; }
.final::before { content: ''; position: absolute; inset: 0; background: radial-gradient(50% 50% at 50% 45%, rgba(233, 176, 77, 0.16), transparent 70%); z-index: -1; }
.final .sigil { width: clamp(110px, 14vw, 160px); }
.final h2 { font-size: clamp(40px, 7vw, 92px); margin-bottom: 18px; }
.final .lede { margin: 0 auto 36px; }
.contact-line { margin-top: 26px; display: inline-flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 14px; flex-wrap: wrap; justify-content: center; }
.contact-line code { font: 700 14px/1 var(--sans); color: var(--gold-soft); background: rgba(233, 176, 77, 0.08); padding: 8px 12px; border-radius: 10px; user-select: all; }
.copy { background: none; border: 1px solid var(--line-2); color: var(--ink-2); border-radius: 10px; padding: 7px 12px; font: 600 12px/1 var(--sans); cursor: pointer; }
.copy:hover { color: var(--gold-soft); }

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

.foot { border-top: 1px solid var(--line); padding: 46px 0 calc(40px + env(safe-area-inset-bottom, 0px)); color: var(--ink-3); font-size: 14px; }
.foot .wrap { display: flex; gap: 22px 40px; align-items: center; flex-wrap: wrap; }
.foot nav { display: flex; gap: 22px; flex-wrap: wrap; margin-left: auto; }
.foot a { text-decoration: none; color: var(--ink-2); }
.foot a:hover { color: var(--gold-soft); }
.foot .brand img { height: 26px; }
.foot .brand span { font-size: 14px; }

/* ------------------------------------------------------------ documents */

.doc-hero { padding: calc(150px + env(safe-area-inset-top, 0px)) 0 50px; text-align: center; position: relative; overflow: hidden; }
.doc-hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(40% 70% at 50% 0%, rgba(233, 176, 77, 0.16), transparent 70%); z-index: -1; }
.doc-hero h1 { font-size: clamp(40px, 7vw, 76px); margin: 18px 0 16px; }
.doc-hero p { color: var(--ink-3); margin: 0; }
.doc { max-width: 760px; margin: 0 auto; padding: 30px var(--gutter) 110px; }
.doc h2 { font: 600 clamp(24px, 3vw, 30px)/1.2 var(--display); margin: 56px 0 14px; scroll-margin-top: 100px; }
.doc h2 .n { font: 600 13px/1 var(--caps); letter-spacing: 0.2em; color: var(--gold); display: block; margin-bottom: 12px; }
.doc h3 { font: 700 15px/1.4 var(--sans); letter-spacing: 0.02em; margin: 28px 0 8px; color: var(--gold-soft); }
.doc p, .doc li { color: var(--ink-2); }
.doc strong { color: var(--ink); }
.doc ul, .doc ol { padding-left: 1.2em; }
.doc li { margin: 6px 0; }
.doc li::marker { color: var(--gold-dim); }
.doc a { color: var(--gold-soft); text-decoration-color: var(--gold-dim); text-underline-offset: 3px; }
.doc .summary { border: 1px solid var(--line-2); border-radius: 20px; padding: 24px 26px; background: linear-gradient(180deg, rgba(233, 176, 77, 0.06), transparent); }
.doc .summary h2 { margin-top: 0; }
.doc .summary ul { margin: 0; }
.table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: 16px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.doc th { font: 700 11px/1.3 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); background: rgba(233, 176, 77, 0.05); }
.doc tr:last-child td { border-bottom: 0; }
.doc td:first-child { color: var(--ink); font-weight: 700; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 30px 0 0; padding: 0; list-style: none; }
.toc a { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; font-size: 13px; color: var(--ink-2); }
.toc a:hover { border-color: var(--line-2); color: var(--gold-soft); }

.steps { counter-reset: s; list-style: none; padding: 0 !important; display: grid; gap: 12px; }
.steps li { counter-increment: s; position: relative; padding: 18px 20px 18px 66px; border: 1px solid var(--line); border-radius: 16px; margin: 0 !important; background: rgba(233, 176, 77, 0.03); }
.steps li::before { content: counter(s, upper-roman); position: absolute; left: 20px; top: 18px; font: 600 15px/1.6 var(--caps); color: var(--gold); width: 30px; text-align: center; }

/* ------------------------------------------------------------ motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .intro, .js [data-reveal], .js .wordmark span, .js [data-lines] .ln > span { opacity: 1 !important; transform: none !important; filter: none !important; }
}
