@font-face { font-family: 'JetBrains Mono Fallback'; src: local('Liberation Mono'), local('DejaVu Sans Mono'), local('Courier New'), local('Menlo'); size-adjust: 100%; ascent-override: 102%; descent-override: 30%; line-gap-override: 0%; }
@font-face { font-family: 'Inter Fallback'; src: local('Arial'), local('Liberation Sans'), local('Helvetica'); size-adjust: 107%; ascent-override: 90%; descent-override: 22%; line-gap-override: 0%; }
  :root {
    --bg: #1a1e24;
    --bg-deep: #14171c;
    --surface: #21262d;
    --surface-raised: #282e38;
    --surface-sunken: #1d2127;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);
    --border-muted: rgba(255, 255, 255, 0.05);
    --text: #cdd6e0;
    --text-strong: #e8edf2;
    --text-muted: #8f99aa;
    --text-faint: #4a5568;
    --accent: #f5a623;
    --accent-dim: rgba(245, 166, 35, 0.12);
    --accent-bright: #ffb83d;
    --teal: #4ec9b0;
    --pink: #e879a0;
    --green: #3fb950;
    --blue: #58a6ff;
    --red: #f85149;
    --mono: 'JetBrains Mono', 'JetBrains Mono Fallback', ui-monospace, SFMono-Regular, Menlo, monospace;
    --sans: 'Inter', 'Inter Fallback', system-ui, -apple-system, sans-serif;
  }

  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.55;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
  }

  ::selection { background: var(--accent); color: #1a1e24; }

  /* ------- Page-wide grid background ------- */
  .grid-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
      radial-gradient(circle at 1px 1px, rgba(255,255,255,0.045) 1px, transparent 0);
    background-size: 28px 28px;
    mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 30%, transparent 80%);
    z-index: 0;
  }

  /* ------- Layout containers ------- */
  .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
    position: relative;
    z-index: 1;
  }

  /* ------- Section labels ------- */
  .label {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
  .label .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
  }

  /* ------- Status dot variants ------- */
  .status-dot {
    width: 6px; height: 6px; border-radius: 50%;
    display: inline-block;
    background: var(--green);
    box-shadow: 0 0 8px currentColor;
    color: var(--green);
  }
  .status-dot.amber { background: var(--accent); color: var(--accent); }
  .status-dot.teal { background: var(--teal); color: var(--teal); }

  /* ------- Pills ------- */
  .pill {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(78, 201, 176, 0.08);
    color: var(--teal);
    border: 1px solid rgba(78, 201, 176, 0.2);
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }
  .pill.pink { background: rgba(232, 121, 160, 0.08); color: var(--pink); border-color: rgba(232, 121, 160, 0.2); }
  .pill.amber { background: var(--accent-dim); color: var(--accent); border-color: rgba(245, 166, 35, 0.25); }

  /* ------- Buttons ------- */
  .btn {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 120ms ease, transform 120ms ease, border-color 120ms ease;
    white-space: nowrap;
  }
  .btn-primary {
    background: var(--accent);
    color: #1a1410;
    font-weight: 600;
  }
  .btn-primary:hover { background: var(--accent-bright); }
  .btn-primary:active { transform: translateY(1px); }
  .btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strong);
  }
  .btn-ghost:hover { background: var(--surface); border-color: var(--text-muted); }
  .btn-text {
    background: transparent;
    color: var(--text);
    padding: 10px 0;
  }
  .btn-text:hover { color: var(--accent); }

  /* =============== NAV =============== */
  nav.top {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(20, 23, 28, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: 58px;
  }
  nav.top .container {
    display: flex;
    align-items: center;
    height: 58px;
    gap: 32px;
  }
  .logo {
    font-family: var(--mono);
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 0.04em;
    color: var(--text-strong);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
  }
  .logo .status-dot { width: 7px; height: 7px; }
  .logo .ver {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 11px;
    margin-left: 4px;
  }
  .nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-left: auto;
  }
  .nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 400;
  }
  .nav-links a:hover { color: var(--text-strong); }
  .nav-cta { margin-left: 8px; }

  /* =============== HERO =============== */
  .hero {
    position: relative;
    padding: 80px 0 100px;
    overflow: hidden;
  }
  .hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 64px;
    align-items: center;
  }
  .hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 100px;
    background: var(--surface-sunken);
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    margin-bottom: 28px;
  }
  .hero-eyebrow .status-dot { width: 7px; height: 7px; }
  h1.hero-title {
    font-family: var(--mono);
    font-weight: 700;
    font-size: clamp(40px, 5.4vw, 68px);
    line-height: 1.02;
    letter-spacing: -0.02em;
    margin: 0 0 24px;
    color: var(--text-strong);
  }
  h1.hero-title .accent { color: var(--accent); }
  .hero-sub {
    font-size: 17px;
    line-height: 1.55;
    color: var(--text-muted);
    max-width: 540px;
    margin: 0 0 36px;
  }
  .hero-sub strong { color: var(--text); font-weight: 500; }
  .hero-cta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
  }
  .panel-chrome {
    height: 32px;
    background: var(--surface-raised);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 10px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .panel-chrome .dots {
    display: inline-flex;
    gap: 6px;
    margin-right: 4px;
  }
  .panel-chrome .dots i {
    width: 9px; height: 9px; border-radius: 50%;
    background: rgba(255,255,255,0.12);
  }
  .panel-chrome .title { color: var(--text-muted); }
  .panel-chrome .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }


  /* =============== FINAL CTA =============== */
  .final-cta {
    padding: 120px 0;
    text-align: center;
    position: relative;
    border-top: 1px solid var(--border);
    background:
      radial-gradient(ellipse 600px 300px at 50% 50%, rgba(245, 166, 35, 0.08), transparent 70%),
      var(--bg);
  }
  .final-cta h2 {
    font-family: var(--mono);
    font-weight: 700;
    font-size: clamp(30px, 4vw, 52px);
    line-height: 1.05;
    letter-spacing: -0.015em;
    margin: 0 0 18px;
    color: var(--text-strong);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
  }
  .final-cta p {
    color: var(--text-muted);
    font-size: 16px;
    max-width: 560px;
    margin: 0 auto 36px;
  }
  .final-cta .cta-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
  }

  /* =============== FOOTER =============== */
  footer {
    border-top: 1px solid var(--border);
    background: var(--surface-sunken);
    padding: 32px 0;
  }
  footer .container {
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
  }
  .foot-logo { display: flex; align-items: center; gap: 12px; }
  .foot-tag { color: var(--text-muted); font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; }
  .foot-links { display: flex; gap: 24px; margin-left: auto; }
  .foot-links a { color: var(--text-muted); text-decoration: none; font-size: 13px; }
  .foot-links a:hover { color: var(--text); }
  .foot-copy { color: var(--text-muted); font-family: var(--mono); font-size: 11px; }

