/* ─────────────────────────────────────────────────────────────
   SATOSHI•NAKAMOTO: design system
   Night Node (default) · Whitepaper (light)
   ───────────────────────────────────────────────────────────── */

:root {
  --orange: #F7931A;
  --orange-hot: #FF6A1A;
  --orange-soft: rgba(247, 147, 26, .14);
  --orange-line: rgba(247, 147, 26, .38);
  --laser: #FF3B1F;
  --up: #3DDC84;
  --down: #FF5C5C;

  --bg: #0B0A09;
  --bg-2: #121110;
  --bg-3: #1A1816;
  --bg-4: #23201D;
  --ink: #F3EEE6;
  --ink-2: #BDB5AA;
  --ink-3: #847C71;
  --line: rgba(255, 240, 220, .08);
  --line-2: rgba(255, 240, 220, .15);
  --accent-ink: #F7931A;      /* orange used as text */
  --on-orange: #0B0A09;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 20px 50px -20px rgba(0,0,0,.6);
  --grid-dot: rgba(255, 240, 220, .06);

  --font-display: 'Anton', 'Impact', 'Arial Narrow', sans-serif;
  --font-serif: 'Instrument Serif', 'Times New Roman', Georgia, serif;
  --font-sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --radius: 12px;
  --radius-sm: 8px;
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 64px;
  --ticker-h: 34px;
  color-scheme: dark;
}

:root[data-theme="paper"] {
  --bg: #F3EEE3;
  --bg-2: #ECE5D7;
  --bg-3: #E4DBCA;
  --bg-4: #D9CEBA;
  --ink: #15130F;
  --ink-2: #4B453C;
  --ink-3: #7A7265;
  --line: rgba(21, 19, 15, .10);
  --line-2: rgba(21, 19, 15, .20);
  --accent-ink: #A85A00;
  --orange-soft: rgba(247, 147, 26, .18);
  --shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 18px 40px -24px rgba(60,40,10,.35);
  --grid-dot: rgba(21, 19, 15, .07);
  color-scheme: light;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .3s ease, color .3s ease;
}
img, svg, canvas, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
::selection { background: var(--orange); color: var(--on-orange); }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 4px; }

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

/* ── Layout ────────────────────────────────────────────────── */
.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(72px, 11vw, 140px) 0; position: relative; }
.section + .section { border-top: 1px solid var(--line); }
.grid { display: grid; gap: 16px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.center { text-align: center; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Type ──────────────────────────────────────────────────── */
.display { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; letter-spacing: .005em; line-height: .9; }
.serif { font-family: var(--font-serif); font-weight: 400; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.accent { color: var(--accent-ink); }
.up { color: var(--up); }
.down { color: var(--down); }

.eyebrow {
  display: flex; align-items: center; gap: 12px;
  font: 500 12px/1 var(--font-mono);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow b { color: var(--accent-ink); font-weight: 600; }
.eyebrow::after { content: ''; flex: 1; height: 1px; background: var(--line-2); max-width: 120px; }
.center .eyebrow { justify-content: center; }
.center .eyebrow::before { content: ''; flex: 1; height: 1px; background: var(--line-2); max-width: 120px; }

.sec-head { max-width: 860px; margin-bottom: clamp(40px, 6vw, 64px); }
.sec-head.center { margin-left: auto; margin-right: auto; }
.sec-title {
  font-family: var(--font-display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(40px, 7.2vw, 92px); line-height: .92; letter-spacing: .003em;
  margin-top: 20px;
}
.sec-title em, .hero-title em {
  font-family: var(--font-serif); font-style: italic; text-transform: none;
  color: var(--accent-ink); letter-spacing: -.01em; font-size: 1.08em; line-height: .8;
}
.sec-lede { margin-top: 22px; font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); max-width: 680px; }
.center .sec-lede { margin-left: auto; margin-right: auto; }

/* ── Buttons & chips ───────────────────────────────────────── */
.btn {
  --b-bg: transparent; --b-fg: var(--ink); --b-bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  background: var(--b-bg); color: var(--b-fg); border: 1px solid var(--b-bd);
  border-radius: 999px;
  font: 600 13px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease;
  white-space: nowrap; user-select: none;
}
.btn:hover { transform: translateY(-2px); border-color: var(--ink-3); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { --b-bg: var(--orange); --b-fg: var(--on-orange); --b-bd: var(--orange); box-shadow: 0 0 0 0 rgba(247,147,26,.0), 0 10px 30px -10px rgba(247,147,26,.6); }
.btn-primary:hover { border-color: var(--orange); box-shadow: 0 0 0 6px var(--orange-soft), 0 14px 34px -10px rgba(247,147,26,.7); }
.btn-ghost { --b-bd: transparent; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 11px; }
.btn[disabled], .btn.is-soon { opacity: .45; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 999px;
  font: 500 12px/1 var(--font-mono); letter-spacing: .04em; color: var(--ink-2);
  background: var(--bg-2);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px rgba(61,220,132,.18); }
.chip .dot.off { background: var(--ink-3); box-shadow: none; }

.copy-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0 6px 0 16px; min-height: 44px;
  border: 1px dashed var(--orange-line); border-radius: 999px;
  background: var(--orange-soft);
  font: 600 14px/1 var(--font-mono); color: var(--ink); cursor: pointer;
  transition: background-color .2s, transform .15s;
}
.copy-chip:hover { background: rgba(247,147,26,.22); }
.copy-chip .lbl { color: var(--ink-3); font-weight: 500; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.copy-chip .ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--orange); color: var(--on-orange); }
.copy-chip .ico svg { width: 14px; height: 14px; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(18px, 2.4vw, 28px); position: relative;
  box-shadow: var(--shadow);
}
.card-title { font: 600 12px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.card h3 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }

/* ── Forms ─────────────────────────────────────────────────── */
.field { display: grid; gap: 8px; }
.field > span, .label { font: 500 11px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.input, .select, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 14px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  color: var(--ink); font: 500 15px/1.3 var(--font-mono);
  transition: border-color .2s, box-shadow .2s;
}
.input:focus, .select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft); }
.input::placeholder { color: var(--ink-3); }
textarea.input { min-height: 88px; resize: vertical; }
input[type="range"] { width: 100%; accent-color: var(--orange); }
input[type="color"] { width: 46px; height: 46px; padding: 4px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--bg); }

