/* ─── RLTRACKER · Design system ─────────────────────────────────────────── */
:root {
  --bg: #070b12;
  --bg-2: #0b1119;
  --card: #101826;
  --card-2: #141d2d;
  --line: rgba(148, 184, 220, 0.14);
  --text: #e8eff6;
  --muted: #8ea3bf;
  --faint: #5b6b84;
  --cyan: #22d3ee;
  --cyan-dim: rgba(34, 211, 238, 0.14);
  --violet: #8b5cf6;
  --violet-dim: rgba(139, 92, 246, 0.14);
  --green: #34d399;
  --red: #f87171;
  --amber: #fbbf24;
  --radius: 14px;
  --max: 1120px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse at 78% 6%, rgba(34, 211, 238, 0.07), transparent 38%),
    radial-gradient(ellipse at 10% 30%, rgba(139, 92, 246, 0.08), transparent 34%);
}
::selection { background: rgba(34, 211, 238, 0.35); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }

.wrap { width: min(var(--max), calc(100% - 40px)); margin: 0 auto; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(7, 11, 18, 0.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 14px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.08em; text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--cyan), var(--violet)); color: #04121a; font-weight: 900; }
.brand small { display: block; font-size: 10px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); }
.main-nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.main-nav a { padding: 8px 11px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none; }
.main-nav a:hover { color: var(--text); background: rgba(148, 184, 220, 0.08); }
.main-nav a[aria-current="page"] { color: var(--cyan); background: var(--cyan-dim); }
.lang-toggle { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 9px;
  font-size: 12px; font-weight: 700; padding: 7px 10px; cursor: pointer; }
.lang-toggle:hover { color: var(--text); border-color: var(--cyan); }
.menu-btn { display: none; }

/* Hero */
.hero { padding: 64px 0 36px; }
.eyebrow { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.hero h1 { font-size: clamp(34px, 5.4vw, 58px); line-height: 1.05; letter-spacing: -0.02em; margin: 12px 0; }
.hero h1 .grad { background: linear-gradient(90deg, var(--cyan), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 17px; color: var(--muted); max-width: 640px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.btn { display: inline-block; padding: 12px 20px; border-radius: 11px; font-weight: 700; font-size: 14.5px; text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn-primary { background: linear-gradient(90deg, #0ea5c4, #7c5cf0); color: #fff; }
.btn-primary:hover { filter: brightness(1.12); }
.btn-ghost { border-color: var(--line); color: var(--text); background: rgba(148, 184, 220, 0.05); }
.btn-ghost:hover { border-color: var(--cyan); }
.btn-small { padding: 8px 13px; font-size: 13px; }
.btn[disabled] { opacity: 0.55; cursor: wait; }

/* Cards & grids */
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.card { background: linear-gradient(180deg, rgba(20, 29, 45, 0.75), rgba(16, 24, 38, 0.92));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35); }
.card h3 { margin: 0 0 6px; font-size: 15px; }
.card p { margin: 6px 0; color: var(--muted); font-size: 13.5px; }
.kpi { font-size: 34px; font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.section { padding: 30px 0; }
.section h2 { font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.01em; margin: 6px 0 8px; }

/* Badges */
.badge { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); }
.badge-demo { color: #ffd166; border-color: rgba(255, 209, 102, 0.4); background: rgba(255, 209, 102, 0.08); }
.badge-manual { color: var(--cyan); border-color: rgba(34, 211, 238, 0.4); background: var(--cyan-dim); }
.badge-external { color: #c4b5fd; border-color: rgba(139, 92, 246, 0.45); background: var(--violet-dim); }
.badge-replay { color: var(--green); border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.08); }
.badge-live { color: var(--red); border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08); }
.badge-live-now { color: #fff; border-color: transparent; background: linear-gradient(90deg, #0ea5c4, #7c5cf0); }
.badge-planned { color: var(--muted); }
.badge-exploring { color: var(--amber); border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.07); }
.conf { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.conf-high { color: var(--green); background: rgba(52, 211, 153, 0.1); }
.conf-medium { color: var(--cyan); background: var(--cyan-dim); }
.conf-low { color: var(--amber); background: rgba(251, 191, 36, 0.1); }
.conf-none { color: var(--muted); background: rgba(148, 184, 220, 0.08); }

/* Tables & lists */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
table.data th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); }
table.data tr:hover td { background: rgba(148, 184, 220, 0.04); }
.win { color: var(--green); font-weight: 800; }
.loss { color: var(--red); font-weight: 800; }
.ev-list { list-style: none; margin: 8px 0; padding: 0; font-size: 13px; }
.ev-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed rgba(148, 184, 220, 0.12); }
.ev-list b { color: var(--muted); font-weight: 600; white-space: nowrap; }
.ev-list span { text-align: right; font-variant-numeric: tabular-nums; }

/* Forms */
label.field { display: block; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
input[type="text"], input[type="number"], input[type="date"], input[type="url"], select {
  width: 100%; margin-top: 4px; padding: 9px 11px; border-radius: 10px;
  border: 1px solid var(--line); background: #0d1420; color: var(--text); font: inherit; font-size: 14px; }
input[type="range"] { width: 100%; accent-color: var(--cyan); }
input[type="file"] { font-size: 13px; color: var(--muted); }
button.linklike { background: none; border: none; color: var(--cyan); cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; padding: 0; }
button.linklike:hover { text-decoration: underline; }
.alert { border-radius: 11px; padding: 11px 14px; font-size: 13.5px; margin: 10px 0; }
.alert-ok { border: 1px solid rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.08); }
.alert-err { border: 1px solid rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08); }
.alert-info { border: 1px solid rgba(34, 211, 238, 0.35); background: var(--cyan-dim); }
.empty { text-align: center; padding: 38px 18px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.skeleton { background: #1a2334; border-radius: 8px; position: relative; overflow: hidden; min-height: 18px; }
.decision { border-radius: var(--radius); padding: 20px; border: 1px solid; margin-top: 14px; }
.decision.CONTINUE { border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.07); }
.decision.REST { border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.06); }
.decision.TRAIN { border-color: rgba(34, 211, 238, 0.4); background: var(--cyan-dim); }
.decision.END { border-color: rgba(248, 113, 113, 0.45); background: rgba(248, 113, 113, 0.07); }
.progress { height: 8px; border-radius: 99px; background: rgba(148, 184, 220, 0.12); overflow: hidden; }
.progress > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--cyan), var(--violet)); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 44px; padding: 26px 0 40px; color: var(--faint); font-size: 12.5px; }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; margin: 8px 0 12px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--cyan); }

