/* DECO — sunset over the reserve.
   The scene is the page; everything here is a HUD laid on top of it. Dark glass, neon edges,
   chrome type. Three families and no more: Anton for the display, Barlow Condensed for every
   label and number (tabular, so a figure does not jump as it ticks), Inter for prose. */

:root {
  --ink: #0a0613;
  --cream: #ffeede;
  --magenta: #ff2d95;
  --cyan: #2de2ff;
  --amber: #ffb24a;
  --glass: rgba(10, 6, 20, .76);
  --line: rgba(255, 45, 149, .26);
  --line-soft: rgba(255, 238, 222, .14);
  --dim: rgba(255, 238, 222, .58);
  --gut: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--ink);
  color: var(--cream);
  font-family: Inter, system-ui, sans-serif;
  overflow-x: hidden;
}

body { min-height: 100svh; }

a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--cream); }

/* ---- the stage ------------------------------------------------------- */

#stage { position: fixed; inset: 0; z-index: 0; }
#stage canvas { width: 100%; height: 100%; display: block; }

.veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 42%, transparent 38%, rgba(6, 3, 12, .62) 100%),
    linear-gradient(to bottom, rgba(6, 3, 12, .52), transparent 26%, transparent 62%, rgba(6, 3, 12, .72));
}

/* VHS: a tape artefact stays faint and covers the whole frame. At any strength you can
   point at, it reads as a bug instead of a texture. */
.scan {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: .055;
  background: repeating-linear-gradient(to bottom, #fff 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

/* ---- brand ----------------------------------------------------------- */

.brand {
  position: fixed; z-index: 5; top: 18px; left: var(--gut);
  display: flex; align-items: center; gap: 10px;
}
.brand img { filter: drop-shadow(0 0 12px rgba(255, 45, 149, .55)); }
.brand-txt { display: flex; flex-direction: column; line-height: 1; }
.brand-txt b {
  font-family: Anton, Impact, sans-serif; font-size: 25px; letter-spacing: .14em;
  text-shadow: 0 0 18px rgba(255, 45, 149, .5);
}
.brand-txt span {
  font-family: 'Barlow Condensed', sans-serif; font-size: 12px; letter-spacing: .24em;
  text-transform: uppercase; color: var(--dim); margin-top: 3px;
}

/* ---- the readout in the corner --------------------------------------- */

.hud {
  position: fixed; z-index: 5; top: 16px; right: var(--gut);
  width: 236px; padding: 14px 14px 12px;
  background: var(--glass); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 3px;
  box-shadow: 0 0 38px rgba(255, 45, 149, .16), inset 0 1px 0 rgba(255, 238, 222, .08);
  font-family: 'Barlow Condensed', sans-serif; font-variant-numeric: tabular-nums;
  text-align: right;
}
.hud-main { display: flex; flex-direction: column; align-items: flex-end; }
.hud-lab {
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim);
}
.hud-num {
  font-family: Anton, Impact, sans-serif; font-size: 34px; line-height: 1.05;
  letter-spacing: .01em; color: var(--cream);
  text-shadow: 0 0 20px rgba(45, 226, 255, .5);
}
.hud-sub { font-size: 14px; color: var(--amber); letter-spacing: .04em; }
.hud-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  margin-top: 8px; font-size: 15px;
}
.hud-row.thin { margin-top: 6px; }
.hud-row b { letter-spacing: .02em; }
.gauge {
  height: 4px; margin: 9px 0 2px; border-radius: 2px;
  background: rgba(255, 238, 222, .12); overflow: hidden;
}
.gauge i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  box-shadow: 0 0 12px rgba(255, 45, 149, .8);
  transition: width .6s ease;
}
.connect {
  margin-top: 11px; width: 100%;
  font-family: 'Barlow Condensed', sans-serif; font-size: 13px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink); background: var(--cream);
  border: 0; border-radius: 2px; padding: 7px 10px; cursor: pointer;
}
.connect:hover { background: var(--amber); }
.connect.on { background: transparent; color: var(--cream); border: 1px solid var(--line-soft); }

/* ---- the panel ------------------------------------------------------- */

.panel {
  position: fixed; z-index: 4; left: var(--gut); bottom: 96px;
  width: min(545px, calc(100vw - var(--gut) * 2));
  max-height: calc(100svh - 230px);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 20px 18px;
  background: var(--glass); backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-left: 2px solid var(--magenta);
  border-radius: 3px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
}
.st { display: none; }
.st.on { display: block; }

