:root {
  --bg-0: #06080d;
  --bg-1: #0c1018;
  --bg-2: #121824;
  --bg-card: rgba(16, 22, 33, 0.86);
  --border: rgba(148, 163, 184, 0.14);
  --border-hi: rgba(255, 107, 43, 0.48);
  --text-0: #f8fafc;
  --text-1: #cbd5e1;
  --text-2: #94a3b8;
  --accent: #ff6b2b;
  --accent-hi: #ff854d;
  --cyan: #00d2ff;
  --green: #38ef7d;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --max-w: 1280px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--bg-0); color: var(--text-0); font-family: var(--font-sans); line-height: 1.6; }
body { background: radial-gradient(circle at 18% 0%, rgba(255, 107, 43, 0.09), transparent 42%), radial-gradient(circle at 82% 8%, rgba(0, 210, 255, 0.08), transparent 40%), var(--bg-0); overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: min(var(--max-w), calc(100% - 2.5rem)); margin-inline: auto; }
.mono { font-family: var(--font-mono); }

.top-banner { background: linear-gradient(90deg, rgba(255, 107, 43, 0.18), rgba(0, 210, 255, 0.16)); border-bottom: 1px solid var(--border); padding: 0.5rem 1rem; text-align: center; font-size: 0.8rem; font-family: var(--font-mono); letter-spacing: 0.03em; color: var(--text-0); }
.top-banner a { color: var(--accent-hi); font-weight: 600; text-decoration: underline; margin-left: 0.5rem; }

.site-header { position: sticky; top: 0; z-index: 1000; backdrop-filter: blur(16px); background: rgba(6, 8, 13, 0.82); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 4.25rem; gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.7rem; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: 0.02em; }
.brand img { width: 34px; height: 34px; }
.brand-pipe { color: var(--accent); font-family: var(--font-mono); }
.nav-links { display: flex; align-items: center; gap: clamp(0.85rem, 1.5vw, 1.4rem); font-size: 0.9rem; color: var(--text-1); }
.nav-links a:hover { color: var(--text-0); }
.nav-actions { display: flex; align-items: center; gap: 0.65rem; flex-shrink: 0; }
.brand, .brand > span, .nav-links a, .nav-actions .btn, .top-banner a { white-space: nowrap; }
.brand { flex-shrink: 0; }
@media (max-width: 1300px) { .nav-actions .btn-outline { display: none; } }
@media (max-width: 1100px) { .nav-links { display: none; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.68rem 1.25rem; border-radius: 8px; font-weight: 600; font-size: 0.9rem; transition: all 0.18s ease; cursor: pointer; border: 1px solid transparent; }
.btn-primary { background: linear-gradient(135deg, var(--accent), #e84c0e); color: #fff; box-shadow: 0 6px 22px rgba(255, 107, 43, 0.32); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(255, 107, 43, 0.45); }
.btn-outline { background: rgba(255, 255, 255, 0.04); border-color: var(--border); color: var(--text-0); }
.btn-outline:hover { border-color: var(--cyan); background: rgba(0, 210, 255, 0.08); }
.btn-sm { padding: 0.46rem 0.9rem; font-size: 0.82rem; }

.hero { position: relative; padding: 4.5rem 0 3.2rem; }
.hero-grid { display: grid; grid-template-columns: 1.08fr 0.92fr; gap: 2.5rem; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.32rem 0.78rem; border-radius: 999px; border: 1px solid rgba(0, 210, 255, 0.35); background: rgba(0, 210, 255, 0.08); color: var(--cyan); font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 1.1rem; }
.hero h1 { font-family: var(--font-display); font-size: clamp(2.25rem, 4.3vw, 3.65rem); line-height: 1.08; letter-spacing: -0.025em; margin-bottom: 1.15rem; }
.hero h1 span { background: linear-gradient(90deg, #ff854d, #00d2ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-lead { color: var(--text-1); font-size: 1.06rem; max-width: 60ch; margin-bottom: 1.75rem; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-bottom: 2rem; }
.hero-card { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65); background: var(--bg-1); }
.hero-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.hero-hud { position: absolute; inset: auto 0 0 0; padding: 0.85rem 1.1rem; background: linear-gradient(to top, rgba(6, 8, 13, 0.95), rgba(6, 8, 13, 0.0)); display: flex; justify-content: space-between; align-items: flex-end; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-1); }
.hud-pill { background: rgba(6, 8, 13, 0.82); border: 1px solid var(--border); padding: 0.25rem 0.6rem; border-radius: 6px; color: var(--green); }

.stats-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; margin-top: 2.5rem; padding: 1.25rem; border-radius: 12px; background: var(--bg-card); border: 1px solid var(--border); }
.stat-cell { padding: 0.35rem 0.6rem; border-right: 1px solid var(--border); }
.stat-cell:last-child { border-right: none; }
.stat-val { font-family: var(--font-display); font-size: 1.65rem; font-weight: 700; color: var(--text-0); line-height: 1.15; }
.stat-lbl { font-family: var(--font-mono); font-size: 0.73rem; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.2rem; }

section { padding: 4.5rem 0; border-top: 1px solid rgba(148, 163, 184, 0.08); }
.sec-head { max-width: 760px; margin-bottom: 2.2rem; }
.sec-head h2 { font-family: var(--font-display); font-size: clamp(1.75rem, 3vw, 2.45rem); letter-spacing: -0.02em; margin-bottom: 0.6rem; }
.sec-head p { color: var(--text-1); font-size: 1rem; }

.tab-bar { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-bottom: 1.15rem; }
.tab-btn { background: var(--bg-2); border: 1px solid var(--border); color: var(--text-1); padding: 0.5rem 0.95rem; border-radius: 8px; font-size: 0.83rem; font-family: var(--font-mono); cursor: pointer; transition: all 0.15s; }
.tab-btn.active, .tab-btn:hover { border-color: var(--accent); color: var(--text-0); background: rgba(255, 107, 43, 0.14); }

.scan-controls-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.85rem; margin-bottom: 1rem; }
.scan-controls-row .tab-bar { margin-bottom: 0; }
.mesh-toggle-wrap { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.mesh-toggle-lbl { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); }
.mesh-toggle-group { display: inline-flex; flex-wrap: wrap; background: var(--bg-1); border: 1px solid var(--border); border-radius: 10px; padding: 0.24rem; gap: 0.25rem; }
.mesh-mode-btn { background: transparent; border: 1px solid transparent; color: var(--text-2); padding: 0.42rem 0.82rem; border-radius: 7px; font-size: 0.78rem; font-family: var(--font-mono); cursor: pointer; transition: all 0.15s ease; display: inline-flex; align-items: center; gap: 0.42rem; }
.mesh-mode-btn:hover { color: var(--text-0); background: rgba(255, 255, 255, 0.04); }
.mesh-mode-btn[data-mode="vis"].active { background: rgba(0, 210, 255, 0.15); border-color: var(--cyan); color: #8beeff; box-shadow: 0 0 14px rgba(0, 210, 255, 0.18); }
.mesh-mode-btn[data-mode="phys"].active { background: rgba(255, 176, 46, 0.16); border-color: #ffb02e; color: #ffd480; box-shadow: 0 0 14px rgba(255, 176, 46, 0.2); }
.mesh-mode-btn[data-mode="compare"].active { background: linear-gradient(90deg, rgba(0, 210, 255, 0.16), rgba(255, 176, 46, 0.18)); border-color: var(--accent); color: var(--text-0); }
.mesh-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.mesh-dot.cyan { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.mesh-dot.amber { background: #ffb02e; box-shadow: 0 0 6px #ffb02e; }
.mesh-dot.dual { background: linear-gradient(90deg, var(--cyan), #ffb02e); }
.mesh-legend { margin-top: 0.65rem; display: flex; flex-wrap: wrap; gap: 1rem; font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-2); padding: 0.55rem 0.85rem; border-radius: 8px; background: rgba(12, 16, 24, 0.75); border: 1px solid var(--border); }
.mesh-legend span { display: inline-flex; align-items: center; gap: 0.42rem; }

.ba-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); user-select: none; background: #05070b; touch-action: pan-y; }
.ba-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ba-before-wrap { position: absolute; inset: 0; clip-path: inset(0 50% 0 0); }
.ba-handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; background: var(--cyan); box-shadow: 0 0 16px rgba(0, 210, 255, 0.9); cursor: ew-resize; z-index: 5; }
.ba-knob { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 42px; height: 42px; border-radius: 50%; background: var(--bg-0); border: 2px solid var(--cyan); display: grid; place-items: center; font-family: var(--font-mono); font-size: 0.8rem; color: var(--cyan); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.7); }
.ba-tag { position: absolute; top: 1rem; padding: 0.35rem 0.75rem; border-radius: 6px; background: rgba(6, 8, 13, 0.84); border: 1px solid var(--border); font-family: var(--font-mono); font-size: 0.75rem; z-index: 4; pointer-events: none; }
.ba-tag.left { left: 1rem; color: var(--cyan); }
.ba-tag.right { right: 1rem; color: var(--accent-hi); }
.ba-caption { margin-top: 0.8rem; font-size: 0.88rem; color: var(--text-2); font-family: var(--font-mono); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }

.map-explorer { display: grid; grid-template-columns: 340px 1fr; gap: 1.25rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 1.15rem; }
.map-sidebar { display: flex; flex-direction: column; gap: 0.75rem; max-height: 590px; overflow-y: auto; padding-right: 0.25rem; }
.map-track-btn { text-align: left; background: var(--bg-1); border: 1px solid var(--border); border-radius: 10px; padding: 0.75rem 0.9rem; color: var(--text-0); cursor: pointer; transition: border-color 0.15s; }
.map-track-btn.active { border-color: var(--accent); background: rgba(255, 107, 43, 0.1); }
.map-track-btn small { display: block; color: var(--text-2); font-family: var(--font-mono); font-size: 0.73rem; margin-top: 0.2rem; }
.layout-list { display: flex; flex-wrap: wrap; gap: 0.4rem; padding-top: 0.35rem; }
.layout-chip { font-family: var(--font-mono); font-size: 0.72rem; padding: 0.28rem 0.55rem; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text-1); cursor: pointer; }
.layout-chip.active { border-color: var(--cyan); color: var(--cyan); background: rgba(0, 210, 255, 0.1); }
.map-main { display: flex; flex-direction: column; gap: 0.85rem; }
#leaflet-map { width: 100%; height: 390px; border-radius: 10px; border: 1px solid var(--border); background: #090d14; }
.elev-box { background: var(--bg-1); border: 1px solid var(--border); border-radius: 10px; padding: 0.7rem 0.9rem; }
.elev-header { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-1); margin-bottom: 0.35rem; }
#elev-canvas { width: 100%; height: 110px; display: block; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 1.35rem; }
.track-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; transition: transform 0.18s, border-color 0.18s; }
.track-card:hover { transform: translateY(-3px); border-color: rgba(255, 107, 43, 0.4); }
.track-thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; cursor: pointer; }
.track-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.track-thumb:hover img { transform: scale(1.03); }
.track-badge { position: absolute; top: 0.75rem; left: 0.75rem; padding: 0.25rem 0.6rem; border-radius: 6px; background: rgba(6, 8, 13, 0.86); border: 1px solid var(--border); font-family: var(--font-mono); font-size: 0.7rem; color: var(--cyan); }
.track-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; flex: 1; }
.track-body h3 { font-family: var(--font-display); font-size: 1.3rem; }
.track-region { font-family: var(--font-mono); font-size: 0.76rem; color: var(--text-2); }
.track-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; padding: 0.65rem; border-radius: 8px; background: var(--bg-1); font-family: var(--font-mono); font-size: 0.75rem; }
.track-metrics strong { display: block; color: var(--text-0); font-size: 0.92rem; }
.thumb-strip { display: flex; gap: 0.4rem; overflow-x: auto; }
.thumb-strip img { width: 64px; height: 40px; object-fit: cover; border-radius: 5px; border: 1px solid var(--border); cursor: pointer; opacity: 0.8; }
.thumb-strip img:hover { opacity: 1; border-color: var(--accent); }
.track-actions { margin-top: auto; display: flex; gap: 0.6rem; padding-top: 0.4rem; }