/* ---------- shared section scaffolding ---------- */
html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 72px; }
[hidden] { display: none !important; }
.section { padding: 112px 0; border-top: 1px solid var(--border); position: relative; }
.section h2 {
  font-family: var(--mono); font-weight: 700; font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.06; letter-spacing: -0.015em; margin: 18px 0 18px; color: var(--text-strong);
}
.section h2 .accent { color: var(--accent); } .section h2 .teal { color: var(--teal); }
.section h2 .pink { color: var(--pink); }
.lead { font-size: 16px; line-height: 1.6; color: var(--text-muted); max-width: 560px; margin: 0; }

/* ---------- protocol row ---------- */
.protocols { padding: 28px 0; border-top: 1px solid var(--border); background: var(--surface-sunken); }
.protocols .container { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center; }
.proto { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px; font-family: var(--mono); font-size: 13px; color: var(--text); }

/* ---------- pillars ---------- */
.pillar { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 72px; align-items: center; }
.pillar.flip .pillar-text { order: 2; }
.facts { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.facts li { display: flex; gap: 12px; font-size: 14px; color: var(--text); line-height: 1.5; }
.facts li::before { content: ''; flex: 0 0 6px; height: 6px; margin-top: 8px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 8px var(--green); }
.pillar-visual { position: relative; }
.shot { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.7), 0 16px 32px -10px rgba(0,0,0,0.5); }
.shot img { display: block; width: 100%; height: auto; }
.shot-inset { position: absolute; width: 46%; right: -24px; bottom: -40px; }
.diagram svg { display: block; width: 100%; height: auto; }

