/* ==========================================================================
   read the rat — BLACKOUT SYSTEM
   Shared key visual / design system for every screen.

   Source of truth: the "Read the Rat - Marca Final" key visual (Claude Design).
   Everything here is the BRAND layer: palette, type, the bracket mark, panels,
   HUD strips, eyebrows, chips and buttons. Screen-specific rules stay in each
   page; anything that is brand belongs here so the screens cannot drift apart.

   Two type families, both with local fallbacks so a blocked Google Fonts never
   leaves the dashboard unreadable:
     - Archivo 800 -> wordmark, headings, big numbers (the loud voice);
     - IBM Plex Mono -> everything else (dense, tabular, terminal-ish).
   ========================================================================== */

:root {
  /* --- surfaces: blackout, from deepest to raised ------------------------ */
  --void: #030405;        /* the KV canvas, deepest */
  --bg: #050608;          /* page background */
  --panel: #0a0d14;       /* raised surface */
  --panel-2: #0c1226;     /* accent-tinted surface (avatar plate) */
  --line: #16203a;        /* the only border colour */
  --line-soft: rgba(63, 109, 255, 0.09);

  /* --- brand blue -------------------------------------------------------- */
  --accent: #3f6dff;
  --accent-hi: #7396ff;
  --accent-rgb: 63, 109, 255;
  --on-accent: #030405;   /* text sitting on top of accent fills */

  /* --- text -------------------------------------------------------------- */
  --text: #f0f3fa;
  --muted: #7a86a3;
  --dim: #566180;

  /* --- semantic signal colours ------------------------------------------
     These carry meaning at a glance on a money screen, so they stay loud and
     distinct. Retuned to sit on blackout instead of the old grey-blue.
     The *-rgb twins exist so translucent washes stay in sync with the solid. */
  --green: #3ddc97;
  --green-rgb: 61, 220, 151;
  --red: #ff6577;
  --red-rgb: 255, 101, 119;
  --yellow: #f4bf50;
  --yellow-rgb: 244, 191, 80;
  --gold: #e3b341;
  --gold-rgb: 227, 179, 65;
  --hot: #ff7b00;         /* FOMO / rocket: the loudest thing on screen */
  --hot-rgb: 255, 123, 0;
  --ink: #1a1400;         /* text on gold/yellow fills */

  /* --- type -------------------------------------------------------------- */
  --font-display: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-ui: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* --- shape ------------------------------------------------------------
     The KV is sharp: 3-4px, never pill-round panels. Chips stay round. */
  --r-sharp: 3px;
  --r-soft: 6px;
  --r-pill: 999px;

  color-scheme: dark;
}

* { box-sizing: border-box; }

/* `hidden` tem que ganhar de qualquer `display` de classe. Sem isto, um
   elemento com display próprio (o termômetro de mercado é `display: flex`)
   aparece mesmo marcado como hidden, e a tela mostra um indicador vazio antes
   do primeiro payload. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); }

/* ==========================================================================
   The mark: four corner brackets around "rr". The whole brand in one shape —
   a reticle closing on a target. Size it with --mk (the box side); the corner
   arms and the letters scale from it, so one class covers 28px and 96px.
   ========================================================================== */
.rr-mark {
  position: relative;
  width: var(--mk, 34px);
  height: var(--mk, 34px);
  flex: none;
}
.rr-mark i {
  position: absolute;
  width: calc(var(--mk, 34px) * 0.26);
  height: calc(var(--mk, 34px) * 0.26);
  border: 0 solid var(--mk-color, var(--accent));
}
.rr-mark i:nth-child(1) { left: 0; top: 0; border-left-width: 2px; border-top-width: 2px; }
.rr-mark i:nth-child(2) { right: 0; top: 0; border-right-width: 2px; border-top-width: 2px; }
.rr-mark i:nth-child(3) { left: 0; bottom: 0; border-left-width: 2px; border-bottom-width: 2px; }
.rr-mark i:nth-child(4) { right: 0; bottom: 0; border-right-width: 2px; border-bottom-width: 2px; }
.rr-mark b {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: calc(var(--mk, 34px) * 0.46);
  font-weight: 800;
  color: var(--mk-ink, var(--text));
  line-height: 1;
}

/* Horizontal lockup: mark + wordmark. */
.rr-lockup { display: flex; align-items: center; gap: 12px; }
.rr-wordmark {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
  line-height: 1;
}

/* Stacked lockup, for the centred screens (login, empty states). */
.rr-lockup-stack {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}

/* ==========================================================================
   Eyebrow: the uppercase micro-label that sits above everything in the KV.
   ========================================================================== */
.rr-eyebrow {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
  display: block;
}
.rr-eyebrow.accent { color: var(--accent); }

/* ==========================================================================
   Surfaces
   ========================================================================== */
.rr-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-sharp);
}

/* The KV backdrop: 28px blueprint grid + scanlines + a corner glow. Applied to
   a positioned container; the layers are pointer-transparent so anything on
   top stays clickable. */
