:root {
  --ink: #0d0f0c;
  --ink-2: #151913;
  --panel: rgba(17, 21, 16, .86);
  --line: rgba(200, 160, 74, .28);
  --gold: #c8a04a;
  --gold-hi: #e9cb83;
  --text: #e8e2d2;
  --muted: #a9a290;
  --wax: #8e1f1a;
  --topbar: 58px;
  --serif: 'Spectral', Georgia, 'Times New Roman', serif;
  --display: 'Cinzel', 'Trajan Pro', Georgia, serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar) + 12px); }
body { margin: 0; background: var(--ink); color: var(--text); font: 18px/1.65 var(--serif); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--gold-hi); }
img { display: block; max-width: 100%; }
kbd { font: 12px var(--serif); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }

/* ---------------------------------------------------------------- top bar */
.topbar { position: fixed; inset: 0 0 auto 0; height: var(--topbar); z-index: 50; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; background: linear-gradient(rgba(10,12,9,.92), rgba(10,12,9,.72)); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--text); font: 600 15px var(--display); letter-spacing: .14em; text-transform: uppercase; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); font-size: 13px; letter-spacing: 0; }
.mode { position: relative; display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: rgba(0,0,0,.4); }
.mode button { position: relative; z-index: 1; border: 0; background: none; color: var(--muted); font: 600 13px var(--display); letter-spacing: .12em; text-transform: uppercase;
  padding: 7px 16px; cursor: pointer; border-radius: 999px; transition: color .3s; }
.mode button[aria-pressed="true"] { color: #17130a; }
.mode .knob { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 999px; background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  box-shadow: 0 0 18px rgba(200,160,74,.35); transition: transform .45s cubic-bezier(.6,.05,.25,1), background .45s; }
html[data-mode="spoilers"] .mode .knob { transform: translateX(100%); background: linear-gradient(180deg, #c8463c, var(--wax)); box-shadow: 0 0 18px rgba(200,60,50,.45); }
html[data-mode="spoilers"] .mode button[aria-pressed="true"] { color: #fbe9e4; }
.progress { position: fixed; top: var(--topbar); left: 0; right: 0; height: 2px; z-index: 49; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--gold-hi)); box-shadow: 0 0 10px var(--accent); }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; min-height: 100svh; display: grid; align-items: end; overflow: hidden; isolation: isolate; }
.hero-bg { position: absolute; inset: -4%; z-index: -2; background: var(--hero) center 35% / cover no-repeat; animation: drift 38s ease-in-out infinite alternate; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(13,15,12,.35) 0%, rgba(13,15,12,.1) 35%, rgba(13,15,12,.75) 72%, var(--ink) 100%),
              radial-gradient(ellipse at 20% 80%, rgba(0,0,0,.55), transparent 60%); }
