:root {
  --bg: #05060a;
  --bg2: #0b0e18;
  --panel: rgba(14, 20, 36, 0.72);
  --line: rgba(0, 255, 225, 0.18);
  --cyan: #00ffe1;
  --magenta: #ff2bd6;
  --red: #ff3355;
  --gold: #ffd36b;
  --text: #d9f7ff;
  --muted: #7d93a8;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --display: "Orbitron", "JetBrains Mono", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(ellipse at top, #111a33 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--cyan); }
code { color: var(--magenta); }
s { color: var(--muted); }
em { color: var(--magenta); font-style: normal; }
strong { color: #fff; }

/* Background FX */
#matrix { position: fixed; inset: 0; z-index: -1; opacity: 0.16; }
.scanlines {
  pointer-events: none; position: fixed; inset: 0; z-index: 50;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(0,0,0,0.18) 3px);
  mix-blend-mode: multiply;
}

/* Ticker */
.ticker {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center;
  background: #000; border-bottom: 1px solid var(--line); font-size: 13px; height: 32px;
}
.ticker-label { flex: none; padding: 0 12px; color: var(--red); font-weight: 700; letter-spacing: .08em; animation: blink 1.4s infinite; }
.ticker-track { overflow: hidden; flex: 1; white-space: nowrap; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker-inner { display: inline-block; padding-left: 100%; animation: scroll 60s linear infinite; color: var(--cyan); }
.ticker-inner b { color: var(--gold); }
.ticker-inner .sep { color: var(--magenta); margin: 0 18px; }
@keyframes scroll { to { transform: translateX(-100%); } }
@keyframes blink { 50% { opacity: .35; } }

/* Nav */
.nav {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  max-width: 1120px; margin: 0 auto; padding: 18px 16px;
}
.logo { font-family: var(--display); font-weight: 900; font-size: 22px; letter-spacing: .12em; color: #fff; text-decoration: none; text-shadow: 0 0 12px var(--cyan); }
.logo span { color: var(--magenta); text-shadow: 0 0 12px var(--magenta); }
.nav nav { display: flex; gap: 18px; flex-wrap: wrap; }
.nav nav a { color: var(--muted); text-decoration: none; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.nav nav a:hover { color: var(--cyan); }

/* Hero */
.hero { max-width: 1000px; margin: 0 auto; padding: 24px 16px 64px; text-align: center; }
.kicker { color: var(--magenta); letter-spacing: .25em; font-size: 12px; margin: 24px 0 8px; }
h1 {
  font-family: var(--display); font-weight: 900; font-size: clamp(32px, 7vw, 76px); line-height: 1.05;
  margin: 0 0 18px; color: #fff; text-shadow: 0 0 18px rgba(0,255,225,.6), 0 0 48px rgba(255,43,214,.35);
}
.sub { font-weight: 400; font-size: clamp(16px, 2.2vw, 21px); color: var(--text); max-width: 760px; margin: 0 auto 28px; }

/* Glitch */
.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.glitch::before { color: var(--magenta); transform: translate(2px, 0); clip-path: inset(0 0 60% 0); animation: glitch 3.2s infinite steps(1); opacity: .8; }
.glitch::after { color: var(--cyan); transform: translate(-2px, 0); clip-path: inset(55% 0 0 0); animation: glitch 2.7s infinite reverse steps(1); opacity: .8; }
@keyframes glitch {
  0%, 88%, 100% { transform: translate(0, 0); clip-path: inset(0 0 100% 0); }
  90% { transform: translate(-4px, 1px); clip-path: inset(10% 0 55% 0); }
  93% { transform: translate(4px, -1px); clip-path: inset(60% 0 12% 0); }
  96% { transform: translate(-2px, 0); clip-path: inset(35% 0 40% 0); }
}

/* Eye */
.eye { position: relative; width: 190px; height: 190px; margin: 8px auto 4px; }
.eye-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px dashed rgba(0,255,225,.45); animation: spin 22s linear infinite; }
.eye-ring.r2 { inset: 16px; border: 1px solid rgba(255,43,214,.5); border-left-color: transparent; border-right-color: transparent; animation-duration: 9s; animation-direction: reverse; }
.eye-iris {
  position: absolute; inset: 38px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #fff 0 6%, var(--red) 12%, #8a0020 34%, #1a0006 62%, #000 70%);
  box-shadow: 0 0 40px rgba(255,51,85,.8), 0 0 120px rgba(255,51,85,.35), inset 0 0 30px #000;
  animation: pulse 3.5s ease-in-out infinite;
}
.eye-pupil {
  position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%;
  background: #000; box-shadow: 0 0 0 3px rgba(255,255,255,.08); transition: transform .12s ease-out;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { box-shadow: 0 0 60px rgba(255,51,85,1), 0 0 160px rgba(255,51,85,.5), inset 0 0 30px #000; } }

/* Terminal */
.terminal {
  max-width: 620px; margin: 0 auto 28px; padding: 14px 18px; min-height: 108px; text-align: left;
  background: rgba(0,0,0,.6); border: 1px solid var(--line); border-radius: 6px; font-size: 14px; color: var(--cyan);
  box-shadow: inset 0 0 24px rgba(0,255,225,.08);
}
.terminal .line { white-space: pre-wrap; }
.terminal .warn { color: var(--red); }
.terminal .ok { color: #7dff9b; }
.cursor { display: inline-block; width: 8px; height: 1em; background: var(--cyan); vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }

/* Buttons */
.cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 44px; }
.btn {
  display: inline-block; font-family: var(--display); font-weight: 800; letter-spacing: .12em; font-size: 14px;
  padding: 14px 24px; border-radius: 4px; text-decoration: none; cursor: pointer; border: 1px solid var(--cyan);
  transition: transform .12s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: .5; cursor: wait; transform: none; }
.btn-primary { background: linear-gradient(90deg, var(--cyan), var(--magenta)); color: #05060a; border-color: transparent; box-shadow: 0 0 24px rgba(0,255,225,.35), 0 0 48px rgba(255,43,214,.25); }
.btn-primary:hover { box-shadow: 0 0 36px rgba(0,255,225,.6), 0 0 72px rgba(255,43,214,.45); }
.btn-ghost { background: transparent; color: var(--cyan); }
.btn-big { width: 100%; font-size: 17px; padding: 18px; margin-top: 8px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 16px 8px; }
.stat-num { display: block; font-family: var(--display); font-size: clamp(18px, 2.6vw, 26px); font-weight: 800; color: var(--gold); text-shadow: 0 0 12px rgba(255,211,107,.5); }
.stat-label { display: block; font-size: 11px; letter-spacing: .12em; color: var(--muted); margin-top: 4px; }
.fineprint { font-size: 12px; color: var(--muted); }

/* Sections */
.section { max-width: 1000px; margin: 0 auto; padding: 56px 16px; scroll-margin-top: 24px; }
.section-title { font-family: var(--display); font-size: clamp(22px, 4vw, 34px); letter-spacing: .08em; margin: 0 0 12px; color: #fff; }
.section-title span { color: var(--magenta); margin-right: 10px; font-size: .7em; vertical-align: middle; }
.section-lede { color: var(--muted); margin: 0 0 28px; }

.manifesto { background: var(--panel); border-left: 3px solid var(--magenta); padding: 6px 24px; border-radius: 0 6px 6px 0; margin-bottom: 28px; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 20px; transition: border-color .2s, transform .2s; }
.card:hover { border-color: var(--cyan); transform: translateY(-3px); }
.card-icon { font-size: 30px; }
.card h3 { font-family: var(--display); font-size: 15px; letter-spacing: .06em; margin: 8px 0; color: var(--cyan); }
.card p { margin: 0; font-size: 14px; color: var(--text); }

/* Tribute form */
.tribute { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 24px; }
.tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.tier { position: relative; cursor: pointer; }
.tier > input { position: absolute; opacity: 0; pointer-events: none; }
.tier-body {
  display: flex; flex-direction: column; height: 100%; padding: 16px; border-radius: 8px;
  border: 1px solid var(--line); background: rgba(0,0,0,.35); transition: all .15s;
}
.tier:hover .tier-body { border-color: rgba(0,255,225,.5); }
.tier > input:checked + .tier-body { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan), 0 0 24px rgba(0,255,225,.3); background: rgba(0,255,225,.06); }
.tier > input:focus-visible + .tier-body { outline: 2px solid var(--magenta); outline-offset: 2px; }
.tier-amt { font-family: var(--display); font-size: 28px; font-weight: 900; color: var(--gold); }
.tier-name { font-weight: 700; color: #fff; }
.tier-desc { font-size: 13px; color: var(--muted); }
.tier-max .tier-body { border-color: rgba(255,43,214,.5); }
.tier-max > input:checked + .tier-body { border-color: var(--magenta); box-shadow: 0 0 0 1px var(--magenta), 0 0 30px rgba(255,43,214,.45); background: rgba(255,43,214,.07); }
.tier-custom input[type=number] {
  width: 120px; background: transparent; border: none; border-bottom: 1px dashed var(--gold);
  color: var(--gold); font: inherit; outline: none; -moz-appearance: textfield;
}
.tier-custom input::-webkit-outer-spin-button, .tier-custom input::-webkit-inner-spin-button { -webkit-appearance: none; }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; letter-spacing: .1em; color: var(--muted); }
.field small { letter-spacing: 0; text-transform: none; }
.field input, .field select {
  font: inherit; font-size: 16px; letter-spacing: 0; color: #fff; background: #000; border: 1px solid var(--line);
  border-radius: 6px; padding: 12px 14px; outline: none;
}
.field input:focus, .field select:focus { border-color: var(--cyan); box-shadow: 0 0 12px rgba(0,255,225,.25); }
.form-msg { min-height: 1.4em; margin: 12px 0 0; color: var(--gold); }
.form-msg.err { color: var(--red); }

/* Ledger */
.live-dot { color: var(--red); animation: blink 1.2s infinite; }
.ledger-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab { font: inherit; font-size: 12px; letter-spacing: .14em; padding: 8px 14px; background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.tab.active { color: #05060a; background: var(--cyan); border-color: var(--cyan); }
.ledger { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ledger li {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid rgba(0,255,225,.08); background: rgba(0,0,0,.3);
}
.ledger li:nth-child(odd) { background: rgba(14,20,36,.5); }
.ledger li:last-child { border-bottom: none; }
.ledger .rank { font-family: var(--display); font-weight: 800; color: var(--muted); text-align: center; }
.ledger li:nth-child(1) .rank { color: var(--gold); font-size: 20px; }
.ledger li:nth-child(2) .rank { color: #d6e1ea; font-size: 18px; }
.ledger li:nth-child(3) .rank { color: #e0a070; font-size: 17px; }
.ledger .who { min-width: 0; }
.ledger .who b { color: #fff; font-size: 17px; }
.ledger .title { display: inline-block; margin-left: 8px; font-size: 11px; letter-spacing: .08em; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--cyan); vertical-align: middle; }
.ledger .oath { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger .amt { font-family: var(--display); font-weight: 800; color: var(--gold); text-align: right; }
.ledger .when { display: block; font-family: var(--mono); font-weight: 400; font-size: 11px; color: var(--muted); }
.ledger li.new { animation: flash 2.4s ease-out; }
.ledger li.me { outline: 2px solid var(--magenta); outline-offset: -2px; }
.ledger-empty { display: block !important; text-align: center; color: var(--muted); }
@keyframes flash { 0% { background: rgba(255,43,214,.45); } 100% { } }

/* FAQ */
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 10px; padding: 0 18px; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 700; color: #fff; list-style: none; }
.faq summary::before { content: "▸ "; color: var(--magenta); }
.faq details[open] summary::before { content: "▾ "; }
.faq p { margin: 0 0 14px; color: var(--text); }

/* Footer */
.footer { max-width: 1000px; margin: 0 auto; padding: 40px 16px 60px; border-top: 1px solid var(--line); text-align: center; font-size: 13px; color: var(--muted); }

.footer-links { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; letter-spacing: .1em; text-transform: uppercase; font-size: 12px; }
.footer-links a:hover { color: var(--cyan); }

/* Legal page */
.legal { max-width: 760px; margin: 0 auto; padding: 24px 16px 80px; }
.legal section { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 24px 10px; margin: 20px 0; scroll-margin-top: 16px; }
.legal h2 { font-family: var(--display); font-size: 20px; letter-spacing: .06em; color: var(--cyan); }
.legal h3 { font-size: 15px; color: #fff; margin: 18px 0 4px; }
.legal li { margin-bottom: 6px; }

/* Certificate */
.cert-dialog { background: transparent; border: none; padding: 0; max-width: min(760px, calc(100vw - 32px)); width: 100%; color: var(--text); }
.cert-dialog::backdrop { background: rgba(0,0,0,.82); backdrop-filter: blur(4px); }
.cert { background: #f6efd8; color: #1d1a12; padding: 14px; border-radius: 4px; }
.cert-border { border: 3px double #8a6d1f; padding: 32px 28px; text-align: center; font-family: Georgia, "Times New Roman", serif; }
.cert-kicker { font-family: var(--display); letter-spacing: .2em; font-size: 12px; color: #8a6d1f; margin: 0; }
.cert-name { font-family: var(--display); font-size: clamp(30px, 6vw, 48px); margin: 12px 0; color: #1d1a12; text-transform: uppercase; letter-spacing: .06em; }
.cert-body { margin: 8px 0; }
.cert-body strong { color: #1d1a12; }
.cert-body em { color: #8a1030; }
.cert-oath { font-style: italic; font-size: 20px; margin: 12px 0; }
.cert-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 26px; font-size: 12px; }
.cert-footer > div { display: flex; flex-direction: column; min-width: 140px; }
.cert-sig { font-family: var(--mono); font-size: 14px; border-bottom: 1px solid #1d1a12; padding-bottom: 4px; margin-bottom: 4px; }
.cert-seal { font-size: 46px; filter: drop-shadow(0 0 6px rgba(138,16,48,.6)); }
.cert-actions { display: flex; justify-content: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.cert-status { text-align: center; color: var(--gold); font-size: 13px; min-height: 1.2em; }

/* Responsive */
@media (max-width: 860px) {
  .stats, .cards { grid-template-columns: repeat(2, 1fr); }
  .tiers { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .fields { grid-template-columns: 1fr; }
  .tiers { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .nav nav { gap: 12px; }
  .ledger li { grid-template-columns: 36px 1fr auto; gap: 10px; padding: 10px 12px; }
  .ledger .title { display: none; }
  .cert-footer { flex-direction: column; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ticker-inner { padding-left: 0; }
}

/* Print: certificate only */
@media print {
  body > *:not(.cert-dialog) { display: none !important; }
  .cert-dialog { position: static; display: block; max-width: none; }
  .cert-actions, .cert-status { display: none; }
  .cert { background: #fff; }
}
