:root {
  --ink: #06122b;
  --deep: #071d44;
  --blue: #0d49a2;
  --cobalt: #1767df;
  --emerald: #0f6a4d;
  --gold: #ffd35d;
  --gold-hot: #fff1a6;
  --paper: #f4e8c9;
  --white: #f8f5e9;
  --line: rgba(255, 211, 93, .36);
  --header-h: 84px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--ink); }
body {
  margin: 0;
  color: var(--white);
  background:
    radial-gradient(circle at 85% 10%, rgba(23, 103, 223, .22), transparent 28rem),
    linear-gradient(180deg, #081a3b 0%, #020816 100%);
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }
::selection { color: var(--ink); background: var(--gold); }

#starfield { position: fixed; inset: 0; z-index: 8; pointer-events: none; opacity: .55; }
.grain {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: .19;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 70px);
  border-bottom: 1px solid rgba(255, 211, 93, .2);
  background: linear-gradient(180deg, rgba(2, 8, 22, .94), rgba(2, 8, 22, .64));
  backdrop-filter: blur(16px) saturate(125%);
}
.brand { display: inline-flex; gap: 12px; align-items: center; min-width: 190px; }
.brand-rune {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50% 44% 50% 42%;
  background: url("assets/wizard-paid-symbol.png") center / 82% no-repeat;
  box-shadow: 0 0 24px rgba(255, 211, 93, .24), inset 0 0 15px rgba(255, 211, 93, .12);
  transform: rotate(-7deg);
}
.brand strong { display: block; font: 700 15px/1.1 Georgia, serif; letter-spacing: .11em; }
.brand small { display: block; margin-top: 5px; color: var(--gold); font-size: 10px; letter-spacing: .25em; }
.site-header nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 48px); }
.site-header nav a { position: relative; font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.site-header nav a:not(.nav-orb)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -9px;
  height: 1px;
  background: var(--gold);
  transition: right .35s ease;
}
.site-header nav a:hover::after { right: 0; }
.nav-orb { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--gold); }

.scene { position: relative; background-size: cover; background-position: center; isolation: isolate; }
.scene::before { display: none; }
.scene--cliff { background-image: url("assets/hero-world.webp"); background-position: 37% center; }
.scene--archive { background-image: url("assets/lore-archive.webp"); }
.hero.scene--cliff { background-image: none; }
.scene-picture { position: absolute; inset: 0; z-index: 0; display: block; overflow: hidden; }
.scene-picture img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 37% center; }

.hero { min-height: 100svh; display: flex; align-items: center; padding: calc(var(--header-h) + 70px) clamp(24px, 7vw, 120px) 80px; background-position: 37% center; }
.hero-shade {
  display: none;
}
.hero-copy { position: relative; z-index: 1; width: min(690px, 64vw); margin-top: 4vh; padding: 32px; margin-left: -32px; background: linear-gradient(90deg, rgba(2,8,22,.74), rgba(2,8,22,.32) 62%, transparent); }
.eyebrow { display: flex; align-items: center; gap: 12px; color: var(--gold); font-size: 11px; font-weight: 900; letter-spacing: .32em; }
.eyebrow::before { content: "✦"; font-size: 14px; }
h1, h2, h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; }
.hero h1, .lore-title h1 {
  margin: 18px 0 28px;
  font-size: clamp(62px, 10vw, 154px);
  line-height: .74;
  letter-spacing: -.075em;
  text-shadow: 0 5px 36px rgba(0, 0, 0, .35);
}
.hero h1 em, .lore-title h1 em { color: var(--gold); font-weight: 400; }
.hero-line { margin: 0 0 36px; max-width: 520px; font: italic clamp(18px, 2vw, 26px)/1.45 Georgia, serif; color: rgba(248, 245, 233, .87); }
.spell-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.spell-button {
  position: relative;
  min-height: 58px;
  display: inline-grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 15px;
  padding: 0 19px;
  border: 1px solid var(--line);
  background: rgba(6, 18, 43, .78);
  cursor: pointer;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
  overflow: hidden;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.spell-button::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 25%, rgba(255,255,255,.22) 46%, transparent 66%); transform: translateX(-120%); transition: transform .65s ease; }
