:root {
  --bg0: #061018;
  --bg1: #0a1f2a;
  --ink: #edf6f4;
  --muted: #8eaeaa;
  --accent: #2ec4b6;
  --accent-deep: #1a8f84;
  --gold: #e0a106;
  --danger: #ef6a6a;
  --ok: #3dd68c;
  --card: rgba(255, 255, 255, 0.035);
  --line: rgba(255, 255, 255, 0.12);
  --font-display: "Segoe UI", "Trebuchet MS", sans-serif;
  --font-mono: "Cascadia Code", "Consolas", monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1000px 520px at 8% -8%, #134e4a 0%, transparent 55%),
    radial-gradient(800px 480px at 100% 0%, #1e3a5f 0%, transparent 48%),
    linear-gradient(165deg, var(--bg0), var(--bg1));
  color: var(--ink);
  font-family: var(--font-display);
}
body { padding: 20px clamp(14px, 3vw, 36px) 72px; }

.topbar {
  max-width: 1120px;
  margin: 0 auto 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand-mark {
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--accent);
}
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  border: 1px solid var(--line);
  background: var(--card);
  padding: 4px 10px;
  font-size: 11px;
  letter-spacing: 0.05em;
}
.badge.sim { border-color: rgba(46, 196, 182, 0.45); color: var(--accent); }
.badge.synth { border-color: rgba(224, 161, 6, 0.4); color: var(--gold); }
.badge.live { border-color: rgba(61, 214, 140, 0.4); color: var(--ok); }
.badge.pending { color: var(--muted); }

.hero {
  max-width: 1120px;
  margin: 0 auto 28px;
  padding: clamp(28px, 5vw, 52px) 0 8px;
  animation: rise 0.7s ease both;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
}
.hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
}
.headline {
  margin: 14px 0 16px;
  font-size: clamp(1.35rem, 3.4vw, 2rem);
  color: #c8fff6;
  max-width: 18ch;
  line-height: 1.2;
}
.lede {
  margin: 0;
  color: var(--muted);
  max-width: 62ch;
  font-size: 1.05rem;
  line-height: 1.55;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.cta-primary, button {
  appearance: none;
  border: 0;
  background: linear-gradient(120deg, var(--accent), var(--accent-deep));
  color: #04201c;
  font-weight: 750;
  padding: 12px 16px;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.cta-primary:hover, button:hover { filter: brightness(1.06); transform: translateY(-1px); }
.cta-secondary, button.secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.disclaimer {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  max-width: 70ch;
}

.product-video {
  margin: 28px auto 8px;
  padding: 18px 0 6px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  animation: rise 0.65s ease both;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.product-video h2 {
  margin: 0 0 8px;
  font-size: clamp(1.25rem, 3.2vw, 1.75rem);
  letter-spacing: -0.02em;
  max-width: 28ch;
  text-align: center;
}
.product-video-label {
  margin: 0 auto 14px;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 42ch;
  line-height: 1.45;
  text-align: center;
}
.video-frame-wrap {
  width: 100%;
  max-width: 720px;
}
.video-frame-portrait {
  max-width: min(360px, 100%);
  margin: 0 auto;
}
.video-aspect {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #050b14;
  border: 1px solid var(--line);
  overflow: hidden;
}
/* Vertical Short: true 9:16 — width derived so max-height never squashes the ratio. */
.video-aspect-portrait {
  padding-top: 0;
  aspect-ratio: 9 / 16;
  width: min(360px, 100%, 36vh);
  height: auto;
  max-width: min(360px, 100%);
  margin: 0 auto;
}
.video-aspect iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-pending {
  margin: 0 auto;
  padding: 28px 16px;
  border: 1px dashed var(--line);
  background: #050b14;
  max-width: 42ch;
  text-align: center;
}
.video-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  margin: 12px auto 0;
  font-size: 0.92rem;
  text-align: center;
}
.video-watch-link {
  display: inline-block;
  text-decoration: none;
  padding: 10px 14px;
}
.text-link {
  color: var(--accent);
  text-underline-offset: 3px;
}
.video-walkthrough {
  max-width: 1120px;
  margin: 0 auto 28px;
  padding: 8px 0 4px;
  animation: rise 0.55s ease both;
  display: flex;
  justify-content: center;
}
.walkthrough-details {
  border: 1px solid var(--line);
  background: var(--card);
  padding: 10px 18px 12px;
  width: fit-content;
  max-width: min(100%, 42rem);
  margin-left: auto;
  margin-right: auto;
  align-self: center;
  text-align: left;
}
.walkthrough-details[open] {
  width: min(100%, 42rem);
}
.walkthrough-details > summary {
  cursor: pointer;
  font-size: clamp(1.15rem, 2.8vw, 1.45rem);
  font-weight: 750;
  list-style: none;
  color: var(--ink);
  text-align: center;
}
.walkthrough-details > summary::-webkit-details-marker { display: none; }
.walkthrough-details > summary::before {
  content: '▸ ';
  color: var(--accent);
  font-weight: 700;
}
.walkthrough-details[open] > summary::before { content: '▾ '; }
.walkthrough-intro {
  margin: 12px auto;
  color: var(--muted);
  max-width: 70ch;
  line-height: 1.5;
}
.walkthrough-list {
  margin: 0;
  padding-left: 1.15rem;
  max-width: 72ch;
  color: var(--ink);
  line-height: 1.55;
}
.walkthrough-list li { margin: 0 0 10px; }
.walkthrough-list strong { color: #c8fff6; }
@media (max-width: 640px) {
  .product-video h2 { max-width: min(100%, 22ch); }
  .video-frame-portrait,
  .video-aspect-portrait {
    width: min(320px, 100%, 42vh);
    max-width: min(100%, 320px);
    margin-left: auto;
    margin-right: auto;
  }
  .video-actions { flex-direction: column; align-items: center; }
}

.guided, .developer {
  max-width: 1120px;
  margin: 0 auto 24px;
  animation: rise 0.45s ease both;
}
.guided[hidden], .developer[hidden] { display: none !important; }

.guided-head h2, .dev-banner h2 { margin: 0 0 6px; }
.guided-head p, .dev-banner p { margin: 0; color: var(--muted); }
.step-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 18px;
}
.step-pill {
  font-size: 11px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--card);
}
.step-pill.active {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 1px rgba(46, 196, 182, 0.25);
}
.step-pill.done { color: var(--ok); border-color: rgba(61, 214, 140, 0.35); }

.story-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(280px, 1.2fr);
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 18px;
}
@media (max-width: 820px) {
  .story-panel { grid-template-columns: 1fr; }
}
.step-kicker {
  margin: 0;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  font-weight: 700;
}
.story-copy h3 { margin: 8px 0 10px; font-size: 1.35rem; }
.step-body { margin: 0; color: var(--muted); line-height: 1.5; }
.story-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.story-stage { display: flex; flex-direction: column; gap: 12px; }
.net-viz, .phone-stage {
  min-height: 88px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px dashed var(--line);
  background: #050b14;
  position: relative;
  overflow: hidden;
}
.net-viz .node, .phone {
  padding: 8px 12px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(46, 196, 182, 0.08);
}
.net-viz .node.active, .phone.active {
  animation: pulse 0.9s ease;
  border-color: var(--gold);
  color: var(--gold);
}
.net-viz .node.done { border-color: var(--ok); color: var(--ok); }
.net-viz .edge { color: var(--muted); }
.packet {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(224, 161, 6, 0.7);
  animation: hop 1.1s ease;
}