.spec-table-wrap { margin-top: 2.2rem; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-card); }
table.spec-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.spec-table th, .spec-table td { padding: 0.8rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
.spec-table th { font-family: var(--font-mono); font-size: 0.74rem; text-transform: uppercase; color: var(--text-2); background: var(--bg-1); }

.dual-grid, .pipe-grid, .tier-grid { display: grid; gap: 1.35rem; }
.dual-grid { grid-template-columns: repeat(2, 1fr); }
.pipe-grid { grid-template-columns: repeat(4, 1fr); }
.tier-grid { grid-template-columns: repeat(3, 1fr); align-items: stretch; }
.panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 1.5rem; }
.panel.featured { border-color: var(--accent); box-shadow: 0 16px 44px rgba(255, 107, 43, 0.14); }
.panel h3 { font-family: var(--font-display); font-size: 1.25rem; margin: 0.5rem 0; }
.panel ul { list-style: none; margin-top: 1rem; display: grid; gap: 0.55rem; color: var(--text-1); font-size: 0.9rem; }
.panel ul li::before { content: "▸ "; color: var(--accent); font-family: var(--font-mono); }
.step-num { font-family: var(--font-mono); font-size: 0.78rem; color: var(--cyan); }
.tier-price { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; margin: 0.4rem 0; }
.tier-price span { font-size: 0.85rem; color: var(--text-2); font-weight: 400; }