.spell-button:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: 0 12px 35px rgba(0,0,0,.3), 0 0 25px rgba(255,211,93,.16); }
.spell-button:hover::before { transform: translateX(120%); }
.spell-button i { font-style: normal; color: var(--gold); }
.spell-button--gold { color: #09142b; border-color: var(--gold); background: linear-gradient(135deg, #ffe48a, #c98a18); box-shadow: 0 0 28px rgba(255,211,93,.18); }
.spell-button--gold i { color: #09142b; }
.spell-button--blue { border-color: rgba(113, 169, 255, .5); background: linear-gradient(135deg, rgba(17,87,187,.92), rgba(7,29,68,.92)); }
.spell-button--ca { min-width: 172px; }
.spell-icon { font-size: 18px; line-height: 1; }

.scroll-mark { position: absolute; z-index: 1; left: 50%; bottom: 30px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; color: rgba(255,255,255,.58); font-size: 8px; font-weight: 900; letter-spacing: .28em; }
.scroll-mark i { width: 1px; height: 38px; background: linear-gradient(var(--gold), transparent); animation: pulse-line 2s ease-in-out infinite; }
@keyframes pulse-line { 50% { transform: scaleY(.6); opacity: .45; } }

.proof-section, .rules-section, .final-spell { position: relative; padding: clamp(90px, 12vw, 170px) clamp(24px, 7vw, 120px); overflow: hidden; }
.proof-section { min-height: 820px; background: radial-gradient(circle at 78% 50%, rgba(23,103,223,.28), transparent 29%), linear-gradient(130deg, #06122b 0%, #082961 58%, #06122b 100%); }
.proof-section::before { content: ""; position: absolute; width: 720px; height: 720px; right: -220px; top: -220px; border: 1px solid var(--line); border-radius: 50%; box-shadow: inset 0 0 100px rgba(255,211,93,.05); }
.section-kicker { color: var(--gold); font-size: 10px; font-weight: 900; letter-spacing: .34em; }
.proof-grid { min-height: 540px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); align-items: center; gap: 6vw; }
.proof-copy h2, .portal-panel h2, .final-spell h2 { margin: 25px 0 30px; font-size: clamp(46px, 6.3vw, 100px); line-height: .92; letter-spacing: -.055em; }
.proof-copy h2 span { color: var(--gold); font-weight: 400; font-style: italic; }
.proof-copy p { max-width: 650px; color: rgba(248,245,233,.72); font: 19px/1.72 Georgia, serif; }
.ink-link { display: inline-flex; gap: 15px; margin-top: 24px; padding-bottom: 7px; border-bottom: 1px solid var(--gold); color: var(--gold-hot); font-size: 11px; font-weight: 900; letter-spacing: .22em; }
.ink-link span { transition: transform .2s ease; }
.ink-link:hover span { transform: translateX(6px); }
.receipt-seal { position: relative; width: min(430px, 38vw); aspect-ratio: 1; margin: auto; display: grid; place-items: center; filter: drop-shadow(0 0 28px rgba(255,211,93,.22)); }
.seal-ring { position: absolute; border-radius: 50%; }
.seal-ring--outer { inset: 0; border: 2px dashed rgba(255,211,93,.75); animation: spin 40s linear infinite; }
.seal-ring--inner { inset: 12%; border: 1px solid var(--line); box-shadow: inset 0 0 70px rgba(255,211,93,.08); }
.seal-rune { width: 58%; height: 66%; background: url("assets/wizard-paid-symbol.png") center / contain no-repeat; filter: drop-shadow(0 0 14px var(--gold)) drop-shadow(0 0 38px rgba(255,211,93,.38)); }
.seal-word { position: absolute; left: 50%; font-size: 8px; font-weight: 900; letter-spacing: .38em; color: var(--paper); transform: translateX(-50%); white-space: nowrap; }
.seal-word--top { top: 18%; }
.seal-word--bottom { bottom: 18%; }
@keyframes spin { to { transform: rotate(360deg); } }

.constellation-line { position: absolute; inset: 0; opacity: .18; background-image: linear-gradient(110deg, transparent 49.8%, var(--gold) 50%, transparent 50.2%); }
.rules-section { background: #f1e4c1; color: var(--ink); }
.rules-section .section-kicker { color: #9b6712; }
.rule-stack { margin-top: 56px; border-top: 1px solid rgba(6,18,43,.22); }
.rule { display: grid; grid-template-columns: 90px minmax(240px, .8fr) 1.2fr; gap: 3vw; align-items: center; min-height: 155px; border-bottom: 1px solid rgba(6,18,43,.22); transition: padding .25s ease, background .25s ease; }
.rule:hover { padding: 0 24px; background: rgba(255,255,255,.25); }
.rule > span { color: #a27118; font: italic 25px Georgia, serif; }
.rule h3 { font-size: clamp(25px, 3vw, 46px); letter-spacing: -.04em; }
.rule p { max-width: 520px; color: rgba(6,18,43,.66); font: 17px/1.5 Georgia, serif; }

.portal-section { min-height: 94svh; display: flex; align-items: center; justify-content: flex-end; padding: 100px clamp(24px, 7vw, 120px); background-position: center; }
.portal-section::after, .lore-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(2,8,22,.1), rgba(2,8,22,.88) 73%, rgba(2,8,22,.96)); }
.portal-panel { width: min(630px, 54vw); padding: clamp(34px, 5vw, 70px); border: 1px solid var(--line); background: rgba(2,8,22,.7); backdrop-filter: blur(10px); box-shadow: 0 35px 90px rgba(0,0,0,.45); clip-path: polygon(26px 0, 100% 0, 100% calc(100% - 26px), calc(100% - 26px) 100%, 0 100%, 0 26px); }
.portal-panel h2 { font-size: clamp(46px, 5.3vw, 82px); }
.portal-panel > p:not(.eyebrow) { margin-bottom: 32px; color: rgba(248,245,233,.72); font: 18px/1.6 Georgia, serif; }

footer { min-height: 130px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding: 25px clamp(24px, 4vw, 70px); border-top: 1px solid var(--line); background: #020816; font-size: 10px; letter-spacing: .12em; }
footer strong { color: var(--gold); }
footer p { margin: 0; color: rgba(255,255,255,.45); text-align: center; }
.footer-links { justify-self: end; display: flex; gap: 18px; align-items: center; }
.footer-links a, .footer-links button { border: 0; background: none; padding: 7px 0; color: var(--paper); cursor: pointer; font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.footer-links a:hover, .footer-links button:hover { color: var(--gold); }
.toast { position: fixed; z-index: 40; left: 50%; bottom: 28px; padding: 16px 22px; border: 1px solid var(--gold); background: rgba(2,8,22,.94); color: var(--gold-hot); box-shadow: 0 15px 50px rgba(0,0,0,.45); font-size: 9px; font-weight: 900; letter-spacing: .18em; transform: translate(-50%, 140%); opacity: 0; transition: .35s ease; }
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

.lore-main { background: #06122b; }
.lore-hero { min-height: 100svh; display: flex; align-items: center; padding: calc(var(--header-h) + 70px) clamp(24px, 8vw, 150px) 90px; background-position: center; }
.lore-hero::after { background: linear-gradient(90deg, rgba(2,8,22,.94), rgba(2,8,22,.35) 60%, rgba(2,8,22,.48)); }
.lore-title { width: min(820px, 74vw); }
.lore-title h1 { margin-top: 24px; font-size: clamp(60px, 9vw, 135px); }
.lore-title > p:last-child { font: italic 22px Georgia, serif; color: rgba(255,255,255,.68); }
.ledger-section { min-height: 100svh; display: grid; place-items: center; padding: 110px 24px; background: radial-gradient(circle at 50% 40%, #0f3878, #041027 70%); }
.ledger-page { position: relative; width: min(870px, 90vw); padding: clamp(45px, 8vw, 105px); color: #20170d; background: #ead9aa; box-shadow: 0 40px 100px rgba(0,0,0,.5), inset 0 0 90px rgba(100,61,14,.2); clip-path: polygon(2% 0, 98% 1%, 100% 96%, 96% 100%, 3% 98%, 0 4%); }
.ledger-page::before { content: ""; position: absolute; inset: 17px; border: 1px solid rgba(94,55,12,.3); pointer-events: none; }
.ledger-page p { position: relative; margin: 0 0 24px; font: 20px/1.8 Georgia, serif; }
.ledger-page .dropcap::first-letter { float: left; margin: 7px 12px 0 0; color: #9b6712; font-size: 82px; line-height: .72; }
.ledger-page blockquote { margin: 50px 0; padding: 28px 0; border-block: 1px solid rgba(94,55,12,.38); text-align: center; font: italic 28px/1.35 Georgia, serif; }
.ledger-signature { display: flex; justify-content: flex-end; align-items: center; gap: 22px; color: #6b4313; font-size: 9px; font-weight: 900; letter-spacing: .25em; }
.ledger-signature i { width: 56px; height: 56px; background: url("assets/wizard-paid-symbol.png") center / contain no-repeat; filter: sepia(.2); }
.final-spell { min-height: 80svh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; background: radial-gradient(circle, rgba(23,103,223,.28), transparent 36%), #020816; }
.final-spell h2 { margin-bottom: 18px; }
.final-spell > p { margin: 0 0 35px; color: rgba(255,255,255,.6); font: italic 21px Georgia, serif; }

.reveal { opacity: 0; transform: translateY(25px); transition: opacity .85s ease, transform .85s cubic-bezier(.2,.8,.2,1); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  :root { --header-h: 72px; }
  .site-header nav a:not(.nav-orb) { display: none; }
  .scene-picture img { object-position: center top; }
  .hero { align-items: flex-end; }
  .hero-copy { width: 100%; }
  .hero-copy { margin-left: 0; padding: 26px 20px; background: linear-gradient(0deg, rgba(2,8,22,.90), rgba(2,8,22,.38) 72%, transparent); }
  .proof-grid { grid-template-columns: 1fr; padding-top: 60px; }
  .receipt-seal { width: min(430px, 75vw); }
  .rule { grid-template-columns: 46px 1fr; padding: 26px 0; }
  .rule p { grid-column: 2; margin-top: 0; }
  .portal-section { justify-content: center; }
  .portal-section::after { background: rgba(2,8,22,.66); }
  .portal-panel { width: min(650px, 94vw); }
  footer { grid-template-columns: 1fr; text-align: center; padding-block: 38px; }
  .footer-links { justify-self: center; }
  .lore-title { width: 100%; }
}

@media (max-width: 560px) {
  .site-header { padding-inline: 16px; }
  .brand strong { font-size: 12px; }
  .brand { min-width: 0; }
  .brand-rune { width: 36px; height: 36px; font-size: 23px; }
  .hero { min-height: 920px; padding-inline: 19px; }
  .hero h1 { font-size: clamp(58px, 21vw, 88px); }
  .hero-line { font-size: 17px; }
  .spell-actions { flex-direction: column; align-items: stretch; }
  .spell-button { width: 100%; }
  .proof-section, .rules-section, .final-spell { padding-inline: 20px; }
  .proof-copy h2, .portal-panel h2, .final-spell h2 { font-size: 43px; }
  .rule { grid-template-columns: 36px 1fr; }
  .rule p { font-size: 15px; }
  .portal-section { padding-inline: 15px; }
  .portal-panel { padding: 33px 23px; }
  .lore-hero { padding-inline: 20px; background-position: 42% center; }
  .lore-title h1 { font-size: 56px; }
  .ledger-page { padding: 55px 35px; }
  .ledger-page p { font-size: 17px; line-height: 1.7; }
  .ledger-page blockquote { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
