
  :root {
    /* Palette — dark, technical, with a signal-green accent */
    --bg-0: #05070a;
    --bg-1: #0a0e14;
    --bg-2: #0f141c;
    --line: rgba(120, 160, 200, 0.08);
    --line-strong: rgba(120, 160, 200, 0.18);

    --ink-0: #f4f7fb;
    --ink-1: #c9d1dc;
    --ink-2: #8a93a2;
    --ink-3: #5a6372;

    --accent: #7cf9b4;        /* signal green */
    --accent-2: #4cc2ff;      /* cyan */
    --accent-glow: rgba(124, 249, 180, 0.35);

    /* Spacing */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 24px;
    --s-6: 32px;
    --s-7: 48px;
    --s-8: 72px;

    --radius: 10px;
    --radius-lg: 18px;

    --font-sans: 'Space Grotesk', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, "SF Mono", Menlo, monospace;
  }

  * { box-sizing: border-box; }

  html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;   /* Enforce single-viewport */
  }

  body {
    font-family: var(--font-sans);
    color: var(--ink-1);
    background: var(--bg-0);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
    font-feature-settings: "ss01", "ss02";
  }

  /* ====== BACKGROUND LAYERS ====== */

  :root {
    --bg-width: 100%;
    --bg-height: 100%;
    --bg-offset-y: 0%;
    --bg-radius: 0px;
    --bg-overlay: 0.5;
    --bg-glow: 0;
  }

  .bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: #05070a;
    display: grid;
    place-items: center;
  }

  .bg video {
    position: relative;
    width: var(--bg-width);
    height: var(--bg-height);
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: var(--bg-radius);
    transform: translateY(var(--bg-offset-y));
    box-shadow: 0 0 calc(60px * var(--bg-glow)) calc(-10px + 20px * var(--bg-glow)) rgba(124, 249, 180, calc(0.35 * var(--bg-glow)));
    transition: width 320ms ease, height 320ms ease, border-radius 260ms ease, transform 320ms ease, box-shadow 320ms ease;
    will-change: transform;
  }

  /* Black overlay for readability — sits above the video, below content */
  .bg::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: rgba(0, 0, 0, var(--bg-overlay));
    transition: background 200ms ease;
  }

  /* ====== SHELL ====== */

  .page {
    position: relative;
    z-index: 1;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    display: grid;
    grid-template-rows: auto 1fr auto;
    padding: clamp(16px, 2.2vw, 28px) clamp(20px, 4vw, 56px);
  }

  /* ====== NAV ====== */
  nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-5);
  }

  .brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink-0);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: -0.01em;
    font-size: 17px;
  }
  .brand .dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow), 0 0 0 2px rgba(124,249,180,0.12);
    animation: pulse 2.4s ease-in-out infinite;
  }
  @keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.75; transform: scale(0.92); }
  }
  .brand .tld { color: var(--ink-2); font-weight: 500; }

  .nav-links {
    display: flex;
    align-items: center;
    gap: clamp(16px, 2vw, 28px);
  }
  .nav-links a {
    color: var(--ink-2);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 180ms ease;
  }
  .nav-links a:hover { color: var(--ink-0); }

  .nav-links .pill {
    padding: 8px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--ink-0);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.02em;
    background: rgba(255,255,255,0.02);
    white-space: nowrap;
    transition: border-color 200ms ease, background 200ms ease;
  }
  .nav-links .pill:hover {
    border-color: rgba(124,249,180,0.5);
    background: rgba(124,249,180,0.06);
  }

  /* ====== HERO ====== */
  main {
    display: grid;
    place-items: center;
    padding: clamp(16px, 3vh, 40px) 0;
  }

  .hero {
    max-width: 880px;
    text-align: center;
    position: relative;
  }

  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--ink-1);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(255,255,255,0.02);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    white-space: nowrap;
    margin-bottom: clamp(18px, 2.4vh, 28px);
  }
  .eyebrow::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
  }

  h1 {
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--ink-0);
    font-size: clamp(34px, 6.4vw, 76px);
    line-height: 1.02;
    letter-spacing: -0.035em;
    margin: 0 0 clamp(12px, 1.6vh, 18px);
    text-wrap: balance;
  }
  h1 em {
    font-style: normal;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  h1 .slash {
    color: var(--ink-3);
    font-weight: 400;
  }

  .sub {
    font-size: clamp(15px, 1.6vw, 19px);
    color: var(--ink-2);
    max-width: 620px;
    margin: 0 auto clamp(20px, 3vh, 32px);
    text-wrap: pretty;
    line-height: 1.55;
  }

  .cta-row {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: clamp(22px, 3.4vh, 40px);
  }

  .btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    border-radius: 12px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: -0.005em;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 180ms ease, box-shadow 220ms ease, background 220ms ease, border-color 220ms ease;
    will-change: transform;
  }

  .btn-primary {
    background: linear-gradient(180deg, #8ffbc0 0%, #5ce6a0 100%);
    color: #042011;
    box-shadow:
      0 0 0 1px rgba(124,249,180,0.35),
      0 10px 30px -10px rgba(124,249,180,0.6),
      inset 0 -1px 0 rgba(0,0,0,0.2);
  }
  .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow:
      0 0 0 1px rgba(124,249,180,0.5),
      0 16px 40px -12px rgba(124,249,180,0.8),
      inset 0 -1px 0 rgba(0,0,0,0.2);
  }
  .btn-primary svg { transition: transform 200ms ease; }
  .btn-primary:hover svg { transform: translateX(3px); }

  .btn-ghost {
    color: var(--ink-1);
    border-color: var(--line-strong);
    background: rgba(255,255,255,0.02);
  }
  .btn-ghost:hover {
    color: var(--ink-0);
    border-color: rgba(180,200,230,0.3);
    background: rgba(255,255,255,0.04);
  }
  .kbd {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-2);
    padding: 2px 6px;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    background: rgba(255,255,255,0.02);
  }

  /* ====== BENEFITS ====== */
  .benefits {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(10px, 1.2vw, 18px);
    max-width: 820px;
    margin: 0 auto;
    padding: clamp(14px, 2vh, 20px);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    background: rgba(10, 14, 20, 0.55);
    backdrop-filter: blur(10px) saturate(1.1);
    -webkit-backdrop-filter: blur(10px) saturate(1.1);
  }
  .benefit {
    text-align: left;
    padding: 4px 10px;
    border-left: 1px solid var(--line);
  }
  .benefit:first-child { border-left: 0; }

  .benefit .k {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 4px;
  }
  .benefit .v {
    font-size: 13.5px;
    color: var(--ink-1);
    line-height: 1.35;
    font-weight: 500;
    letter-spacing: -0.005em;
  }

  /* ====== FOOTER ====== */
  footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--s-5);
    color: var(--ink-3);
    font-size: 12.5px;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
  }
  footer .status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-2);
  }
  footer .status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
    animation: pulse 2.4s ease-in-out infinite;
  }
  footer .links {
    white-space: nowrap;
  }
  footer a {
    color: var(--ink-2);
    text-decoration: none;
    transition: color 180ms ease;
    margin-left: 18px;
  }
  footer a:hover { color: var(--ink-0); }

  /* ====== RESPONSIVE ====== */
  @media (max-width: 860px) {
    .benefits {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .benefit:nth-child(3) { border-left: 0; }
  }

  @media (max-width: 560px) {
    .page { padding: 14px 18px; }
    .nav-links a:not(.pill) { display: none; }
    h1 { font-size: clamp(30px, 9vw, 44px); }
    .sub { font-size: 14.5px; }
    .eyebrow { font-size: 10.5px; margin-bottom: 14px; }
    .benefits {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      padding: 12px;
      gap: 8px;
    }
    .benefit { padding: 2px 6px; }
    .benefit .v { font-size: 12.5px; }
    .btn { padding: 12px 18px; font-size: 14px; }
    footer { font-size: 11px; }
    footer a { margin-left: 12px; }
    footer .links .sep { display: none; }
  }

  @media (max-height: 680px) {
    h1 { font-size: clamp(28px, 5vw, 52px); }
    .sub { font-size: 14.5px; }
    .eyebrow { margin-bottom: 14px; }
    .cta-row { margin-bottom: 20px; }
  }

  @media (prefers-reduced-motion: reduce) {
    .brand .dot, footer .status::before {
      animation: none !important;
    }
  }

  /* ====== TWEAKS PANEL ====== */
  .tweaks {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 50;
    width: 280px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(10, 14, 20, 0.82);
    border: 1px solid rgba(120,160,200,0.18);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    box-shadow: 0 20px 60px -20px rgba(0,0,0,0.7), 0 0 0 1px rgba(0,0,0,0.3);
    color: var(--ink-1);
    font-family: var(--font-sans);
    font-size: 13px;
  }
  .tweaks[hidden] { display: none; }

  .tweaks__hd {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 2px 2px 10px;
    border-bottom: 1px solid rgba(120,160,200,0.12);
    margin-bottom: 10px;
  }
  .tweaks__title {
    font-weight: 600;
    color: var(--ink-0);
    letter-spacing: -0.01em;
  }
  .tweaks__sub {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .tweaks__body { display: grid; gap: 10px; }

  .t-row { display: grid; gap: 6px; }
  .t-row--switch {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
  }
  .t-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    font-size: 11.5px;
    font-family: var(--font-mono);
    color: var(--ink-2);
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }
  .t-val {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: none;
    letter-spacing: 0;
  }

  /* Segmented control */
  .t-seg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 3px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(120,160,200,0.12);
    border-radius: 8px;
  }
  .t-seg button {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--ink-2);
    font: 500 12px var(--font-sans);
    padding: 7px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease;
  }
  .t-seg button:hover { color: var(--ink-0); }
  .t-seg button.is-active {
    background: rgba(124,249,180,0.14);
    color: var(--accent);
  }

  /* Range slider */
  .tweaks input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(120,160,200,0.2);
    border-radius: 999px;
    outline: none;
    cursor: pointer;
  }
  .tweaks input[type="range"]:disabled {
    opacity: 0.35;
    cursor: not-allowed;
  }
  .tweaks input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #0a0e14;
    box-shadow: 0 0 0 1px rgba(124,249,180,0.4), 0 0 10px rgba(124,249,180,0.4);
    cursor: pointer;
  }
  .tweaks input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid #0a0e14;
    box-shadow: 0 0 0 1px rgba(124,249,180,0.4);
    cursor: pointer;
  }

  /* Switch */
  .t-switch {
    appearance: none;
    border: 0;
    width: 40px;
    height: 22px;
    border-radius: 999px;
    background: rgba(120,160,200,0.18);
    position: relative;
    cursor: pointer;
    transition: background 200ms ease;
    padding: 0;
  }
  .t-switch span {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e9eef5;
    transition: transform 200ms ease, background 200ms ease;
  }
  .t-switch[aria-pressed="true"] {
    background: rgba(124,249,180,0.35);
  }
  .t-switch[aria-pressed="true"] span {
    transform: translateX(18px);
    background: var(--accent);
    box-shadow: 0 0 10px rgba(124,249,180,0.5);
  }

  @media (max-width: 560px) {
    .tweaks { right: 12px; bottom: 12px; width: calc(100vw - 24px); max-width: 320px; }
  }