h1 {
  margin: 0 0 12px;
  font-family: Anton, Impact, sans-serif; font-weight: 400;
  font-size: clamp(30px, 5.2vw, 46px); line-height: .96; letter-spacing: .005em;
  text-transform: uppercase;
  background: linear-gradient(176deg, #ffeede 18%, #ffb3d6 52%, #ff2d95 96%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 18px rgba(255, 45, 149, .35));
}
h2 {
  margin: 0 0 10px;
  font-family: Anton, Impact, sans-serif; font-weight: 400; font-size: 28px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--cream);
}
.lede { margin: 0 0 14px; font-size: 14.5px; line-height: 1.58; color: rgba(255, 238, 222, .82); }
.lede b { color: var(--cream); font-weight: 600; }

.grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px;
  background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: 2px;
}
.cell {
  background: rgba(8, 4, 16, .62); padding: 9px 10px;
  font-family: 'Barlow Condensed', sans-serif; font-variant-numeric: tabular-nums;
  min-width: 0;
}
.cell span {
  display: block; font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--dim);
}
.cell b {
  display: block; font-size: 21px; line-height: 1.2; letter-spacing: .01em;
  overflow-wrap: anywhere;
}
.cell i { display: block; font-size: 11px; font-style: normal; color: rgba(255, 238, 222, .45); }

.note {
  margin: 12px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--amber);
  border-left: 2px solid rgba(255, 178, 74, .5); padding-left: 10px;
}
.links { display: flex; gap: 16px; margin-top: 14px; font-family: 'Barlow Condensed', sans-serif; }
.links a { font-size: 14px; letter-spacing: .14em; text-transform: uppercase; }

/* ---- forms ----------------------------------------------------------- */