/* Steps */
.steps { counter-reset: step; display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding-top: 8px; }
.step-num { font-family: var(--mono); color: var(--violet); font-weight: 700; font-size: 12px; letter-spacing: 0.1em; }

.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--mono); font-size: 9px; fill: var(--faint); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.toolbar select { width: auto; }
.doc h3 { margin-top: 22px; }
.doc code { font-family: var(--mono); font-size: 12.5px; background: rgba(148, 184, 220, 0.1); padding: 1px 6px; border-radius: 6px; }
.doc pre { background: #0a0f18; border: 1px solid var(--line); border-radius: 10px; padding: 14px; overflow-x: auto; font-size: 12.5px; }

@media (max-width: 760px) {
  .main-nav { display: none; position: absolute; top: 62px; left: 0; right: 0; background: var(--bg-2);
    flex-direction: column; padding: 10px 20px 16px; border-bottom: 1px solid var(--line); }
  .main-nav.open { display: flex; }
  .menu-btn { display: inline-block; margin-left: auto; background: none; border: 1px solid var(--line);
    color: var(--text); border-radius: 9px; padding: 7px 11px; cursor: pointer; font-size: 14px; }
}

/* ─── Phase 2 · Cinematic landing ─────────────────────────────────────────── */
.brand-mark-img { width: 34px; height: 34px; display: block; filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.35)); }
.auth-btn { margin-left: 10px; white-space: nowrap; }

.hero-cine { position: relative; margin: 0 calc(50% - 50vw); padding: 0; overflow: clip; border-bottom: 1px solid var(--line); }
.hero-cine canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-veil { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(7,11,18,.55) 0%, rgba(7,11,18,.25) 40%, rgba(7,11,18,.88) 100%),
              radial-gradient(ellipse at 50% 110%, rgba(139,92,246,.18), transparent 55%); }
.hero-inner { position: relative; width: min(var(--max), calc(100% - 40px)); margin: 0 auto;
  padding: clamp(70px, 12vh, 130px) 0 clamp(50px, 8vh, 90px); }
.hero-inner h1 { font-size: clamp(40px, 7vw, 76px); line-height: 1.02; letter-spacing: -0.025em; margin: 14px 0; text-wrap: balance;
  text-shadow: 0 4px 40px rgba(0,0,0,.6); }
