/* Downline: a temple ledger. Obsidian and basalt, papyrus text, gold for the asset, verdigris for what burns. */
:root {
  color-scheme: dark;
  --bg: #0a0807;
  --panel: #14100c;
  --panel-2: #1b1610;
  --line: #2e2619;
  --line-hi: #5a4a2a;
  --ink: #e9dcbf;
  --muted: #a3927a;
  --dim: #6b5e4c;
  --gold: #d4a94a;
  --gold-hi: #f0cc6f;
  --gold-dim: rgba(212, 169, 74, 0.12);
  --verdigris: #5fb59a;
  --verdigris-hi: #8bd9bf;
  --oxblood: #a83a3a;
  --lapis: #5b7fc7;
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --sans: "EB Garamond", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --glyph: "Noto Sans Egyptian Hieroglyphs", "Noto Sans Symbols 2", serif;
  --r: 2px;
}
* { box-sizing: border-box; }
/* The page background lives on html (the canvas); body stays transparent so the fixed wall shows through it.
   A block's own background paints above negative-z-index children, so an opaque body would hide the wall. */
html { margin: 0; color: var(--ink); background: var(--bg)
  url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.9 0 0 0 0 0.8 0 0 0 0 0.6 0 0 0 0.045 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
body { margin: 0; background: transparent; font: 17px/1.6 var(--sans); min-height: 100vh; display: flex; flex-direction: column; position: relative; }
main { flex: 1; width: 100%; }
/* The wall: the hieroglyph clip behind everything, dimmed so the ledger stays readable. */
.wall { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg) url("/assets/bg.jpg") center/cover no-repeat; }
.wall video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.6s ease; }
.wall video.on { opacity: 1; }
.wall::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 8, 7, 0.55), rgba(10, 8, 7, 0.74) 45%, rgba(10, 8, 7, 0.9)),
    radial-gradient(900px 420px at 50% -80px, rgba(212, 169, 74, 0.10), transparent 65%); }
.top { background: rgba(10, 8, 7, 0.82); }
.panel { background: rgba(20, 16, 12, 0.92); }
.foot { background: rgba(10, 8, 7, 0.6); }
@media (prefers-reduced-motion: reduce) { .wall video { display: none; } }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hi); text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 0.92em; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.1; margin: 0; letter-spacing: 0.02em; }
h1 { font-size: clamp(2.2rem, 6.2vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); }
h3 { font-size: 1.05rem; }
.kicker { font: 500 11px/1 var(--mono); letter-spacing: 0.32em; text-transform: uppercase; color: var(--gold); }
.kicker::before { content: "◈ "; color: var(--dim); }

/* glyphs */
.glyph { font-family: var(--glyph); font-weight: 400; }
.frieze { font-family: var(--glyph); color: var(--line-hi); letter-spacing: 0.9em; white-space: nowrap; overflow: hidden; text-align: center; user-select: none; font-size: 15px; line-height: 1; opacity: 0.85; }
.frieze.faint { opacity: 0.45; }
.rule { display: flex; align-items: center; gap: 14px; color: var(--dim); font-family: var(--glyph); font-size: 14px; margin: 28px 0; }
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line-hi), transparent); }
.sigil { display: block; }
.sigil .ring { fill: none; stroke: var(--gold); stroke-width: 1.2; }
.sigil .ring.dim { stroke: var(--line-hi); }
.sigil .fill { fill: var(--gold); }
.sigil .verd { stroke: var(--verdigris); fill: none; stroke-width: 1.2; }

/* header / footer */
.top { border-bottom: 1px solid var(--line); background: rgba(10, 8, 7, 0.92); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(8px); }
.top .wrap { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font: 700 1.15rem var(--display); letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; }
.brand:hover { text-decoration: none; color: var(--gold-hi); }
.brand small { font: 500 9px var(--mono); letter-spacing: 0.3em; color: var(--muted); }
.nav { display: flex; gap: 22px; flex: 1; }
.nav a { color: var(--muted); font-family: var(--display); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; }
.nav a.active, .nav a:hover { color: var(--gold); text-decoration: none; }
.foot { border-top: 1px solid var(--line); margin-top: 72px; padding: 32px 0 40px; color: var(--muted); font-size: 15px; }
.foot p { max-width: 720px; margin: 10px 0 0; }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-hi); background: var(--panel-2); color: var(--ink);
  font: 600 12px var(--display); letter-spacing: 0.14em; text-transform: uppercase; padding: 11px 18px; border-radius: var(--r); cursor: pointer; white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5); }
