/* Layout: a wide hero with the live Service Runtime gate as its object, then alternating bands
   (benefits, steps, live network, install, FAQ, community) on one 1120px column.
   Motif: CKB cells. Each runner is a square cell; empty seats are dashed outlines. */
:root {
  color-scheme: light;
  --bg: #f2f5f3;
  --surface: #ffffff;
  --band: #e8eeeb;
  --ink: #0f1d1a;
  --muted: #56655f;
  --line: #d3ddd8;
  --accent: #0b7a5c;
  --accent-ink: #ffffff;
  --accent-soft: #d8eee5;
  --amber: #a86400;
  --amber-soft: #f8e7cc;
  --cell-open: #b9c7c1;
  --bad: #b3261e;
  --land: #ffffff;
  --land-line: #cdd7d2;
  --shadow: #dbe6e1;
  --dot: #0b7a5c;

  /* System faces only: the page loads nothing from outside (D42). Bahnschrift (Windows) and DIN Alternate (macOS)
     give the headings a technical, DIN-like voice; elsewhere the system sans takes over. */
  --f-display: "Bahnschrift", "DIN Alternate", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --step--1: .8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.75rem, 1.2rem + 2.2vw, 2.5rem);
  --step-4: clamp(2.25rem, 1.4rem + 3.6vw, 3.6rem);
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1211; --surface: #121c1a; --band: #0f1816; --ink: #e2ebe7; --muted: #93a49e; --line: #233230;
    --accent: #36c695; --accent-ink: #04201a; --accent-soft: #12352b; --amber: #e8a640; --amber-soft: #3a2a10;
    --cell-open: #3a4a46; --bad: #ff8a80; --land: #1d2826; --land-line: #33443f; --shadow: #0a100f; --dot: #36c695;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1211; --surface: #121c1a; --band: #0f1816; --ink: #e2ebe7; --muted: #93a49e; --line: #233230;
  --accent: #36c695; --accent-ink: #04201a; --accent-soft: #12352b; --amber: #e8a640; --amber-soft: #3a2a10;
  --cell-open: #3a4a46; --bad: #ff8a80; --land: #1d2826; --land-line: #33443f; --shadow: #0a100f; --dot: #36c695;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--step-0)/1.6 var(--f-body); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
code { font-family: var(--f-mono); font-size: .88em; background: var(--band); border: 1px solid var(--line); border-radius: 5px; padding: .05em .35em; overflow-wrap: anywhere; }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; }
p { margin: 0; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }
.h2 { font-size: var(--step-3); font-weight: 750; font-variation-settings: "wdth" 112; letter-spacing: -.01em; line-height: 1.1; }
.h3 { font-size: var(--step-1); font-weight: 700; font-variation-settings: "wdth" 110; }

/* Top bar */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--f-display); font-variation-settings: "wdth" 115; font-weight: 800; letter-spacing: .01em; }
.brand b { font-weight: 550; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; font-size: var(--step--1); font-weight: 500; padding: 6px 10px; border-radius: 6px; }
.nav a:hover { background: var(--band); }
.nav .netswitch { border: 1px solid var(--line); color: var(--muted); }
@media (max-width: 560px) { .brand b { display: none; } .nav a:not(.netswitch):not([href="#install"]) { display: none; } }

/* Hero */
.hero { padding-block: clamp(32px, 6vw, 72px) clamp(32px, 5vw, 56px); }
.hero-in { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(28px, 4vw, 56px); align-items: center; }
@media (max-width: 900px) { .hero-in { grid-template-columns: minmax(0, 1fr); } }
.eyebrow { font-family: var(--f-mono); font-size: var(--step--1); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: 14px; }
.eyebrow span { color: var(--ink); }
.hero h1 { font-size: var(--step-4); font-weight: 800; font-variation-settings: "wdth" 118; line-height: 1.02; letter-spacing: -.02em; }
.hero h1 em { display: block; font-style: normal; color: var(--accent); }
.lede { font-size: var(--step-1); line-height: 1.55; color: var(--muted); max-width: 36em; margin-top: 20px; }
.only-testnet { display: none; }
[data-net="testnet"] .only-testnet { display: block; }
[data-net="testnet"] .only-mainnet { display: none; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.cta-note { margin-top: 14px; font-size: var(--step--1); color: var(--muted); }

.btn { display: inline-flex; align-items: center; gap: 9px; min-height: 46px; padding: 0 20px; border-radius: 8px; font: 600 var(--step-0)/1 var(--f-body); text-decoration: none; border: 1.5px solid transparent; transition: transform .15s ease, background-color .15s ease; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent); }