/* =========================================================
   SUBPAGE ADDITIONS (projects / docs / changelog / legal / status)
   ========================================================= */

/* Scrollable pages override the single-viewport lock */
body.scroll, html.scroll { overflow: auto; }
body.scroll .page { height: auto; min-height: 100dvh; }

/* Active nav link */
.nav-links a.is-active {
  color: var(--ink-0);
  position: relative;
}
.nav-links a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* ====== PAGE HEADING ====== */
.page-head {
  max-width: 1120px;
  margin: clamp(16px, 4vh, 32px) auto clamp(20px, 3.5vh, 36px);
  padding: 0 8px;
  text-align: center;
}
.page-head h1 {
  font-size: clamp(32px, 5.2vw, 60px);
  margin-bottom: 14px;
}
.page-head .sub { margin: 0 auto; }

/* ====== PROJECTS GRID ====== */
.projects {
  max-width: 1200px;
  margin: 0 auto clamp(24px, 4vh, 48px);
  padding: 0 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 22px);
}
@media (max-width: 960px) { .projects { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .projects { grid-template-columns: 1fr; } }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: rgba(10, 14, 20, 0.6);
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 240ms cubic-bezier(.2,.7,.2,1),
              border-color 220ms ease,
              box-shadow 320ms ease;
  will-change: transform;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(124,249,180,0.3);
  box-shadow: 0 24px 60px -24px rgba(0,0,0,0.8),
              0 0 0 1px rgba(124,249,180,0.12),
              0 0 40px -10px rgba(124,249,180,0.25);
}

