/* Design tokens — CertStone "Night Console".
   World: a void-violet console lit by amber. Modelled on the owner's pinned
   reference (infinitytechstack.uk/pulsebridge), first shipped on the landing
   page 2026-10-20 and promoted site-wide the same day. Supersedes Warm Night
   (2026-09-12). Class names are unchanged from the previous worlds, so every
   template inherits this system without markup changes.
   Durable rules carried over: violet is the confidence band's alone; status
   is always glyph + words, never color alone; geometry encodes real numbers. */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600;700&display=swap');

:root {
  /* Surfaces — void ground, deep cards */
  --bg:          #06060c;   /* void */
  --bg-elev:     #0b0e16;   /* card */
  --bg-elev-2:   #121725;   /* nested surface, hover rows, meter tracks */
  --border:      #1c2030;   /* hairline */
  --border-lit:  #2a3045;   /* hovered/focused container */

  /* Text */
  --fg:          #e4e4f0;   /* body                 16.0:1 on --bg  AAA */
  --fg-bright:   #f4f1ea;   /* headings, numerals   17.9:1         AAA */
  --fg-muted:    #98a1b3;   /* meaningful captions   7.6:1         AAA */
  --fg-dim:      #5d6477;   /* decoration only       3.2:1 — never words */

  /* Semantic accents — every status still carries a glyph + label */
  --accent:      #ffc53d;   /* amber — primary actions, links, focus */
  --accent-2:    #ff7a1a;   /* orange — the far end of the amber gradient */
  --accent-ink:  #1a0f00;   /* text on a filled amber control */
  --cyan:        #22d3ee;   /* secondary signal, tag chips */
  --ok:          #34d399;   /* emerald — correct, above cut, converged */
  --warn:        #fb923c;   /* orange — borderline, due, needs work */
  --danger:      #f87171;   /* red — incorrect, below cut, destructive */
  --uncertainty: #c39ef2;   /* violet — the confidence band and nothing else */
  --purple:      #9a86e8;   /* reserved: "flagged for review" only */

  /* Domain identity colors — one fixed hue per domain, identity never status */
  --d1: #3ee0ff;
  --d2: #5cc8ff;
  --d3: #7db0ff;
  --d4: #4df0b0;
  --d5: #a0e86a;
  --d6: #ffc766;
  --d7: #ff9d5c;
  --d8: #f27ab0;   /* rose — violet is the band's alone */

  /* Type — Space Grotesk display, Inter body, JetBrains Mono for data/labels */
  --font-display: 'Space Grotesk', 'Inter Tight', 'Segoe UI', system-ui, sans-serif;
  --font-body:    'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
  --step--1: 0.8125rem;  /* 13px small */
  --step-0:  0.9375rem;  /* 15px body */
  --step-1:  1.1875rem;  /* 19px */
  --step-2:  1.5rem;     /* 24px */
  --step-3:  1.875rem;   /* 30px */
  --step-4:  2.5rem;     /* 40px */
  --step-5:  3.25rem;    /* 52px */

  /* Rhythm */
  --r: 16px;             /* cards */
  --r-ctl: 10px;         /* buttons, inputs */
  --r-pill: 999px;       /* badges, meters */
  --settle: 700ms;       /* the one motion clock: meters settle once on load */

  --shadow-card: inset 0 1px 0 rgba(255,255,255,0.05), 0 18px 50px -24px rgba(0,0,0,0.8);
  --grad-accent: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
}

* { box-sizing: border-box; }

html, body, body.bg-bg {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  margin: 0;
  min-height: 100vh;
}

/* Ground: void + three ambient glows, a faint fading grid, and film grain. */
body {
  font-size: var(--step-0);
  line-height: 1.6;
  background:
    radial-gradient(1200px 820px at 14% -6%, rgba(96,44,168,0.16), transparent 60%),
    radial-gradient(1050px 720px at 88% 4%, rgba(0,132,172,0.12), transparent 60%),
    radial-gradient(1300px 900px at 50% 112%, rgba(128,24,148,0.10), transparent 62%),
    linear-gradient(180deg, #080814 0, #070711 24%, #05050c 58%, #06060f 100%),
    var(--bg);
  background-attachment: fixed;
}
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 85%);
          mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 85%);
}
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.05;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.62' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}
body > * { position: relative; z-index: 1; }

a { color: var(--accent); }
strong, b { color: var(--fg-bright); }

/* Browser surfaces carry the world too. */
::selection { background: rgba(255, 197, 61, 0.30); color: #fff; }
input, textarea { caret-color: var(--accent); }
* { scrollbar-width: thin; scrollbar-color: var(--border-lit) var(--bg); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-lit); border: 2px solid var(--bg); border-radius: 999px; }