/* Gate panel */
.gate { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: grid; gap: 18px; box-shadow: 0 1px 0 var(--line), 0 18px 40px -28px color-mix(in srgb, var(--ink) 40%, transparent); min-width: 0; }
.gate-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.gate-head h2 { font-size: var(--step-1); font-weight: 700; font-variation-settings: "wdth" 110; line-height: 1.25; }
.chip { flex: none; font: 600 .75rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; padding: 6px 9px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); }
.chip.met { background: var(--accent-soft); color: var(--accent); }
.cells { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
.cell { aspect-ratio: 1; max-width: 100%; border-radius: 4px; border: 1.5px dashed var(--cell-open); }
.cell.on { background: var(--accent); border: 1.5px solid var(--accent); }
.cell.prov { background: var(--amber-soft); border: 1.5px solid var(--amber); animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { background: transparent; } }
.cells-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--step--1); color: var(--muted); }
.cells-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cells-legend b { color: var(--ink); font-variant-numeric: tabular-nums; }
.sw { display: inline-block; width: 11px; height: 11px; border-radius: 2px; }
.sw.on { background: var(--accent); }
.sw.prov { background: var(--amber-soft); border: 1.5px solid var(--amber); }
.sw.open { border: 1.5px dashed var(--cell-open); }
.meters { margin: 0; display: grid; gap: 10px; }
.meter { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); align-items: center; gap: 10px; font-size: var(--step--1); }
.meter dt { color: var(--muted); }
.meter dd { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.bar { position: relative; height: 8px; border-radius: 99px; background: var(--band); overflow: visible; }
.fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 99px; background: var(--accent); transition: width .9s cubic-bezier(.2, .7, .2, 1); }
.fill.over { background: var(--amber); }
.limit { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); opacity: .55; border-radius: 1px; }
.val { font-family: var(--f-mono); font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); }
.gate-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; padding-top: 14px; border-top: 1px dashed var(--line); font: .75rem/1.4 var(--f-mono); color: var(--muted); }
.gate-foot .tip b { color: var(--ink); font-weight: 600; }
.tip::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 1px; animation: pulse 2s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 100% { box-shadow: 0 0 0 7px transparent; } }

.error { color: var(--bad); font-weight: 600; padding-block: 8px; }
.snapshot { font: .78rem/1.4 var(--f-mono); color: var(--amber); padding-block: 6px; }

/* Bands */
.band { background: var(--band); border-block: 1px solid var(--line); padding-block: clamp(40px, 6vw, 72px); }
.band-alt { background: var(--bg); border: 0; }
.why { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); margin-top: 28px; }
@media (max-width: 820px) { .why { grid-template-columns: minmax(0, 1fr); } }
.why article { display: grid; gap: 10px; align-content: start; }
.why svg { width: 34px; height: 34px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.why h3 { font-size: var(--step-1); font-weight: 700; font-variation-settings: "wdth" 108; }
.why p { color: var(--muted); max-width: 34em; }

.steps-sec { padding-block: clamp(40px, 6vw, 72px); }
.steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; counter-reset: s; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; } }
@media (max-width: 520px) { .steps { grid-template-columns: minmax(0, 1fr); } }
.steps li { counter-increment: s; position: relative; padding: 44px 20px 0 0; display: grid; gap: 6px; align-content: start; }
.steps li::before { content: counter(s); position: absolute; top: 0; left: 0; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 6px; border: 1.5px solid var(--accent); color: var(--accent); font: 600 .85rem/1 var(--f-mono); background: var(--bg); z-index: 1; }
.steps li::after { content: ""; position: absolute; top: 15px; left: 30px; right: 0; border-top: 1.5px dashed var(--line); }
.steps li:last-child::before { background: var(--accent); color: var(--accent-ink); }
.steps li:last-child::after { display: none; }
@media (max-width: 900px) { .steps li::after { display: none; } }
.steps h3 { font-size: var(--step-0); font-weight: 700; font-variation-settings: "wdth" 106; }
.steps p { color: var(--muted); font-size: .94rem; }

