:root {
      --bg:         #0a0a0f;
      --surface:    #111118;
      --border:     #1e1e2e;
      --accent:     #4f8ef7;
      --accent2:    #7c3aed;
      --github-btn: #2b3ea7;
      --tron-orange:#ff6b1a;
      --text:       #e2e8f0;
      --muted:      #64748b;
      --green:      #22c55e;
      --mono:       'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }

    html { scroll-behavior: smooth; }

    body {
      background: var(--bg);
      background-image:
        linear-gradient(rgba(79,168,232,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79,168,232,0.06) 1px, transparent 1px);
      background-size: 48px 48px;
      color: var(--text);
      font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
      font-size: 17px;
      line-height: 1.7;
    }

    a { color: var(--accent); text-decoration: none; }
    a:hover { text-decoration: underline; }

    /* ── Layout ─────────────────────────────── */
    .container {
      max-width: 960px;
      margin: 0 auto;
      padding: 0 2rem;
    }

    section { padding: 5rem 0; }
    section + section {
      border-top: none;
      position: relative;
    }

    section + section::before {
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0;
      height: 1px;
      background: linear-gradient(90deg, transparent, var(--accent) 25%, var(--tron-orange) 75%, transparent);
      opacity: 0.55;
    }

    /* ── Nav ────────────────────────────────── */
    nav {
      position: sticky;
      top: 0;
      z-index: 100;
      background: rgba(10,10,15,0.85);
      backdrop-filter: blur(12px);
      border-bottom: 1px solid rgba(79,168,232,0.2);
      padding: 0.6rem 1rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      box-shadow: 0 1px 20px rgba(79,168,232,0.06);
    }

    section[id] { scroll-margin-top: 64px; }

    .nav-logo {
      display: flex;
      align-items: center;
      text-decoration: none;
    }

    .nav-logo:hover { opacity: .85; text-decoration: none; }

    nav ul {
      list-style: none;
      display: flex;
      gap: 2rem;
    }

    nav ul a {
      color: var(--muted);
      font-size: 0.9rem;
      font-weight: 500;
      transition: color .15s;
    }

    nav ul a:hover { color: var(--text); text-decoration: none; }

    /* ── Hamburger ──────────────────────────── */
    .nav-toggle {
      display: none;
      flex-direction: column;
      gap: 5px;
      background: none;
      border: none;
      cursor: pointer;
      padding: .4rem;
    }

    .nav-toggle span {
      display: block;
      width: 22px;
      height: 2px;
      background: var(--text);
      border-radius: 2px;
      transition: transform .25s ease, opacity .2s ease;
    }

    .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
    .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    /* ── Hero ───────────────────────────────── */
    .hero {
      padding: 2rem 0 5rem;
      text-align: center;
      position: relative;
      overflow: hidden;
    }

    .hero::before {
      content: '';
      position: absolute;
      top: -120px; left: 50%;
      transform: translateX(-50%);
      width: 700px; height: 700px;
      background: radial-gradient(ellipse, rgba(79,168,232,.25) 0%, transparent 70%);
      pointer-events: none;
    }

    .hero::after {
      content: '';
      position: absolute;
      bottom: 0; left: 5%; right: 5%;
      height: 2px;
      background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--tron-orange) 70%, transparent);
      opacity: 0.85;
      box-shadow: 0 0 12px var(--accent), 0 0 24px rgba(79,168,232,0.4);
    }

    .hero-badge {
      display: inline-block;
      font-size: 0.78rem;
      font-weight: 600;
      letter-spacing: .1em;
      text-transform: uppercase;
      color: var(--accent);
      border: 1px solid rgba(79,168,232,.5);
      border-radius: 20px;
      padding: .3rem .9rem;
      margin-bottom: 1.8rem;
      box-shadow: 0 0 12px rgba(79,168,232,0.3), inset 0 0 8px rgba(79,168,232,0.05);
    }

    .hero h1 {
      font-size: clamp(2.4rem, 6vw, 4rem);
      font-weight: 800;
      line-height: 1.15;
      letter-spacing: -.02em;
      margin-bottom: 1.5rem;
    }

    .hero h1 em {
      font-style: normal;
      background: linear-gradient(135deg, var(--accent), var(--accent2));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .hero-sub {
      font-size: 1.2rem;
      color: var(--muted);
      max-width: 560px;
      margin: 0 auto 2.5rem;
      line-height: 1.6;
    }

    .hero-actions {
      display: flex;
      gap: 1rem;
      justify-content: center;
      flex-wrap: wrap;
    }

    .btn {
      display: inline-flex;
      align-items: center;
      gap: .5rem;
      padding: .75rem 1.6rem;
      border-radius: 8px;
      font-weight: 600;
      font-size: .95rem;
      transition: all .15s;
      cursor: pointer;
      border: none;
    }

    .btn-primary {
      background: var(--github-btn);
      color: #fff;
    }

    .btn-primary:hover { opacity: .88; text-decoration: none; }

    .btn-ghost {
      background: transparent;
      color: var(--text);
      border: 1px solid var(--border);
    }

    .btn-ghost:hover { border-color: var(--muted); text-decoration: none; }

    a[href^="http"]:not([href^="https://grid-protocol.org"])::after { content: "\00a0\2197"; display: inline; }

    /* ── Terminal ───────────────────────────── */
    .terminal {
      background: #0d0d14;
      border: 1px solid rgba(79,168,232,0.25);
      border-radius: 12px;
      overflow: hidden;
      margin: 3rem auto 0;
      max-width: 680px;
      text-align: left;
      box-shadow: 0 0 40px rgba(79,168,232,0.15), 0 0 80px rgba(79,168,232,0.05);
    }

    .terminal-bar {
      background: #151520;
      padding: .7rem 1rem;
      display: flex;
      align-items: center;
      gap: .5rem;
    }

    .dot { width: 12px; height: 12px; border-radius: 50%; }
    .dot-r { background: #ff5f57; }
    .dot-y { background: #febc2e; }
    .dot-g { background: #28c840; }

    .terminal-body {
      padding: 1.2rem 1.5rem;
      font-family: var(--mono);
      font-size: .85rem;
      line-height: 1.8;
    }

    .t-prompt { color: var(--accent); }
    .t-cmd    { color: var(--text); }
    .t-out    { color: var(--muted); }
    .t-ok     { color: var(--green); }
    .t-comment { color: #374151; }

    /* ── Stat bar ───────────────────────────── */
    .stat-bar {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 1px;
      background: var(--border);
      border: 1px solid var(--border);
      border-radius: 12px;
      overflow: hidden;
      margin-bottom: 4rem;
    }

    .stat {
      background: var(--surface);
      padding: 2rem 1.5rem;
      text-align: center;
    }

    .stat-number {
      font-size: 2.8rem;
      font-weight: 800;
      letter-spacing: -.03em;
      background: linear-gradient(135deg, var(--accent), var(--accent2));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
      display: block;
    }

    .stat-label {
      color: var(--muted);
      font-size: .85rem;
      margin-top: .25rem;
    }

    /* ── Section headings ───────────────────── */
    .section-label {
      font-size: .75rem;
      font-weight: 700;
      letter-spacing: .12em;
      text-transform: uppercase;
      color: var(--accent);
      margin-bottom: .75rem;
    }

    h2 {
      font-size: clamp(1.7rem, 4vw, 2.4rem);
      font-weight: 800;
      letter-spacing: -.02em;
      line-height: 1.2;
      margin-bottom: 1rem;
    }

    .section-lead {
      color: var(--muted);
      font-size: 1.05rem;
      max-width: 580px;
      margin-bottom: 3rem;
    }

    /* ── Problem / Solution ─────────────────── */
    .two-col {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1.5rem;
    }

    .card {
      background: var(--surface);
      border: 1px solid rgba(79,168,232,0.15);
      border-top: 2px solid rgba(79,168,232,0.55);
      border-radius: 12px;
      padding: 1.8rem;
      transition: border-color .2s, box-shadow .2s;
    }

    .card:hover {
      border-color: rgba(79,168,232,0.4);
      border-top-color: var(--accent);
      box-shadow: 0 0 28px rgba(79,168,232,0.18), inset 0 0 20px rgba(79,168,232,0.03);
    }


    .card h3 {
      font-size: 1.05rem;
      font-weight: 700;
      margin-bottom: .5rem;
    }

    .card p {
      color: var(--muted);
      font-size: .92rem;
      line-height: 1.65;
    }

    .card.highlight {
      border-color: rgba(79,168,232,.4);
      border-top-color: var(--accent);
      background: rgba(79,168,232,.04);
    }

    /* ── How it works ───────────────────────── */
    .steps {
      display: flex;
      flex-direction: column;
      gap: 0;
    }

    .step {
      display: grid;
      grid-template-columns: 3rem 1fr;
      gap: 1.5rem;
      padding: 2rem 0;
      border-bottom: 1px solid var(--border);
    }

    .step:last-child { border-bottom: none; }

    .step-num {
      width: 3rem;
      height: 3rem;
      border-radius: 50%;
      border: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: .9rem;
      color: var(--accent);
      flex-shrink: 0;
      margin-top: .2rem;
    }

    .step h3 {
      font-size: 1.05rem;
      font-weight: 700;
      margin-bottom: .4rem;
    }

    .step p {
      color: var(--muted);
      font-size: .92rem;
    }

    /* ── Benchmark ──────────────────────────── */
    .benchmark {
      background: var(--surface);
      border: 1px solid rgba(79,168,232,0.2);
      border-top: 2px solid rgba(79,168,232,0.6);
      border-radius: 16px;
      padding: 3rem;
      position: relative;
      overflow: hidden;
      box-shadow: 0 0 40px rgba(79,168,232,0.06);
    }

    .benchmark::before {
      content: '';
      position: absolute;
      top: -60px; right: -60px;
      width: 300px; height: 300px;
      background: radial-gradient(ellipse, rgba(79,168,232,.12) 0%, transparent 70%);
      pointer-events: none;
    }

    .quote {
      font-size: 1.3rem;
      font-weight: 600;
      line-height: 1.5;
      margin-bottom: 1.5rem;
    }

    .quote em {
      font-style: normal;
      color: var(--accent);
    }

    .fact-items {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      gap: 1rem;
      margin-top: 2rem;
    }

    .fact-items--3 {
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }

    .fact-item {
      background: rgba(255,255,255,.03);
      border: 1px solid rgba(79,168,232,0.15);
      border-top: 2px solid rgba(79,168,232,0.4);
      border-radius: 8px;
      padding: 1rem;
      transition: border-color .2s, box-shadow .2s;
    }

    .fact-item:hover {
      border-top-color: var(--accent);
      box-shadow: 0 0 20px rgba(79,168,232,0.15);
    }

    .fact-item strong {
      display: block;
      font-size: 1.1rem;
      font-weight: 700;
      color: var(--green);
      margin-bottom: .2rem;
    }

    .fact-item span {
      font-size: .8rem;
      color: var(--muted);
    }

    /* ── Programs ───────────────────────────── */
    .programs-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 1rem;
      align-items: stretch;
    }

    .program-card {
      background: var(--surface);
      border: 1px solid rgba(79,168,232,0.15);
      border-top: 2px solid rgba(79,168,232,0.55);
      border-radius: 10px;
      padding: 1.4rem;
      transition: border-color .2s, box-shadow .2s;
      display: flex;
      flex-direction: column;
    }

    .program-card:hover {
      border-color: rgba(79,168,232,0.4);
      border-top-color: var(--accent);
      box-shadow: 0 0 28px rgba(79,168,232,0.2), 0 0 60px rgba(79,168,232,0.06), inset 0 0 20px rgba(79,168,232,0.03);
    }

    .program-card h3 {
      font-size: .95rem;
      font-weight: 700;
      margin-bottom: .4rem;
    }

    .program-card p {
      color: var(--muted);
      font-size: .83rem;
      line-height: 1.55;
    }

    /* ── Differentiators ────────────────────── */
    .diff-table {
      width: 100%;
      border-collapse: collapse;
      font-size: .88rem;
    }

    .diff-table th {
      text-align: left;
      padding: .75rem 1rem;
      color: var(--muted);
      font-weight: 600;
      font-size: .78rem;
      letter-spacing: .06em;
      text-transform: uppercase;
      border-bottom: 1px solid var(--border);
    }

    .diff-table td {
      padding: .85rem 1rem;
      border-bottom: 1px solid var(--border);
      vertical-align: top;
    }

    .diff-table tr:last-child td { border-bottom: none; }

    .diff-table td:first-child { color: var(--text); font-weight: 500; }
    .diff-table td:not(:first-child) { color: var(--muted); }

    .check { color: var(--green); font-weight: 700; }
    .cross { color: #ef4444; }
    .partial { color: #f59e0b; }

    /* ── CTA ────────────────────────────────── */
    .cta-section {
      text-align: center;
    }

    .cta-section h2 { margin-bottom: .75rem; }
    .cta-section p  { color: var(--muted); margin-bottom: 2rem; }

    /* ── Footer ─────────────────────────────── */
    footer {
      border-top: 1px solid var(--border);
      padding: 2rem;
      text-align: center;
      color: var(--muted);
      font-size: .85rem;
    }

    footer a { color: var(--muted); }
    footer a:hover { color: var(--text); }

    /* ── Responsive ─────────────────────────── */
    @media (pointer: coarse), (max-width: 900px) {
      .two-col    { grid-template-columns: 1fr; }
      .stat-bar   { grid-template-columns: 1fr; }
      .fact-items,
      .fact-items--3 { grid-template-columns: 1fr; }
      .hero       { padding: 4rem 0 3rem; }
      .benchmark  { padding: 2rem; }

      .nav-toggle { display: flex; }

      nav ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        flex-direction: column;
        gap: 0;
        background: rgba(10,10,15,.97);
        border-bottom: 1px solid var(--border);
        padding: .5rem 0;
        max-height: calc(100vh - 56px);
        overflow-y: auto;
      }

      nav ul.open { display: flex; }

      nav ul li a {
        display: block;
        padding: .75rem 1.5rem;
        font-size: 1rem;
      }
    }

    /* ── Article subpages ───────────────────── */
    .article-page {
      font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
      font-size: 16px;
    }

    .article-page nav {
      background: rgba(10,10,15,.92);
      border-bottom: 1px solid var(--border);
      box-shadow: none;
    }

    .article-page nav .nav-logo {
      display: flex;
      align-items: center;
      gap: .6rem;
      color: var(--text);
      font-size: 1rem;
      font-weight: 700;
    }

    .nav-back {
      font-size: .9rem;
      color: var(--muted);
      display: inline-block;
    }

    .nav-back:hover {
      color: var(--accent);
      text-decoration: none;
    }


    .article-page .container {
      max-width: 860px;
      padding: 0 1.5rem;
    }

    .article-page .hero {
      padding: 4rem 0 2rem;
      border-bottom: 1px solid var(--border);
      margin-bottom: 3rem;
      text-align: left;
      position: static;
      overflow: visible;
    }

    .article-page .hero::before,
    .article-page .hero::after {
      content: none;
    }


    .article-page h1 {
      font-size: clamp(1.8rem, 4vw, 2.6rem);
      font-weight: 800;
      line-height: 1.2;
      letter-spacing: -.02em;
      margin-bottom: 1rem;
    }

    .article-page h1 em { font-style: normal; color: var(--accent); }

    .article-page .hero-meta {
      color: var(--muted);
      font-size: .9rem;
      margin-top: 1rem;
    }

    .article-page .body-content { max-width: 720px; }

    .article-page .body-content h2 {
      font-size: 1.4rem;
      font-weight: 700;
      margin: 2.5rem 0 .8rem;
      padding-top: 2.5rem;
      border-top: 1px solid var(--border);
      color: var(--text);
    }

    .article-page .body-content h2:first-of-type {
      border-top: none;
      padding-top: 0;
    }

    .article-page .body-content h3 {
      font-size: 1.05rem;
      font-weight: 600;
      margin: 1.8rem 0 .5rem;
      color: var(--accent);
    }

    .article-page .body-content p {
      margin-bottom: 1rem;
      color: #cbd5e1;
    }

    .article-page .body-content ul { margin: .5rem 0 1rem 1.5rem; }

    .article-page .body-content li { color: #cbd5e1; }

    .article-page .body-content li strong { color: var(--text); }

    .article-page .observation {
      background: var(--surface);
      border: 1px solid rgba(79,168,232,0.2);
      border-left: 3px solid var(--accent);
      border-radius: 0 8px 8px 0;
      padding: 1rem 1.2rem;
      margin: 1.5rem 0;
      font-size: .9rem;
    }

    .article-page .observation .obs-label {
      font-size: .72rem;
      font-weight: 700;
      letter-spacing: .07em;
      text-transform: uppercase;
      color: var(--accent);
      margin-bottom: .4rem;
    }

    .article-page .cta-block {
      background: var(--surface);
      border: 1px solid rgba(79,168,232,0.2);
      border-top: 2px solid var(--accent);
      border-radius: 12px;
      padding: 2rem;
      margin: 3rem 0 4rem;
      text-align: center;
    }

    .article-page .cta-block h3 {
      color: var(--text);
      font-size: 1.15rem;
      margin: 0 0 .6rem;
      padding: 0;
      border: none;
    }

    .article-page .cta-block p {
      margin-bottom: 1.2rem;
      color: var(--muted);
    }

    .article-page .btn {
      display: inline-block;
      padding: .65rem 1.4rem;
      font-size: .9rem;
      transition: opacity .2s;
    }

    .article-page .btn:hover {
      opacity: .85;
      text-decoration: none;
    }

    .article-page .btn-primary {
      background: var(--accent);
      color: #fff;
    }

    .article-page .btn-ghost {
      background: transparent;
      border: 1px solid var(--border);
      color: var(--text);
      margin-left: .8rem;
    }

    .article-page footer a:hover { color: var(--accent); }


    .article-page blockquote {
      padding: .8rem 1.2rem;
      margin: 1.5rem 0;
      border-radius: 0 8px 8px 0;
      font-size: .95rem;
      line-height: 1.75;
      border-left: 3px solid var(--accent);
      background: rgba(79,168,232,.05);
      color: #cbd5e1;
    }

    .article-page blockquote em { color: var(--muted); font-style: italic; }

    .article-page .case-label {
      display: inline-block;
      font-size: .75rem;
      font-weight: 600;
      letter-spacing: .08em;
      text-transform: uppercase;
      border-radius: 4px;
      padding: .2rem .7rem;
      margin-bottom: 1.2rem;
      color: var(--accent);
      background: rgba(79,168,232,.1);
      border: 1px solid rgba(79,168,232,.25);
    }

    .data-table {
      width: 100%;
      border-collapse: collapse;
      margin: 1rem 0 1.5rem;
      font-size: .88rem;
    }

    .data-table th {
      text-align: left;
      padding: .5rem .8rem;
      border-bottom: 1px solid var(--border);
      color: var(--muted);
      font-weight: 600;
      font-size: .78rem;
      text-transform: uppercase;
      letter-spacing: .05em;
    }

    .data-table td {
      padding: .5rem .8rem;
      border-bottom: 1px solid rgba(30,30,46,.8);
      color: #cbd5e1;
    }

    .data-table tr:last-child td { border-bottom: none; }

    .data-table td code {
      font-family: var(--mono);
      font-size: .82em;
      color: var(--accent);
    }

    .data-table td em {
      font-style: normal;
      color: var(--muted);
      font-size: .85em;
    }
