/* ───────────────────────────────────────────────────────────────────────
 * OCN DONATE — OBLVN / NEO-CORTEX wrapper
 * Aesthetic descends from GMUNK's Oblivion (2013) Light Table UI.
 * Tokens lifted from bvi-command/static/css/oblvn-source-reference.css
 * and context-ui-oblvn.md (canonical palette, 2026-06-11 audit).
 * Self-contained for Vercel — no external app dependency.
 * Rules respected: color = signal, restraint, corner brackets, true-black,
 * dot-grid base, Saira display / JetBrains Mono data, no bounce motion.
 * ─────────────────────────────────────────────────────────────────────── */

:root {
  --bg: #02060a;
  --panel: #04090e;
  --panel-2: #070d13;
  --line: #16242e;
  --line-2: #21384a;
  --line-3: #2c4d63;
  --ink: #cfe2ee;
  --ink-dim: #8fa6b4;
  --ink-mute: #566876;
  --cyan: #5CCFFF;          /* live / online / confirmed signal */
  --cyan-2: #8DE4FF;        /* hover / active */
  --mint: #BFF2E9;
  --orange: #F24C27;        /* command / danger / target — used sparingly */
  --orange-soft: #F08A3C;
  --cream: #F2ECCD;         /* decoded-payload emphasis */
  --ok: #5CFFAE;

  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --disp: 'Saira Condensed', 'Saira Semi Condensed', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--disp);
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}

/* Base texture: fine dot-grid + faint cool depth gradient + CRT scanline */
body {
  background-image:
    radial-gradient(circle at 50% -10%, rgba(92,207,255,0.06), transparent 55%),
    radial-gradient(rgba(120,180,210,0.10) 0.5px, transparent 0.5px);
  background-size: 100% 100%, 22px 22px;
  position: relative;
}
body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 50;
  background: repeating-linear-gradient(
    to bottom, rgba(120,180,210,0.018) 0 1px, transparent 1px 3px);
}

/* ── Three.js island canvas: full-screen, behind frame + content ── */
#bg {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  z-index: 1; display: block; pointer-events: none;
}
/* Vignette + readability scrim over the 3D scene so text stays legible */
.scrim {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 50% 48%, transparent 55%, rgba(2,6,10,0.45) 100%),
    linear-gradient(to bottom, rgba(2,6,10,0.30) 0%, transparent 26%, transparent 64%, rgba(2,6,10,0.5) 100%);
}

/* ── Perimeter frame + corner brackets ── */
.frame { position: fixed; inset: 14px; border: 0.5px solid var(--line-2); pointer-events: none; z-index: 40; }
.br { position: fixed; width: 18px; height: 18px; border: 1px solid var(--cyan); z-index: 41; }
.br-tl { top: 14px; left: 14px; border-right: 0; border-bottom: 0; }
.br-tr { top: 14px; right: 14px; border-left: 0; border-bottom: 0; }
.br-bl { bottom: 14px; left: 14px; border-right: 0; border-top: 0; }
.br-br { bottom: 14px; right: 14px; border-left: 0; border-top: 0; }

/* ── Topbar ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 34px; position: relative; z-index: 10;
}
.brand { display: flex; align-items: baseline; gap: 12px; }
.brand-mark { color: var(--cyan); font-size: 14px; }
.brand-name { font-weight: 700; letter-spacing: 0.42em; font-size: 20px; color: var(--ink); }
.brand-sub { color: var(--ink-mute); font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase; }
.status {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em;
  border: 1px solid currentColor; padding: 4px 10px; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.status.online { color: var(--ok); }
.status .dot { width: 6px; height: 6px; background: currentColor; border-radius: 50%; box-shadow: 0 0 8px currentColor; }

/* ── Stage / hero ── */
.stage { display: flex; justify-content: center; padding: 30px 34px 60px; position: relative; z-index: 10; }
.hero { width: 100%; max-width: 720px; }

.card {
  background: var(--panel);
  border: 0.5px solid var(--line-2);
  position: relative;
  padding: 34px 38px 30px;
}

/* Hero card = translucent glass so the orbiting island shows through.
   Backdrop blur + dark tint keeps the headline/copy legible over it. */