kbd {
  font-family: var(--font-mono); font-size: 0.8em;
  padding: 0.1em 0.45em; border-radius: 6px;
  background: var(--bg-elev-2); border: 1px solid var(--border-lit); color: var(--fg-bright);
}

/* Page titles: every screen's single h1 speaks the display voice, whatever
   utility sizes the template gave it (the :not() keeps the landing hero). */
main h1:not(.lp-h1) {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3.2vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
  color: var(--fg-bright);
  text-transform: none;
  display: block;
  margin-bottom: 1.5rem;
}
main h1:not(.lp-h1) .sigil { display: none; }

/* Reading surface (question stems, explanations): raised contrast, roomy
   leading, book measure — the world goes quiet where reading happens. */
.reading-surface {
  color: var(--fg-bright);
  font-size: 1rem;
  line-height: 1.75;
  max-width: 68ch;
}

/* Focus-visible: 2px amber outline, offset — always visible, never removed. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Section headers — the console label: mono, uppercase, tracked. */
.hdr {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-bright);
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin: 0 0 1.1em 0;
}
.hdr::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  flex-shrink: 0;
}
.hdr .sigil { display: none; }
.hdr .caret { display: none; }

/* Mono eyebrow + display title, for page-level section breaks. */
.eyebrow {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 0.6rem;
}

/* Cards — deep, quiet, lit from above. */
.panel {
  position: relative;
  background: linear-gradient(rgba(255,255,255,0.035), rgba(255,255,255,0.01)), var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}
.panel--nested {
  background: rgba(255,255,255,0.02);
  border-radius: 12px;
  box-shadow: none;
}
/* The headline card (readiness hero) carries the amber edge glow. */
.panel--plot {
  border-color: rgba(255,197,61,0.38);
  box-shadow: 0 15px 35px rgba(0,0,0,0.5), 0 0 24px rgba(234,179,8,0.10);
}

/* Buttons — glass secondaries, one amber gradient primary. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: -0.01em;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.09);
  color: var(--fg-bright);
  border-radius: var(--r-ctl);
  padding: 0.6em 1.15em;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.btn:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.18); }
.btn:active { transform: translateY(1px); }
.btn--accent {
  background: var(--grad-accent);
  border-color: transparent;
  color: var(--accent-ink);
  box-shadow: 0 8px 28px rgba(255,122,26,0.28), inset 0 1px 0 rgba(255,255,255,0.45);
}
.btn--accent:hover { background: var(--grad-accent); border-color: transparent; transform: translateY(-1px); box-shadow: 0 12px 36px rgba(255,122,26,0.42), inset 0 1px 0 rgba(255,255,255,0.5); }
.btn--danger { border-color: rgba(248,113,113,0.5); color: var(--danger); background: rgba(248,113,113,0.05); }
.btn--danger:hover { background: rgba(248, 113, 113, 0.12); border-color: var(--danger); }
.btn--ghost { background: transparent; border-color: var(--border-lit); color: var(--fg); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn[aria-pressed="true"] { background: rgba(154, 134, 232, 0.16); border-color: var(--purple); color: var(--purple); }

/* Exam navigator grid — answered and flagged stay orthogonal, glyph + style. */
.nav-item { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 0.15em; font-family: var(--font-mono); }
.nav-item.is-answered { border-color: var(--ok); }
.nav-item.is-flagged { border-style: dashed; }
.nav-item .nav-mark { font-size: 0.7em; line-height: 1; }
.nav-item .nav-mark--answered { color: var(--ok); }
.nav-item .nav-mark--flagged { color: var(--purple); position: absolute; top: -0.55em; right: -0.3em; }

/* Badges — tinted pills with a hairline. Glyph + label always ride with the color. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--step--1);
  padding: 0.3em 0.85em;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  /* Sentence-length notices (forgot-password, reset confirmations) must
     wrap inside their card instead of overflowing it. */
  white-space: normal;
}
.badge--ok { color: var(--ok); background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.32); }
.badge--warn { color: var(--warn); background: rgba(251, 146, 60, 0.08); border-color: rgba(251, 146, 60, 0.32); }
.badge--danger { color: var(--danger); background: rgba(248, 113, 113, 0.08); border-color: rgba(248, 113, 113, 0.32); }
.badge--muted { color: var(--fg-muted); background: rgba(255, 255, 255, 0.03); border-color: var(--border-lit); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }

/* Answer choices — deep rows, generous targets, amber when chosen. */
.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  border: 1px solid var(--border-lit);
  border-radius: 12px;
  padding: 0.95rem 1.05rem;
  cursor: pointer;
  background: var(--bg-elev);
  transition: border-color 150ms ease, background-color 150ms ease;
}
.choice:hover { border-color: #3a4260; background: var(--bg-elev-2); }
.choice input[type="radio"] {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}
.choice .key {
  font-family: var(--font-mono);
  font-weight: 700;
  width: 1.9em; height: 1.9em;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-lit);
  border-radius: 8px;
  flex-shrink: 0;
  color: var(--fg-muted);
}
.choice.is-selected { border-color: var(--accent); background: rgba(255, 197, 61, 0.06); box-shadow: 0 0 20px rgba(234,179,8,0.08); }
.choice.is-selected .key { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.choice.is-correct { border-color: var(--ok); background: rgba(52, 211, 153, 0.07); }
.choice.is-correct .key { background: var(--ok); color: #04241a; border-color: var(--ok); }
.choice.is-incorrect-chosen { border-color: var(--danger); background: rgba(248, 113, 113, 0.07); }
.choice.is-incorrect-chosen .key { background: var(--danger); color: #2b0c0c; border-color: var(--danger); }
.choice.is-correct-not-chosen { border-color: var(--ok); border-style: dashed; }
.choice .status-label { font-size: var(--step--1); font-weight: 700; margin-top: 0.15rem; }
.choice.is-correct .status-label { color: var(--ok); }
.choice.is-incorrect-chosen .status-label { color: var(--danger); }
.choice.is-correct-not-chosen .status-label { color: var(--ok); }

/* Data tables — mono uppercase headers, hairline rows, amber hover. */
table.data-table { width: 100%; border-collapse: collapse; }
table.data-table caption { text-align: left; color: var(--fg-muted); font-size: var(--step--1); margin-bottom: 0.5em; }
table.data-table th {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  text-align: left;
  padding: 0.7em 0.7em;
  border-bottom: 1px solid var(--border-lit);
}
table.data-table tbody th { font-family: var(--font-body); font-size: inherit; letter-spacing: 0; text-transform: none; color: var(--fg); font-weight: 500; }
table.data-table td {
  padding: 0.75em 0.7em;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
table.data-table tbody tr:hover { background: rgba(255, 197, 61, 0.03); }
table.data-table td.num, table.data-table th.num { text-align: right; }
table.data-table td.num { font-family: var(--font-mono); font-size: 0.9em; color: var(--fg-bright); }
table.data-table td .badge, table.data-table td .btn { white-space: nowrap; }
/* Wide admin tables scroll inside their card instead of spilling past it. */
.panel { overflow-x: auto; }
/* On admin screens (full-width, see base.html) every cell stays on one line;
   only cells marked .cell-wrap (free text like a question stem) may wrap. */
.page--admin table.data-table th,
.page--admin table.data-table td { white-space: nowrap; padding-left: 0.45em; padding-right: 0.45em; }
.page--admin table.data-table td.cell-wrap { white-space: normal; min-width: 24rem; }

/* Stacked tables at phone widths: name row + wrapped meta row. */
@media (max-width: 767px) {
  table.data-table--stack, table.data-table--stack tbody { display: block; }
  table.data-table--stack thead { display: none; }
  table.data-table--stack caption { display: block; }
  table.data-table--stack tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3em 1.1em;
    padding: 0.7em 0;
    border-bottom: 1px solid var(--border);
  }
  table.data-table--stack th[scope="row"] { flex: 1 1 100%; border: 0; padding: 0; }
  table.data-table--stack td { border: 0; padding: 0; }
  table.data-table--stack td[data-label]::before {
    content: attr(data-label) ' ';
    color: var(--fg-muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
}

/* Chart axis labels. SVG text scales with the viewBox. */
.trend-label { font-family: var(--font-mono); font-weight: 600; }

/* Stat strip — one row of facts divided by hairlines, not a card grid. */
.console-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem 2.5rem;
}
.console-strip > div { min-width: 12rem; flex: 1; }
.console-strip > div + div { border-left: 1px solid var(--border); padding-left: 2.5rem; }
@media (max-width: 767px) {
  .console-strip > div + div { border-left: 0; padding-left: 0; border-top: 1px solid var(--border); padding-top: 1rem; }
}

/* Numeric readouts — mono, bright, tabular. */
.readout {
  font-family: var(--font-mono);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--fg-bright);
  line-height: 1.05;
}

/* Meters and progress rails — pills with the amber gradient; settle once. */
.progress-bar {
  height: 8px;
  background: var(--bg-elev-2);
  border: 0;
  border-radius: var(--r-pill);
  overflow: hidden;
}
.progress-bar > span {
  display: block;
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  animation: meter-settle var(--settle) cubic-bezier(.22,.8,.36,1) 1 both;
  transform-origin: left center;
}
@keyframes meter-settle {
  from { transform: scaleX(0.4); opacity: 0.5; }
  to   { transform: scaleX(1); opacity: 1; }
}

/* Empty states — plain-spoken, always with a next action. */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--fg-muted);
}
.empty-state h3 { color: var(--fg-bright); font-family: var(--font-body); font-weight: 700; margin-bottom: 0.5rem; }

/* Ghost treatment — designed absence: unmeasured domains, unearned mastery. */
.ghost-card {
  opacity: 0.6;
  border-style: dashed;
  box-shadow: none;
}

/* Forms */
.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.4rem;
}
.field-input,
main input[type="email"], main input[type="password"], main input[type="text"],
main input[type="number"], main input[type="url"], main input[type="search"],
main select, main textarea {
  background: #0d1120;
  border: 1px solid var(--border-lit);
  border-radius: var(--r-ctl);
  padding: 0.6em 0.85em;
  color: var(--fg-bright);
  font-family: var(--font-body);
  font-size: var(--step-0);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
main input[type="checkbox"], main input[type="radio"] { accent-color: var(--accent); }
.field-input:hover, main input:hover, main select:hover, main textarea:hover { border-color: #3a4260; }
.field-input:focus, main input:focus, main select:focus, main textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,197,61,0.12); outline: none; }
.field-input:focus-visible, main input:focus-visible, main select:focus-visible, main textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.field-input { width: 100%; }
.field-input.has-error { border-color: var(--danger); }
textarea.field-input { resize: vertical; min-height: 4.5em; }
.field-error {
  display: flex;
  align-items: flex-start;
  gap: 0.4em;
  color: var(--danger);
  font-size: var(--step--1);
  font-weight: 600;
  margin-top: 0.35rem;
}