.hero-inner h1 .grad { background: linear-gradient(92deg, var(--cyan), var(--violet) 70%, #ff9f5a 130%);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-stats { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 26px; }
.hero-stats div b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.hero-stats div span { font-size: 12px; color: var(--muted); }
.concept-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; background: rgba(7,11,18,.55); }
.concept-tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

/* Scroll reveals */
.rv { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.rv.in { opacity: 1; transform: none; }
.rv-d1 { transition-delay: .08s; } .rv-d2 { transition-delay: .16s; } .rv-d3 { transition-delay: .24s; }

/* Showcase */
.show-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .show-grid { grid-template-columns: 1fr; } }
.show-card { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  background: #0a0f18; min-height: 300px; display: flex; flex-direction: column; justify-content: flex-end; }
.show-card canvas, .show-card video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.show-cap { position: relative; padding: 16px; background: linear-gradient(0deg, rgba(4,7,12,.92), transparent); }
.show-cap h3 { margin: 0 0 4px; }
.show-cap p { margin: 0 0 8px; font-size: 13px; color: var(--muted); }

/* Modal (accounts) */
.modal-veil { position: fixed; inset: 0; z-index: 90; background: rgba(3,5,9,.72); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 20px; }
.modal { width: min(480px, 100%); max-height: 88vh; overflow-y: auto; }
.pilot-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 11px; margin: 8px 0; background: rgba(148,184,220,.04); }
.pilot-row .nm { font-weight: 700; }
.pilot-row .pf { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.pilot-row .sp { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ─── Phase 4 · Private app shell ─────────────────────────────────────────── */
body.in-app .site-header { display: none; }
body.in-app .site-footer { display: none; }
.app-layout { display: grid; grid-template-columns: 236px 1fr; gap: 0; min-height: 100vh; }
.app-side { border-right: 1px solid var(--line); background: rgba(11, 17, 25, 0.9); padding: 18px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.app-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; font-weight: 800;
  letter-spacing: .08em; text-decoration: none; }
.app-brand img { width: 30px; height: 30px; }
.app-brand small { display: block; font-size: 10px; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.app-nav { display: flex; flex-direction: column; gap: 2px; }
.app-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; }
.app-nav a:hover { color: var(--text); background: rgba(148, 184, 220, 0.07); }
.app-nav a[aria-current="page"] { color: var(--cyan); background: var(--cyan-dim); }
.app-side .scope { margin: 14px 8px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; font-size: 12px; color: var(--muted); }
.app-main { min-width: 0; padding: 0 0 40px; }
.app-top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px;
  padding: 12px 22px; background: rgba(7, 11, 18, 0.9); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.app-top .crumb { font-weight: 800; font-size: 15px; }
.app-top .spacer { margin-left: auto; }
.profile-menu { position: relative; }
.profile-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 12px; font-size: 13px; font-weight: 700; }
.profile-menu summary::-webkit-details-marker { display: none; }
.profile-menu .avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--cyan), var(--violet)); color: #04121a; font-weight: 900; font-size: 13px; }
.profile-menu[open] .drop, .profile-menu .drop { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px; box-shadow: 0 18px 50px rgba(0,0,0,.5); }
.profile-menu .drop { display: none; }
.profile-menu[open] .drop { display: block; }
.profile-menu .drop a, .profile-menu .drop button { display: block; width: 100%; text-align: left; padding: 9px 10px;
  border-radius: 8px; font-size: 13.5px; color: var(--text); text-decoration: none; background: none; border: none; cursor: pointer; font: inherit; }
.profile-menu .drop a:hover, .profile-menu .drop button:hover { background: rgba(148, 184, 220, 0.08); }
.profile-menu .who { padding: 8px 10px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.side-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 7px 11px; cursor: pointer; font-size: 14px; }
.scope-banner { display: flex; align-items: center; gap: 10px; border-radius: 11px; padding: 10px 14px;
  font-size: 13px; margin: 14px 0; border: 1px solid rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.07); }
@media (max-width: 960px) {
  .app-layout { grid-template-columns: 1fr; }
  .app-side { position: fixed; z-index: 60; inset: 0 auto 0 0; width: 250px; transform: translateX(-105%);
    transition: transform .22s ease; height: 100vh; }
  body.side-open .app-side { transform: none; }
  body.side-open::after { content: ""; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.55); }
  .side-toggle { display: inline-block; }
}
