:root {
  --navy: #061a3a;
  --navy-2: #0b2550;
  --ink: #0d1b2e;
  --paper: #ffffff;
  --alt: #f4f2ec;
  --line: #e2ded3;
  --gold: #b8975a;
  --muted: #6b7686;
  --up: #17976f;
  --down: #cf4444;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-weight: 300;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  overflow-x: hidden;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.up { color: var(--up); }
.down { color: var(--down); }
button { font: inherit; color: inherit; cursor: pointer; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.1; margin: 0; }
h2 { font-size: clamp(30px, 4.4vw, 46px); max-width: 20ch; }
h3 { font-size: 24px; }
.eyebrow {
  font-size: 12px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 14px;
}
.sub { font-size: 18px; color: var(--muted); margin: 14px 0 0; }
.fine { font-size: 12.5px; color: var(--muted); margin: 22px 0 0; }
section { padding: 88px 0; scroll-margin-top: 60px; }
section.alt { background: var(--alt); }

/* ticker tape */
.tape { background: #030e22; color: #cfd8e6; overflow: hidden; white-space: nowrap; font-family: var(--mono); font-size: 12.5px; }
.tape-track { display: inline-block; padding: 8px 0; animation: tape 60s linear infinite; }
.tape-track span.item { margin-right: 34px; }
.tape-track b { color: #fff; font-weight: 500; margin-right: 6px; }
.tape .up { color: #3fd6a4; }
.tape .down { color: #ff7a7a; }
.tape .halt { color: #f2c14e; }
@keyframes tape { to { transform: translateX(-50%); } }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; background: rgba(6, 26, 58, .96); color: #fff;
  backdrop-filter: blur(6px);
}
.logo { display: flex; align-items: center; gap: 12px; background: none; border: 0; padding: 0; color: inherit; user-select: none; }
.logo.static { cursor: default; }
.logo-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--gold); color: var(--gold);
  font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: .04em;
}
.logo-text { font-size: 14px; font-weight: 500; letter-spacing: .26em; text-align: left; line-height: 1.25; }
.logo-text small { display: block; font-size: 10px; font-weight: 300; letter-spacing: .34em; text-transform: uppercase; opacity: .7; }
.nav-links a { color: #fff; text-decoration: none; font-size: 13px; letter-spacing: .08em; margin-left: 26px; opacity: .8; }
.nav-links a:hover { opacity: 1; color: var(--gold); }

/* hero */
.hero {
  padding: 120px 0 96px; color: #fff;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 100% 56px,
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 56px 100%,
    radial-gradient(1200px 500px at 80% -10%, #173d7e 0%, transparent 60%),
    var(--navy);
}
.hero h1 { font-size: clamp(42px, 7.2vw, 88px); max-width: 15ch; }
.pigeon-word {
  background: none; border: 0; padding: 0; font: inherit; color: var(--gold);
  font-style: italic; border-bottom: 1px dashed transparent;
}
.pigeon-word:hover { border-bottom-color: var(--gold); }
.lede { font-size: 20px; max-width: 56ch; opacity: .85; margin: 28px 0 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; margin-top: 72px; border-top: 1px solid rgba(255,255,255,.16); padding-top: 28px; }
.stats b { display: block; font-family: var(--serif); font-size: 40px; font-weight: 500; line-height: 1.1; }
.stats span { font-size: 13px; opacity: .7; }

@keyframes blink { 50% { opacity: .35; } }

/* neural net */
.nn-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; margin-top: 40px; }
.nn { display: block; width: 100%; height: auto; padding: 8px 12px 0; }
.nn-edges path { stroke: #c9ced7; stroke-width: 2; fill: none; transition: stroke .2s; }
.nn-edges path.hot { stroke: var(--gold); }
.nn-nodes circle { fill: #fff; stroke: var(--ink); stroke-width: 2; transition: fill .2s; }
.nn-nodes circle.hot { fill: var(--gold); }
#nn-n4 { stroke: var(--up); }
.nn-w text { font-size: 11px; fill: var(--muted); }
.nn-lab text { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; fill: var(--ink); font-weight: 500; }
.nn-pulse { fill: var(--gold); opacity: 0; }
.nn-out { margin-right: auto; font-size: 12.5px; min-width: 0; overflow-wrap: anywhere; }
.params { padding: 18px 16px 8px; }
.prow { display: grid; grid-template-columns: 11.5em 1fr 3.6em; gap: 12px; align-items: center; font-size: 13.5px; padding: 5px 0; }
.prow i { display: block; height: 12px; width: var(--w); background: var(--navy-2); border-radius: 0 4px 4px 0; transform-origin: left; }
.prow b { text-align: right; font-weight: 500; }
.prow.andi { color: var(--down); font-weight: 500; }
.prow.andi i { background: var(--down); min-width: 3px; }
.prow:hover i { opacity: .8; }
.spec { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 6px; }
.spec td { padding: 8px 16px; border-top: 1px solid var(--line); }
.spec td:last-child { text-align: right; }

/* clock */
.clock { background: var(--navy); color: #fff; }
.clock h2 { max-width: 24ch; }
.clock-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; margin-top: 44px; }
.readout { border: 1px solid rgba(255,255,255,.16); padding: 26px; background: rgba(255,255,255,.03); min-width: 0; }
.readout label { display: block; font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.readout small { display: block; margin-top: 14px; font-size: 12.5px; opacity: .6; }
.big { font-size: clamp(20px, 3.5vw, 40px); color: #7ef0c4; overflow-wrap: anywhere; line-height: 1.2; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.countdown b { display: block; font-family: var(--mono); font-weight: 500; font-size: clamp(24px, 3.4vw, 40px); line-height: 1.2; }
.countdown span { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; opacity: .6; }
.clock .fine { color: rgba(255,255,255,.55); }

/* trading desk */
.desk { display: grid; grid-template-columns: 1fr 1.25fr; gap: 24px; margin-top: 40px; }
.panel { border: 1px solid var(--line); background: #fff; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
.live { color: var(--up); animation: blink 1.6s steps(2) infinite; }
#book { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 13.5px; }
#book td { padding: 4px 16px; text-align: right; position: relative; }
#book td:first-child { text-align: left; color: var(--muted); }
#book tr.ask td.px { color: var(--down); }
#book tr.bid td.px { color: var(--up); }
#book tr.mid td { text-align: center; font-size: 17px; font-weight: 500; padding: 9px; border-block: 1px solid var(--line); color: var(--ink); }
#book .bar { position: absolute; right: 0; top: 2px; bottom: 2px; opacity: .1; }
#book tr.ask .bar { background: var(--down); }
#book tr.bid .bar { background: var(--up); }
.ticket { display: flex; gap: 8px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.ticket label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-right: auto; }
.ticket input { width: 78px; margin-left: 6px; padding: 8px; border: 1px solid var(--line); font-family: var(--mono); font-size: 14px; }
.btn { border: 1px solid var(--ink); background: var(--ink); color: #fff; padding: 9px 20px; font-size: 13px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; transition: transform .08s, opacity .15s; }
.btn:hover { opacity: .85; }
.btn:active { transform: translateY(1px); }
.btn.buy { background: var(--up); border-color: var(--up); }
.btn.sell { background: var(--down); border-color: var(--down); }
.btn.ghost { background: transparent; color: var(--ink); border-color: #b9bfc9; }
.btn.sm { padding: 6px 12px; font-size: 11px; }
.pnl { display: grid; grid-template-columns: 1fr 1fr; }
.pnl > div { padding: 16px; }
.pnl > div + div { border-left: 1px solid var(--line); }
.pnl label { display: block; font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.pnl b { font-size: 26px; font-weight: 500; }
#chart { width: 100%; height: 150px; display: block; border-block: 1px solid var(--line); }
.log { height: 172px; overflow-y: auto; padding: 12px 16px; font-size: 12px; line-height: 1.55; }
.log div { margin-bottom: 4px; }
.log .you { color: var(--down); }
.log .andi { color: var(--up); }

/* cards */
.cards { display: grid; gap: 20px; margin-top: 40px; }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.cards.four { grid-template-columns: repeat(4, 1fr); }
.card { background: #fff; border: 1px solid var(--line); padding: 26px; }
.card p { margin: 10px 0 0; font-size: 15px; color: #3d4858; }
.leader { text-align: left; font-weight: 300; transition: transform .2s, box-shadow .2s; }
.leader:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(6,26,58,.1); }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--navy); display: grid; place-items: center; font-size: 30px; margin-bottom: 16px; }
.leader h3 { font-size: 22px; }
.leader .role { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 500; margin: 6px 0 0; }
.dance .leader { animation: dance .5s ease-in-out infinite alternate; }
.dance .leader:nth-child(even) { animation-delay: .25s; }
@keyframes dance { from { transform: rotate(-4deg) translateY(0); } to { transform: rotate(4deg) translateY(-12px); } }

/* risk table */
.risk { width: 100%; border-collapse: collapse; margin-top: 36px; font-size: 15px; }
.risk th { text-align: left; font-size: 11.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--ink); }
.risk td { padding: 15px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.risk td:first-child { font-family: var(--serif); font-size: 21px; font-weight: 500; white-space: nowrap; }
.risk td:last-child { text-align: right; white-space: nowrap; }
.pill { display: inline-block; font-family: var(--sans); font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; padding: 3px 9px; border: 1px solid #b9bfc9; color: #4a5565; white-space: nowrap; vertical-align: middle; }
.pill.crit { border-color: var(--down); color: var(--down); }
.pill.warn { border-color: #b98300; color: #9a6a00; }
#sf-btn { position: relative; transition: transform .18s ease-out; z-index: 5; }

/* careers */
.job { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; border: 1px solid var(--line); padding: 30px; margin-top: 40px; }
.job ul { margin: 14px 0 0; padding-left: 20px; font-size: 15.5px; }
.job p { margin: 6px 0 0; font-size: 14px; }
.job .btn { white-space: nowrap; }

/* egg counter */
.egg-pill { position: fixed; left: 16px; bottom: 16px; z-index: 40; background: var(--navy); color: #fff; border: 1px solid var(--gold); border-radius: 999px; padding: 6px 13px; font-family: var(--mono); font-size: 12.5px; opacity: .75; }
.egg-pill:hover { opacity: 1; }
.egg-pill b { font-weight: 500; }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 60; display: none; place-items: center; padding: 20px; background: rgba(3, 12, 28, .72); }
.overlay.open { display: grid; }
#crash { background: rgba(140, 10, 10, .9); color: #fff; text-align: center; z-index: 80; }
#crash h2 { max-width: none; font-family: var(--mono); font-size: clamp(22px, 5vw, 46px); font-weight: 500; animation: blink .5s steps(2) infinite; }
#crash p { font-family: var(--mono); font-size: 15px; }
body.crash section, body.crash .nav { animation: fall 1.6s cubic-bezier(.5,0,1,.6) forwards; }
body.crash section:nth-of-type(odd) { animation-name: fall-l; }
body.crash { animation: shake .12s linear 8; }
@keyframes fall { to { transform: translateY(70vh) rotate(7deg); opacity: .25; } }
@keyframes fall-l { to { transform: translateY(70vh) rotate(-9deg); opacity: .25; } }
@keyframes shake { 25% { transform: translate(7px, -4px); } 75% { transform: translate(-7px, 4px); } }

.term { width: min(720px, 100%); background: #050b14; color: #7ef0c4; font-family: var(--mono); font-size: 13.5px; border: 1px solid #1f3a5c; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.term-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: #0c1a2e; color: #9fb0c8; font-size: 12px; }
.term-bar button { background: none; border: 0; font-size: 18px; line-height: 1; color: inherit; }
#term-out { margin: 0; padding: 14px; height: min(52vh, 360px); overflow-y: auto; white-space: pre-wrap; font: inherit; }
.term-in { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid #1f3a5c; }
.term-in input { flex: 1; background: none; border: 0; outline: 0; color: inherit; font: inherit; }

.modal { background: #fff; width: min(440px, 100%); padding: 30px; }
.modal p { margin: 12px 0 0; font-size: 16px; }
.modal-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }

#bee { position: fixed; left: 0; top: 0; font-size: 30px; z-index: 70; pointer-events: none; display: none; will-change: transform; }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { background: var(--navy); color: #fff; border-left: 3px solid var(--gold); padding: 12px 16px; font-size: 14px; max-width: 340px; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: toast-in .25s ease-out; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 75; overflow: hidden; }
.fly { position: absolute; left: -60px; animation: fly linear forwards; }
@keyframes fly { to { transform: translate(calc(100vw + 140px), var(--dy)); } }
.confetti { position: absolute; top: -40px; animation: drop linear forwards; }
@keyframes drop { to { transform: translateY(110vh) rotate(var(--rot)); } }

body.bday .hero h1 { max-width: 12ch; }

@media (max-width: 860px) {
  section { padding: 60px 0; }
  .nav { padding: 12px 16px; }
  .nav-links { display: none; }
  .hero { padding: 76px 0 60px; }
  .stats { grid-template-columns: repeat(2, 1fr); margin-top: 48px; }
  .clock-grid, .desk, .nn-grid, .cards.three { grid-template-columns: 1fr; }
  .cards.four { grid-template-columns: repeat(2, 1fr); }
  .job { flex-direction: column; }
  .risk thead { display: none; }
  .risk tr { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .risk td { display: block; padding: 3px 0; border: 0; text-align: left !important; white-space: normal !important; }
}
@media (max-width: 480px) {
  .prow { grid-template-columns: 8.5em 1fr 3.2em; font-size: 12.5px; }
  .cards.four { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .tape-track, .live, .nn-pulse { animation: none; }
}

/* transit promo */
.transit { padding: 56px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.transit-row { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.transit .btn { white-space: nowrap; text-decoration: none; padding: 13px 24px; }
@media (max-width: 860px) { .transit-row { flex-direction: column; align-items: flex-start; } }
