/* ============ Aethel World Guide ============ */
:root {
  --net: #C9A0A6;
  --ground: #0A0B0F;
  --panel: #111217;
  --panel-2: #14151A;
  --line: #2E3038;
  --line-soft: #23252C;
  --text: #ECE8DF;
  --text-2: #D2CCBF;
  --text-3: #ADA89D;
  --muted: #8E8A82;
  --gold: #D8BC82;
  --gold-hi: #F0DDB0;
  --gold-deep: #5A4C33;
  --cold: #BFD3E0;
  --sand: #D9B27A;
  --display: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --body: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--text);
  font-family: var(--body);
  font-size: clamp(17px, 1.1vw + 12px, 20px);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
a { color: var(--gold); }
a:hover { color: var(--gold-hi); }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--gold); color: var(--ground); padding: 10px 14px; font-family: var(--display); font-size: 12px; letter-spacing: .2em; text-decoration: none; }
.skip:focus { top: 12px; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .22em; }
.gold { color: var(--gold); }
.noscript { position: relative; z-index: 5; text-align: center; padding: 40px 20px; font-size: 20px; }

/* ---------- backdrop ---------- */
.backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.backdrop-map {
  position: absolute; left: 50%; top: 50%;
  width: max(140vw, 1600px); aspect-ratio: 3 / 2; max-width: none; object-fit: cover;
  transform: translate(-50%, -48%) scale(1.02);
  filter: brightness(.55) saturate(.85);
  transition: transform 2.2s cubic-bezier(.6, 0, .2, 1), filter 1.6s ease;
  will-change: transform;
}
.backdrop-vignette { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(10,11,15,.82) 0, rgba(10,11,15,.55) 150px, rgba(10,11,15,0) 260px), radial-gradient(ellipse at 50% 30%, rgba(10,11,15,.15) 0%, rgba(10,11,15,.72) 60%, var(--ground) 100%); }
.embers { position: absolute; inset: 0; }
.ember { position: absolute; bottom: -10px; border-radius: 50%; background: #F0D49A; box-shadow: 0 0 8px rgba(240,212,154,.9); animation: ember linear infinite; }
@keyframes ember { 0% { transform: translate(0,0); opacity: 0 } 12% { opacity: .9 } 100% { transform: translate(40px,-75vh); opacity: 0 } }

/* ---------- shell ---------- */
.shell { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { width: 100%; max-width: 1360px; margin: 0 auto; padding: 22px var(--gutter) 8px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.wordmark { display: flex; flex-direction: column; text-decoration: none; color: var(--text); }
.wordmark:hover { color: var(--text); }
.wordmark-name { font-family: var(--display); font-size: 22px; letter-spacing: .4em; }
.wordmark-sub { font-family: var(--mono); font-size: 10px; letter-spacing: .3em; color: var(--gold); }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 16px;
  background: rgba(10,11,15,.7); border: 1px solid #3A3B42; color: var(--text);
  font-family: var(--display); font-size: 12px; letter-spacing: .2em; cursor: pointer;
  transition: border-color .35s, color .35s, background .35s;
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-hi); }
.btn-ghost.small { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; padding: 0 14px; }
.top-actions { display: flex; gap: 10px; }
a.btn-ghost { text-decoration: none; }
.note-open[aria-current="page"] { border-color: var(--gold); color: var(--gold-hi); background: rgba(216,188,130,.1); }
.btn-gold {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 26px;
  border: 0; background: var(--gold); color: var(--ground);
  font-family: var(--display); font-size: 13px; letter-spacing: .22em; cursor: pointer; transition: background .35s;
}
.btn-gold:hover { background: var(--gold-hi); }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 13px; letter-spacing: .22em; }
kbd { font-family: var(--mono); font-size: 11px; color: #9C978C; border: 1px solid #3A3B42; padding: 0 6px; letter-spacing: 0; }

/* ---------- dock (tabs) ---------- */
.dock { width: 100%; max-width: 1360px; margin: 0 auto; padding: 18px var(--gutter) 0; position: relative; }
.dock-line { position: absolute; left: 12%; right: 12%; top: 51px; height: 1px; background: linear-gradient(90deg, rgba(216,188,130,0) 0%, rgba(216,188,130,.45) 50%, rgba(216,188,130,0) 100%); background-size: 200% 100%; animation: shimmer 7s linear infinite; }
.dock-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 18px 26px; position: relative; }
.medal { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 4px 2px; background: transparent; border: 0; cursor: pointer; transition: transform .5s var(--ease); }
.medal:hover { transform: translateY(-5px); }
.medal-disc-wrap { position: relative; width: 66px; height: 66px; }
.medal-ring { position: absolute; inset: -7px; border-radius: 50%; border: 1px dashed rgba(216,188,130,0); animation: spin 24s linear infinite; transition: border-color .5s; }
.medal-disc { width: 100%; height: 100%; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(14,15,19,.85); border: 1px solid #3A3B42; color: var(--text-2); transition: background .5s, border-color .5s, color .5s, box-shadow .5s; }
.medal-disc svg { width: 26px; height: 26px; }
.medal:hover .medal-disc { border-color: var(--gold); color: var(--gold-hi); }
.medal-label { text-shadow: 0 0 6px #0A0B0F, 0 0 3px #0A0B0F; font-family: var(--display); font-size: 11px; letter-spacing: .24em; color: #9C978C; transition: color .5s; }
.medal[aria-current="page"] { transform: translateY(-6px); }
.medal[aria-current="page"] .medal-disc { background: var(--gold); border-color: var(--gold); color: var(--ground); box-shadow: 0 0 34px rgba(216,188,130,.45); }
.medal[aria-current="page"] .medal-ring { border-color: rgba(216,188,130,.7); }
.medal[aria-current="page"] .medal-label { color: var(--gold-hi); }

/* ---------- stage ---------- */
.stage { width: 100%; max-width: 1360px; margin: 0 auto; padding: 44px var(--gutter) 80px; flex: 1; outline: none; }
.enter { animation: stage .9s var(--ease) both; }
.swap { animation: pop .6s var(--ease) both; }
@keyframes stage { from { opacity: 0; transform: translateY(18px) scale(.985); filter: blur(6px) } to { opacity: 1; transform: none; filter: blur(0) } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }
@keyframes page { from { opacity: 0; transform: perspective(1400px) rotateY(-14deg) translateX(30px) } to { opacity: 1; transform: none } }
@keyframes letter { 0% { opacity: 0; transform: translateY(.35em); filter: blur(10px) } 100% { opacity: 1; transform: none; filter: blur(0) } }
@keyframes shimmer { 0% { background-position: -150% 0 } 100% { background-position: 250% 0 } }
@keyframes spin { to { transform: rotate(360deg) } }
@keyframes spinback { to { transform: rotate(-360deg) } }
@keyframes twinkle { 0%, 100% { opacity: .15 } 50% { opacity: 1 } }
@keyframes ping { 0% { transform: scale(.5); opacity: .9 } 100% { transform: scale(2.8); opacity: 0 } }
@keyframes bob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }
@keyframes drift { 0% { transform: translateX(-10%) } 100% { transform: translateX(10%) } }
@keyframes pulse { 0%, 100% { opacity: .75; transform: scale(1) } 50% { opacity: 1; transform: scale(1.04) } }
@keyframes fall { 0% { transform: translate(0,0); opacity: 0 } 10% { opacity: .8 } 100% { transform: translate(-30px, 600px); opacity: 0 } }
@keyframes blow { 0% { transform: translateX(0); opacity: 0 } 15% { opacity: 1 } 100% { transform: translateX(700px); opacity: 0 } }
@keyframes veil { from { opacity: 0 } to { opacity: 1 } }

.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 24px; margin-bottom: 28px; }
.kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .26em; color: var(--gold); }
.h2 { font-family: var(--display); font-size: clamp(36px, 5vw, 52px); letter-spacing: .04em; line-height: 1.08; margin-top: 8px; }
.lede { max-width: 460px; color: var(--text-3); font-size: 19px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 16px; border: 1px solid #3A3B42; background: rgba(14,15,19,.7); color: var(--text-2); font-family: var(--display); font-size: 12px; letter-spacing: .16em; cursor: pointer; transition: background .4s, color .4s, border-color .4s; }
.chip:hover { border-color: var(--gold); }
.chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--ground); }
.tag { display: inline-block; font-family: var(--display); font-size: 12px; letter-spacing: .08em; padding: 6px 10px; border: 1px solid #34363E; color: #DCD6C9; }

/* ---------- home ---------- */
.home { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; min-height: min(640px, 70vh); }
.home-copy { flex: 1 1 480px; min-width: 0; text-shadow: 0 2px 14px rgba(10,11,15,.9), 0 0 4px rgba(10,11,15,.8); display: flex; flex-direction: column; gap: 20px; }
.home-title { font-family: var(--display); font-size: clamp(56px, 12vw, 176px); line-height: .9; letter-spacing: .08em; display: flex; }
.home-title span { display: inline-block; animation: letter 1.6s var(--ease) both; }
.rule-shimmer { height: 1px; width: min(520px, 100%); background: linear-gradient(90deg, rgba(216,188,130,0) 0%, var(--gold) 50%, rgba(216,188,130,0) 100%); background-size: 200% 100%; animation: shimmer 6s linear infinite; }
.home-lede { font-size: clamp(20px, 2vw, 25px); font-style: italic; color: var(--text-2); max-width: 580px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.astrolabe-wrap { flex: 1 1 360px; display: flex; justify-content: center; min-width: 0; }
.astrolabe { position: relative; width: min(500px, 80vw); aspect-ratio: 1 / 1; animation: bob 9s ease-in-out infinite; }
.astrolabe svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.astrolabe .a1 { animation: spin 160s linear infinite; }
.astrolabe .a2 { animation: spinback 90s linear infinite; }
.astrolabe-core { position: absolute; inset: 40%; border-radius: 50%; background: radial-gradient(circle, rgba(240,212,154,.5) 0%, rgba(240,212,154,.08) 55%, rgba(240,212,154,0) 72%); }

/* ---------- genesis ---------- */
.genesis { display: flex; flex-wrap: wrap; gap: 32px; align-items: stretch; }
.books { flex: 0 1 230px; display: flex; flex-direction: column; gap: 14px; }
.book-btn { position: relative; text-align: left; min-height: 150px; padding: 22px 20px 22px 30px; border: 1px solid var(--line); background: rgba(14,15,19,.7); color: var(--text); cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; transition: transform .45s var(--ease), background .45s, border-color .45s; }
.book-btn:hover { transform: translateX(6px); }
.book-btn::before { content: ""; position: absolute; left: 10px; top: 14px; bottom: 14px; width: 2px; background: #3A3B42; transition: background .45s; }
.book-btn[aria-pressed="true"] { background: #16171C; border-color: var(--gold); }
.book-btn[aria-pressed="true"]::before { background: var(--gold); }
.book-btn .k { font-family: var(--mono); font-size: 10px; letter-spacing: .22em; color: var(--gold); }
.book-btn .t { font-family: var(--display); font-size: 20px; line-height: 1.2; letter-spacing: .04em; }
.book-btn .c { font-size: 15px; font-style: italic; color: #9C978C; }
.reader { flex: 1 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.spread { position: relative; display: flex; flex-wrap: wrap; background: #121318; border: 1px solid var(--line); box-shadow: 0 40px 80px rgba(0,0,0,.55); }
.spread::before { content: ""; position: absolute; inset: 10px; border: 1px solid #262117; pointer-events: none; }
.spread::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 40px; margin-left: -20px; background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.35) 50%, rgba(0,0,0,0) 100%); pointer-events: none; }
.page { flex: 1 1 340px; min-width: 0; min-height: 600px; padding: 52px 46px 40px; display: flex; flex-direction: column; gap: 16px; }
.page.turn { animation: page .9s var(--ease) both; }
.page.turn + .page.turn { animation-delay: .12s; }
.page p { font-size: 19px; line-height: 1.72; color: #DCD6C9; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.page .cap { float: left; font-family: var(--display); font-size: 66px; line-height: .82; padding: 6px 10px 0 0; color: var(--gold); }
.page-no { margin-top: auto; padding-top: 12px; text-align: center; font-family: var(--mono); font-size: 11px; color: #6E6B65; }
.title-page { margin: auto 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.title-page .num { font-family: var(--display); font-size: 120px; line-height: 1; color: var(--gold); text-shadow: 0 0 40px rgba(216,188,130,.25); }
.title-page .vt { font-family: var(--display); font-size: 30px; letter-spacing: .06em; }
.fin { margin: auto 0; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--gold-deep); font-family: var(--display); letter-spacing: .3em; font-size: 12px; }
.fin span:first-child { font-size: 22px; color: var(--gold); }
.reader-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.reader-mid { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.vol-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.vol-btn { min-width: 44px; height: 44px; padding: 0 10px; border: 1px solid #3A3B42; background: transparent; color: var(--text-2); font-family: var(--display); font-size: 14px; cursor: pointer; transition: background .4s, color .4s, border-color .4s; }
.vol-btn[aria-pressed="true"] { background: var(--gold); color: var(--ground); border-color: var(--gold); }
.page-label { font-family: var(--mono); font-size: 11px; letter-spacing: .18em; color: var(--muted); text-align: center; }

/* ---------- atlas ---------- */
.atlas { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.atlas-map { flex: 3 1 600px; min-width: 0; border: 1px solid var(--line); box-shadow: 0 40px 80px rgba(0,0,0,.5); }
.map-frame { position: relative; width: 100%; aspect-ratio: 3 / 2; overflow: hidden; }
.map-frame > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.9) brightness(.9); }
.pin { position: absolute; width: 36px; height: 36px; margin: -18px 0 0 -18px; padding: 0; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pin .ping { position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 1px solid #F0D49A; animation: ping 2.8s var(--ease) infinite; }
.pin .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--ground); border: 2px solid #F0D49A; box-shadow: 0 0 14px rgba(240,212,154,.7); transition: transform .35s var(--ease), width .35s, height .35s, background .35s; }
.pin:hover .dot { transform: scale(1.4); }
.pin[aria-pressed="true"] .dot { width: 18px; height: 18px; background: #F0D49A; }
.place-card { background: rgba(12,13,17,.92); border-top: 1px solid var(--line); padding: 16px 20px 18px; min-height: 112px; }
.place-meta { display: flex; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: 10px; letter-spacing: .18em; }
.place-name { font-family: var(--display); font-size: 22px; margin-top: 4px; }
.place-text { font-size: 16px; line-height: 1.45; color: #CFC9BC; }
.region-card { flex: 2 1 380px; min-width: 0; background: var(--panel); border: 1px solid var(--line); }
.region-img { position: relative; height: 210px; overflow: hidden; }
.region-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); }
.region-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(17,18,23,0) 40%, var(--panel) 100%); }
.region-name { position: absolute; z-index: 1; left: 22px; right: 22px; bottom: 12px; font-family: var(--display); font-size: clamp(26px, 3vw, 34px); letter-spacing: .04em; text-shadow: 0 2px 20px rgba(0,0,0,.8); }
.region-body { padding: 18px 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.facts { margin: 0; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 14px; font-size: 16px; }
.facts dt { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--muted); padding-top: 4px; }
.facts dd { margin: 0; }
.region-text { font-size: 18px; color: #CFC9BC; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags .tag { animation: pop .5s var(--ease) both; }

/* ---------- pantheon ---------- */
.pantheon { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; min-height: 620px; }
.orbit-wrap { flex: 1 1 500px; min-width: 0; display: flex; justify-content: center; padding: 40px 0; }
.orbit { position: relative; width: min(560px, 76vw); aspect-ratio: 1 / 1; }
.orbit .ring { position: absolute; border-radius: 50%; }
.orbit .r1 { inset: 0; border: 1px solid #2A2B31; }
.orbit .r2 { inset: 9%; border: 1px dashed #3A352A; animation: spin 90s linear infinite; }
.orbit .r3 { inset: 27%; border: 1px solid #2A2B31; animation: spinback 70s linear infinite; }
.orbit .core { position: absolute; inset: 36%; border-radius: 50%; background: radial-gradient(circle, rgba(216,188,130,.38) 0%, rgba(216,188,130,.07) 55%, rgba(216,188,130,0) 72%); }
.orbit .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-family: var(--display); text-align: center; pointer-events: none; }
.orbit .center span { font-size: 13px; letter-spacing: .3em; }
.orbit-spin { position: absolute; inset: 0; animation: spin 140s linear infinite; }
.god-anchor { position: absolute; width: 0; height: 0; }
.god-counter { position: absolute; left: 0; top: 0; width: 0; height: 0; animation: spinback 140s linear infinite; }
.god-btn { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px; min-width: 44px; min-height: 44px; border: 0; background: transparent; cursor: pointer; white-space: nowrap; }
.god-star { width: 9px; height: 9px; border-radius: 50%; background: #F0D49A; box-shadow: 0 0 16px rgba(240,212,154,.95); animation: twinkle 4s ease-in-out infinite; transition: width .4s, height .4s; }
.god-btn.dark .god-star { background: #8C74C2; box-shadow: 0 0 16px rgba(140,116,194,.95); }
.god-name { font-family: var(--display); font-size: 14px; letter-spacing: .14em; color: var(--text); background: rgba(10,11,15,.78); padding: 3px 9px; transition: color .4s, background .4s; }
.god-btn:hover .god-name { color: var(--gold-hi); }
.god-btn[aria-pressed="true"] .god-star { width: 16px; height: 16px; }
.god-btn[aria-pressed="true"] .god-name { background: var(--gold); color: var(--ground); }
.god-info { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.god-info h2 { font-family: var(--display); font-size: clamp(40px, 5vw, 58px); letter-spacing: .04em; line-height: 1; }
.god-title { font-size: 24px; font-style: italic; color: var(--gold); }
.god-text { font-size: 21px; color: var(--text-2); }

/* ---------- peoples ---------- */
.fan-scroll { overflow-x: auto; padding: 50px 0 14px; -webkit-overflow-scrolling: touch; }
.fan { display: flex; width: max-content; margin: 0 auto; padding: 0 40px; }
.tarot { position: relative; flex: 0 0 150px; height: 240px; margin-left: -18px; padding: 16px 10px; border: 1px solid #34363E; background: var(--panel-2); color: var(--text); cursor: pointer; transform: var(--tf); transform-origin: 50% 120%; z-index: var(--z); box-shadow: 0 20px 40px rgba(0,0,0,.5); display: flex; flex-direction: column; align-items: center; justify-content: space-between; transition: transform .6s var(--ease), box-shadow .6s, border-color .4s; }
.tarot:first-child { margin-left: 0; }
.tarot::before { content: ""; position: absolute; inset: 6px; border: 1px solid #2A2620; pointer-events: none; }
.tarot:hover { transform: translateY(-34px) rotate(0deg) scale(1.04); z-index: 20; box-shadow: 0 30px 60px rgba(0,0,0,.6), 0 0 40px rgba(216,188,130,.18); }
.tarot[aria-pressed="true"] { border-color: var(--gold); }
.tarot .n { font-family: var(--mono); font-size: 10px; letter-spacing: .2em; color: var(--gold); }
.tarot .g { font-family: var(--display); font-size: 54px; line-height: 1; color: #6E6B65; }
.tarot[aria-pressed="true"] .g { color: #F0D49A; }
.tarot .nm { font-family: var(--display); font-size: 15px; letter-spacing: .1em; text-align: center; }
.race-panel { display: flex; flex-wrap: wrap; gap: 20px 28px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); padding: 30px 32px; margin-top: 18px; }
.race-head { flex: 1 1 240px; display: flex; flex-direction: column; gap: 6px; }
.race-head .nm { font-family: var(--display); font-size: clamp(30px, 4vw, 40px); letter-spacing: .04em; }
.race-body { flex: 2 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.race-body p { font-size: 20px; color: var(--text-2); }

/* ---------- threats ---------- */
.threats { display: flex; flex-wrap: wrap; gap: 28px; align-items: stretch; }
.threat-art { flex: 1 1 440px; min-width: 0; position: relative; min-height: 520px; overflow: hidden; border: 1px solid var(--line); }
.threat-art.cold { background: #090B10; }
.threat-art.sand { background: #0E0B08; }
.mist { position: absolute; inset: -20% -40%; }
.mist.m1 { background: radial-gradient(ellipse 40% 22% at 30% 70%, rgba(205,222,235,.16), transparent 70%), radial-gradient(ellipse 35% 18% at 70% 55%, rgba(205,222,235,.12), transparent 70%); animation: drift 26s ease-in-out infinite alternate; }
.mist.m2 { background: radial-gradient(ellipse 30% 16% at 55% 80%, rgba(205,222,235,.14), transparent 70%), radial-gradient(ellipse 45% 20% at 20% 40%, rgba(205,222,235,.08), transparent 70%); animation: drift 34s ease-in-out infinite alternate-reverse; }
.threat-svg { position: absolute; left: 50%; top: 44%; width: min(230px, 55%); transform: translate(-50%, -50%); }
.threat-svg svg { width: 100%; height: auto; }
.threat-svg.pulse svg { animation: pulse 5s ease-in-out infinite; }
.threat-svg.bob svg { animation: bob 8s ease-in-out infinite; }
.flake { position: absolute; top: -10px; border-radius: 50%; background: #E3EEF5; opacity: .7; animation: fall linear infinite; }
.grain { position: absolute; left: -10px; height: 1px; background: rgba(233,198,143,.55); animation: blow linear infinite; }
.dunes { position: absolute; left: -10%; right: -10%; bottom: 0; height: 46%; background: radial-gradient(ellipse 60% 100% at 30% 100%, #6B4E2A 0%, rgba(107,78,42,0) 70%), radial-gradient(ellipse 70% 90% at 80% 100%, #5A4224 0%, rgba(90,66,36,0) 70%); }
.sun { position: absolute; left: 50%; top: 18%; width: 120px; height: 120px; margin-left: -60px; border-radius: 50%; background: radial-gradient(circle, rgba(217,178,122,.55) 0%, rgba(217,178,122,.08) 60%, rgba(217,178,122,0) 72%); animation: pulse 7s ease-in-out infinite; }
.threat-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 28px; background: linear-gradient(180deg, rgba(10,11,15,0) 0%, rgba(10,11,15,.92) 60%); }
.threat-caption .nm { font-family: var(--display); font-size: clamp(34px, 4.5vw, 46px); letter-spacing: .04em; line-height: 1.05; }
.threat-body { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.threat-body p { font-size: 21px; color: var(--text-2); }
.facts-table { margin: 0; display: grid; grid-template-columns: 150px minmax(0, 1fr); border-top: 1px solid var(--line-soft); }
.facts-table dt { padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-family: var(--mono); font-size: 10px; letter-spacing: .18em; }
.facts-table dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 18px; }
.cold-accent { color: var(--cold); }
.sand-accent { color: var(--sand); }
.chip.cold[aria-pressed="true"] { background: var(--cold); border-color: var(--cold); }
.chip.sand[aria-pressed="true"] { background: var(--sand); border-color: var(--sand); }
.net-accent { color: var(--net); }
.chip.net[aria-pressed="true"] { background: var(--net); border-color: var(--net); }
.threat-art.net { background: #0D0A0C; }
.threads { position: absolute; inset: -20%; background: repeating-linear-gradient(45deg, rgba(201,160,166,.07) 0 1px, transparent 1px 34px), repeating-linear-gradient(-45deg, rgba(201,160,166,.07) 0 1px, transparent 1px 34px); -webkit-mask-image: radial-gradient(ellipse at 50% 45%, #000 0%, transparent 70%); mask-image: radial-gradient(ellipse at 50% 45%, #000 0%, transparent 70%); animation: drift 30s ease-in-out infinite alternate; }
.cell { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #E7C3C8; box-shadow: 0 0 10px rgba(231,195,200,.8); animation: twinkle ease-in-out infinite; }
.net-ring { transform-box: fill-box; transform-origin: center; animation: spin 60s linear infinite; }
.net-nodes circle { animation: twinkle 3.5s ease-in-out infinite; }
.net-nodes circle:nth-child(2n) { animation-delay: -1.2s; }
.net-nodes circle:nth-child(3n) { animation-delay: -2.3s; }

/* ---------- orders ---------- */
.shields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 30px 24px; }
.shield { position: relative; height: 330px; transition: transform .5s var(--ease); animation: pop .6s var(--ease) both; }
.shield:hover { transform: translateY(-8px); }
.shield-edge, .shield-face { position: absolute; clip-path: polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%); }
.shield-edge { inset: 0; background: var(--gold-deep); }
.shield.shadows .shield-edge { background: #4A3E66; }
.shield-face { inset: 1px; background: #121318; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 26px 22px 0; }
.shield .kind { font-family: var(--mono); font-size: 10px; letter-spacing: .22em; color: var(--muted); }
.shield .sigil { display: flex; width: 56px; height: 56px; flex: 0 0 56px; border-radius: 50%; border: 1px solid var(--gold); align-items: center; justify-content: center; font-family: var(--display); font-size: 24px; color: var(--gold); }
.shield h3 { font-family: var(--display); font-weight: 500; font-size: 19px; letter-spacing: .04em; line-height: 1.2; }
.shield p { font-size: 16px; line-height: 1.4; color: #BDB7AB; }

/* ---------- cast ---------- */
.cast-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.cast-scroll { padding: 40px 0 30px; }
.cast-row { display: grid; grid-template-columns: repeat(5, minmax(0, 200px)); justify-content: center; gap: 46px 22px; padding-bottom: 28px; }
.portrait { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; --ty: 0px; transform: translateY(var(--ty)); transition: transform .6s var(--ease); }
.portrait:nth-child(5n+2), .portrait:nth-child(5n+4) { --ty: 28px; }
.portrait:hover { transform: translateY(calc(var(--ty) - 14px)); }
.pframe { position: relative; display: block; width: 100%; aspect-ratio: 5 / 7; background: #121318; border: 1px solid #2A2C33; overflow: hidden; border-radius: 999px 999px 0 0; transition: border-color .6s, box-shadow .6s; }
.pframe img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
.pframe::before { content: ""; position: absolute; z-index: 1; inset: 8px; border: 1px solid rgba(216,188,130,.35); border-radius: 999px 999px 0 0; pointer-events: none; }
.pframe::after { content: ""; position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; height: 3px; background: var(--bar); }
.portrait:hover .pframe { border-color: var(--gold); box-shadow: 0 0 50px rgba(216,188,130,.22); }
.portrait .nm { font-family: var(--display); font-size: 19px; letter-spacing: .08em; text-align: center; }

/* ---------- search ---------- */
.search { position: fixed; inset: 0; z-index: 50; background: rgba(6,7,10,.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: flex; justify-content: center; padding: clamp(20px, 10vh, 110px) var(--gutter) 24px; overflow-y: auto; animation: veil .4s ease both; }
.search[hidden] { display: none; }
.search-panel { width: 100%; max-width: 760px; display: flex; flex-direction: column; gap: 14px; animation: stage .6s var(--ease) both; }
.search-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.search-field { position: relative; }
.search-field svg { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); color: var(--gold); pointer-events: none; }
.search-field input { width: 100%; height: 68px; padding: 0 20px 0 60px; background: var(--panel); border: 1px solid var(--gold); color: var(--text); font-family: var(--body); font-size: clamp(20px, 3vw, 26px); outline: none; border-radius: 0; box-shadow: 0 0 60px rgba(216,188,130,.12); -webkit-appearance: none; appearance: none; }
.search-results { display: flex; flex-direction: column; border: 1px solid var(--line-soft); background: #0E0F13; }
.res { display: flex; align-items: baseline; gap: 18px; width: 100%; text-align: left; padding: 16px 20px; border: 0; border-bottom: 1px solid #1E2026; background: transparent; color: var(--text); cursor: pointer; transition: background .3s; animation: pop .45s var(--ease) both; }
.res:hover, .res:focus-visible { background: #1A1B21; }
.res .c { flex: 0 0 90px; font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--gold); }
.res .b { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.res .n { font-family: var(--display); font-size: 19px; }
.res .t { font-size: 16px; color: var(--text-3); }
.res-empty { padding: 20px; font-style: italic; color: #9C978C; }

/* ---------- footer ---------- */
.footer { width: 100%; max-width: 1360px; margin: 0 auto; padding: 0 var(--gutter) 34px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 16px; font-family: var(--mono); font-size: 11px; letter-spacing: .2em; color: var(--muted); }
.footer-link { color: var(--gold); text-decoration: none; }
.footer-link:hover { color: var(--gold-hi); }

/* ---------- author's note ---------- */
.note { display: flex; justify-content: center; }
.letter { position: relative; width: 100%; max-width: 760px; padding: clamp(36px, 6vw, 64px) clamp(22px, 6vw, 70px); border: 1px solid var(--line); background: radial-gradient(ellipse at 50% 0%, rgba(216,188,130,.07), transparent 60%), rgba(12,13,17,.88); box-shadow: 0 40px 80px rgba(0,0,0,.45); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.letter::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(216,188,130,.16); pointer-events: none; }
.letter-corner { position: absolute; width: 18px; height: 18px; border-color: var(--gold); border-style: solid; border-width: 0; opacity: .8; }
.letter-corner.tl { left: 10px; top: 10px; border-left-width: 1px; border-top-width: 1px; }
.letter-corner.tr { right: 10px; top: 10px; border-right-width: 1px; border-top-width: 1px; }
.letter-corner.bl { left: 10px; bottom: 10px; border-left-width: 1px; border-bottom-width: 1px; }
.letter-corner.br { right: 10px; bottom: 10px; border-right-width: 1px; border-bottom-width: 1px; }
.letter .rule-shimmer { width: min(260px, 70%); margin: 6px 0 10px; }
.letter-body { display: flex; flex-direction: column; gap: 18px; text-align: left; }
.letter-body p { font-size: clamp(19px, 2.2vw, 22px); line-height: 1.6; color: var(--text-2); animation: pop .9s var(--ease) both; }
.letter-body p.note-first { font-style: italic; font-size: clamp(22px, 2.6vw, 26px); color: var(--gold-hi); text-align: center; }
.signoff { margin-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; animation: pop .9s var(--ease) both; }
.seal { width: 46px; height: 46px; color: var(--gold); }
.seal svg { width: 100%; height: 100%; animation: spin 40s linear infinite; }
.sig { font-family: var(--body); font-style: italic; font-size: 30px; color: var(--gold-hi); letter-spacing: .02em; }

/* ============ responsive ============ */
@media (max-width: 1200px) {
  .fan-scroll { padding: 20px 0 10px; overflow: visible; }
  .fan { width: auto; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .tarot { flex: none; width: auto; height: 190px; margin: 0; transform: none; z-index: auto; }
  .tarot:hover { transform: translateY(-6px); box-shadow: 0 24px 44px rgba(0,0,0,.55); }
}

@media (max-width: 1100px) {
  .cast-row { gap: 40px 16px; }
  .page { min-height: 540px; padding: 44px 36px 32px; }
}

@media (max-width: 860px) {
  .dock-list { gap: 14px 18px; }
  .medal-disc-wrap { width: 54px; height: 54px; }
  .medal-disc svg { width: 22px; height: 22px; }
  .dock-line { top: 45px; }
  .books { flex: 1 1 100%; flex-direction: row; }
  .book-btn { flex: 1 1 0; min-height: 110px; }
  .spread::after { display: none; }
  .page { min-height: 0; flex-basis: 100%; }
  .page + .page { border-top: 1px solid #262117; }
  .page.empty { display: none; }
  .title-page { padding: 20px 0; }
  .title-page .num { font-size: 96px; }
  .pin { width: 30px; height: 30px; margin: -15px 0 0 -15px; }
  .pin .dot { width: 9px; height: 9px; }
  .pin[aria-pressed="true"] .dot { width: 14px; height: 14px; }
  .pantheon { min-height: 0; }
  .orbit-wrap { padding: 30px 0; }
}

@media (max-width: 640px) {
  .topbar { padding-top: 16px; }
  .wordmark-name { font-size: 19px; }
  .search-open kbd { display: none; }
  .search-open span { display: none; }
  .search-open { width: 44px; padding: 0; }
  .note-open span { display: none; }
  .note-open { width: 44px; padding: 0; }
  .top-actions { gap: 8px; }
  .dock { padding-top: 14px; }
  .dock-line { display: none; }
  .dock-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 6px; }
  .medal { min-width: 0; }
  .medal-disc-wrap { width: 48px; height: 48px; }
  .medal-ring { inset: -5px; }
  .medal-disc svg { width: 20px; height: 20px; }
  .medal-label { font-size: 9px; letter-spacing: .14em; }
  .medal[aria-current="page"], .medal:hover { transform: none; }
  .stage { padding-top: 32px; }
  .home { gap: 28px; min-height: 0; }
  .home-copy { flex-basis: 100%; text-shadow: 0 2px 14px rgba(10,11,15,.95), 0 0 4px rgba(10,11,15,.9); }
  .backdrop-vignette { background: linear-gradient(to bottom, rgba(10,11,15,.85) 0, rgba(10,11,15,.6) 200px, rgba(10,11,15,0) 320px), radial-gradient(ellipse at 50% 30%, rgba(10,11,15,.55) 0%, rgba(10,11,15,.85) 60%, var(--ground) 100%); }
  .astrolabe { width: min(320px, 78vw); }
  .btn-row > * { flex: 1 1 100%; }
  .books { flex-direction: column; }
  .book-btn { flex: none; min-height: 0; }
  .page { padding: 32px 22px 24px; }
  .page p { font-size: 18px; text-align: left; }
  .page .cap { font-size: 54px; }
  .title-page .num { font-size: 80px; }
  .title-page .vt { font-size: 24px; }
  .reader-nav { display: grid; grid-template-columns: 1fr 1fr; }
  .reader-mid { grid-column: 1 / -1; grid-row: 1; }
  .reader-nav .btn-ghost { width: 100%; padding: 0 10px; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 8px; }
  .region-img { height: 170px; }
  .orbit { width: min(340px, 86vw); }
  .god-name { font-size: 11px; letter-spacing: .08em; padding: 2px 6px; }
  .god-btn { gap: 4px; }
  .god-text { font-size: 19px; }
  .fan-scroll { padding: 10px 0; overflow: visible; }
  .fan { width: auto; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .tarot { flex: none; width: auto; height: 150px; margin: 0; padding: 12px 4px; transform: none; z-index: auto; }
  .tarot:hover { transform: none; box-shadow: 0 20px 40px rgba(0,0,0,.5); }
  .tarot .g { font-size: 36px; }
  .tarot .nm { font-size: 11px; letter-spacing: .04em; }
  .race-panel { padding: 22px 20px; }
  .race-body p { font-size: 18px; }
  .threat-art { min-height: 380px; flex-basis: 100%; }
  .threat-body p { font-size: 19px; }
  .facts-table { grid-template-columns: 1fr; }
  .facts-table dt { padding: 12px 0 2px; border-bottom: 0; }
  .shields { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
  .shield { height: 300px; }
  .cast-scroll { padding: 24px 0 10px; }
  .cast-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; padding-bottom: 0; }
  .portrait, .portrait:nth-child(5n+2), .portrait:nth-child(5n+4) { --ty: 0px; }
  .portrait:hover { transform: none; }
  .portrait .nm { font-size: 16px; }
  .res { flex-direction: column; gap: 4px; }
  .res .c { flex: none; }
}

@media (max-width: 380px) {
  .medal-label { font-size: 8px; letter-spacing: .1em; }
  .chip { padding: 0 12px; font-size: 11px; letter-spacing: .12em; }
  .home-title { letter-spacing: .04em; }
  .fan { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tarot { height: 130px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