.hero.card {
  background: rgba(4, 9, 14, 0.46);
  backdrop-filter: blur(7px) saturate(1.1);
  -webkit-backdrop-filter: blur(7px) saturate(1.1);
  border-color: rgba(92, 207, 255, 0.30);
  box-shadow: 0 0 60px rgba(0, 6, 12, 0.55), inset 0 0 40px rgba(2, 10, 16, 0.35);
}
/* Amount tiles + meta sit on the glass too — lighten their fills slightly */
.hero.card .ident { background: rgba(7, 13, 19, 0.55); }
.hero.card .ident:hover { background: rgba(8, 21, 30, 0.7); }
/* TL + BR brackets via pseudo, TR + BL via .corner spans */
.card::before, .card::after {
  content: ''; position: absolute; width: 14px; height: 14px;
  border: 1px solid var(--cyan); pointer-events: none;
}
.card::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.card::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.corner { position: absolute; width: 14px; height: 14px; border: 1px solid var(--cyan); pointer-events: none; }
.corner.c-tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.corner.c-bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }

.hero-mission { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.pill {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.24em;
  color: var(--cyan); border: 1px solid var(--line-3); padding: 4px 10px; text-transform: uppercase;
}
.ruler { font-family: var(--mono); font-size: 9px; letter-spacing: 0.3em; color: var(--ink-mute); }

/* Ghosted dot-matrix-feel display headline */
.ghost-head {
  font-family: var(--disp); font-weight: 700; font-size: clamp(34px, 7vw, 62px);
  letter-spacing: 0.06em; line-height: 0.98; margin: 4px 0 18px;
  color: var(--ink); text-transform: uppercase; position: relative;
}
.ghost-head::after {
  content: attr(data-text); position: absolute; inset: 0;
  color: transparent; -webkit-text-stroke: 0.5px rgba(92,207,255,0.25);
  z-index: -1; transform: translate(2px, 2px);
}

.lede { color: var(--ink-dim); font-size: 16px; line-height: 1.55; max-width: 56ch; margin: 0 0 14px; }
.lede strong { color: var(--cream); font-weight: 500; }

/* Fiscal-sponsorship line — required attribution, kept quiet but legible */
.sponsor {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  color: var(--ink-mute); margin: 0 0 28px; line-height: 1.5;
}
.sponsor strong { color: var(--cyan); font-weight: 500; }

/* ── Amount ident-tiles ── */
.amounts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.ident {
  flex: 1 1 96px; min-width: 96px; cursor: pointer;
  background: var(--panel-2); border: 0.5px solid var(--line-2);
  color: var(--ink); padding: 14px 10px 10px; position: relative;
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
  transition: border-color 90ms linear, background 90ms linear; /* snap, no bounce */
}
.ident::before {
  content: ''; position: absolute; top: -1px; left: -1px; width: 9px; height: 9px;
  border: 1px solid var(--line-3); border-right: 0; border-bottom: 0;
}
.ident-val { font-family: var(--disp); font-weight: 600; font-size: 22px; letter-spacing: 0.04em; }
.ident-tag { font-family: var(--mono); font-size: 9px; letter-spacing: 0.2em; color: var(--ink-mute); }
.ident:hover { border-color: var(--cyan); background: #08121a; }
.ident.sel { border-color: var(--cyan); background: #08151e; }
.ident.sel .ident-val { color: var(--cyan-2); }
.ident.sel::before { border-color: var(--cyan); }

/* ───────────────────────────────────────────────────────────────
 * Primary CTA — movie-UI "arm the command" button.
 * Motion grammar matches oblvn-source-reference.css: linear snap,
 * bracket-in scale, scanline sweep (oblvnBootSweep lineage). No bounce.
 * States: idle (armed-and-waiting sweep) → hover (brackets snap in)
 *         → .arming (lock sequence) before the modal opens.
 * ─────────────────────────────────────────────────────────────── */
.cta {
  width: 100%; cursor: pointer; background: transparent;
  border: 1px solid var(--cyan); color: var(--cyan-2);
  font-family: var(--disp); font-weight: 600; font-size: 15px; letter-spacing: 0.28em;
  text-transform: uppercase; padding: 17px 18px;
  display: flex; align-items: center; justify-content: center; gap: 18px;
  transition: background 90ms linear, color 90ms linear, letter-spacing 140ms linear;
  position: relative; overflow: hidden; isolation: isolate;
  animation: ctaBreathe 2.8s ease-in-out infinite;
}
/* Idle: faint border-glow breathing — console "powered, waiting" */
@keyframes ctaBreathe {
  0%, 100% { box-shadow: 0 0 0 rgba(92,207,255,0), inset 0 0 0 rgba(92,207,255,0); border-color: var(--cyan); }
  50%      { box-shadow: 0 0 14px rgba(92,207,255,0.28), inset 0 0 18px rgba(92,207,255,0.06); border-color: var(--cyan-2); }
}

/* Idle scanline sweep — thin cyan line travels L→R on a loop */
.cta::before {
  content: ''; position: absolute; top: 0; bottom: 0; width: 60px; z-index: 0;
  background: linear-gradient(90deg,
    transparent 0,
    rgba(92,207,255,0.10) 40%,
    rgba(140,230,255,0.55) 50%,
    rgba(92,207,255,0.10) 60%,
    transparent 100%);
  filter: blur(0.5px);
  animation: ctaSweep 3.2s linear infinite;
  pointer-events: none;
}
@keyframes ctaSweep {
  0%   { transform: translateX(-80px); opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translateX(720px); opacity: 0; }
}

.cta-label, .cta-bracket { position: relative; z-index: 1; }
.cta-bracket { color: var(--cyan); font-size: 18px; transition: transform 200ms linear, color 90ms linear; }

/* Hover: invert fill, snap brackets inward, tighten tracking, kill idle sweep */
.cta:hover {
  background: var(--cyan); color: var(--bg);
  letter-spacing: 0.34em; animation-play-state: paused;
  box-shadow: 0 0 22px rgba(92,207,255,0.45);
}
.cta:hover::before { animation-play-state: paused; opacity: 0; }
.cta:hover .cta-bracket { color: var(--bg); }
.cta:hover .cta-bracket:first-of-type  { transform: translateX(6px); }
.cta:hover .cta-bracket.cta-bracket-r   { transform: translateX(-6px); }

/* ═══════════════════════════════════════════════════════════════
 * LAUNCH SEQUENCE — multi-stage console arm/countdown/ignition.
 * JS drives data-stage through: armed → t3 → t2 → t1 → ignite.
 * A progress bar fills across the whole run; the label steps through
 * SEQUENCE START · 3 · 2 · 1 · IGNITION; ignition does a hold-shake +
 * white-out flash → then the modal opens. Motion stays linear/snap.
 * ─────────────────────────────────────────────────────────────── */
.cta.launching {
  pointer-events: none; animation: none;
  color: var(--cyan-2);
  border-color: var(--cyan-2);
  letter-spacing: 0.34em;
}
/* Stop the idle sweep during launch */
.cta.launching::before { display: none; }

/* The fill bar — a charging cyan progress that runs the full countdown */
.cta.launching .cta-fill {
  position: absolute; left: 0; top: 0; bottom: 0; z-index: 0;
  width: 0%; background: linear-gradient(90deg, rgba(92,207,255,0.18), rgba(92,207,255,0.42));
  box-shadow: inset 0 0 18px rgba(140,230,255,0.3);
  border-right: 2px solid var(--cyan-2);
}
/* fill advances stage by stage (set as inline width by JS for exact sync,
   but provide a CSS fallback transition so it glides) */
.cta .cta-fill { transition: width 600ms linear; }

/* Per-stage label tint + bracket pull */
.cta.launching .cta-bracket { color: var(--cyan-2); }
.cta.launching[data-stage="armed"]  .cta-bracket:first-of-type { transform: translateX(4px); }
.cta.launching[data-stage="armed"]  .cta-bracket.cta-bracket-r  { transform: translateX(-4px); }
.cta.launching[data-stage="t3"]     .cta-bracket:first-of-type { transform: translateX(7px); }
.cta.launching[data-stage="t3"]     .cta-bracket.cta-bracket-r  { transform: translateX(-7px); }
.cta.launching[data-stage="t2"]     .cta-bracket:first-of-type { transform: translateX(10px); }
.cta.launching[data-stage="t2"]     .cta-bracket.cta-bracket-r  { transform: translateX(-10px); }
.cta.launching[data-stage="t1"]     .cta-bracket:first-of-type { transform: translateX(13px); }
.cta.launching[data-stage="t1"]     .cta-bracket.cta-bracket-r  { transform: translateX(-13px); }

/* Countdown digit punches in on each tick (number-roll lineage) */
.cta.launching .cta-label { animation: ctaTick 200ms linear; }
@keyframes ctaTick {
  0%   { opacity: 0.3; transform: translateY(-5px); filter: brightness(1.8); }
  40%  { opacity: 1;   transform: translateY(0);    filter: brightness(1.8); }
  100% { opacity: 1;   transform: translateY(0);    filter: brightness(1); }
}

/* IGNITION — fill completes, button shakes/charges, then white-out flash */
.cta.launching[data-stage="ignite"] {
  background: var(--cyan); color: var(--bg);
  box-shadow: 0 0 38px rgba(140,230,255,0.85), 0 0 80px rgba(92,207,255,0.5);
  animation: ctaIgniteShake 380ms steps(8) 1;
}
.cta.launching[data-stage="ignite"] .cta-fill { width: 100% !important; border-right: 0; }
.cta.launching[data-stage="ignite"] .cta-bracket { color: var(--bg); }
.cta.launching[data-stage="ignite"] .cta-label { animation: none; }
@keyframes ctaIgniteShake {
  0%   { transform: translate(0,0); }
  25%  { transform: translate(-1.5px, 1px); }
  50%  { transform: translate(1.5px, -1px); }
  75%  { transform: translate(-1px, -1px); }
  100% { transform: translate(0,0); }
}
/* Liftoff white-out — bright bar sweeps + full flash on ignition */
.cta.launching[data-stage="ignite"]::after {
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: rgba(240,250,255,0);
  animation: ctaWhiteout 380ms linear 1;
}
@keyframes ctaWhiteout {
  0%   { background: rgba(240,250,255,0); }
  55%  { background: rgba(240,250,255,0.92); }
  100% { background: rgba(240,250,255,0); }
}

/* Respect users who ask for less motion */
@media (prefers-reduced-motion: reduce) {
  .cta, .cta::before { animation: none !important; }
  .cta::before { display: none; }
  .cta.launching .cta-label, .cta.launching::after,
  .cta.launching .cta-fill { animation: none !important; transition: none !important; }
}

/* ── Meta readout row ── */
.meta-row {
  display: flex; flex-wrap: wrap; gap: 22px; margin-top: 22px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; color: var(--ink-dim);
  border-top: 0.5px solid var(--line); padding-top: 16px;
}
.meta-row em { color: var(--ink-mute); font-style: normal; margin-right: 6px; }
.meta-row .ok { color: var(--ok); }

.foot {
  text-align: center; font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.18em; color: var(--ink-mute); padding: 0 20px 28px;
}

/* ── Modal ── */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 24px; }
.modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,4,8,0.86); backdrop-filter: blur(2px); }
.modal-panel {
  position: relative; z-index: 1; width: 100%; max-width: 520px;
  max-height: 90vh; overflow: hidden; display: flex; flex-direction: column;
  background: var(--panel); padding: 0;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 0.5px solid var(--line-2);
}
.modal-close {
  background: transparent; border: 1px solid var(--line-3); color: var(--ink-dim);
  width: 30px; height: 30px; cursor: pointer; font-family: var(--mono); font-size: 13px;
  transition: border-color 90ms linear, color 90ms linear;
}
.modal-close:hover { border-color: var(--orange); color: var(--orange); }
.modal-body { overflow-y: auto; padding: 6px; background: #fff; } /* Donorbox form is light; give it a clean canvas */
.modal-body dbox-widget { display: block; }

/* ── Responsive ── */
@media (max-width: 560px) {
  .topbar { padding: 18px 20px; }
  .brand-sub { display: none; }
  .stage { padding: 18px 16px 40px; }
  .card { padding: 24px 20px 22px; }
  .ident { flex-basis: calc(50% - 5px); }
}