.disclaimer {
  font-size: var(--step--1);
  color: var(--fg-muted);
  max-width: 60ch;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.5em 1em;
  border-radius: 0 0 10px 0;
  z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* ---- App chrome: the floating glass console bar ---- */
.chrome {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 0.9rem 1rem 0;
  background: transparent;
  border: 0;
}
.chrome-bar {
  border-radius: 22px;
  background: rgba(10,10,16,0.78);
  border: 1px solid rgba(139,92,246,0.25);
  box-shadow: 0 10px 40px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.08);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
}
.chrome-brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--fg-bright);
  text-decoration: none;
  white-space: nowrap;
}
.chrome-brand .sigil { color: var(--accent); letter-spacing: 0; margin-right: 0.15em; }
.chrome-link {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  color: #c9cbe0;
  text-decoration: none;
  padding: 0.3em 0.1em;
  border-bottom: 2px solid transparent;
  transition: color 150ms ease;
}
.chrome-link:hover { color: #fff; }
.chrome-link[aria-current="page"] { color: #fff; border-bottom-color: var(--accent); }
.chrome .btn { padding: 0.45em 0.95em; font-size: 0.8rem; border-radius: 999px; }
/* On phones the bar wraps to several rows, so it scrolls away instead of pinning. */
@media (max-width: 767px) { .chrome { position: static; } }

/* ---- Readiness hero pieces (partials/readiness_gauge.html) ---- */

/* The mastery rail: fill width IS the pass probability; the violet overlay
   spans exactly prob_low → prob_high. Geometry still encodes real numbers. */
.mastery-rail {
  position: relative;
  height: 12px;
  border-radius: var(--r-pill);
  background: var(--bg-elev-2);
  overflow: hidden;
}
.mastery-rail .fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  animation: meter-settle var(--settle) cubic-bezier(.22,.8,.36,1) 1 both;
  transform-origin: left center;
}
.mastery-rail .band {
  position: absolute;
  top: 0; bottom: 0;
  background: rgba(195, 158, 242, 0.32);
  border-left: 2px solid var(--uncertainty);
  border-right: 2px solid var(--uncertainty);
}

/* Legacy animation hooks (old-world class names still referenced by any
   unconverted template): collapse to the same gentle settle. */
.sweep-line { display: none; }
.converge-band { animation: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* =========================================================================
   Marketing components (.lp-*) — the landing page's vocabulary, shared so
   any public page can use it. Built first in landing.html, moved here.
   ========================================================================= */

/* ---- Night Console: landing-only tokens -------------------------------- */
.lp {
  --lp-bg:      #06060c;
  --lp-card:    #0b0e16;
  --lp-card-2:  #10141f;
  --lp-line:    rgba(255,255,255,0.07);
  --lp-line-2:  rgba(255,255,255,0.12);
  --lp-head:    #f4f1ea;   /* headings          17.9:1 on --lp-bg */
  --lp-text:    #e4e4f0;   /* body              16.0:1 */
  --lp-muted:   #98a1b3;   /* captions           7.6:1 */
  --lp-dim:     #5d6477;   /* decoration only */
  --lp-amber:   #ffc53d;
  --lp-orange:  #ff7a1a;
  --lp-cyan:    #22d3ee;
  --lp-green:   #34d399;
  --lp-display: 'Space Grotesk', 'Inter Tight', 'Segoe UI', system-ui, sans-serif;
  --lp-sans:    'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --lp-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  /* Re-point the shared tokens so token-built pieces (mastery rail,
     progress bar, readout, disclaimer) render in this page's palette. */
  --fg: var(--lp-text);
  --fg-bright: var(--lp-head);
  --fg-muted: var(--lp-muted);
  --accent: var(--lp-amber);
  --bg-elev-2: #161b28;
  --border: var(--lp-line);

  font-family: var(--lp-sans);
  color: var(--lp-text);
  font-size: 1rem;
  line-height: 1.6;
}

/* Ground: void + three ambient glows + film grain + a faint fading grid. */

.lp a { color: var(--lp-amber); }
.lp :focus-visible { outline: 2px solid var(--lp-amber); outline-offset: 3px; }
.lp em { color: var(--lp-head); }
.lp strong, .lp .hl { color: var(--lp-head); font-weight: 700; }

/* ---- floating pill nav ---------------------------------------------- */
.lp-nav {
  position: sticky; top: 0.9rem; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.55rem 0.6rem 0.55rem 1.4rem;
  margin: 0 auto 2.75rem;
  border-radius: 100px;
  background: rgba(10,10,16,0.75);
  border: 1px solid rgba(139,92,246,0.25);
  box-shadow: 0 10px 40px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.08);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
}
.lp-brand {
  font-family: var(--lp-mono); font-weight: 700;
  font-size: 0.8rem; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--lp-head) !important; text-decoration: none; white-space: nowrap;
}
.lp-brand .gem { color: var(--lp-amber); letter-spacing: 0; margin-right: 0.35em; }
.lp-navlinks { display: flex; align-items: center; gap: 1.6rem; list-style: none; margin: 0; padding: 0; }
.lp-navlinks a {
  font-weight: 600; font-size: 0.875rem; color: #c9cbe0 !important; text-decoration: none;
  transition: color 150ms ease;
}
.lp-navlinks a:hover { color: #fff !important; }
.lp-navactions { display: flex; align-items: center; gap: 0.5rem; }
@media (max-width: 899px) { .lp-navlinks { display: none; } }
@media (max-width: 480px) {
  .lp-nav { padding-left: 1rem; }
  .lp-brand { letter-spacing: 0.18em; }
  .lp-navactions .lp-btn--ghost { display: none; }
}

/* ---- buttons ---------------------------------------------------------- */
.lp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  font-family: var(--lp-sans); font-weight: 700; font-size: 0.9rem; letter-spacing: -0.01em;
  padding: 0.8rem 1.4rem; border-radius: 10px;
  text-decoration: none !important; cursor: pointer; white-space: nowrap;
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease, border-color 150ms ease;
}
.lp-btn--primary {
  color: #1a0f00 !important;
  background: linear-gradient(135deg, var(--lp-amber) 0%, var(--lp-orange) 100%);
  box-shadow: 0 8px 32px rgba(255,122,26,0.32), inset 0 1px 0 rgba(255,255,255,0.45);
}
.lp-btn--primary:hover { transform: translateY(-1px); box-shadow: 0 12px 40px rgba(255,122,26,0.45), inset 0 1px 0 rgba(255,255,255,0.5); }
.lp-btn--ghost {
  color: var(--lp-head) !important;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}
