:root {
  --bg: #f9fbfd;
  --ink: #0a1628;
  --muted: #5a6b82;
  --line: rgba(15, 23, 42, 0.09);
  --blue: #2563eb;
  --cyan: #0891b2;
  --violet: #7c3aed;
  --emerald: #059669;
  --amber: #d97706;
  --dark: #0f172a;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #fff 0%, var(--bg) 100%);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
.container { width: min(1160px, calc(100% - 40px)); margin: 0 auto; }

/* Header */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.85);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.nav {
  min-height: 68px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.1rem; letter-spacing: -.04em; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px;
  background: conic-gradient(from 200deg, var(--blue), var(--cyan), var(--emerald), var(--blue));
}
.nav-links { display: flex; align-items: center; gap: 14px; font-size: .84rem; font-weight: 700; color: var(--muted); }
.nav-links a:hover { color: var(--ink); }
.nav-cta { background: var(--dark); color: #fff !important; padding: 9px 15px; border-radius: 999px; font-weight: 800; }
.language-wrap { position: relative; }
.language-select {
  appearance: none; min-height: 36px; max-width: 168px; padding: 0 30px 0 11px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; font-weight: 700; font-size: .82rem;
}
[dir="rtl"] .nav-links { flex-direction: row-reverse; }
[dir="rtl"] .planner-label { text-anchor: end; }
.language-wrap::after { content: "⌄"; position: absolute; right: 10px; top: 50%; transform: translateY(-55%); pointer-events: none; color: var(--muted); }
.mobile-toggle { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.mobile-toggle span { width: 16px; height: 2px; background: var(--ink); border-radius: 99px; }
.mobile-menu { display: none; border-top: 1px solid var(--line); background: #fff; }
.mobile-menu-inner { padding: 14px 0 18px; display: grid; gap: 8px; width: min(1160px, calc(100% - 40px)); margin: 0 auto; }
.mobile-menu a, .mobile-menu label { padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; font-weight: 750; }
body.menu-open .mobile-menu { display: block; }

/* Hero */
.hero { padding: 56px 0 40px; }
.hero-intro { max-width: 640px; margin-bottom: 28px; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: .78rem; font-weight: 800; color: var(--muted); background: #fff; }
.pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--emerald); }
h1 { margin: 16px 0 10px; font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 950; letter-spacing: -.07em; line-height: .95; }
.gradient-text { background: linear-gradient(135deg, var(--dark), var(--blue), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.subtitle { margin: 0 0 12px; font-size: clamp(1.1rem, 2vw, 1.45rem); font-weight: 850; letter-spacing: -.03em; }
.lead { margin: 0; color: var(--muted); line-height: 1.65; font-size: .98rem; }

/* Transport Grid */
.transport-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.transport-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f8fafc);
}
.transport-header h2 { margin: 0; font-size: 1.05rem; font-weight: 900; letter-spacing: -.02em; }
.packet-legend { display: flex; flex-wrap: wrap; gap: 10px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 800; color: var(--ink); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.transport-svg { display: block; width: 100%; height: auto; min-height: 480px; max-height: 620px; }

/* SVG grid styles */
.grid-edge { stroke: rgba(37,99,235,.12); stroke-width: 1.5; transition: stroke .35s, opacity .35s; }
.grid-edge.edge-active { stroke: rgba(37,99,235,.35); }
.grid-edge.edge-dim { stroke: rgba(148,163,184,.15); opacity: .35; }
.node-core { fill: #fff; stroke: rgba(37,99,235,.35); stroke-width: 1.5; }
.node-core.hub { fill: url(#hubGrad); stroke: var(--blue); stroke-width: 2; }
.grid-node .node-label {
  font-size: 13px; font-weight: 900; fill: var(--ink); font-family: Inter, sans-serif;
  stroke: #fff; stroke-width: 4px; paint-order: stroke fill;
}
.grid-node.node-dim { opacity: .25; }
.grid-node.node-active .node-core { stroke-width: 2.5; filter: drop-shadow(0 0 6px rgba(37,99,235,.25)); }
.packet { opacity: .9; }

/* Sections */
section { padding: 64px 0; }
.section-head { max-width: 680px; margin-bottom: 28px; }
.kicker { color: var(--blue); font-size: .74rem; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 8px; }
h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 950; letter-spacing: -.05em; line-height: 1.05; }
.section-text { margin-top: 12px; color: var(--muted); line-height: 1.65; font-size: .95rem; }

/* Flow Engine */
.flow-engine { border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.flow-controls {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}
.flow-btn {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font-weight: 800; font-size: .78rem; cursor: pointer;
  transition: .2s;
}
.flow-btn:hover, .flow-btn.active { color: #fff; border-color: transparent; background: var(--blue); }
.flow-btn[data-mode="identity"].active { background: var(--violet); }
.flow-btn[data-mode="intelligence"].active { background: var(--blue); }
.flow-btn[data-mode="proof"].active { background: var(--emerald); }
.flow-btn[data-mode="energy"].active { background: var(--amber); }
.flow-btn[data-mode="governance"].active { background: var(--dark); }
.flow-desc { padding: 10px 18px; font-size: .82rem; color: var(--muted); border-bottom: 1px solid var(--line); min-height: 38px; }

/* Architecture layers */
.arch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.arch-layer {
  padding: 20px; border-radius: 18px; border: 1px solid var(--line); background: #fff;
  box-shadow: 0 8px 28px rgba(15,23,42,.04);
  border-left: 3px solid var(--blue);
}
.arch-layer[data-layer="identity"] { border-left-color: var(--violet); }
.arch-layer[data-layer="intelligence"] { border-left-color: var(--blue); }
.arch-layer[data-layer="proof"] { border-left-color: var(--emerald); }
.arch-layer[data-layer="governance"] { border-left-color: var(--dark); }
.arch-layer[data-layer="wallet"] { border-left-color: var(--cyan); }
.arch-layer[data-layer="energy"] { border-left-color: var(--amber); }
.arch-layer h3 { margin: 0 0 6px; font-size: .95rem; }
.arch-layer p { margin: 0; font-size: .84rem; color: var(--muted); line-height: 1.55; }
.arch-modules { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 5px; }
.arch-tag { padding: 3px 8px; border-radius: 999px; background: var(--bg); font-size: .68rem; font-weight: 750; color: var(--muted); border: 1px solid var(--line); }

/* Nervous system */
.nervous-panel { border: 1px solid var(--line); border-radius: 24px; background: #fff; padding: 20px; box-shadow: var(--shadow); }
.nervous-svg { width: 100%; height: auto; display: block; }
.nerve-line { stroke: rgba(37,99,235,.2); stroke-width: 2; }
.nerve-node { fill: #fff; stroke: var(--blue); stroke-width: 2; }
.nerve-label {
  font-size: 15px; font-weight: 900; fill: var(--ink); font-family: Inter, sans-serif;
  stroke: #fff; stroke-width: 4px; paint-order: stroke fill;
}
.nerve-packet { fill: var(--cyan); filter: drop-shadow(0 0 4px rgba(6,182,212,.6)); }

/* Route planner */
.planner { border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.planner-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #f8fafc; }
.planner-tab {
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font-weight: 800; font-size: .76rem; cursor: pointer;
}
.planner-tab.active { color: #fff; background: var(--tab-color, var(--blue)); border-color: transparent; }
.planner-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 0; min-height: 380px; }
.planner-svg { width: 100%; background: linear-gradient(180deg, #f8fafc, #fff); border-right: 1px solid var(--line); }
.planner-line { stroke: rgba(148,163,184,.35); stroke-width: 2; }
.planner-line.lit { stroke: var(--route-color, var(--blue)); stroke-width: 2.5; }
.planner-node { fill: #fff; stroke: rgba(148,163,184,.5); stroke-width: 2; }
.planner-node.lit { stroke: var(--route-color, var(--blue)); fill: color-mix(in srgb, var(--route-color, var(--blue)) 12%, #fff); }
.planner-label {
  font-size: 15px; font-weight: 900; fill: var(--ink); font-family: Inter, sans-serif;
  stroke: #fff; stroke-width: 4px; paint-order: stroke fill;
}
.planner-packet { filter: drop-shadow(0 0 4px rgba(37,99,235,.5)); }
.planner-info { padding: 24px; display: flex; flex-direction: column; justify-content: center; }
.planner-desc { margin: 0 0 18px; color: var(--muted); font-size: .9rem; line-height: 1.6; }
.planner-metrics { display: flex; gap: 20px; }
.planner-metrics > div { text-align: center; }
.metric-val { display: block; font-size: 1.4rem; font-weight: 950; font-variant-numeric: tabular-nums; }
.metric-lbl { font-size: .68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* AI flow */
.ai-panel { border: 1px solid var(--line); border-radius: 24px; background: #fff; padding: 16px; box-shadow: var(--shadow); }
.ai-svg { width: 100%; display: block; }
.ai-path { fill: none; stroke: rgba(37,99,235,.2); stroke-width: 2; }
.ai-node { fill: #fff; stroke: var(--blue); stroke-width: 2; }
.ai-label {
  font-size: 14px; font-weight: 900; fill: var(--ink); font-family: Inter, sans-serif;
  stroke: #fff; stroke-width: 4px; paint-order: stroke fill;
}
.ai-flow-label {
  font-size: 13px; font-weight: 900; fill: var(--ink); text-anchor: middle; font-family: Inter, sans-serif;
  stroke: #fff; stroke-width: 3px; paint-order: stroke fill;
}
.ai-packet { fill: var(--blue); filter: drop-shadow(0 0 4px rgba(37,99,235,.5)); }

/* Enterprise flow */
.ent-flow {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0;
  padding: 24px; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow);
}
.ent-step {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg);
  min-width: 100px; transition: .25s;
}
.ent-step.active { background: linear-gradient(135deg, rgba(37,99,235,.1), rgba(6,182,212,.08)); border-color: rgba(37,99,235,.3); transform: scale(1.04); }
.ent-num { font-size: .68rem; font-weight: 900; color: var(--blue); }
.ent-name { font-size: .95rem; font-weight: 900; letter-spacing: -.01em; }
.ent-arrow { width: 36px; height: 2px; background: var(--line); position: relative; margin: 0 4px; }
.ent-arrow.flowing { background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.ent-packet {
  position: absolute; top: -3px; left: 0; width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan); opacity: 0;
}
.ent-arrow.flowing .ent-packet { animation: entMove 1s ease-in-out forwards; }
@keyframes entMove { 0% { left: 0; opacity: 1; } 100% { left: calc(100% - 8px); opacity: 1; } }

/* Status + roadmap */
.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.status-card { padding: 18px; border-radius: 16px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); }
.status-card h3 { margin: 0 0 6px; font-size: .88rem; }
.status-badge { display: inline-block; padding: 4px 9px; border-radius: 999px; font-size: .72rem; font-weight: 800; background: rgba(6,182,212,.15); color: #a5f3fc; border: 1px solid rgba(6,182,212,.25); }
.status-badge.planned { background: rgba(124,58,237,.15); color: #ddd6fe; border-color: rgba(124,58,237,.25); }
.status-badge.future { background: rgba(255,255,255,.08); color: #cbd5e1; }
.dark-band { padding: 36px; border-radius: 24px; background: var(--dark); color: #fff; box-shadow: var(--shadow); }
.dark-band .section-text { color: #94a3b8; }
.roadmap { display: grid; gap: 10px; }
.roadmap-step { display: grid; grid-template-columns: 90px 1fr; gap: 16px; padding: 18px 20px; border-radius: 18px; border: 1px solid var(--line); background: #fff; }
.roadmap-step strong { color: var(--blue); font-size: .84rem; }
.roadmap-step h3 { margin: 0 0 4px; font-size: 1rem; }
.roadmap-step p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.55; }

/* CTA + footer */
.cta { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; padding: 40px; border-radius: 24px; background: linear-gradient(135deg, var(--dark), #1e3a8a); color: #fff; box-shadow: var(--shadow); }
.cta p { margin: 0; color: #bfdbfe; line-height: 1.65; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 800; font-size: .88rem; }
.btn.primary { background: linear-gradient(135deg, var(--blue), var(--cyan)); color: #fff; border: none; }
.cta .btn { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.2); }
.cta .btn.primary { background: linear-gradient(135deg, var(--blue), var(--cyan)); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
footer { padding: 32px 0 44px; color: var(--muted); font-size: .86rem; }

/* Legal pages */
.legal-page { padding: 48px 0 72px; max-width: 760px; }
.legal-page h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 950; letter-spacing: -.05em; }
.legal-updated { margin: 0 0 28px; color: var(--muted); font-size: .9rem; }
.legal-page h2 { margin: 28px 0 10px; font-size: 1.15rem; font-weight: 900; letter-spacing: -.03em; }
.legal-page p, .legal-page li { color: var(--muted); line-height: 1.7; font-size: .95rem; }
.legal-page ul { padding-left: 1.2rem; }
.legal-back { display: inline-flex; margin-bottom: 20px; font-weight: 800; color: var(--blue); }
.footer-top { margin-bottom: 16px; }
.footer-top strong { color: var(--ink); }
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; padding-top: 16px; border-top: 1px solid var(--line); }

@media (max-width: 900px) {
  .planner-stage { grid-template-columns: 1fr; }
  .planner-svg { border-right: none; border-bottom: 1px solid var(--line); max-height: 280px; }
  .arch-grid { grid-template-columns: 1fr 1fr; }
  .status-grid { grid-template-columns: 1fr; }
  .cta { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .mobile-toggle { display: flex; }
  .arch-grid { grid-template-columns: 1fr; }
  .ent-flow { flex-direction: column; }
  .ent-arrow { width: 2px; height: 24px; margin: 4px 0; }
  .transport-svg { min-height: 340px; }
}