.result-card {
  background: #07141c;
  border: 1px solid var(--line);
  padding: 14px;
  min-height: 120px;
}
.result-card h4 { margin: 0 0 8px; font-size: 1rem; }
.result-card ul { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.55; }
.result-card .status-ok { color: var(--ok); font-weight: 700; }
.result-card .status-warn { color: var(--gold); font-weight: 700; }
.result-card .status-bad { color: var(--danger); font-weight: 700; }
.amount { font-family: var(--font-mono); color: var(--ink); }

.tech-evidence {
  margin-top: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
  padding: 8px 12px;
}
.tech-evidence summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
}
.tech-evidence pre, pre {
  margin: 8px 0 0;
  overflow: auto;
  background: #050b14;
  border: 1px solid var(--line);
  padding: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 280px;
}

.developer {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.dev-banner { grid-column: 1 / -1; }
section {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 16px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
section.wide { grid-column: 1 / -1; }
section h2 { margin: 0; font-size: 1.05rem; }
section .hint { color: var(--muted); font-size: 0.9rem; margin: 0; }
label { font-size: 0.85rem; color: var(--muted); display: block; margin-bottom: 4px; }
input, select {
  width: 100%;
  background: #061018;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 8px 10px;
  margin-bottom: 8px;
  font-family: var(--font-mono);
}
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.ok { color: var(--ok); }
.bad { color: var(--danger); }
.warn { color: var(--gold); }
.muted { color: var(--muted); }

.scenario-tag {
  margin: 10px 0 0;
  color: var(--gold);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.cpx-summary {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  padding: 10px 12px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink);
}
.cpx-summary.ok { border-color: rgba(61, 214, 140, 0.35); }
.cpx-summary.warn { border-color: rgba(224, 161, 6, 0.4); }
.cpx-summary.bad { border-color: rgba(239, 106, 106, 0.45); }
.cpx-summary a { color: var(--accent); }
label input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
  vertical-align: middle;
}

footer {
  max-width: 1120px;
  margin: 28px auto 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}
footer code { color: var(--accent); font-family: var(--font-mono); font-size: 0.8rem; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@keyframes hop {
  from { transform: translateX(-12px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