.lp-btn--ghost:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.16); }
.lp-btn--sm { padding: 0.55rem 1.05rem; font-size: 0.82rem; border-radius: 100px; }
.lp-btn:active { transform: translateY(1px); }

/* ---- chips / badges --------------------------------------------------- */
.lp-pill {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--lp-mono); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.45rem 1rem; border-radius: 100px;
  color: var(--lp-amber); background: rgba(255,197,61,0.06);
  border: 1px solid rgba(255,197,61,0.35);
}
.lp-pill--cyan { color: #67e8f9; background: rgba(34,211,238,0.06); border-color: rgba(34,211,238,0.35); }
.lp-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.lp-pill .dot--pulse { animation: lp-pulse 2.2s ease-in-out infinite; }
@keyframes lp-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.lp-tag {
  display: inline-block;
  font-family: var(--lp-mono); font-size: 0.68rem;
  padding: 0.2rem 0.55rem; border-radius: 6px;
  color: #8be9f7; background: rgba(34,211,238,0.07);
  border: 1px solid rgba(34,211,238,0.28);
}
.lp-tag--amber { color: var(--lp-amber); background: rgba(255,197,61,0.07); border-color: rgba(255,197,61,0.32); }
.lp-tag--muted { color: var(--lp-muted); background: rgba(255,255,255,0.03); border-color: var(--lp-line-2); }
.lp-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* ---- hero ------------------------------------------------------------- */
.lp-hero { position: relative; text-align: center; padding: 1.5rem 0 1rem; }
.lp-hero::before {
  content: ""; position: absolute; left: 50%; top: 8%;
  width: min(900px, 100%); height: 420px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255,160,40,0.13), transparent 70%);
  filter: blur(20px); pointer-events: none; z-index: -1;
}
.lp-hero-pills { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2rem; }
.lp-h1 {
  font-family: var(--lp-display); font-weight: 700;
  font-size: clamp(2.5rem, 6.6vw, 5.4rem);
  line-height: 1.02; letter-spacing: -0.045em;
  color: var(--lp-head); margin: 0 auto 1.6rem; max-width: 18ch;
  text-wrap: balance;
}
.lp-grad {
  background: linear-gradient(100deg, #fff6dc 0, var(--lp-amber) 38%, var(--lp-orange) 78%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.lp-sub { font-size: clamp(1.02rem, 1.5vw, 1.2rem); line-height: 1.7; color: var(--lp-muted); max-width: 46rem; margin: 0 auto 0.75rem; }
.lp-cta-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.75rem; margin: 2.2rem 0 1rem; }
.lp-fineprint { font-family: var(--lp-mono); font-size: 0.75rem; letter-spacing: 0.04em; color: var(--lp-muted); margin: 0; }

.lp-metrics {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0.9rem;
  max-width: 60rem; margin: 3rem auto 0;
}
@media (min-width: 768px) { .lp-metrics { grid-template-columns: repeat(var(--cols, 5), minmax(0,1fr)); } }
.lp-metric {
  text-align: center; padding: 1.4rem 0.8rem 1.25rem;
}
.lp-metric-val {
  display: block;
  font-family: var(--lp-mono); font-weight: 700; font-size: 1.6rem; line-height: 1.15;
  color: var(--lp-amber); font-variant-numeric: tabular-nums;
}
.lp-metric-val small { font-size: 0.6em; color: var(--lp-muted); font-weight: 600; }
.lp-metric-label {
  font-family: var(--lp-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--lp-muted); margin: 0.6rem 0 0; line-height: 1.6;
}
.lp-pulse-line { display: block; width: 100%; max-width: 64rem; height: 34px; margin: 3.5rem auto 0; }

/* ---- section header --------------------------------------------------- */
.lp-section { margin-top: 7rem; scroll-margin-top: 6rem; }
.lp-section-head { text-align: center; max-width: 48rem; margin: 0 auto 3rem; }
.lp-eyebrow {
  font-family: var(--lp-mono); font-size: 0.75rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--lp-amber); margin: 0 0 1rem;
}
.lp-h2 {
  font-family: var(--lp-display); font-weight: 700;
  font-size: clamp(1.9rem, 3.6vw, 2.65rem); line-height: 1.12; letter-spacing: -0.035em;
  color: var(--lp-head); margin: 0 0 1.1rem; text-wrap: balance;
}
.lp-h2 .hl-amber { color: var(--lp-amber); }
.lp-desc { color: var(--lp-muted); font-size: 0.98rem; line-height: 1.7; margin: 0 auto; max-width: 42rem; }
.lp-rule { width: 64px; height: 2px; margin: 1.6rem auto 0; border: 0; background: linear-gradient(90deg, transparent, var(--lp-amber), transparent); }