.btn:hover { border-color: var(--gold); color: var(--gold-hi); text-decoration: none; }
.btn.go { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); border-color: var(--gold); color: #1a1206; }
.btn.go:hover { background: linear-gradient(180deg, #ffe08a, var(--gold-hi)); color: #1a1206; }
.btn.sm { padding: 8px 13px; font-size: 11px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
input, textarea, select { width: 100%; background: var(--bg); border: 1px solid var(--line-hi); color: var(--ink); border-radius: var(--r);
  padding: 10px 12px; font: 17px var(--sans); }
input:focus, textarea:focus, select:focus { outline: 1px solid var(--gold); border-color: var(--gold); }
label { display: block; font: 500 11px var(--mono); letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin: 18px 0 6px; }

/* panels: carved slabs */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; position: relative;
  box-shadow: inset 0 1px 0 rgba(233, 220, 191, 0.04), 0 10px 30px rgba(0, 0, 0, 0.35); }
.panel::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--line); pointer-events: none; opacity: 0.6; }
.panel.lit { border-color: var(--line-hi); background: linear-gradient(180deg, var(--gold-dim), transparent 55%), var(--panel); }
.panel.lit::before { border-color: var(--line-hi); }
.panel.plain::before { display: none; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stat .label { font: 500 10px var(--mono); letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); }
.stat .value { font: 600 1.5rem var(--display); margin-top: 8px; color: var(--gold-hi); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.stat .sub { color: var(--dim); font-size: 13px; margin-top: 2px; }

/* hero */
.hero { padding: 56px 0 28px; text-align: center; }
.hero p.lede { font-size: 1.2rem; color: var(--muted); max-width: 640px; margin: 18px auto 0; font-style: italic; text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8); }
.hero h1 { text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7); }
.hero .kicker { display: block; }
.chain { font: 500 12px var(--mono); letter-spacing: 0.1em; color: var(--muted); margin: 26px auto 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; }
.chain b { color: var(--ink); font-weight: 600; padding: 6px 12px; border: 1px solid var(--line-hi); border-radius: var(--r); background: var(--panel); font-family: var(--display); font-size: 12px; letter-spacing: 0.16em; }
.chain b.main { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 18px rgba(212, 169, 74, 0.18); }
.chain i { color: var(--dim); font-style: normal; font-family: var(--glyph); }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font: 500 10px var(--mono); letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line-hi); }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td.r, th.r { text-align: right; }
tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }
.rank { font: 600 0.85rem var(--display); color: var(--dim); width: 44px; }

/* coin rows */
.coin { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); }
.coin:hover { text-decoration: none; color: var(--gold-hi); }
.coin img, .coin .ph { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; background: var(--panel-2); border: 1px solid var(--line-hi); }
.coin .ph { display: grid; place-items: center; font: 700 11px var(--mono); color: var(--muted); }
.coin .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--display); font-size: 14px; letter-spacing: 0.04em; }
.coin .sym { color: var(--muted); font: 12px var(--mono); }
.tag { display: inline-block; font: 600 10px var(--mono); letter-spacing: 0.22em; text-transform: uppercase; padding: 4px 8px; border: 1px solid var(--line-hi); border-radius: var(--r); color: var(--muted); }
.tag.main { color: var(--gold); border-color: var(--gold); }
.tag.child { color: var(--verdigris); border-color: rgba(95, 181, 154, 0.5); }
.tag.grad { color: var(--lapis); border-color: rgba(91, 127, 199, 0.5); }