.tabs { display: inline-flex; padding: 4px; gap: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; flex-wrap: wrap; }
.tab {
  padding: 10px 18px; border: 0; border-radius: 999px; background: transparent;
  font: 600 12px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2);
  transition: background-color .2s, color .2s;
}
.tab[aria-selected="true"] { background: var(--orange); color: var(--on-orange); }
.tab:not([aria-selected="true"]):hover { color: var(--ink); background: var(--bg-3); }

/* ── Ticker ────────────────────────────────────────────────── */
.ticker {
  height: var(--ticker-h); overflow: hidden; position: relative; z-index: 60;
  background: var(--orange); color: var(--on-orange);
  font: 600 12px/var(--ticker-h) var(--font-mono); letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap;
}
.ticker-track { display: inline-flex; animation: marquee 60s linear infinite; will-change: transform; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: center; gap: 8px; padding: 0 22px; }
.ticker-item::after { content: '•'; margin-left: 22px; opacity: .5; }
.ticker-item .k { opacity: .6; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ── Header ────────────────────────────────────────────────── */
#site-header { min-height: calc(var(--header-h) + var(--ticker-h)); }
.header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header .wrap { height: 100%; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.brand-mark { width: 34px; height: 34px; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.brand:hover .brand-mark { transform: rotate(-20deg) scale(1.06); }
.brand-name { font: 400 21px/1 var(--font-display); letter-spacing: .02em; }
.brand-name i { font-style: normal; color: var(--accent-ink); }

.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav a {
  padding: 9px 12px; border-radius: 999px; text-decoration: none;
  font: 500 13px/1 var(--font-mono); letter-spacing: .04em; color: var(--ink-2);
  transition: color .2s, background-color .2s;
}
.nav a:hover { color: var(--ink); background: var(--bg-3); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--bg-3); }
.nav a[aria-current="page"]::before { content: '•'; color: var(--orange); margin-right: 6px; }

.header-tools { display: flex; align-items: center; gap: 8px; }
.price-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; height: 36px;
  border: 1px solid var(--line-2); border-radius: 999px; text-decoration: none;
  font: 600 12px/1 var(--font-mono); white-space: nowrap;
}
.price-pill .sym { color: var(--accent-ink); font-size: 14px; }
.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  border: 1px solid var(--line-2); border-radius: 50%; background: transparent; color: var(--ink);
  transition: background-color .2s, transform .2s;
}
.icon-btn:hover { background: var(--bg-3); }
.icon-btn svg { width: 17px; height: 17px; }
.menu-btn { display: none; }

@media (max-width: 1080px) {
  .price-pill { display: none; }
}
@media (max-width: 920px) {
  .menu-btn { display: grid; }
  .nav {
    position: fixed; inset: calc(var(--header-h)) 0 auto 0; z-index: 49;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 12px var(--gutter) 24px; margin: 0;
    background: var(--bg); border-bottom: 1px solid var(--line-2);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav.open { transform: none; opacity: 1; visibility: visible; }
  .nav a { padding: 16px 4px; font-size: 16px; border-radius: 0; border-bottom: 1px solid var(--line); }
  .header-tools { margin-left: auto; }
}
@media (max-width: 420px) {
  .brand-name { font-size: 18px; }
}

/* ── Footer ────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--line); padding: 64px 0 40px; background: var(--bg-2); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; }
.footer h4 { font: 600 11px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 16px; }
.footer ul { list-style: none; display: grid; gap: 10px; }
.footer a { color: var(--ink-2); text-decoration: none; font-size: 14px; }
.footer a:hover { color: var(--accent-ink); }
.footer .soon { color: var(--ink-3); font-size: 14px; }
.footer .soon::after { content: ' · soon'; font: 500 10px var(--font-mono); text-transform: uppercase; letter-spacing: .1em; }
.footer-quote { font: italic 22px/1.3 var(--font-serif); color: var(--ink-2); max-width: 380px; margin-top: 18px; }
.disclaimer { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 1.7; color: var(--ink-3); }
.disclaimer p + p { margin-top: 8px; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ── Toast ─────────────────────────────────────────────────── */
#toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 200;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 12px 20px; border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font: 600 13px/1 var(--font-mono); letter-spacing: .04em;
  box-shadow: 0 16px 40px -12px rgba(0,0,0,.5);
  transition: opacity .25s, transform .25s;
  max-width: calc(100vw - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Reveal ────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: .08s; } .reveal-d2 { transition-delay: .16s; } .reveal-d3 { transition-delay: .24s; }

/* ── Decorative ────────────────────────────────────────────── */
.dotgrid {
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px);
  background-size: 22px 22px;
}
.glyph { display: inline-block; width: 1em; height: 1em; vertical-align: -.12em; }
.glyph svg { width: 100%; height: 100%; }