/* ---- cards ------------------------------------------------------------ */
.lp-card {
  position: relative;
  background: linear-gradient(rgba(255,255,255,0.035), rgba(255,255,255,0.01)), var(--lp-card);
  border: 1px solid var(--lp-line);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 18px 50px -24px rgba(0,0,0,0.8);
}
.lp-card--pad { padding: 1.75rem; }
.lp-card--sm { border-radius: 12px; }
.lp-card--lit { border-color: rgba(255,197,61,0.38); box-shadow: 0 15px 35px rgba(0,0,0,0.5), 0 0 24px rgba(234,179,8,0.10); }
.lp-feature { padding: 1.75rem; display: flex; flex-direction: column; gap: 0.85rem; transition: border-color 200ms ease, transform 200ms ease; }
.lp-feature:hover { border-color: rgba(255,197,61,0.25); transform: translateY(-2px); }
.lp-feature-icon { font-size: 1.5rem; line-height: 1; }
.lp-h3 { font-family: var(--lp-sans); font-weight: 700; font-size: 1.12rem; line-height: 1.4; color: var(--lp-head); margin: 0; }
.lp-feature p { color: var(--lp-muted); font-size: 0.875rem; line-height: 1.7; margin: 0; }
.lp-feature .lp-tags { margin-top: auto; padding-top: 0.4rem; }
.lp-grid-3 { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .lp-grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1024px) { .lp-grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.lp-grid-2 { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .lp-grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); } }