/* ---------- trust strip ---------- */
.trust { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; background: var(--surface); }
.trust > div { padding: 24px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.trust > div:last-child { border-right: none; }
.trust .t-k { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-muted); }
.trust .t-v { font-family: var(--mono); font-size: 16px; font-weight: 600; color: var(--text-strong); }
.trust .t-d { color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.footnote { margin: 20px 0 0; text-align: center; font-family: var(--mono); font-size: 11.5px; color: var(--text-muted); }

@media (max-width: 1280px) {
  .pillar { gap: 48px; }
}
@media (max-width: 960px) {
  .hero-grid, .pillar { grid-template-columns: 1fr; gap: 40px; }
  .pillar.flip .pillar-text { order: 0; }
  .shot-inset { position: static; width: 70%; max-width: 420px; margin: -24px 0 0 auto; }
  .trust { grid-template-columns: repeat(2, 1fr); }
  .trust > div:nth-child(2) { border-right: none; }
  .trust > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}
@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .nav-links { display: none; }
  .hero { padding: 56px 0 64px; }
  .final-cta { padding: 72px 0; }
  footer .container { flex-direction: column; align-items: flex-start; gap: 16px; }
  .foot-links { margin-left: 0; flex-wrap: wrap; }
  .section { padding: 64px 0; }
  .trust { grid-template-columns: 1fr; }
  .trust > div { border-right: none; border-bottom: 1px solid var(--border); }
  .shot-inset { width: 100%; margin-top: 16px; }
}

/* ---------- diagrams ---------- */
.diagram text { font-family: var(--mono); font-size: 12px; fill: var(--text); text-anchor: middle; }
.diagram .d-label text { font-size: 10px; letter-spacing: 0.14em; fill: var(--text-muted); text-anchor: start; }
.diagram .d-label text.mid { text-anchor: middle; }
.diagram .d-sub { font-size: 10px; fill: var(--text-muted); }
.d-dev rect { fill: var(--surface); stroke: var(--border-strong); }
.d-node rect { fill: var(--surface-raised); stroke: rgba(78, 201, 176, 0.45); }
.d-hub rect { fill: var(--surface-raised); stroke: rgba(245, 166, 35, 0.55); }
.d-central rect { fill: var(--surface); stroke: var(--border-strong); }
.d-building { fill: rgba(255, 255, 255, 0.015); stroke: var(--border); stroke-dasharray: 4 4; }
.d-link { stroke: var(--text-faint); stroke-width: 1.5; }
.d-pulse { fill: var(--teal); }
.d-wan-pulse { fill: var(--accent); }
.diagram .d-offline { fill: var(--red); opacity: 0; }
#distributed-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
#distributed-diagram[data-wan="down"] .d-wan { opacity: 0.15; }
#distributed-diagram[data-wan="down"] .d-wan-label { opacity: 0; }
#distributed-diagram[data-wan="down"] .d-wan-pulse { visibility: hidden; animation: none; }
#distributed-diagram[data-wan="down"] .d-offline { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  .d-pulse { animation: 2.4s linear infinite; }
  .p-h50 { animation-name: pulse-h50; } .p-h30 { animation-name: pulse-h30; }
  .p-v80 { animation-name: pulse-v80; } .p-v100 { animation-name: pulse-v100; }
  .d-wan, .d-wan-label, .d-offline { transition: opacity 200ms ease; }
  .d2 { animation-delay: -0.6s; } .d3 { animation-delay: -1.2s; } .d4 { animation-delay: -1.8s; }
}
@keyframes pulse-h50 { from { transform: translateX(0); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } to { transform: translateX(50px); opacity: 0; } }
@keyframes pulse-h30 { from { transform: translateX(0); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } to { transform: translateX(30px); opacity: 0; } }
@keyframes pulse-v80 { from { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } to { transform: translateY(-80px); opacity: 0; } }
@keyframes pulse-v100 { from { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } to { transform: translateY(-100px); opacity: 0; } }

/* diagrams on small screens: legible hero, scrollable distributed view */
@media (max-width: 640px) {
  #hero-diagram text { font-size: 14px; }
  #hero-diagram .d-label text { font-size: 12px; }
  #hero-diagram .d-sub { display: none; }
  #distributed-diagram text { font-size: 14px; }
  #distributed-diagram .d-label text { font-size: 12px; }
  #distributed-diagram .d-sub { font-size: 11.5px; }
  #distributed-diagram { min-width: 760px; }
  .diagram:has(#distributed-diagram) { overflow-x: auto; }
}