.faq-list { display: grid; gap: 0.75rem; max-width: 880px; }
details.faq-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.2rem; }
details.faq-item summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.faq-item summary::after { content: "+"; font-family: var(--font-mono); color: var(--accent); font-size: 1.2rem; }
details[open].faq-item summary::after { content: "−"; }
details.faq-item p { margin-top: 0.75rem; color: var(--text-1); font-size: 0.92rem; }

.lightbox { position: fixed; inset: 0; background: rgba(4, 6, 10, 0.92); backdrop-filter: blur(10px); z-index: 2000; display: none; place-items: center; padding: 1.5rem; }
.lightbox.open { display: grid; }
.lightbox-inner { max-width: 1180px; width: 100%; }
.lightbox-inner img { width: 100%; border-radius: 10px; border: 1px solid var(--border); }
.lightbox-bar { display: flex; justify-content: space-between; align-items: center; margin-top: 0.75rem; font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-1); }

.card-mesh-bar { display: flex; gap: 0.35rem; padding: 0.55rem 0.85rem; background: var(--bg-1); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-mesh-btn { flex: 1; background: rgba(15, 23, 42, 0.72); border: 1px solid var(--border); color: var(--text-1); font-family: var(--font-mono); font-size: 0.71rem; padding: 0.34rem 0.5rem; border-radius: 6px; cursor: pointer; transition: all 0.16s ease; white-space: nowrap; }
.card-mesh-btn:hover { border-color: var(--cyan); color: var(--text-0); }
.card-mesh-btn.active { background: rgba(0, 210, 255, 0.14); border-color: var(--cyan); color: var(--cyan); font-weight: 600; }

footer { border-top: 1px solid var(--border); padding: 2.8rem 0; color: var(--text-2); font-size: 0.86rem; background: var(--bg-1); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1.5rem; align-items: center; }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-links a:hover { color: var(--text-0); }

@media (max-width: 980px) {
  .hero-grid, .map-explorer, .dual-grid, .pipe-grid, .tier-grid { grid-template-columns: 1fr; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
}

.xlink { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.xlink:hover { color: var(--text-0); }
.prism-callout { margin-top: 1.5rem; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; border-color: rgba(0, 210, 255, 0.35); }
.prism-callout > div:first-child { flex: 1 1 320px; }
.prism-callout-links { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.leaflet-container { background: #0b0f16; }
.rsr-relief { mix-blend-mode: screen; opacity: 0.9; filter: contrast(1.35) brightness(1.25); }
.rsr-roads { opacity: 0.6; filter: saturate(0.6) brightness(1.1); }
.rsr-labels { filter: brightness(1.6); }