.card__shot {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0a0e14;
  border-bottom: 1px solid var(--line);
}
.card__shot::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(5,7,10,0.5) 100%);
  pointer-events: none;
}

/* Mock browser chrome for project shots */
.chrome {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 28px;
  background: rgba(12, 16, 22, 0.9);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  z-index: 2;
}
.chrome .dots { display: flex; gap: 5px; }
.chrome .dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.14);
}
.chrome .url {
  margin-left: 8px;
  letter-spacing: 0.02em;
}
.chrome .url b { color: var(--ink-1); font-weight: 500; }

.card__shot-inner {
  position: absolute;
  inset: 28px 0 0 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.card__body {
  padding: clamp(14px, 1.4vw, 20px);
  display: grid;
  gap: 8px;
}
.card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.card__meta .tag { color: var(--accent); }
.card__title {
  font-size: 19px;
  font-weight: 600;
  color: var(--ink-0);
  letter-spacing: -0.015em;
}
.card__desc {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.5;
  text-wrap: pretty;
}
.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}
.card__foot .host { color: var(--ink-2); }
.card__foot .go {
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 180ms ease;
}
.card:hover .card__foot .go { transform: translateX(3px); }

/* ====== CONTENT PAGES (docs/changelog/legal/status) ====== */
.content {
  max-width: 880px;
  margin: 0 auto clamp(40px, 6vh, 80px);
  padding: 0 clamp(8px, 2vw, 20px);
  color: var(--ink-1);
  line-height: 1.7;
}
.content section { margin-bottom: clamp(28px, 4vh, 48px); }
.content h2 {
  color: var(--ink-0);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.content h2::before {
  content: attr(data-idx);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.08em;
  font-weight: 500;
}
.content h3 {
  color: var(--ink-0);
  font-size: 16px;
  font-weight: 600;
  margin: 18px 0 8px;
  letter-spacing: -0.005em;
}
.content p { margin: 0 0 12px; text-wrap: pretty; }
.content ul { padding-left: 20px; margin: 0 0 14px; }
.content li { margin: 6px 0; color: var(--ink-1); }
.content li::marker { color: var(--accent); }
.content code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--accent);
}
.content pre {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-1);
  background: rgba(10, 14, 20, 0.7);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 16px;
  line-height: 1.55;
}
.content pre .k { color: var(--accent-2); }
.content pre .s { color: var(--accent); }
.content pre .c { color: var(--ink-3); }
.content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed rgba(124,249,180,0.35);
}
.content a:hover { border-bottom-style: solid; }

