    /* ── Design tokens ─────────────────────────────────────── */
    :root {
      color-scheme: light;
      --bg:         #ffffff;
      --bg-card:    #fafafa;
      --bg-code:    #f3f3f3;
      --bg-surface: #f5f5f5;
      --border:     #e5e5e5;
      --border-mid: #d0d0d0;
      --green:      #16a34a;
      --green-dim:  #86efac;
      --green-glow: rgba(22,163,74,.08);
      --amber:      #d97706;
      --cyan:       #0891b2;
      --red:        #dc2626;
      --text:       #1a1a1a;
      --text-muted: #666666;
      --text-dim:   #999999;
      --font-mono:  'JetBrains Mono', monospace;
      --font-sans:  'Syne', sans-serif;
      --font-body:  'Instrument Serif', Georgia, serif;
      --r:          4px;
      --r-lg:       8px;
      --nav-h:      62px;
    }

    /* ── Dark theme (system preference) ────────────────────── */
    @media (prefers-color-scheme: dark) {
      :root {
        color-scheme: dark;
        --bg:         #0a0d0f;
        --bg-card:    #0f1417;
        --bg-code:    #060809;
        --bg-surface: #111518;
        --border:     #1e2a1e;
        --border-mid: #2a3a2a;
        --green:      #22c55e;
        --green-dim:  #166534;
        --green-glow: rgba(34,197,94,.12);
        --amber:      #f59e0b;
        --cyan:       #22d3ee;
        --red:        #ef4444;
        --text:       #e2e8e2;
        --text-muted: #6b7a6b;
        --text-dim:   #9aad9a;
      }
    }

    /* ── User-selected light theme ────────────────────────── */
    html[data-theme="light"] {
      color-scheme: light;
      --bg:         #ffffff;
      --bg-card:    #fafafa;
      --bg-code:    #f3f3f3;
      --bg-surface: #f5f5f5;
      --border:     #e5e5e5;
      --border-mid: #d0d0d0;
      --green:      #16a34a;
      --green-dim:  #86efac;
      --green-glow: rgba(22,163,74,.08);
      --amber:      #d97706;
      --cyan:       #0891b2;
      --red:        #dc2626;
      --text:       #1a1a1a;
      --text-muted: #666666;
      --text-dim:   #999999;
    }

    /* ── User-selected dark theme ────────────────────────── */
    html[data-theme="dark"] {
      color-scheme: dark;
      --bg:         #0a0d0f;
      --bg-card:    #0f1417;
      --bg-code:    #060809;
      --bg-surface: #111518;
      --border:     #1e2a1e;
      --border-mid: #2a3a2a;
      --green:      #22c55e;
      --green-dim:  #166534;
      --green-glow: rgba(34,197,94,.12);
      --amber:      #f59e0b;
      --cyan:       #22d3ee;
      --red:        #ef4444;
      --text:       #e2e8e2;
      --text-muted: #6b7a6b;
      --text-dim:   #9aad9a;
    }

    /* ── Smooth theme transitions (after init) ───────────────── */
    html[data-theme-init="true"],
    html[data-theme-init="true"] * {
      transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    }

    /* ── Additional theme-aware backgrounds for nested components ─ */
    :root {
      --bg-header: #ffffff;
      --bg-rail: #f5f5f5;
    }
    @media (prefers-color-scheme: dark) {
      :root {
        --bg-header: #0d1117;
        --bg-rail: #070809;
      }
    }
    html[data-theme="light"] {
      --bg-header: #ffffff;
      --bg-rail: #f5f5f5;
    }
    html[data-theme="dark"] {
      --bg-header: #0d1117;
      --bg-rail: #070809;
    }

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html {
      scroll-behavior: smooth;
      -webkit-text-size-adjust: 100%;
      text-size-adjust: 100%;
    }

    body {
      background: var(--bg);
      color: var(--text);
      font-family: var(--font-body);
      font-size: 1.0625rem;
      line-height: 1.75;
      min-height: 100vh;
      background-image:
        linear-gradient(rgba(34,197,94,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34,197,94,.025) 1px, transparent 1px);
      background-size: 40px 40px;
    }

    /* ── Utilities ─────────────────────────────────────────── */
    .sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
    img, svg, video, canvas { max-width: 100%; height: auto; }

    /* ── Reading progress ──────────────────────────────────── */
    #readingBar {
      position: fixed; top: var(--nav-h); left: 0;
      height: 2px; background: var(--green); width: 0%;
      z-index: 99; transition: width .1s linear;
    }

    /* ── Page router ───────────────────────────────────────── */
    .page { display: none; animation: fadeUp .3s ease both; }
    .page.active { display: block; }
    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(12px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    /* ── Layout shell ──────────────────────────────────────── */
    .shell {
      max-width: 1240px; margin: 0 auto;
      padding: 0 clamp(1rem,4vw,2.5rem);
    }

    /* ── Section headers ───────────────────────────────────── */
    .sec-head {
      display: flex; align-items: baseline;
      justify-content: space-between; flex-wrap: wrap;
      gap: 1rem; margin-bottom: 2rem;
    }
    .sec-title {
      font-family: var(--font-mono); font-weight: 700;
      font-size: 1.35rem; letter-spacing: -.02em;
    }
    .sec-title span { color: var(--green); }
    .sec-link {
      font-family: var(--font-mono); font-size: .74rem;
      color: var(--text-muted); text-decoration: none;
      transition: color .18s;
    }
    .sec-link:hover { color: var(--green); }

    /* ── Hero ──────────────────────────────────────────────── */
    .hero {
      display: grid; grid-template-columns: 1fr 1fr;
      gap: 3rem; align-items: center;
      padding: clamp(2.5rem,6vw,5rem) 0 3rem;
    }
    .hero-label {
      font-family: var(--font-mono); font-size: .7rem;
      color: var(--green); letter-spacing: .12em;
      text-transform: uppercase; margin-bottom: .85rem;
      display: flex; align-items: center; gap: .5rem;
    }
    .hero-label::before {
      content: ''; display: inline-block;
      width: 22px; height: 1px; background: var(--green);
    }
    .hero h1 {
      font-family: var(--font-mono); font-weight: 800;
      font-size: clamp(2.2rem,4.5vw,3.6rem); line-height: 1.06;
      letter-spacing: -.03em; margin-bottom: 1.1rem;
    }
    .hero h1 em { font-style: normal; color: var(--green); }
    .hero-desc { color: var(--text-dim); font-size: 1rem; max-width: 460px; margin-bottom: 1.75rem; }
    .hero-btns { display: flex; gap: .75rem; flex-wrap: wrap; }
    .btn-primary {
      background: var(--green); color: var(--bg);
      font-family: var(--font-mono); font-size: .78rem; font-weight: 700;
      padding: .65rem 1.4rem; border-radius: var(--r); text-decoration: none;
      transition: opacity .18s;
    }
    .btn-primary:hover { opacity: .85; }
    .btn-ghost {
      border: 1px solid var(--border-mid); color: var(--text-dim);
      font-family: var(--font-mono); font-size: .78rem;
      padding: .65rem 1.4rem; border-radius: var(--r); text-decoration: none;
      transition: border-color .18s, color .18s;
    }
    .btn-ghost:hover { border-color: var(--green); color: var(--green); }

    /* Hero terminal */
    .hero-term {
      background: var(--bg-code); border: 1px solid var(--border);
      border-radius: var(--r-lg); overflow: hidden;
      box-shadow: 0 0 50px rgba(34,197,94,.06), 0 20px 48px rgba(0,0,0,.45);
    }
    .term-bar {
      background: #0d1117; border-bottom: 1px solid var(--border);
      padding: .55rem 1rem; display: flex; align-items: center; gap: .45rem;
    }
    .t-dot { width: 10px; height: 10px; border-radius: 50%; }
    .t-dot.r { background: #ff5f56; } .t-dot.a { background: #ffbd2e; } .t-dot.g { background: #27c93f; }
    .term-title { font-family: var(--font-mono); font-size: .66rem; color: var(--text-muted); margin-left: .6rem; }
    .term-body { padding: 1.1rem 1.4rem; font-family: var(--font-mono); font-size: .76rem; line-height: 2; }
    .tc { color: #4d6a4d; } .tp { color: var(--green); } .tv { color: var(--amber); }
    .ts { color: var(--cyan); } .to { color: var(--text-dim); }
    .cursor { display:inline-block; width:7px; height:13px; background:var(--green); vertical-align:middle; animation: blink 1s step-end infinite; }
    @keyframes blink { 50% { opacity:0; } }

    /* ── Hamburger ─────────────────────────────────────────── */
    .hamburger {
      display: none;
      flex-direction: column; justify-content: space-between;
      width: 26px; height: 18px;
      background: none; border: none; cursor: pointer; padding: 0; margin-left: auto;
    }
    .hamburger span {
      display: block; height: 2px; width: 100%;
      background: var(--text); border-radius: 2px;
      transition: transform .25s, opacity .2s;
    }
    .hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.open span:nth-child(2) { opacity: 0; }
    .hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    /* ── Mobile ────────────────────────────────────────────── */
    @media (max-width: 800px) {
      .hero { grid-template-columns: 1fr; }
      .hero-term { display: none; }
      .hamburger { display: flex; }
      .nav-links {
        display: none; flex-direction: column; gap: 0;
        position: absolute; top: var(--nav-h); left: 0; right: 0;
        background: var(--bg-card); border-bottom: 1px solid var(--border);
        padding: .5rem 0;
      }
      .nav-links.mobile-open { display: flex; }
      .nav-links a { padding: .75rem 1.5rem; }
      .nav-search-wrap .nav-search { display: none; }
      .nl-form { flex-direction: column; }
    }
    @media (max-width: 480px) {
      .cats-grid { grid-template-columns: 1fr 1fr; }
      .pinned-card { padding: 1rem; }
      .pinned-title { font-size: 1rem; }
    }

    @media (prefers-reduced-motion: reduce) {
      html { scroll-behavior: auto; }
      .page, .cursor { animation: none !important; }
    }