.lp-cardhead { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.lp-cardtitle { font-family: var(--lp-mono); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--lp-head); margin: 0; }

/* ---- the instrument split -------------------------------------------- */
.lp-split { display: grid; gap: 1.5rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1024px) { .lp-split { grid-template-columns: 5fr 6fr; } }
.lp-instrument { padding: 1.75rem; }
.lp-instrument .readout { font-family: var(--lp-mono); color: var(--lp-head); }
.lp-big { font-size: 3.6rem; font-weight: 700; line-height: 1; }
.lp-big small { font-size: 0.45em; color: var(--lp-muted); }
.lp-caption { color: var(--lp-muted); font-size: 0.82rem; margin: 0; }
.lp-caption-strong { color: var(--lp-text); font-weight: 600; font-size: 0.875rem; margin: 0; }
.lp .mastery-rail { background: #161b28; }
.lp .mastery-rail .fill, .lp .progress-bar > span { background: linear-gradient(90deg, var(--lp-amber), var(--lp-orange)); }
.lp .disclaimer { color: var(--lp-muted); font-size: 0.8rem; line-height: 1.6; }
.lp-locked { text-align: center; padding: 0.5rem 0.25rem 0.25rem; }
.lp-locked h3 { font-family: var(--lp-sans); font-weight: 700; font-size: 1rem; color: var(--lp-head); margin: 0 0 0.5rem; }

/* terminal / log panel */
.lp-term { overflow: hidden; }
.lp-term-bar {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--lp-line);
  background: rgba(255,255,255,0.02);
}
.lp-lights { display: flex; gap: 6px; }
.lp-lights i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.lp-term-title { flex: 1; text-align: center; font-family: var(--lp-mono); font-size: 0.75rem; color: var(--lp-muted); }
.lp-term-body { padding: 1.25rem 1.4rem 1.4rem; font-family: var(--lp-mono); font-size: 0.8rem; line-height: 1.75; }
.lp-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.lp-log li { display: grid; grid-template-columns: 5.6rem 1fr; gap: 0.75rem; }
.lp-log .k { color: var(--lp-amber); font-weight: 600; }
.lp-log .v { color: #7ee2b8; }
.lp-log .v b { color: var(--lp-head); font-weight: 600; }
.lp-term-foot { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px dashed var(--lp-line-2); color: var(--lp-muted); }
.lp-term-foot .p { color: var(--lp-amber); }
@media (max-width: 480px) { .lp-log li { grid-template-columns: 1fr; gap: 0.1rem; } }

.lp-prose { color: var(--lp-text); line-height: 1.75; font-size: 0.98rem; }
.lp-prose p { margin: 0 0 1rem; }

/* ---- screenshot + captions ------------------------------------------- */
.lp-shot-wrap { display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1024px) { .lp-shot-wrap { grid-template-columns: 5fr 7fr; } }
.lp-shot {
  border-radius: 22px; padding: 10px; background: #0d1020;
  border: 1px solid rgba(139,92,246,0.28);
  box-shadow: 0 0 60px rgba(255,160,40,0.10), 0 30px 60px -20px rgba(0,0,0,0.9);
}
.lp-shot img { display: block; width: 100%; height: auto; border-radius: 14px; }
.lp-caps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.lp-cap { padding: 1.1rem 1.25rem; display: grid; grid-template-columns: 1fr auto; gap: 0.35rem 1rem; align-items: center; border-radius: 14px; }
.lp-cap .t { display: flex; align-items: center; gap: 0.65rem; font-weight: 700; color: var(--lp-head); font-size: 0.98rem; }
.lp-cap .t i { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.lp-cap .d { grid-column: 1 / -1; color: var(--lp-muted); font-size: 0.85rem; margin: 0; }
@media (min-width: 640px) { .lp-cap .d { grid-column: 1; } .lp-cap .lp-tag { grid-row: 1 / span 2; grid-column: 2; } }

/* ---- dossier ---------------------------------------------------------- */
.lp-dossier { padding: 2rem; overflow: hidden; }
.lp-dossier::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--lp-amber), var(--lp-cyan));
}
.lp-kv { display: grid; gap: 0.9rem; grid-template-columns: 1fr; margin: 1.5rem 0 0; }
@media (min-width: 640px) { .lp-kv { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1024px) { .lp-kv { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.lp-kv > div { background: rgba(255,255,255,0.02); border: 1px solid var(--lp-line); border-radius: 12px; padding: 1rem 1.1rem; }
.lp-kv dt { font-family: var(--lp-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--lp-muted); margin-bottom: 0.4rem; }
.lp-kv dd { margin: 0; font-weight: 700; color: var(--lp-head); font-size: 0.95rem; line-height: 1.45; }
.lp-kv dd .m { font-family: var(--lp-mono); color: var(--lp-amber); }

/* ---- tables ----------------------------------------------------------- */
.lp-table-wrap { overflow-x: auto; border-radius: 16px; }
.lp-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.lp-table thead th {
  font-family: var(--lp-mono); font-weight: 600; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--lp-muted); text-align: left; padding: 1.1rem 1.25rem;
  background: rgba(255,255,255,0.025); border-bottom: 1px solid var(--lp-line);
}
.lp-table td, .lp-table tbody th { padding: 1.05rem 1.25rem; border-bottom: 1px solid var(--lp-line); vertical-align: middle; color: var(--lp-text); text-align: left; font-weight: 400; }
.lp-table tbody tr:last-child td, .lp-table tbody tr:last-child th { border-bottom: 0; }
.lp-table tbody tr:hover { background: rgba(255,197,61,0.03); }
.lp-table .id { font-family: var(--lp-mono); font-weight: 700; color: var(--lp-amber); white-space: nowrap; }
.lp-table .res { font-family: var(--lp-mono); font-weight: 600; color: var(--lp-amber); font-size: 0.82rem; }
.lp-table .num { text-align: right; font-family: var(--lp-mono); font-weight: 700; color: var(--lp-head); white-space: nowrap; font-variant-numeric: tabular-nums; }
.lp-bar { height: 8px; border-radius: 100px; background: #161b28; overflow: hidden; width: 100%; min-width: 5rem; }
.lp-bar > span { display: block; height: 100%; border-radius: 100px; }
@media (max-width: 640px) { .lp-table td, .lp-table tbody th, .lp-table thead th { padding: 0.85rem 0.8rem; } .lp-hide-sm { display: none; } }

.lp-note { color: var(--lp-muted); font-size: 0.9rem; line-height: 1.75; max-width: 46rem; margin: 1.6rem auto 0; }

/* ---- plans ------------------------------------------------------------ */
.lp-plan { padding: 2rem 1.75rem; display: flex; flex-direction: column; }
.lp-plan-name { font-family: var(--lp-mono); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--lp-muted); margin: 0; }
.lp-price { font-family: var(--lp-display); font-weight: 700; font-size: 3rem; letter-spacing: -0.04em; color: var(--lp-head); line-height: 1; margin: 1rem 0 0.4rem; }
.lp-price small { font-family: var(--lp-sans); font-size: 0.95rem; font-weight: 500; letter-spacing: 0; color: var(--lp-muted); }
.lp-checks { list-style: none; margin: 1.4rem 0 0; padding: 1.4rem 0 0; border-top: 1px solid var(--lp-line); display: grid; gap: 0.7rem; font-size: 0.875rem; flex: 1; align-content: start; }
.lp-checks li { display: grid; grid-template-columns: 1.2rem 1fr; gap: 0.5rem; color: var(--lp-text); line-height: 1.55; }
.lp-checks li .g { color: var(--lp-green); font-weight: 700; }
.lp-checks li.off { color: var(--lp-muted); }
.lp-checks li.off .g { color: var(--lp-dim); }
.lp-plan .lp-btn { margin-top: 1.75rem; width: 100%; }

/* ---- closing ---------------------------------------------------------- */
.lp-close { text-align: center; padding: 3.5rem 1.5rem; overflow: hidden; }
.lp-close::before {
  content: ""; position: absolute; inset: auto 10% -60% 10%; height: 120%;
  background: radial-gradient(closest-side, rgba(255,140,30,0.12), transparent 70%);
  pointer-events: none;
}
.lp-close > * { position: relative; }
.lp-footer { margin-top: 4rem; padding: 2rem 0 1rem; border-top: 1px solid var(--lp-line); display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.lp-footer p { color: var(--lp-muted); font-size: 0.78rem; line-height: 1.7; max-width: 44rem; margin: 0; }

.lp-warnbox { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; padding: 1.4rem 1.6rem; margin-top: 1.5rem; }
.lp-warnbox .ic { font-family: var(--lp-mono); font-weight: 700; color: #1a0f00; background: var(--lp-amber); width: 1.6rem; height: 1.6rem; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.lp-warnbox p { margin: 0; color: var(--lp-muted); font-size: 0.9rem; line-height: 1.7; }

