/* CHARON — instrument panel, not a casino.
   The subject is somebody's money being at risk. The visual language is a precision
   instrument: dark ground, one warm accent used only for danger, numbers given room.
   Motion is used where it carries information (the cascade actually happened that way)
   and nowhere else. */

:root{
  --bg:#07080b; --bg2:#0b0d12; --panel:#0f1218; --line:#1c212b;
  --ink:#e8ecf4; --dim:#8b94a7; --faint:#5a6478;
  --hot:#ff6b3d; --hot-dim:#8a3a22; --cool:#39d8c8; --gold:#f0b429;
  --r:14px; --max:1160px;
  --mono:ui-monospace,SFMono-Regular,"SF Mono",Menlo,monospace;
  --sans:-apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Roboto,Helvetica,Arial,sans-serif;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0; background:var(--bg); color:var(--ink); font-family:var(--sans);
  -webkit-font-smoothing:antialiased; line-height:1.55; overflow-x:hidden;
}
#bg{position:fixed; inset:0; width:100%; height:100%; z-index:0; opacity:.5; pointer-events:none}
main,.nav{position:relative; z-index:1}
a{color:inherit}
h1,h2,h3{letter-spacing:-.022em; line-height:1.1; margin:0}
code{font-family:var(--mono)}

/* ---- nav ---- */
.nav{
  display:flex; align-items:center; justify-content:space-between; gap:24px;
  max-width:var(--max); margin:0 auto; padding:22px 24px;
}
.brand{display:flex; align-items:center; gap:10px; font-weight:650; letter-spacing:.14em; font-size:14px; text-decoration:none}
.mark{
  width:11px; height:11px; border-radius:50%; background:var(--hot);
  box-shadow:0 0 0 0 rgba(255,107,61,.55); animation:pulse 3.2s ease-out infinite;
}
@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(255,107,61,.5)}70%{box-shadow:0 0 0 13px rgba(255,107,61,0)}100%{box-shadow:0 0 0 0 rgba(255,107,61,0)}}
.nav nav{display:flex; align-items:center; gap:26px; font-size:14px}
.nav nav a{color:var(--dim); text-decoration:none; transition:color .18s}
.nav nav a:hover{color:var(--ink)}
.nav .cta{
  color:var(--ink); border:1px solid var(--line); padding:8px 16px; border-radius:9px;
  background:linear-gradient(180deg,#141821,#0e1116); transition:border-color .18s, transform .18s;
}
.nav .cta:hover{border-color:#2e3746; transform:translateY(-1px)}
/* The language picker stays a native <select>: it is the one control that must work with a
   screen reader, a keyboard and a ten-year-old phone. `color-scheme: dark` is the supported way
   to make the browser render its OWN widget dark — an earlier attempt drew a custom caret from
   an inline SVG data URI, and the unencoded < and > in it made the CSS parser discard the whole
   rule silently, leaving a white box on a black page. */
#lang{
  color-scheme:dark;
  background:var(--panel); border:1px solid var(--line); color:var(--dim);
  border-radius:9px; padding:8px 10px; font-size:13px; font-family:inherit;
  cursor:pointer; max-width:9.5rem; transition:border-color .18s, color .18s;
}
#lang:hover{border-color:#2e3746; color:var(--ink)}
#lang:focus{outline:none; border-color:var(--hot)}

/* ---- hero ---- */
.hero{
  max-width:var(--max); margin:0 auto; padding:56px 24px 40px;
  display:grid; grid-template-columns:1.05fr .95fr; gap:56px; align-items:center;
}
.eyebrow{
  font-family:var(--mono); font-size:11.5px; letter-spacing:.16em; text-transform:uppercase;
  color:var(--hot); margin:0 0 20px;
}
h1{font-size:clamp(38px,5vw,60px); font-weight:680}
h1 em{font-style:normal; color:var(--hot)}
.lede{color:var(--dim); font-size:17px; max-width:52ch; margin:22px 0 28px}
.lede b{color:var(--ink); font-weight:600}

.probe{display:flex; gap:8px; flex-wrap:wrap}
.probe select,.probe input{
  background:var(--panel); border:1px solid var(--line); color:var(--ink);
  border-radius:10px; padding:12px 14px; font-size:14px; font-family:var(--mono);
  transition:border-color .18s;
}
.probe input{flex:1; min-width:230px}
.probe select:focus,.probe input:focus{outline:none; border-color:var(--hot)}
.probe button{
  background:var(--hot); color:#160a05; border:0; border-radius:10px; padding:12px 22px;
  font-size:14px; font-weight:640; cursor:pointer; transition:filter .18s, transform .18s;
}
.probe button:hover{filter:brightness(1.08); transform:translateY(-1px)}
.probe button:disabled{opacity:.55; cursor:progress; transform:none}
.probe-note{color:var(--faint); font-size:12.5px; margin:12px 0 0}
.probe-out{
  margin-top:18px; border:1px solid var(--line); border-radius:var(--r);
  background:rgba(15,18,24,.82); padding:16px 18px; font-size:14px;
  animation:rise .45s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes rise{from{opacity:0; transform:translateY(10px)}to{opacity:1; transform:none}}
.probe-out .row{display:flex; justify-content:space-between; gap:14px; padding:7px 0; border-bottom:1px solid #161a22}
.probe-out .row:last-child{border-bottom:0}
.probe-out .k{color:var(--dim)}
.probe-out .v{font-family:var(--mono)}
.probe-out .v.bad{color:var(--hot)} .probe-out .v.warn{color:var(--gold)} .probe-out .v.good{color:var(--cool)}

/* ---- cascade figure ---- */
.cascade{
  margin:0; border:1px solid var(--line); border-radius:var(--r); overflow:hidden;
  background:linear-gradient(180deg,rgba(16,19,26,.9),rgba(9,11,15,.9));
  box-shadow:0 30px 80px -40px rgba(0,0,0,.9);
}
.cascade-head{
  display:flex; align-items:center; gap:9px; padding:12px 16px; border-bottom:1px solid var(--line);
  font-family:var(--mono); font-size:11.5px; color:var(--dim); letter-spacing:.05em;
}
.dot{width:7px; height:7px; border-radius:50%; background:var(--faint)}
.dot.live{background:var(--cool); box-shadow:0 0 9px var(--cool)}
.replay{
  margin-left:auto; background:transparent; border:1px solid var(--line); color:var(--dim);
  border-radius:7px; padding:4px 11px; font-size:11px; cursor:pointer; font-family:var(--mono);
  transition:color .18s,border-color .18s;
}
.replay:hover{color:var(--ink); border-color:#2e3746}
#cascadeSvg{display:block; width:100%; height:auto; background:#080a0e}
.cascade figcaption{
  padding:13px 16px; font-size:12.5px; color:var(--dim); border-top:1px solid var(--line);
  min-height:44px; font-family:var(--mono);
}

/* ---- stat strip ---- */
.strip{
  max-width:var(--max); margin:36px auto; padding:26px 24px; display:grid;
  grid-template-columns:repeat(4,1fr); gap:12px;
  border-top:1px solid var(--line); border-bottom:1px solid var(--line);
}
.stat b{display:block; font-size:clamp(22px,2.6vw,32px); font-family:var(--mono); font-weight:600; letter-spacing:-.02em}
.stat:nth-child(1) b,.stat:nth-child(3) b{color:var(--hot)}
.stat span{color:var(--faint); font-size:12.5px; display:block; margin-top:6px; max-width:26ch}

/* ---- legs ---- */
.legs,.api{max-width:var(--max); margin:0 auto; padding:70px 24px}
.legs h2,.api h2{font-size:clamp(26px,3.2vw,38px)}
.sub{color:var(--dim); margin:12px 0 40px; font-size:16px}
.cards{display:grid; grid-template-columns:repeat(3,1fr); gap:18px}
.card{
  border:1px solid var(--line); border-radius:var(--r); padding:24px;
  background:linear-gradient(180deg,rgba(16,19,26,.7),rgba(10,12,17,.7));
  transition:transform .22s cubic-bezier(.2,.7,.3,1), border-color .22s;
}
.card:hover{transform:translateY(-4px); border-color:#2a323f}
.card.accent{border-color:var(--hot-dim)}
.card h3{font-size:19px; margin:18px 0 10px}
.card p{color:var(--dim); font-size:14.5px; margin:0}
.card p b{color:var(--ink); font-weight:600}
.card-viz{height:120px; display:flex; align-items:center; justify-content:center; position:relative}
.card-viz svg{width:100%; height:100%; overflow:visible}

.gauge-viz{max-width:130px; margin:0 auto}
.gtrack{fill:none; stroke:#191e27; stroke-width:9}
.gfill{
  fill:none; stroke:var(--hot); stroke-width:9; stroke-linecap:round;
  transform:rotate(-90deg); transform-origin:60px 60px;
  stroke-dasharray:289; stroke-dashoffset:289;
  transition:stroke-dashoffset 1.6s cubic-bezier(.2,.7,.3,1);
}
.in-view .gfill{stroke-dashoffset:281}
.gval{position:absolute; font-family:var(--mono); font-size:22px; font-weight:600}
.gval i{font-style:normal; font-size:13px; color:var(--dim)}

.dep-edge{stroke:#232b37; stroke-width:1.5}
.dep-edge.d2,.dep-edge.d3{stroke-dasharray:4 4; animation:flow 2.4s linear infinite}
@keyframes flow{to{stroke-dashoffset:-16}}
.dep-node{stroke-width:1.5}
.dep-node.me{fill:#101620; stroke:var(--cool)}
.dep-node.pool{fill:rgba(255,107,61,.14); stroke:var(--hot)}
.dep-node.who{fill:#0f131a; stroke:var(--faint)}
.in-view .dep-node.pool{animation:breathe 3.4s ease-in-out infinite}
@keyframes breathe{0%,100%{r:14}50%{r:16.5}}

.depth-line{fill:none; stroke:var(--cool); stroke-width:2; stroke-linejoin:round}
.depth-fill{fill:rgba(57,216,200,.09)}

/* ---- story ---- */
.story{border-top:1px solid var(--line); border-bottom:1px solid var(--line); background:rgba(9,11,15,.6)}
.story-inner{max-width:760px; margin:0 auto; padding:66px 24px}
.story h2{font-size:clamp(24px,3vw,32px); margin-bottom:20px}
.story p{color:var(--dim); font-size:16.5px; margin:0 0 18px}
.story b{color:var(--ink); font-weight:600}

/* ---- api ---- */
.caps{display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin-bottom:26px}
.cap{border:1px solid var(--line); border-radius:12px; padding:18px; background:rgba(15,18,24,.6)}
.cap h4{margin:0 0 8px; font-family:var(--mono); font-size:13px; color:var(--cool); font-weight:600}
.cap p{color:var(--dim); font-size:13.5px; margin:0 0 12px}
.cap .price{font-family:var(--mono); font-size:12px; color:var(--gold)}
.code{
  background:#0a0c11; border:1px solid var(--line); border-radius:12px; padding:18px 20px;
  overflow-x:auto; font-size:12.5px; color:#b9c3d4; line-height:1.7;
}
.fine{color:var(--faint); font-size:13px; margin-top:22px; max-width:74ch}

footer{
  max-width:var(--max); margin:0 auto; padding:34px 24px 60px; border-top:1px solid var(--line);
  display:flex; justify-content:space-between; gap:20px; font-size:13px; flex-wrap:wrap;
}
footer .muted{color:var(--faint)}
footer a{color:var(--dim)}

/* ---- cabinet ---- */
.cab{max-width:960px; margin:0 auto; padding:34px 24px 80px}
.cab h1{font-size:30px; margin-bottom:8px}
.cab .sub{margin-bottom:28px}
.watchform{display:grid; grid-template-columns:130px 1fr 150px auto; gap:8px; margin-bottom:14px}
.watchform input,.watchform select{
  background:var(--panel); border:1px solid var(--line); color:var(--ink);
  border-radius:10px; padding:11px 13px; font-family:var(--mono); font-size:13.5px;
}
.watchform button{background:var(--hot); color:#160a05; border:0; border-radius:10px; padding:11px 20px; font-weight:640; cursor:pointer}
.token{
  background:rgba(240,180,41,.07); border:1px solid rgba(240,180,41,.3); border-radius:10px;
  padding:14px 16px; font-family:var(--mono); font-size:12.5px; margin:16px 0; word-break:break-all;
}
.token b{color:var(--gold)}
.wlist{display:grid; gap:12px; margin-top:24px}
.watch{border:1px solid var(--line); border-radius:var(--r); padding:18px; background:rgba(15,18,24,.6)}
.watch .top{display:flex; align-items:baseline; gap:12px; justify-content:space-between}
.watch .addr{font-family:var(--mono); font-size:13px; color:var(--dim)}
.bar{height:6px; border-radius:4px; background:#161b24; overflow:hidden; margin:14px 0 8px}
.bar i{display:block; height:100%; border-radius:4px; background:linear-gradient(90deg,var(--hot),var(--gold)); transition:width 1s cubic-bezier(.2,.7,.3,1)}
.badge{font-family:var(--mono); font-size:11px; padding:3px 9px; border-radius:20px; border:1px solid var(--line); color:var(--dim)}
.badge.already{background:rgba(255,107,61,.14); border-color:var(--hot); color:var(--hot)}
.badge.under_1pct{background:rgba(240,180,41,.12); border-color:var(--gold); color:var(--gold)}
.empty{color:var(--faint); font-size:14px; padding:26px 0}

@media (max-width:940px){
  /* The brand must never be overlapped by the actions: at narrow widths it takes its own row
     rather than competing for one. A clipped wordmark is the first thing a reader distrusts. */
  .nav{flex-wrap:wrap; gap:10px 12px; padding:16px 20px}
  .brand{flex:0 0 100%}
  .nav nav{gap:12px; flex:1 1 100%; justify-content:flex-start; min-width:0; flex-wrap:wrap}
  #lang{max-width:7.5rem; padding:7px 26px 7px 10px; font-size:12.5px}
  .hero{grid-template-columns:1fr; gap:36px; padding-top:26px}
  .cards,.caps{grid-template-columns:1fr}
  .strip{grid-template-columns:repeat(2,1fr); gap:22px}
  .watchform{grid-template-columns:1fr 1fr}
  .nav nav a:not(.cta){display:none}
}
@media (prefers-reduced-motion:reduce){
  *{animation:none!important; transition:none!important; scroll-behavior:auto}
}