@keyframes drift { from { transform: scale(1.04) translate(0, 0); } to { transform: scale(1.12) translate(-2%, -1.5%); } }
.hero-inner { padding: calc(var(--topbar) + 40px) clamp(20px, 6vw, 90px) clamp(70px, 12vh, 130px); max-width: 980px; }
.hero-emblem { width: 92px; height: 92px; object-fit: contain; filter: drop-shadow(0 6px 18px rgba(0,0,0,.7)); margin-bottom: 14px; animation: rise 1.2s .1s both; }
.kicker { margin: 0; font: 600 13px var(--display); letter-spacing: .3em; text-transform: uppercase; color: var(--gold); animation: rise 1.2s .2s both; }
.hero h1 { margin: .1em 0 0; font: 700 clamp(46px, 8vw, 104px)/1 var(--display); letter-spacing: .04em; text-shadow: 0 4px 30px rgba(0,0,0,.7); animation: rise 1.2s .3s both; }
.subtitle { margin: .35em 0 0; font: italic 400 clamp(20px, 2.4vw, 28px) var(--serif); color: var(--gold-hi); animation: rise 1.2s .4s both; }
.lede { max-width: 640px; font-size: clamp(17px, 1.6vw, 20px); color: #ddd6c4; text-shadow: 0 2px 12px rgba(0,0,0,.8); animation: rise 1.2s .5s both; }
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; animation: rise 1.2s .6s both; }
.facts div { padding: 8px 14px; border: 1px solid var(--line); border-radius: 6px; background: rgba(10,12,9,.6); backdrop-filter: blur(4px); }
.facts span { display: block; font: 600 11px var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.facts b { font-weight: 600; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.scroll-cue { position: absolute; left: 50%; bottom: 22px; width: 26px; height: 42px; margin-left: -13px; border: 2px solid rgba(233,203,131,.6); border-radius: 14px; }
.scroll-cue span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--gold-hi); animation: cue 1.8s infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------------------------------------------------------------- ambient backdrop */
.ambient { position: fixed; inset: -8%; z-index: 0; opacity: 0; transition: opacity 1.2s ease; pointer-events: none; }
body.in-journey .ambient { opacity: 1; }
.ambient i { position: absolute; inset: 0; background: center / cover no-repeat; opacity: 0; transition: opacity 1.6s ease; }
.ambient i.on { opacity: 1; }
.hero, .foot, .home { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- journey layout */
.journey { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(380px, 560px) 1fr; gap: 0; padding-left: 56px; }
.steps { position: relative; z-index: 2; padding: 10vh 28px 20vh 24px; grid-column: 1; grid-row: 1; }
.stage { grid-column: 2; grid-row: 1; position: sticky; top: var(--topbar); height: calc(100svh - var(--topbar)); display: flex; flex-direction: column; justify-content: center;
  padding: 3vh 3vw 3vh 1vw; }
.frame { position: relative; aspect-ratio: 1864 / 843; width: 100%; border: 1px solid var(--line); outline: 1px solid rgba(0,0,0,.6); outline-offset: 5px;
  box-shadow: 0 30px 80px rgba(0,0,0,.65), inset 0 0 0 1px rgba(233,203,131,.15); overflow: hidden; background: #000; border-radius: 3px; }
.frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06); transition: opacity 1.1s ease, transform 7s ease-out; }
.frame img.on { opacity: 1; transform: scale(1); }
.vignette { position: absolute; inset: 0; box-shadow: inset 0 0 120px rgba(0,0,0,.6); pointer-events: none; }
.plate { display: flex; gap: 14px; align-items: baseline; justify-content: center; margin-top: 18px; text-align: center; min-height: 32px; }
.plate-era { font: 600 12px var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.plate-caption { font: 600 clamp(18px, 1.6vw, 24px) var(--display); letter-spacing: .06em; color: var(--gold-hi); transition: opacity .5s; }
.plate.swap .plate-caption { opacity: 0; }

.step { min-height: 88vh; display: flex; flex-direction: column; justify-content: center; padding: 8vh 0; }
.inline-img { display: none; }
.card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 30px 30px 26px; box-shadow: 0 20px 50px rgba(0,0,0,.45);
  opacity: .35; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease, border-color .7s; }
.step.active .card { opacity: 1; transform: none; border-color: rgba(200,160,74,.5); }
.era { font: 600 12px var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.card h2 { margin: .15em 0 .5em; font: 700 clamp(26px, 2.6vw, 36px)/1.15 var(--display); color: #f3ead2; }
.card h3 { font: 600 19px var(--display); color: var(--gold-hi); margin: 1.2em 0 .3em; }
.card p { margin: .7em 0; }
.card ul, .card ol { padding-left: 1.2em; margin: .7em 0; }
.card li { margin: .35em 0; }
.card li::marker { color: var(--gold); }
.card strong { color: #fff4d8; font-weight: 600; }
.card em { color: var(--gold-hi); }
.table { overflow-x: auto; margin: 1em 0; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th { text-align: left; font: 600 11px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); border-bottom: 1px solid var(--line); padding: 6px 8px; }
td { padding: 8px; border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: top; }
td:nth-child(2) { white-space: nowrap; color: var(--gold-hi); }
.callout { margin: 1.1em 0; padding: 12px 16px; border-left: 3px solid var(--gold); background: rgba(200,160,74,.08); border-radius: 0 4px 4px 0; font-size: 16px; }
.callout p { margin: 0; }
.callout-label { display: block; font: 600 11px var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.callout.warning { border-color: #c8463c; background: rgba(200,70,60,.09); }
.callout.warning .callout-label { color: #e0796f; }
.anchor { display: none; }

/* ---------------------------------------------------------------- spoilers */
.seal { position: absolute; top: -16px; right: 18px; display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #c0392b, var(--wax) 60%, #5a120e); color: #f7d9cf; font: 700 9px var(--display); letter-spacing: .14em; text-transform: uppercase;
  box-shadow: 0 6px 16px rgba(0,0,0,.6), inset 0 -3px 6px rgba(0,0,0,.4); transform: rotate(-12deg); }
.step.spoiler .card { border-color: rgba(200,70,60,.35); }
.step.spoiler.active .card { border-color: rgba(220,90,75,.65); }
.step.spoiler .era { color: #e0796f; }
.secret { position: relative; margin: 1.1em 0 .2em; padding: 14px 16px 6px; border: 1px dashed rgba(220,90,75,.55); border-radius: 5px; background: rgba(142,31,26,.12); }
.secret-tag { position: absolute; top: -10px; left: 12px; padding: 0 8px; background: #2a1110; color: #e0796f; font: 600 10px var(--display); letter-spacing: .18em; text-transform: uppercase; border-radius: 3px; }
html[data-mode="basic"] .step.spoiler, html[data-mode="basic"] .secret, html[data-mode="basic"] .rail .dot.spoiler { display: none; }
html[data-mode="spoilers"] .sealed { display: none; }
.revealed { animation: unseal .9s ease both; }
@keyframes unseal { from { opacity: 0; filter: blur(6px); transform: translateY(16px); } to { opacity: 1; filter: none; transform: none; } }
.sealed { margin: 8vh 0; padding: 34px 28px; text-align: center; border: 1px solid rgba(200,70,60,.4); border-radius: 8px;
  background: repeating-linear-gradient(135deg, rgba(142,31,26,.08) 0 12px, rgba(0,0,0,0) 12px 24px), var(--panel); }
.wax { width: 74px; height: 74px; margin: -70px auto 14px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #c0392b, var(--wax) 60%, #5a120e);
  box-shadow: 0 8px 20px rgba(0,0,0,.6); position: relative; }
.wax::after { content: "III"; position: absolute; inset: 0; display: grid; place-items: center; color: #f7d9cf; font: 700 18px var(--display); }
.reveal { margin-top: 6px; padding: 11px 22px; border: 0; border-radius: 999px; background: linear-gradient(180deg, #c8463c, var(--wax)); color: #fbe9e4;
  font: 600 13px var(--display); letter-spacing: .14em; text-transform: uppercase; cursor: pointer; box-shadow: 0 6px 20px rgba(142,31,26,.45); }
.reveal:hover { filter: brightness(1.12); }

/* ---------------------------------------------------------------- widgets */
.roster { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 10px 2px 14px; margin: 14px -6px 0; scrollbar-color: var(--gold) transparent; }
.unit { flex: 0 0 132px; margin: 0; scroll-snap-align: start; border: 1px solid var(--line); border-radius: 5px; background: #0b0d0a; overflow: hidden;
  transition: transform .35s, box-shadow .35s, border-color .35s; }
.unit:hover { transform: translateY(-6px); border-color: var(--gold); box-shadow: 0 14px 28px rgba(0,0,0,.6); }
.unit img { width: 100%; aspect-ratio: 330 / 450; object-fit: cover; }
.unit figcaption { padding: 7px 8px 9px; font-size: 13px; line-height: 1.3; }
.unit b { display: block; font-weight: 600; color: #f3ead2; min-height: 2.6em; }
.unit .where { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.unit .price { display: inline-flex; align-items: center; gap: 5px; margin-top: 5px; color: var(--gold-hi); font-weight: 600; }
.unit .price::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff1b8, var(--gold) 60%, #7a5a1c); }
.relics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-top: 18px; }
.relic { text-align: center; font-size: 14px; line-height: 1.4; }
.relic img { width: 120px; height: 94px; object-fit: contain; margin: 0 auto 8px; filter: drop-shadow(0 10px 14px rgba(0,0,0,.6)); animation: bob 5s ease-in-out infinite; }
.relic:nth-child(2) img { animation-delay: -1.6s; }
.relic:nth-child(3) img { animation-delay: -3.2s; }
.relic b { display: block; font: 600 15px var(--display); color: var(--gold-hi); }
.relic span { color: var(--muted); }
@keyframes bob { 50% { transform: translateY(-7px); } }
.emblem { display: grid; place-items: center; margin-top: 18px; }
.emblem img { width: 190px; filter: drop-shadow(0 0 30px rgba(95,154,104,.45)); animation: bob 6s ease-in-out infinite; }

.tips { margin: 6vh 0 0; padding: 28px 30px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.tips h2 { margin: 0 0 .4em; font: 700 28px var(--display); color: #f3ead2; }

/* ---------------------------------------------------------------- chapter rail */
.rail { position: fixed; left: 16px; top: 50%; transform: translateY(-50%); z-index: 40; display: flex; flex-direction: column; gap: 9px; opacity: 0; transition: opacity .5s; }
body.in-journey .rail { opacity: 1; }
.rail .dot { position: relative; display: flex; align-items: center; text-decoration: none; }
.rail .dot i { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--gold); background: transparent; transition: background .3s, transform .3s, box-shadow .3s; }
.rail .dot.spoiler i { border-color: #d0584c; }
.rail .dot.active i { background: var(--gold); transform: scale(1.35); box-shadow: 0 0 10px var(--gold); }
.rail .dot.spoiler.active i { background: #d0584c; box-shadow: 0 0 10px #d0584c; }
.rail .dot span { position: absolute; left: 20px; white-space: nowrap; padding: 3px 9px; border-radius: 4px; background: rgba(10,12,9,.92); border: 1px solid var(--line);
  color: var(--text); font-size: 13px; opacity: 0; transform: translateX(-6px); pointer-events: none; transition: opacity .25s, transform .25s; }
.rail .dot:hover span, .rail .dot:focus span { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- index */
.links { display: flex; gap: 22px; margin-left: auto; margin-right: 22px; }
.links a { color: var(--muted); text-decoration: none; font: 600 12px var(--display); letter-spacing: .16em; text-transform: uppercase; transition: color .25s; }
.links a:hover { color: var(--gold-hi); }
.home { position: relative; z-index: 1; padding: 30px clamp(16px, 5vw, 70px) 80px; }
.home-first { display: grid; }
.guide-card { position: relative; display: grid; align-content: end; gap: 6px; min-height: 320px; padding: 34px clamp(20px, 4vw, 48px); border: 1px solid var(--gold);
  border-radius: 10px; overflow: hidden; isolation: isolate; text-decoration: none; color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.guide-card::before { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--card) center 40% / cover; transition: transform 1.4s ease; }
.guide-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(13,15,12,.95) 0%, rgba(13,15,12,.7) 45%, rgba(13,15,12,.1) 100%); }
.guide-card:hover::before { transform: scale(1.05); }
.guide-card b { font: 700 clamp(30px, 4vw, 48px)/1.05 var(--display); max-width: 640px; }
.guide-card > span:not(.kicker) { max-width: 560px; color: #ddd6c4; }
.guide-card i { justify-self: start; margin-top: 10px; padding: 9px 20px; border-radius: 999px; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #17130a;
  font: 600 12px var(--display); font-style: normal; letter-spacing: .16em; text-transform: uppercase; }
.home-h { margin: 46px 0 6px; font: 700 26px var(--display); color: #f3ead2; letter-spacing: .04em; }
/* Big warning chapter */
.card .callout.danger { border-left-width: 5px; border-color: #d0584c; background: linear-gradient(90deg, rgba(160,40,30,.28), rgba(160,40,30,.08)); padding: 16px 18px; font-size: 17px; }
.card .callout.danger .callout-label { color: #ff9a8e; font-size: 13px; }
.hero.home { min-height: 72svh; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; padding: 14px 0 0; }
.faction { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-height: 280px; padding: 22px; border: 1px solid var(--line);
  border-radius: 8px; text-align: center; text-decoration: none; color: var(--text); overflow: hidden; isolation: isolate; background: var(--ink-2); }
.faction.live::before { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--card) center / cover; transition: transform 1.2s ease; }
.faction.live::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(13,15,12,.1), rgba(13,15,12,.92)); }
.faction.live:hover::before { transform: scale(1.08); }
.faction.live:hover { border-color: var(--gold); }
.faction img { width: 74px; height: 74px; object-fit: contain; filter: drop-shadow(0 4px 12px rgba(0,0,0,.7)); }
.faction b { font: 700 21px var(--display); }
.faction span { color: var(--muted); font-size: 15px; }
.faction.soon { opacity: .45; filter: grayscale(.7); justify-content: center; }

/* ---------------------------------------------------------------- Orcthal */
.support { margin: 7vh 0 0; padding: 30px 30px 26px; text-align: center; border: 1px solid var(--gold); border-radius: 8px;
  background: radial-gradient(ellipse at top, rgba(200,160,74,.16), transparent 70%), var(--panel); box-shadow: 0 20px 50px rgba(0,0,0,.45); }
.support .kicker { animation: none; }
.support h2 { margin: .15em 0 .3em; font: 700 30px var(--display); color: #f3ead2; }
.support p { max-width: 560px; margin: .6em auto; }
.support .steam { display: block; width: 100%; max-width: 646px; height: 190px; margin: 18px auto 6px; border: 0; border-radius: 4px; background: #1b2838; }
.wish { display: inline-block; margin-top: 10px; padding: 11px 24px; border-radius: 999px; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #17130a;
  text-decoration: none; font: 600 13px var(--display); letter-spacing: .14em; text-transform: uppercase; box-shadow: 0 6px 20px rgba(200,160,74,.3); }
.wish:hover { filter: brightness(1.08); }
.thanks { color: var(--muted); font-style: italic; font-size: 15px; }
.thanks-block { max-width: 760px; margin: 56px auto 0; text-align: center; }
.thanks-block .kicker { animation: none; }
.thanks-block h2 { margin: .15em 0 .6em; font: 700 30px var(--display); color: #f3ead2; }
.thanks-block ul { list-style: none; margin: 0; padding: 0; }
.thanks-block li { padding: 10px 0; border-bottom: 1px solid rgba(200,160,74,.14); color: var(--muted); }
.thanks-block li b { display: block; color: var(--gold-hi); font: 600 19px var(--serif); }
.thanks-block .theme { margin-top: 22px; color: var(--muted); }
.thanks-block .theme i { color: var(--text); }
.home-support { max-width: 760px; margin: 40px auto 0; }
.foot { padding: 30px 20px 50px; text-align: center; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 60; transform: translate(-50%, 30px); opacity: 0; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(10,12,9,.95); font-size: 15px; transition: opacity .35s, transform .35s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 960px) {
  .journey { display: block; padding-left: 0; }
  .stage, .rail { display: none; }
  .steps { padding: 4vh 16px 10vh; }
  .step { min-height: 0; padding: 4vh 0; }
  .inline-img { display: block; width: 100%; aspect-ratio: 1864 / 843; object-fit: cover; border: 1px solid var(--line); border-radius: 6px 6px 0 0; }
  .card { opacity: 1; transform: none; border-radius: 0 0 6px 6px; border-top: 0; padding: 22px 18px; }
  .seal { top: 8px; right: 10px; width: 52px; height: 52px; }
  .topbar { padding: 0 12px; }
  .brand span:last-child { display: none; }
  .links { gap: 12px; margin-right: 10px; }
  .links a { font-size: 10px; letter-spacing: .1em; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