/* TOC sidebar for docs */
.layout-docs {
  max-width: 1120px;
  margin: 0 auto clamp(40px, 6vh, 80px);
  padding: 0 clamp(8px, 2vw, 20px);
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(20px, 3vw, 48px);
}
.toc {
  position: sticky;
  top: 24px;
  align-self: start;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(10, 14, 20, 0.55);
  backdrop-filter: blur(10px);
}
.toc .toc__hd {
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 10.5px;
  margin-bottom: 10px;
}
.toc a {
  display: block;
  color: var(--ink-2);
  text-decoration: none;
  padding: 5px 8px;
  border-radius: 5px;
  transition: background 160ms ease, color 160ms ease;
  letter-spacing: 0;
}
.toc a:hover { color: var(--ink-0); background: rgba(255,255,255,0.03); }
.toc a.is-active { color: var(--accent); background: rgba(124,249,180,0.08); }
@media (max-width: 860px) {
  .layout-docs { grid-template-columns: 1fr; }
  .toc { position: static; }
}

/* ====== CHANGELOG ====== */
.log {
  max-width: 840px;
  margin: 0 auto clamp(40px, 6vh, 80px);
  padding: 0 8px;
}
.log__entry {
  position: relative;
  padding: 20px 0 28px 24px;
  border-left: 1px solid var(--line-strong);
}
.log__entry::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 26px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}
.log__entry:last-child { border-left-color: transparent; }
.log__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}
.log__ver {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 500;
}
.log__date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}
.log__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-0);
  letter-spacing: -0.01em;
  width: 100%;
  margin-top: 2px;
}
.log__entry ul { margin-top: 10px; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  margin-right: 6px;
}
.badge-new    { background: rgba(124,249,180,0.14); color: var(--accent); }
.badge-fix    { background: rgba(76,194,255,0.14); color: var(--accent-2); }
.badge-perf   { background: rgba(255,210,100,0.12); color: #ffd264; }
.badge-break  { background: rgba(255,110,110,0.14); color: #ff9090; }

/* ====== STATUS ====== */
.status-grid {
  max-width: 860px;
  margin: 0 auto clamp(24px, 3vh, 32px);
  padding: 0 8px;
  display: grid;
  gap: 10px;
}
.status-banner {
  max-width: 860px;
  margin: 0 auto clamp(18px, 2vh, 28px);
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid rgba(124,249,180,0.25);
  background: rgba(124,249,180,0.06);
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink-0);
}
.status-banner .indicator {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
  animation: pulse 2.4s ease-in-out infinite;
  flex: none;
}
.status-banner h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.status-banner p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--ink-2);
}