/* Network */
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; }
.sec-head #summary { font-family: var(--f-mono); font-size: .8rem; }
.disclaimer { margin-top: 16px; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 6px 6px 0; color: var(--muted); font-size: .92rem; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 24px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.stats > div { padding: 14px 18px; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.stats > div:first-child { border-left: 0; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats > div:nth-child(3) { border-left: 0; } .stats > div:nth-child(n+3) { border-top: 1px solid var(--line); } }
.stats .k { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stats .n { font: 700 var(--step-2)/1.15 var(--f-display); font-variation-settings: "wdth" 112; font-variant-numeric: tabular-nums; }
.mapbox { margin-top: 20px; display: grid; gap: 6px; }
.map { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; padding: 8px; }
.wm { display: block; width: 100%; height: auto; }
.wm-shadow path { fill: var(--shadow); stroke: none; }
.wm-c { fill: var(--land); stroke: var(--land-line); stroke-width: .3; }
.wm-dot { fill: var(--dot); fill-opacity: .8; stroke: var(--land); stroke-width: .4; cursor: pointer; }
.wm-own { fill: var(--amber); }
.credit { color: var(--muted); font-size: .72rem; }

.rank-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-top: 32px; margin-bottom: 10px; }
.filter { display: grid; gap: 4px; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.filter input { width: min(22rem, 100%); font: .9rem var(--f-mono); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; text-transform: none; letter-spacing: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; background: var(--band); }
td.id { font-family: var(--f-mono); font-size: .82rem; }
td.score { display: flex; align-items: center; gap: 8px; }
.sbar { width: 56px; height: 5px; border-radius: 9px; background: var(--band); position: relative; overflow: hidden; }
.sbar i { position: absolute; inset: 0 auto 0 0; background: var(--accent); }
.st { font: 600 .7rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .05em; padding: 4px 7px; border-radius: 99px; background: var(--band); color: var(--muted); }
.st.ranked { background: var(--accent-soft); color: var(--accent); }
.st.provisional { background: var(--amber-soft); color: var(--amber); }
.st.excluded { color: var(--bad); }
tr.inactive td { color: var(--muted); opacity: .6; }
tr.empty td { color: var(--muted); text-align: center; padding: 24px; white-space: normal; }

/* Install */
.install { padding-block: clamp(40px, 6vw, 72px); }
.install-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; margin-top: 28px; align-items: start; }
@media (max-width: 900px) { .install-grid { grid-template-columns: minmax(0, 1fr); } }
.win { background: var(--surface); border: 1.5px solid var(--accent); border-radius: 14px; padding: clamp(18px, 3vw, 28px); display: grid; gap: 18px; min-width: 0; }
.win-head { display: grid; gap: 2px; }
.win .dl-win { justify-self: start; }
.win-file { font-family: var(--f-mono); font-size: .82rem; font-weight: 600; }
.need { padding: 12px 14px; background: var(--band); border-radius: 8px; font-size: .94rem; }
.win-steps { margin: 0; padding: 0; list-style: none; counter-reset: w; display: grid; gap: 14px; }
.win-steps li { counter-increment: w; position: relative; padding-left: 44px; min-height: 30px; padding-top: 3px; }
.win-steps li::before { content: counter(w); position: absolute; left: 0; top: 0; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font: 600 .85rem/1 var(--f-mono); }
.win-more { display: grid; gap: 0; border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; padding: 12px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font: 400 1.2rem/1 var(--f-mono); color: var(--accent); }
details[open] summary::after { content: "−"; }
details p { color: var(--muted); padding-bottom: 12px; max-width: 46em; }
details .code { margin-bottom: 14px; }
.code { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--ink); color: var(--bg); border-radius: 8px; padding: 10px 10px 10px 14px; min-width: 0; }
.code code { background: none; border: 0; color: inherit; padding: 0; font-size: .85rem; overflow-x: auto; white-space: nowrap; }
.copy { flex: none; font: 600 .72rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--bg); background: transparent; border: 1px solid color-mix(in srgb, var(--bg) 40%, transparent); border-radius: 5px; padding: 6px 8px; cursor: pointer; }
.linux { border: 1px dashed var(--line); border-radius: 14px; padding: clamp(18px, 3vw, 24px); display: grid; gap: 14px; justify-items: start; min-width: 0; }
.linux > p { color: var(--muted); }
.linux .code { width: 100%; }

/* FAQ */
.faq-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 24px 48px; }
@media (max-width: 820px) { .faq-in { grid-template-columns: minmax(0, 1fr); } }
.faq { border-top: 1px solid var(--line); }

/* Community */
.community { padding-block: clamp(40px, 6vw, 72px); }
.links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
@media (max-width: 820px) { .links { grid-template-columns: minmax(0, 1fr); } }
.link-tile { display: grid; gap: 4px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); text-decoration: none; color: var(--ink); transition: border-color .15s ease, transform .15s ease; }
.link-tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.link-tile .k { font: 600 .72rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.link-tile .t { font: 700 var(--step-1)/1.3 var(--f-display); font-variation-settings: "wdth" 108; }
.link-tile .d { color: var(--muted); font-size: .92rem; }

.site-footer { border-top: 1px solid var(--line); padding-block: 24px 32px; color: var(--muted); font-size: .82rem; }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.site-footer code { font-size: .78rem; }

/* Map band under the top bar, logo, dashboard screenshot (D47) */
:root { --logo-tile: transparent; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --logo-tile: #dfe9e4; } }
:root[data-theme="dark"] { --logo-tile: #dfe9e4; }
.brand-mark { width: 32px; height: 32px; border-radius: 7px; background: var(--logo-tile); }
.mapband { padding-block: 20px 4px; }
.mapband .mapbox { margin-top: 0; }
.maplabel { display: flex; align-items: center; gap: 8px; font: .75rem/1.4 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; animation: pulse 2s ease-out infinite; }
.hero { padding-block: clamp(24px, 4vw, 48px) clamp(32px, 5vw, 56px); }
.shot { margin: clamp(32px, 5vw, 56px) auto 0; max-width: 980px; display: grid; gap: 10px; }
.shot img { display: block; width: 100%; max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 24px 60px -36px color-mix(in srgb, var(--ink) 55%, transparent); background: #fff; }
.shot figcaption { color: var(--muted); font-size: var(--step--1); text-align: center; }

tr.runner-highlight td { background: var(--accent-soft); color: var(--ink); box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }
tr.runner-highlight td:first-child { box-shadow: inset 3px 0 0 var(--accent), inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); }