/* Konami laser mode */
body.laser-mode .eyes circle { fill: var(--laser) !important; }
body.laser-mode .beams { opacity: 1 !important; }
body.laser-mode .brand-mark { filter: drop-shadow(0 0 10px var(--laser)); }

/* Page hero for inner pages */
.page-hero { padding: clamp(56px, 9vw, 110px) 0 clamp(32px, 5vw, 56px); position: relative; overflow: hidden; }
.page-hero h1 { font-size: clamp(54px, 10vw, 140px); margin-top: 18px; }
.page-hero p:not(.eyebrow) { margin-top: 18px; font-size: clamp(17px, 1.6vw, 20px); color: var(--ink-2); max-width: 640px; }

/* ── Runestone viewer (shared) ─────────────────────────────── */
.rs { --c0:#F7931A; --c1:#FFC247; --c2:#3DDC84; --c3:#4FC3F7; --c4:#B388FF; --c5:#FF6FA8; --c6:#9BE15D; --c7:#FF7A59; --cx: var(--ink-3); }
:root[data-theme="paper"] .rs { --c0:#C46A00; --c1:#A67C00; --c2:#138A4B; --c3:#0A7BB0; --c4:#6B44C9; --c5:#C2306E; --c6:#4E8A12; --c7:#C24A2A; }
.rs .c-0 { --c: var(--c0); } .rs .c-1 { --c: var(--c1); } .rs .c-2 { --c: var(--c2); } .rs .c-3 { --c: var(--c3); }
.rs .c-4 { --c: var(--c4); } .rs .c-5 { --c: var(--c5); } .rs .c-6 { --c: var(--c6); } .rs .c-7 { --c: var(--c7); }
.rs .c-x { --c: var(--cx); } .rs .c-u { --c: var(--ink-3); }
.rs-hex { display: flex; flex-wrap: wrap; gap: 5px; padding: 18px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.rs-b {
  display: inline-grid; place-items: center; min-width: 2.6em; height: 2.2em; padding: 0 4px; border-radius: 5px;
  font-size: clamp(12px, 1.3vw, 15px); font-weight: 600; letter-spacing: .02em;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent);
  transition: opacity .15s, transform .15s, background-color .15s;
  cursor: default;
}
.rs.has-focus .rs-b:not(.is-on) { opacity: .22; }
.rs-b.is-on { background: color-mix(in srgb, var(--c) 30%, transparent); transform: translateY(-2px); }
.rs-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 2px 18px; font-size: 12px; color: var(--ink-3); }
.rs-meta .ok { color: var(--up); } .rs-meta .bad { color: var(--down); }
.rs-legend { display: grid; gap: 4px; }
.rs-row {
  display: grid; grid-template-columns: 14px minmax(140px, .9fr) minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: 14px;
  width: 100%; padding: 11px 14px; text-align: left; background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm);
  transition: background-color .15s, border-color .15s, opacity .15s;
}
.rs-row:hover, .rs-row.is-on { background: var(--bg-3); border-color: var(--line); }
.rs.has-focus .rs-row:not(.is-on) { opacity: .45; }
.rs-sw { width: 14px; height: 14px; border-radius: 4px; background: var(--c); }
.rs-name { font-weight: 600; font-size: 14.5px; display: flex; align-items: baseline; gap: 8px; }
.rs-tag { font-size: 10.5px; font-weight: 500; color: var(--ink-3); letter-spacing: .04em; }
.rs-val { font-size: 14.5px; color: var(--ink); word-break: break-word; }
.rs-raw { font-size: 12px; color: var(--ink-3); word-break: break-all; text-align: right; }
.rs-row.k-prefix .rs-name, .rs-row.k-prefix .rs-val { color: var(--ink-2); font-weight: 500; }
@media (max-width: 700px) {
  .rs-row { grid-template-columns: 14px 1fr; gap: 4px 12px; }
  .rs-val, .rs-raw { grid-column: 2; text-align: left; }
}