/* split bar */
.splitbar { display: flex; height: 8px; border-radius: 2px; overflow: hidden; margin: 14px 0 10px; background: var(--panel-2); border: 1px solid var(--line); }
.splitbar i { display: block; height: 100%; }
.legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; font-size: 14px; }
.legend span { display: flex; gap: 8px; align-items: center; }
.sw { width: 18px; text-align: center; flex: none; font-family: var(--glyph); font-size: 14px; }
.progress { height: 5px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-hi)); }

/* launch */
.mode { padding: 20px; }
.mode h3 { margin-top: 8px; }
.mode p { color: var(--muted); font-size: 15px; margin: 8px 0 0; }
.drop { border: 1px dashed var(--line-hi); border-radius: var(--r); padding: 18px; display: flex; gap: 14px; align-items: center; cursor: pointer; background: var(--bg); }
.drop.over { border-color: var(--gold); }
.thumb { width: 64px; height: 64px; border-radius: 50%; background: var(--panel-2) center/cover; flex: none; border: 1px solid var(--line-hi); }

/* steps */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 6px; }
.steps li { font: 14px var(--mono); color: var(--muted); display: flex; gap: 10px; align-items: baseline; }
.steps li::before { counter-increment: s; content: counter(s, upper-roman); color: var(--dim); font-family: var(--display); font-size: 12px; min-width: 24px; }
.steps li.ok { color: var(--verdigris); }
.steps li.err { color: var(--oxblood); }

/* misc */
.notice { border-left: 2px solid var(--gold); padding: 10px 14px; background: var(--panel); color: var(--muted); font-size: 15px; font-style: italic; }
.empty { color: var(--dim); padding: 24px 0; text-align: center; font-style: italic; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.section { margin-top: 52px; }
.section > .head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.section > .head h2::before { content: "𓏏 "; font-family: var(--glyph); color: var(--line-hi); font-weight: 400; font-size: 0.8em; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 50; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--panel-2); border: 1px solid var(--line-hi); border-left: 3px solid var(--verdigris); padding: 10px 14px; border-radius: var(--r); font-size: 15px; }
.toast.err { border-left-color: var(--oxblood); }
.wmenu { position: absolute; right: 0; top: 46px; background: var(--panel-2); border: 1px solid var(--line-hi); border-radius: var(--r); padding: 6px; display: grid; min-width: 180px; z-index: 30; }
.wmenu button, .wmenu a { background: none; border: 0; color: var(--ink); text-align: left; padding: 8px 10px; font: 15px var(--sans); cursor: pointer; border-radius: 3px; }
.wmenu button:hover, .wmenu a:hover { background: var(--panel); text-decoration: none; }
.wallet-wrap { position: relative; }

@media (max-width: 720px) {
  .nav { display: none; }
  .top .wrap { gap: 10px; }
  .hide-sm { display: none !important; }
  .hero { padding: 36px 0 24px; }
  td, th { padding: 8px 6px; }
  .frieze { letter-spacing: 0.5em; font-size: 13px; }
}

.hide-desk { display: none; }
@media (max-width: 720px) { .hide-desk { display: block; } }
.coinhead { display: flex; align-items: center; gap: 18px; margin-top: 14px; min-width: 0; justify-content: center; text-align: left; }
.coinhead .big { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex: none; background: var(--panel-2); border: 1px solid var(--gold);
  display: grid; place-items: center; font: 700 1.2rem var(--mono); color: var(--muted); box-shadow: 0 0 28px rgba(212, 169, 74, 0.18); }
.coinhead h1 { overflow-wrap: anywhere; font-size: clamp(1.8rem, 5vw, 3rem); }
.coinhead .sym { font: 500 1rem var(--mono); color: var(--muted); margin-top: 6px; }

/* tablets (rules) */
.tablet { margin-top: 36px; }
.tablet .no { font: 700 2.4rem var(--display); color: var(--line-hi); line-height: 1; }
.tablet h2 { margin: 6px 0 12px; }
.tablet h2::before { display: none; }
.tablet p, .tablet li { color: var(--muted); max-width: 760px; }
.tablet b { color: var(--ink); font-weight: 600; }
.tablet ol, .tablet ul { padding-left: 22px; }
.tablet li { margin: 6px 0; }
