  /* ── SITE TOKENS ───────────────────────────────────── */
  :root {
    --green:      #4fc431;
    --green-dark: #3aad1f;
    --bg:         #0f1620;
    --bg2:        #18202e;
    --bg3:        #222c3c;
    --text:       #e8edf4;
    --text-muted: #8fa0b8;
    --border:     #2a3547;
    --radius:     16px;
    --mono:       'JetBrains Mono', monospace;
    --sans:       'DM Sans', sans-serif;
    /* sim colours */
    --vec-c:      #FFE600;
    --vec-d:      #FF1698;
    --vec-e:      #ffffff;
    --alpha-col:  #FFA500;
    --beta-col:   #4FC3F7;
    --grid-line:  #2a3547;
    --axis-col:   #4fc431;
  }

  [data-theme="light"] {
    --bg:         #dde4ef;
    --bg2:        #eaf0f8;
    --bg3:        #d0d9e8;
    --text:       #0f1a2e;
    --text-muted: #3d5070;
    --border:     #b0bdd0;
    --vec-e:      #1a2236;
    --grid-line:  #b0bdd0;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }
  html { scroll-behavior: smooth; }

  body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }

  /* ── NAV ───────────────────────────────────────────── */
  nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15,22,32,0.92);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    display: flex;
    align-items: center;
    height: 64px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    gap: 16px;
    flex-shrink: 0;
  }
  [data-theme="light"] nav { background: rgba(234,240,248,0.95); }

  .nav-back {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
  }
  .nav-back:hover { color: var(--green); border-color: var(--green); }

  .nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
  }
  .nav-logo img { height: 32px; width: auto; }
  .nav-brand {
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--green);
    font-weight: 700;
  }
  .nav-title {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .theme-btn {
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: 0.2s;
    line-height: 1;
    flex-shrink: 0;
  }
  .theme-btn:hover { color: var(--text); }

  /* ── PAGE CONTENT ──────────────────────────────────── */
  .page-wrap {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px 56px;
    flex: 1;
  }

  .page-label {
    font-family: var(--mono);
    font-size: 0.73rem;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 10px;
  }

  h1 {
    font-family: var(--mono);
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 10px;
    line-height: 1.2;
  }

  .subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 28px;
    max-width: 680px;
    line-height: 1.7;
  }

  /* ── SIM CARD ──────────────────────────────────────── */
  .sim-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
  }

  svg { width: 100%; height: auto; display: block; }

  /* ── SLIDER GRID ───────────────────────────────────── */
  .slider-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 20px;
  }

  .slider-group { display: flex; flex-direction: column; gap: 6px; }

  .slider-header {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .slider-label {
    font-family: var(--mono);
    font-size: 1rem;
    font-weight: 700;
  }

  .slider-val {
    font-family: var(--mono);
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: auto;
  }

  input[type="range"] {
    -webkit-appearance: none; appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    margin: 4px 0;
  }
  input[type="range"].alpha { background: linear-gradient(to right, var(--alpha-col) var(--pct, 60%), var(--bg3) var(--pct, 60%)); }
  input[type="range"].beta  { background: linear-gradient(to right, var(--beta-col)  var(--pct, 40%), var(--bg3) var(--pct, 40%)); }
  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 2px solid var(--bg2);
    cursor: pointer;
  }
  input[type="range"].alpha::-webkit-slider-thumb { background: var(--alpha-col); }
  input[type="range"].beta::-webkit-slider-thumb  { background: var(--beta-col); }
  input[type="range"]::-moz-range-thumb {
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 2px solid var(--bg2);
    cursor: pointer;
  }
  input[type="range"].alpha::-moz-range-thumb { background: var(--alpha-col); }
  input[type="range"].beta::-moz-range-thumb  { background: var(--beta-col); }

  /* ── FORMULA BAR ───────────────────────────────────── */
  .formula-bar {
    margin-top: 20px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 18px;
    font-family: var(--mono);
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.8;
  }

  .formula-result {
    color: var(--text);
    font-weight: 600;
  }

  /* ── FOOTER ──────────────────────────────────────────── */
  footer {
    background: var(--bg2);
    border-top: 1px solid var(--border);
    padding: 28px 32px;
    text-align: center;
    flex-shrink: 0;
  }
  footer p { font-family: var(--mono); font-size: 0.78rem; color: var(--text-muted); }
  footer span { color: var(--green); }

  @media (max-width: 520px) {
    .slider-grid { grid-template-columns: 1fr; }
    nav { padding: 0 16px; }
    .nav-title { display: none; }
  }