.rr-kv { position: relative; overflow: hidden; background: var(--void); }
.rr-kv > .kv-grid,
.rr-kv > .kv-scan,
.rr-kv > .kv-glow { position: absolute; inset: 0; pointer-events: none; }
.rr-kv > .kv-grid {
  background-image:
    linear-gradient(rgba(63, 109, 255, 0) 97%, var(--line-soft) 97%),
    linear-gradient(90deg, rgba(63, 109, 255, 0) 97%, var(--line-soft) 97%);
  background-size: 28px 28px;
}
.rr-kv > .kv-scan {
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0) 0 3px, rgba(0, 0, 0, 0.22) 3px 4px);
}
.rr-kv > .kv-glow {
  inset: auto auto -260px -180px;
  width: 760px; height: 760px; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.14) 0%, rgba(var(--accent-rgb), 0) 62%);
}

/* Frame corners for a hero block: same reticle language, at panel scale. */
.rr-corners > .c { position: absolute; width: 26px; height: 26px; border: 0 solid var(--accent); pointer-events: none; }
.rr-corners > .c.tl { left: 20px; top: 20px; border-left-width: 2px; border-top-width: 2px; }
.rr-corners > .c.tr { right: 20px; top: 20px; border-right-width: 2px; border-top-width: 2px; }
.rr-corners > .c.bl { left: 20px; bottom: 20px; border-left-width: 2px; border-bottom-width: 2px; }
.rr-corners > .c.br { right: 20px; bottom: 20px; border-right-width: 2px; border-bottom-width: 2px; }

/* ==========================================================================
   HUD strip: the stat bar from the KV footer. Cells separated by 1px of the
   border colour; the last cell can carry the accent fill + notch.
   ========================================================================== */
.rr-hud {
  display: flex; align-items: stretch; gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r-sharp); overflow: hidden;
}
.rr-hud .cell {
  flex: 1; min-width: 0;
  background: var(--panel);
  padding: 10px 14px;
  display: flex; flex-direction: column; gap: 3px;
}
.rr-hud .cell .k {
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rr-hud .cell .v {
  font-family: var(--font-display); font-size: 20px; font-weight: 800; color: var(--text);
  overflow-wrap: anywhere;
}
.rr-hud .cell.live { background: var(--accent); clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%); }
.rr-hud .cell.live .k { color: rgba(3, 4, 5, 0.65); }
.rr-hud .cell.live .v { color: var(--on-accent); }

/* ==========================================================================
   Controls
   ========================================================================== */
.rr-btn,
.rr-select {
  font-family: var(--font-ui);
  font-size: 11px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-soft);
  padding: 5px 9px;
  cursor: pointer;
}
.rr-btn:hover,
.rr-select:hover { border-color: var(--accent); }
.rr-btn:focus-visible,
.rr-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.rr-btn.primary {
  background: var(--accent); color: var(--on-accent); border-color: var(--accent);
  font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.rr-btn.primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }

.rr-chip {
  font-family: var(--font-ui);
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 2px 9px; font-size: 11px; font-weight: 600; cursor: pointer;
}
.rr-chip:hover { color: var(--text); border-color: var(--accent); }
.rr-chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* Segmented toggle (SOL / HOOD and friends). */
.rr-seg { display: inline-flex; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-soft); overflow: hidden; }
.rr-seg > button {
  font-family: var(--font-ui);
  background: var(--panel); border: none; color: var(--muted); cursor: pointer;
  font-size: 11px; font-weight: 800; letter-spacing: 0.1em; padding: 6px 13px;
}
.rr-seg > button:hover:not(.on) { color: var(--text); }
.rr-seg > button.on { background: var(--accent); color: var(--on-accent); }

/* Live dot, as in the KV header (SYS.ONLINE). Square, not round: the KV has no
   circles except the glow. */
.rr-dot { width: 7px; height: 7px; background: var(--dim); flex: none; }
.rr-dot.on { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.rr-dot.off { background: var(--red); box-shadow: 0 0 10px rgba(var(--red-rgb), 0.6); }

/* Status label pair used in headers: "SYS.ONLINE ▪ ..." */
.rr-sys {
  display: flex; align-items: center; gap: 10px;
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim);
}

/* ==========================================================================
   Type helpers
   ========================================================================== */
.rr-display {
  font-family: var(--font-display); font-weight: 800;
  letter-spacing: -0.02em; line-height: 0.95; text-transform: uppercase;
}
.rr-outline { color: transparent; -webkit-text-stroke: 2px var(--accent); }
.rr-num { font-family: var(--font-display); font-weight: 800; font-variant-numeric: tabular-nums; }
.rr-muted { color: var(--muted); }
.rr-dimmed { color: var(--dim); }

/* Section heading used across the token / pilot screens. */
.rr-h2 {
  font-size: 11px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--dim); margin: 26px 0 10px;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.rr-h2 .note { letter-spacing: 0; text-transform: none; color: var(--muted); font-size: 11px; font-weight: 400; }

@media (max-width: 640px) {
  .rr-wordmark { font-size: 16px; }
  .rr-hud { flex-wrap: wrap; }
  .rr-hud .cell { flex: 1 1 45%; }
  .rr-hud .cell.live { clip-path: none; }
}