.svc {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(10, 14, 20, 0.55);
  backdrop-filter: blur(8px);
}
.svc .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.svc.is-degraded .dot { background: #ffd264; box-shadow: 0 0 8px rgba(255,210,100,0.5); }
.svc.is-down .dot     { background: #ff6b6b; box-shadow: 0 0 8px rgba(255,107,107,0.5); }
.svc .name {
  color: var(--ink-0);
  font-weight: 500;
  font-size: 14.5px;
  letter-spacing: -0.005em;
}
.svc .region {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}
.svc .uptime {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}
.svc.is-degraded .uptime { color: #ffd264; }

/* 90-day uptime bars */
.bars {
  max-width: 860px;
  margin: 20px auto 0;
  padding: 18px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(10, 14, 20, 0.55);
}
.bars__hd {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.bars__grid {
  display: grid;
  grid-template-columns: repeat(90, 1fr);
  gap: 2px;
}
.bars__grid span {
  height: 26px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.72;
}
.bars__grid span.warn { background: #ffd264; opacity: 0.85; }
.bars__grid span.down { background: #ff6b6b; }
.bars__foot {
  display: flex; justify-content: space-between;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
}

/* Utility */
.muted { color: var(--ink-3); }
.lead  { font-size: 16px; color: var(--ink-1); }


/* =========================================================
   THEME + FONT SIZE + SWITCHER (added)
   ========================================================= */

/* Font-size scale via root var (S/M/L) */
:root { --scale: 1; }
html { font-size: calc(16px * var(--scale)); }

/* Shift many clamp-based sizes proportionally via a scale factor applied to body font */
body { font-size: calc(15px * var(--scale)); }

/* ===== LIGHT THEME overrides ===== */
:root.light {
  --bg-0: #f4f6fa;
  --bg-1: #ffffff;
  --bg-2: #eef1f6;
  --line: rgba(30, 50, 80, 0.08);
  --line-strong: rgba(30, 50, 80, 0.16);

  --ink-0: #0a0e14;
  --ink-1: #2a3340;
  --ink-2: #546070;
  --ink-3: #8895a5;

  --accent: #0e8c5a;         /* darker green for contrast on light */
  --accent-2: #0a72c9;
  --accent-glow: rgba(14, 140, 90, 0.28);
}
:root.light body { background: var(--bg-0); }
:root.light .bg { background: var(--bg-0); }
/* The video still plays; in light mode we soften the overlay and let content carry contrast via bg-tinted surfaces */
:root.light .bg::after { background: rgba(255,255,255, var(--bg-overlay)); }

/* Surface treatments that were dark translucent — flip to light translucent */
:root.light .eyebrow,
:root.light .benefits,
:root.light .nav-links .pill,
:root.light .btn-ghost,
:root.light .kbd,
:root.light .card,
:root.light .toc,
:root.light .svc,
:root.light .bars,
:root.light .status-banner,
:root.light pre,
:root.light .tweaks,
:root.light .t-seg,
:root.light .switcher {
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line-strong);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
}

:root.light .status-banner {
  background: rgba(14, 140, 90, 0.08);
  border-color: rgba(14, 140, 90, 0.3);
}

:root.light .chrome {
  background: rgba(255,255,255,0.9);
  border-bottom-color: rgba(0,0,0,0.08);
}
:root.light .chrome .dots span { background: rgba(0,0,0,0.15); }

:root.light h1 em {
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

:root.light .btn-primary {
  background: linear-gradient(180deg, #10a66c 0%, #0a8257 100%);
  color: #ffffff;
  box-shadow:
    0 0 0 1px rgba(14,140,90,0.3),
    0 10px 30px -10px rgba(14,140,90,0.5),
    inset 0 -1px 0 rgba(0,0,0,0.2);
}

:root.light .badge-new   { background: rgba(14,140,90,0.14); color: var(--accent); }
:root.light .badge-fix   { background: rgba(10,114,201,0.14); color: var(--accent-2); }
:root.light .badge-perf  { background: rgba(180,130,0,0.14); color: #b88200; }
:root.light .badge-break { background: rgba(200,60,60,0.14); color: #c83c3c; }

:root.light .tweaks input[type="range"] {
  background: rgba(30,50,80,0.18);
}

/* ===== SWITCHER (header control group) ===== */
.switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(10px) saturate(1.15);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  white-space: nowrap;
}
.switcher .sw-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
}
.switcher .sw-group + .sw-group {
  border-left: 1px solid var(--line);
  margin-left: 4px;
  padding-left: 8px;
}
.switcher button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font: 500 12px var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-width: 28px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 160ms ease, color 160ms ease;
}
.switcher button:hover { color: var(--ink-0); }
.switcher button.is-active {
  background: rgba(124,249,180,0.14);
  color: var(--accent);
}
:root.light .switcher button.is-active {
  background: rgba(14,140,90,0.14);
  color: var(--accent);
}
.switcher button svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Hide the switcher on very small screens and offer a compact control */
@media (max-width: 760px) {
  .switcher .sw-group.sw-size { display: none; }
}
@media (max-width: 560px) {
  .switcher { padding: 3px; }
  .switcher button { min-width: 24px; height: 24px; padding: 0 6px; font-size: 11px; }
  .switcher .sw-group.sw-lang { display: inline-flex; }
}

/* Slightly tighter benefits label when scaled */
.page { font-size: inherit; }