.form { margin-top: 14px; display: flex; flex-direction: column; gap: 9px; }
.form label {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  font-family: 'Barlow Condensed', sans-serif; font-size: 13px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--dim);
}
.form input {
  flex: 1 1 130px; min-width: 0;
  background: rgba(0, 0, 0, .42); color: var(--cream);
  border: 1px solid var(--line-soft); border-radius: 2px; padding: 8px 10px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 17px; font-variant-numeric: tabular-nums;
}
.form input:focus { outline: 0; border-color: var(--magenta); }
.bal { font-size: 12px; letter-spacing: .1em; color: rgba(255, 238, 222, .5); }
.bal b { color: var(--cream); }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btns button, .hint button {
  font-family: 'Barlow Condensed', sans-serif; font-size: 13px; letter-spacing: .17em;
  text-transform: uppercase; cursor: pointer;
  background: transparent; color: var(--cream);
  border: 1px solid var(--line-soft); border-radius: 2px; padding: 8px 13px;
}
.btns button:hover { border-color: var(--cyan); color: var(--cyan); }
.btns button.go {
  background: linear-gradient(100deg, var(--magenta), #ff6a3d); color: #14000c; border: 0;
  font-weight: 600;
}
.btns button.go:hover { filter: brightness(1.12); color: #14000c; }
.btns button[disabled] { opacity: .45; cursor: not-allowed; }
.hint { margin: 2px 0 0; font-size: 12.5px; color: rgba(255, 238, 222, .6); }
.hint b { color: var(--cream); }

.bonds { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.bond {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border: 1px solid var(--line-soft); border-radius: 2px; padding: 7px 9px;
  font-family: 'Barlow Condensed', sans-serif; font-size: 14px;
}
.bond .bar { flex: 1 1 80px; height: 3px; background: rgba(255, 238, 222, .14); border-radius: 2px; }
.bond .bar i { display: block; height: 100%; background: var(--cyan); }

/* ---- the dial -------------------------------------------------------- */

.dial {
  position: fixed; z-index: 6; left: 0; right: 0; bottom: 30px;
  display: flex; gap: 2px; justify-content: center; align-items: stretch;
  padding: 0 var(--gut);
}
.needle { display: none; }
.stn {
  position: relative; flex: 0 1 132px; min-width: 0;
  padding: 8px 10px 9px;
  background: rgba(8, 4, 16, .72); backdrop-filter: blur(10px);
  border: 1px solid var(--line-soft); border-bottom: 2px solid transparent;
  font-family: 'Barlow Condensed', sans-serif; color: var(--dim);
  display: flex; align-items: baseline; gap: 7px;
}
.stn i {
  font-style: normal; font-size: 11px; letter-spacing: .1em; color: rgba(255, 238, 222, .4);
}
.stn span {
  font-size: 14px; letter-spacing: .2em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stn:hover { color: var(--cream); border-bottom-color: rgba(45, 226, 255, .55); }
.stn.on {
  color: var(--cream); border-bottom-color: var(--magenta);
  box-shadow: 0 0 26px rgba(255, 45, 149, .25), inset 0 -14px 24px -16px rgba(255, 45, 149, .7);
}
.stn.on i { color: var(--magenta); }

.ticker {
  position: fixed; z-index: 6; left: 0; right: 0; bottom: 8px; margin: 0;
  text-align: center;
  font-family: 'Barlow Condensed', sans-serif; font-size: 12px; letter-spacing: .26em;
  text-transform: uppercase; color: rgba(255, 238, 222, .52);
  padding: 0 var(--gut);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ticker.warn { color: var(--amber); }

/* ---- bare: the stage on its own, for the banner and the card ---------- */

body.bare .brand, body.bare .hud, body.bare .panel, body.bare .dial, body.bare .ticker { display: none; }
body.bare .veil { background: radial-gradient(130% 90% at 50% 46%, transparent 52%, rgba(6, 3, 12, .5) 100%); }

/* ---- docs ------------------------------------------------------------ */

body.reading #stage { left: 44%; opacity: .7; }
body.reading .veil { background: radial-gradient(90% 70% at 76% 46%, transparent 42%, rgba(6, 3, 12, .72) 100%); }

.read {
  position: relative; z-index: 4;
  width: min(760px, calc(100vw - var(--gut) * 2));
  margin: 86px 0 120px var(--gut);
  padding: 26px 26px 30px;
  background: var(--glass); backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-left: 2px solid var(--magenta); border-radius: 3px;
}
.read h1 { font-size: clamp(32px, 5vw, 52px); }
.read h2 { margin-top: 30px; }
.read h3 {
  margin: 22px 0 6px; font-family: 'Barlow Condensed', sans-serif; font-size: 17px;
  letter-spacing: .18em; text-transform: uppercase; color: var(--cyan);
}
.read p, .read li { font-size: 15px; line-height: 1.65; color: rgba(255, 238, 222, .84); }
.read b { color: var(--cream); }
.read table {
  width: 100%; border-collapse: collapse; margin: 12px 0 4px;
  font-family: 'Barlow Condensed', sans-serif; font-variant-numeric: tabular-nums; font-size: 15px;
}
.read th, .read td {
  text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line-soft);
  overflow-wrap: anywhere;
}
.read th { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--dim); }
.read code {
  font-family: ui-monospace, monospace; font-size: 12.5px; color: var(--amber);
  overflow-wrap: anywhere;
}
.chapters {
  display: flex; gap: 14px; flex-wrap: wrap; margin: 0 0 18px; padding: 0 0 12px;
  border-bottom: 1px solid var(--line-soft);
  font-family: 'Barlow Condensed', sans-serif;
}
.chapters a { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; }

/* ---- narrow ---------------------------------------------------------- */

@media (max-width: 900px) {
  .hud { width: 174px; padding: 10px 11px; top: 14px; }
  .hud-num { font-size: 26px; }
  .brand-txt b { font-size: 21px; }
  .panel { bottom: 88px; max-height: calc(100svh - 210px); padding: 16px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stn { flex: 1 1 auto; padding: 7px 8px 8px; }
  .stn span { font-size: 12px; letter-spacing: .12em; }
  .stn i { display: none; }
  body.reading #stage { left: 0; opacity: .34; }
  .read { margin: 74px var(--gut) 110px; padding: 18px; }
}

@media (max-width: 560px) {
  .hud {
    width: auto; left: var(--gut); right: var(--gut); top: auto; bottom: 76px;
    display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; text-align: left;
  }
  .hud-main { align-items: flex-start; grid-row: span 3; }
  .gauge { grid-column: span 2; }
  .connect { grid-column: span 2; }
  .panel { bottom: 242px; max-height: calc(100svh - 368px); }
  .hud-row.thin { display: none; }
  .brand { top: 12px; }
}
