:root {
  --bg: #0d0718;
  --bg-2: #150b26;
  --panel: rgba(28, 16, 48, 0.62);
  --ink: #f6efe3;
  --muted: #b8a9cc;
  --dim: #7c6c93;
  --gold: #e8c26a;
  --gold-2: #b8862b;
  --gold-soft: rgba(232, 194, 106, 0.28);
  --grape: #7c3aed;
  --grape-2: #b78bff;
  --up: #49e09a;
  --down: #ff6b8a;
  --line: rgba(232, 194, 106, 0.18);
  --line-2: rgba(232, 194, 106, 0.35);
  --display: "Cinzel", Georgia, serif;
  --serif: "Cormorant Garamond", Georgia, serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(124, 58, 237, .28), transparent 60%),
    radial-gradient(900px 600px at -10% 40%, rgba(184, 134, 43, .10), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.label { font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.up { color: var(--up); }
.down { color: var(--down); }
em { font-family: var(--serif); font-style: italic; font-weight: 600; color: var(--gold); letter-spacing: 0; text-transform: none; }

#snow { position: fixed; inset: 0; z-index: 30; pointer-events: none; }

/* ── nav ───────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; gap: 28px;
  padding: 14px clamp(16px, 4vw, 52px);
  background: linear-gradient(to bottom, rgba(13, 7, 24, .92), rgba(13, 7, 24, .55));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.crest { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: .12em; color: var(--gold); }
.crest img { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--gold); box-shadow: 0 0 0 3px rgba(232, 194, 106, .15); }
.nav-links { display: flex; gap: 26px; margin-left: auto; font-family: var(--display); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.nav-links a:hover { color: var(--gold); }
.chain-pill { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid var(--line-2); border-radius: 4px; font-size: 12.5px; background: rgba(124, 58, 237, .12); }
.chain-label { color: var(--grape-2); font-weight: 600; }
.dot, .live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex: none; }
.chain-pill.on .dot, .live-dot { background: var(--up); animation: ping 1.8s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(73, 224, 154, .55); } 70%, 100% { box-shadow: 0 0 0 7px rgba(73, 224, 154, 0); } }

/* ── hero ──────────────────────────────────────────────── */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; overflow: hidden; padding: 110px clamp(16px, 6vw, 96px) 80px; }
.hero-bg { position: absolute; inset: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 72% 4%; transform: scale(1.06); animation: drift 30s ease-in-out infinite alternate; }
@keyframes drift { to { transform: scale(1.12) translate(-1.5%, 1%); } }
.hero-veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(13, 7, 24, .96) 0%, rgba(13, 7, 24, .82) 38%, rgba(13, 7, 24, .25) 70%, rgba(13, 7, 24, .1) 100%),
    linear-gradient(to top, var(--bg) 0%, transparent 30%);
}
.hero-inner { position: relative; max-width: 780px; }
.kicker { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--grape-2); }
.pre-title { margin-top: 26px; font-family: var(--serif); font-style: italic; font-weight: 600; font-size: clamp(24px, 3vw, 34px); color: var(--gold); }
.title {
  font-family: var(--display); font-weight: 900; letter-spacing: .04em; line-height: .95;
  font-size: clamp(40px, 7vw, 100px);
  background: linear-gradient(180deg, #fff6d8 0%, var(--gold) 45%, var(--gold-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 30px rgba(184, 134, 43, .35));
}
.motto { margin-top: 22px; font-family: var(--serif); font-style: italic; font-size: clamp(21px, 2.3vw, 27px); line-height: 1.35; color: var(--ink); max-width: 30ch; }
.sub { margin-top: 12px; color: var(--muted); max-width: 46ch; }
.sub strong { color: var(--gold); font-weight: 600; }

.seal-row { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.seal {
  display: flex; flex-direction: column; gap: 4px; min-width: 132px;
  padding: 14px 18px; border: 1px solid var(--line-2); border-radius: 6px;
  background: linear-gradient(160deg, rgba(232, 194, 106, .08), rgba(124, 58, 237, .10));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.seal b { font-size: 22px; font-weight: 600; }
.seal b sub { font-size: .6em; color: var(--muted); }

.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 15px 28px; border-radius: 4px; font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; transition: transform .2s, box-shadow .2s, background .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-gold { color: #241405; background: linear-gradient(180deg, #f7dc93, var(--gold) 50%, var(--gold-2)); box-shadow: 0 10px 34px -10px rgba(232, 194, 106, .7), inset 0 1px 0 rgba(255, 255, 255, .6); }
.btn-line { border: 1px solid var(--line-2); background: rgba(13, 7, 24, .4); }
.btn-line:hover { border-color: var(--gold); }
.btn.soon { cursor: default; pointer-events: none; opacity: .92; }
.arrow { font-size: 1.1em; }

.ca { display: flex; align-items: center; gap: 12px; margin-top: 16px; width: 100%; max-width: 560px; padding: 10px 10px 10px 16px; border: 1px solid var(--line); border-radius: 4px; background: rgba(13, 7, 24, .55); text-align: left; }
.ca:hover { border-color: var(--line-2); }
.ca-text { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy { font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 3px; background: var(--gold-soft); color: var(--gold); }
.copy[hidden] { display: none; }
.ca.copied .copy { background: rgba(73, 224, 154, .18); color: var(--up); }

.hero-badge {
  position: absolute; right: clamp(16px, 5vw, 70px); bottom: 70px;
  width: 150px; height: 150px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 2px;
  border: 2px solid var(--gold); background: radial-gradient(circle, rgba(124, 58, 237, .85), rgba(40, 14, 80, .92));
  box-shadow: 0 0 0 6px rgba(232, 194, 106, .12), 0 20px 50px rgba(0, 0, 0, .5);
  font-size: 12px; line-height: 1.25; color: var(--ink); transform: rotate(-8deg);
}
.hero-badge[hidden] { display: none; }
.hero-badge .mono { font-size: 30px; font-weight: 600; color: var(--gold); }
.scroll-cue { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); color: var(--gold); font-size: 22px; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translate(-50%, 6px); } }

.chg { font-weight: 600; }
.flash-up { animation: fu 1s; }
.flash-down { animation: fd 1s; }
@keyframes fu { 0% { color: var(--up); text-shadow: 0 0 16px var(--up); } }
@keyframes fd { 0% { color: var(--down); text-shadow: 0 0 16px var(--down); } }

/* ── banner ────────────────────────────────────────────── */
.ticker { overflow: hidden; border-block: 1px solid var(--line-2); background: linear-gradient(90deg, #2a1150, #3b1a6e, #2a1150); }
.ticker[hidden] { display: none; }
.ticker-track { display: flex; width: max-content; animation: marquee 46s linear infinite; }
.ticker-track span { padding: 14px 30px; font-family: var(--mono); font-size: 13px; white-space: nowrap; color: var(--muted); }
.ticker-track b { color: var(--ink); margin-left: 6px; }
.ticker-track i { font-style: normal; color: var(--gold); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ── sections ──────────────────────────────────────────── */
.section { max-width: 1240px; margin: 0 auto; padding: 110px clamp(16px, 4vw, 48px) 0; }
.section-head { display: flex; align-items: flex-end; gap: 22px; margin-bottom: 36px; }
.section-head.row { flex-wrap: wrap; }
.section-head.row > div:nth-child(2) { flex: 1; min-width: 240px; }
.numeral { font-family: var(--display); font-weight: 900; font-size: clamp(50px, 6vw, 78px); line-height: .8; letter-spacing: .02em; background: linear-gradient(180deg, #f7dc93, var(--gold-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 3.6vw, 44px); line-height: 1.12; letter-spacing: .02em; margin-top: 8px; }
h2 em { font-size: 1.12em; }
h3 { font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: .06em; }

.stat {
  position: relative; padding: 22px 24px; border-radius: 6px;
  background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: border-color .25s, transform .25s;
}
.stat::before { /* gold corner ornaments */
  content: ""; position: absolute; inset: 6px; border-radius: 3px; pointer-events: none;
  background:
    linear-gradient(var(--gold), var(--gold)) top left / 14px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) top left / 1px 14px no-repeat,
    linear-gradient(var(--gold), var(--gold)) bottom right / 14px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) bottom right / 1px 14px no-repeat;
  opacity: .55;
}
.stat:hover { border-color: var(--line-2); transform: translateY(-2px); }
.stat b { display: block; font-size: clamp(22px, 2.4vw, 28px); font-weight: 600; margin-top: 4px; }
.stat b sub { font-size: .55em; color: var(--muted); }
.stat small { color: var(--muted); font-size: 13px; }

/* treasury */
.treasury { display: grid; grid-template-columns: 1.4fr 1fr 1fr; grid-auto-rows: auto; gap: 14px; }
.ledger { grid-row: span 2; display: flex; flex-direction: column; gap: 6px; background: linear-gradient(160deg, rgba(232, 194, 106, .10), rgba(124, 58, 237, .14)), var(--panel); }
.ledger .big { font-size: clamp(34px, 4vw, 52px); }
.ledger-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.medals { grid-column: 3; grid-row: 2; }
.medal-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px; }
.medal { text-align: center; padding: 12px 6px; border-radius: 50px; border: 1px solid var(--line); background: rgba(13, 7, 24, .45); }
.medal b { font-size: 17px; margin-top: 2px; }
.morale { grid-column: 1 / -1; }
.morale-head { display: flex; justify-content: space-between; align-items: center; }
.pressure { height: 12px; border-radius: 2px; background: rgba(255, 107, 138, .5); overflow: hidden; margin: 14px 0 10px; border: 1px solid var(--line); }
.pressure-buy { height: 100%; width: 50%; background: repeating-linear-gradient(135deg, #2bbf7a 0 10px, var(--up) 10px 20px); transition: width .8s ease; }
.source { margin-top: 16px; font-size: 12px; color: var(--dim); }

/* campaign */
.tabs { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); }
.tabs button { padding: 8px 16px; border-radius: 3px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.tabs button:hover { color: var(--ink); }
.tabs button.on { background: var(--gold); color: #241405; font-weight: 600; }
.chart-card { position: relative; height: clamp(320px, 52vh, 520px); border-radius: 6px; border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
#chart-el { position: absolute; inset: 12px; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 20px; pointer-events: none; }

/* dispatches */
.live-badge { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--muted); padding: 8px 14px; border: 1px solid var(--line); border-radius: 4px; }
.trades { border: 1px solid var(--line); border-radius: 6px; background: var(--panel); overflow: hidden; }
.trade { display: grid; grid-template-columns: 90px 1.3fr 1fr 1fr 80px; gap: 12px; align-items: center; padding: 13px 22px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 13.5px; }
.trade:last-child { border-bottom: 0; }
.trade-head { font-family: var(--display); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); background: rgba(232, 194, 106, .06); }
.trade a:hover { color: var(--gold); text-decoration: underline; }
.trade .t-time, .trade-head span:last-child { text-align: right; color: var(--muted); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 2px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.pill.buy { background: rgba(73, 224, 154, .14); color: var(--up); }
.pill.sell { background: rgba(255, 107, 138, .14); color: var(--down); }
.trade.new { animation: slide .8s ease-out; }
@keyframes slide { from { background: rgba(232, 194, 106, .16); transform: translateX(-8px); opacity: 0; } }
.trade-empty { padding: 36px; text-align: center; color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 19px; }

/* legend timeline */
.timeline { list-style: none; position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding-top: 34px; }
.timeline::before { content: ""; position: absolute; top: 9px; left: 4%; right: 4%; height: 2px; background: linear-gradient(90deg, var(--gold-2), var(--gold), var(--grape-2)); }
.timeline li::after { content: ""; position: absolute; top: -31px; left: 24px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--gold); }
.timeline li.now::after { background: var(--grape); border-color: var(--grape-2); box-shadow: 0 0 16px var(--grape); }
.year { font-family: var(--display); font-weight: 900; font-size: 30px; color: var(--gold); }
.timeline h3 { margin: 6px 0 8px; }
.timeline p { color: var(--muted); font-size: 14.5px; }
.timeline .now { border-color: rgba(183, 139, 255, .45); background: linear-gradient(160deg, rgba(124, 58, 237, .25), rgba(28, 16, 48, .7)); }

/* enlist */
.enlist { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
.orders { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.orders li { display: flex; gap: 18px; align-items: flex-start; }
.order-n { font-family: var(--display); font-weight: 900; font-size: 26px; color: var(--gold); min-width: 46px; }
.orders p { color: var(--muted); font-size: 14.5px; margin-top: 4px; }
.marengo { display: flex; flex-direction: column; gap: 18px; align-items: center; text-align: center; justify-content: center; }
.marengo img { width: 170px; height: 170px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); box-shadow: 0 0 0 6px rgba(232, 194, 106, .12), 0 0 40px rgba(124, 58, 237, .45); }
.quote { font-family: var(--serif); font-style: italic; font-size: 24px; line-height: 1.3; }
.who { margin-top: 8px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.final-cta { display: flex; align-items: center; gap: 22px; margin-top: 16px; padding: 24px 28px; background: linear-gradient(110deg, rgba(124, 58, 237, .28), rgba(232, 194, 106, .10)), var(--panel); }
.final-cta > div { flex: 1; min-width: 0; }
.final-icon { width: 64px; height: 64px; border-radius: 50%; border: 1.5px solid var(--gold); }
.final-ca { color: var(--muted); font-size: 13px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; }

/* footer */
.footer { max-width: 1240px; margin: 120px auto 0; padding: 40px clamp(16px, 4vw, 48px) 52px; border-top: 1px solid var(--line); color: var(--dim); font-size: 13px; }
.footer p { max-width: 82ch; }
.footer-motto { font-family: var(--display); font-weight: 900; letter-spacing: .2em; font-size: 22px; color: var(--gold); margin-bottom: 14px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.footer-links a { padding: 8px 14px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 13.5px; }
.footer-links a:hover { color: var(--gold); border-color: var(--line-2); }

.toast { position: fixed; left: 50%; bottom: 26px; z-index: 50; transform: translate(-50%, 20px); opacity: 0; padding: 12px 18px; border-radius: 4px; background: #24123f; border: 1px solid var(--line-2); font-size: 14px; transition: .3s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ── responsive ────────────────────────────────────────── */
@media (max-width: 1000px) {
  .nav-links { display: none; }
  .chain-pill { margin-left: auto; }
  .treasury { grid-template-columns: 1fr 1fr; }
  .ledger { grid-column: 1 / -1; grid-row: auto; }
  .medals { grid-column: 1 / -1; grid-row: auto; }
  .medals .medal-row { grid-template-columns: repeat(4, 1fr); }
  .timeline { grid-template-columns: 1fr 1fr; }
  .timeline::before { display: none; }
  .timeline li::after { display: none; }
  .enlist { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hero { align-items: flex-end; padding-top: 90px; min-height: 100svh; }
  .hero-bg img { object-position: 64% 0%; }
  .hero-veil { background: linear-gradient(to top, rgba(13, 7, 24, .98) 0%, rgba(13, 7, 24, .9) 45%, rgba(13, 7, 24, .25) 80%, rgba(13, 7, 24, .1) 100%); }
  .hero-badge { top: 86px; bottom: auto; right: 14px; width: 110px; height: 110px; font-size: 10.5px; }
  .hero-badge .mono { font-size: 22px; }
  .seal { min-width: 0; flex: 1 1 30%; padding: 12px; }
  .seal b { font-size: 17px; }
  .chain-label { display: none; }
  .section-head { gap: 14px; }
  .treasury { grid-template-columns: 1fr; }
  .ledger-row { grid-template-columns: 1fr; }
  .medals .medal-row { grid-template-columns: repeat(2, 1fr); }
  .timeline { grid-template-columns: 1fr; }
  .trade { grid-template-columns: 62px 1fr 76px 52px; padding: 12px 14px; font-size: 12.5px; }
  .trade > :nth-child(4) { display: none; }
  .final-cta { flex-direction: column; align-items: flex-start; }
  .crest span { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  #snow { display: none; }
}
