/* ============================================================================
   CargoFlow — marketing homepage
   Same design language as the app: an instrument panel, not a SaaS template.
   Flat red accent, hairline seams, technical paper background, instrument-
   glass dark panels for anything meant to be "read" (the 3D deck render).
   No gradients-as-decoration, no glow, no stock icon set.
   ========================================================================== */
:root {
  --red: #d81f2a;
  --red-dark: #ac151f;
  --red-soft: rgba(216, 31, 42, 0.08);
  --ink: #11161c;
  --ink-2: #37414d;
  --muted: #5a6673;
  --muted-2: #8b95a2;
  --line: #dbe0e6;
  --line-2: #c6cdd6;
  --paper: #eef1f4;
  --panel: #ffffff;
  --panel-2: #f7f9fb;

  --glass: #0e1319;
  --glass-2: #151c24;
  --glass-line: rgba(233, 240, 248, 0.12);
  --glass-ink: #e8eef5;
  --glass-muted: rgba(232, 238, 246, 0.6);
  --amber: #f5b301;
  --green: #1f9d57;

  --sans: "Saira", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cond: "Saira Semi Condensed", var(--sans);
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 28px; }

/* ───────── header ───────── */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(238, 241, 244, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.scrolled { border-color: var(--line); box-shadow: 0 6px 18px -12px rgba(17,22,28,.25); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }

.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.brand-mark { display: inline-flex; color: var(--ink); }
.brand-mark img { display: block; }
.brand-word { font-family: var(--cond); font-size: 20px; font-weight: 700; letter-spacing: -.2px; color: var(--ink); }
.brand-word b { color: var(--red); font-weight: 700; }

.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 600; transition: color .15s; }
.site-nav a:hover { color: var(--ink); }
.site-nav .nav-cta {
  color: var(--red); border: 1px solid rgba(216,31,42,.35); padding: 8px 14px; border-radius: 8px;
}
.site-nav .nav-cta:hover { background: var(--red-soft); color: var(--red-dark); }
.site-nav .nav-login {
  color: #fff; background: var(--ink); padding: 8px 16px; border-radius: 8px;
}
.site-nav .nav-login:hover { background: var(--red); }

.nav-burger { display: none; flex-direction: column; justify-content: center; gap: 4px; width: 34px; height: 34px; border: 0; background: none; cursor: pointer; padding: 0; }
.nav-burger span { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s var(--ease), opacity .2s; margin: 0 auto; }
.nav-burger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.site-nav-mobile {
  display: none; flex-direction: column; gap: 2px; padding: 8px 28px 16px;
  max-height: 0; overflow: hidden; transition: max-height .25s var(--ease);
}
.site-nav-mobile a { padding: 10px 4px; color: var(--ink-2); text-decoration: none; font-weight: 600; border-top: 1px solid var(--line); }
.site-nav-mobile.open { max-height: 320px; }

/* ───────── hero ─────────
   The preview panel runs the full content width, same as the Build-Up Plan
   screen's own deck panel does in the app (that panel fills the dashboard's
   main column, not a sidebar-sized slice) — copy sits above it, not beside
   it, so the panel isn't squeezed into a narrow half. */
.hero { padding: 44px 0 32px; }
.hero-inner { display: block; }
.hero-copy { max-width: 820px; margin: 0 0 28px; }

.eyebrow {
  font-family: var(--sans); text-transform: uppercase; letter-spacing: .16em;
  font-size: 12.5px; font-weight: 600; color: var(--red); margin: 0 0 12px;
}
.hero h1 { font-family: var(--cond); font-size: 46px; line-height: 1.1; margin: 0 0 20px; letter-spacing: -.3px; }
.lede { font-size: 16.5px; line-height: 1.62; color: var(--muted); margin: 0 0 28px; max-width: 620px; }
.lede-note { font-size: 14.5px; color: var(--muted-2); margin-top: -16px; max-width: 680px; }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 28px; }
.btn {
  display: inline-block; padding: 13px 24px; border-radius: 9px; font-weight: 600;
  font-size: 15px; text-decoration: none; transition: background .15s, border-color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); }

.hero-stats { display: grid; grid-template-columns: repeat(3, auto); gap: 28px; margin: 0; padding-top: 18px; border-top: 1px solid var(--line); max-width: 700px; }
.hero-stats > div { display: flex; flex-direction: column; }
.hero-stats dt { font-family: var(--mono); font-size: 28px; font-weight: 600; color: var(--ink); margin: 0; }
.hero-stats dd { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.35; }

/* --- hero 3D panel: the same build-up viewer as the live app (app.css's
   .instrument-frame classes), reused here as a read-only preview. Every HUD
   element lives in normal document flow (a toolbar row, then the canvas,
   then a footer row) — nothing is absolutely positioned over anything else,
   so narrow viewports wrap instead of colliding. Only the hover tooltip is
   absolute, and it only appears on pointer hover. --- */
.hero-visual { min-width: 0; }
.instrument-frame {
  position: relative; border-radius: 14px; background: var(--glass);
  border: 1px solid var(--glass-line); overflow: hidden;
  box-shadow: 0 24px 50px -30px rgba(0,0,0,.55);
}
/* Heights match the app's own two views exactly, not an invented figure:
   app.css's #bu3DFrame is a fixed 520px; the 2D canvas has no fixed height
   at all in the app — it's the canvas's own intrinsic size (360px, set in
   drawBuildup2D) inside a card that just wraps it, no forced crop, no inner
   scrollbar. Same here: the page scrolls, this panel doesn't. */
.scene-panel { display: flex; flex-direction: column; width: 100%; }
.scene-panel.mode-3d #previewMount { height: 520px; }
.scene-panel.mode-2d #previewMount { height: auto; }
/* If WebGL/module loading fails, home.js adds scene-failed but never reaches
   setMode() (that only runs inside a successful deck-preview.js init), so
   neither mode-3d nor mode-2d is ever applied. Without this, #previewMount
   has no height at all and the whole frame collapses to the toolbar/footer's
   sliver height, clipping the fallback SVG (which is absolutely positioned
   and otherwise contributes no layout height of its own). */
.instrument-frame.scene-failed #previewMount { height: 520px; }

.preview-toolbar {
  flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 8px 14px;
  align-items: center; justify-content: space-between;
  padding: 11px 14px; border-bottom: 1px solid var(--glass-line);
}
.preview-label {
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--glass-muted); white-space: nowrap;
}
.preview-toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.preview-toggle {
  display: flex; background: rgba(255,255,255,0.04); border: 1px solid var(--glass-line);
  border-radius: 7px; overflow: hidden;
}
.preview-toggle button {
  all: unset; cursor: pointer; padding: 5px 10px; font-family: var(--mono); font-size: 11px;
  color: var(--glass-muted); transition: background .15s, color .15s;
}
.preview-toggle button.on { background: var(--red); color: #fff; }
.preview-check {
  display: flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 11px;
  color: var(--glass-muted); cursor: pointer; user-select: none; white-space: nowrap;
}
.preview-check input { accent-color: var(--red); cursor: pointer; margin: 0; }
.preview-check:has(input:disabled) { opacity: .35; cursor: default; }
.preview-replay {
  all: unset; cursor: pointer; border: 1px solid rgba(245,179,1,0.5); color: var(--amber);
  border-radius: 7px; padding: 5px 10px; font-family: var(--mono); font-size: 11px; white-space: nowrap;
  transition: background .15s;
}
.preview-replay:hover { background: rgba(245,179,1,0.15); }
.preview-replay:disabled { opacity: .35; cursor: default; pointer-events: none; }

#previewMount { position: relative; }
#previewMount canvas { display: block; width: 100%; height: 100%; cursor: grab; }
#previewMount canvas:active { cursor: grabbing; }

/* --- the real 2D deck view: deck-view.js's drawBuildup2D (canvas) +
   renderCgBlock (the same "Balance & Validation" HTML app.js renders) ---  */
.plan2d {
  /* Normal flow, not absolutely positioned: only one of .plan2d / the 3D
     canvas is ever visible at a time (the other is display:none), so there's
     no need to stack them — and normal flow is what lets #previewMount grow
     to fit this content instead of clipping it into an inner scrollbar. */
  overflow-x: auto; padding: 14px 16px 16px;
  font-family: var(--sans); color: var(--glass-ink);
}
/* No width:100% here on purpose — the canvas pins its own display size (in
   deck-view.js) to match what it's actually drawn at, so proportions are
   identical to the live Build-Up Plan screen; .plan2d scrolls horizontally
   instead of the canvas being stretched/distorted to fit a narrower panel. */
.plan2d-canvas { display: block; }
.plan2d-legend { display: flex; gap: 14px; justify-content: flex-end; margin: 0 0 10px; font-family: var(--mono); font-size: 10.5px; color: var(--glass-muted); }
.plan2d-legend span { display: inline-flex; align-items: center; gap: 5px; }
.plan2d-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.plan2d-legend .sw-green { background: #1fa34a; } .plan2d-legend .sw-amber { background: #f59e0b; }
.plan2d-legend .sw-red { background: #dc2626; } .plan2d-legend .sw-over { background: #991b1b; }
.plan2d-balance { margin-top: 18px; }

/* app.css's cg-block / horizon-* / trim-* classes (verbatim), so the
   "Balance & Validation" readout is pixel-identical to the live app. */
.cg-block { margin-bottom: 18px; }
.cg-bar { position: relative; height: 15px; border-radius: 7px; background: rgba(255,255,255,0.06); }
.cg-marker { position: absolute; top: -5px; width: 3px; height: 23px; border-radius: 2px; background: var(--green); transform: translateX(-1.5px); box-shadow: 0 0 0 2px #0e1319; }
.cg-marker.bad { background: var(--red); }
.cg-target { position: absolute; top: -3px; width: 0; height: 19px; border-left: 2px dashed var(--glass-muted); transform: translateX(-1px); }
.cg-scale { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; color: var(--glass-muted); margin-top: 6px; }

.horizon-wrap { display: flex; align-items: center; gap: 18px; padding: 16px; background: rgba(255,255,255,0.03); border: 1px solid var(--glass-line); border-radius: 12px; margin-bottom: 14px; }
.horizon-gauge { flex-shrink: 0; width: 96px; height: 96px; border-radius: 50%; position: relative; box-shadow: 0 0 0 3px rgba(255,255,255,0.06); }
.horizon-disc { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; transition: transform .8s cubic-bezier(.22,1,.36,1); }
.horizon-sky { position: absolute; left: -50%; right: -50%; top: -100%; height: 150%; background: linear-gradient(to bottom, #2f6ea8, #1d4569); }
.horizon-ground { position: absolute; left: -50%; right: -50%; bottom: -100%; height: 150%; background: linear-gradient(to top, #6f4a2a, #4a321d); }
.horizon-line { position: absolute; left: -50%; right: -50%; top: 50%; height: 2px; background: #fff; }
.horizon-ladder { position: absolute; left: 50%; top: 50%; width: 22px; height: 1px; background: rgba(255,255,255,0.55); }
.horizon-index {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
}
.horizon-index::before, .horizon-index::after { content: ''; position: absolute; top: 50%; width: 20px; height: 3px; background: var(--amber); transform: translateY(-50%); }
.horizon-index::before { left: 4px; } .horizon-index::after { right: 4px; }
.horizon-readout { flex: 1; min-width: 0; }
.horizon-readout .hr-label { font-size: 11px; font-weight: 600; color: var(--glass-muted); }
.horizon-readout .hr-value { font-family: var(--mono); font-size: 22px; font-weight: 600; color: #fff; margin: 3px 0 8px; }
.horizon-readout .hr-value.hr-bad { color: #f87171; }
.horizon-readout .hr-margins { display: flex; gap: 14px; font-family: var(--mono); font-size: 11px; color: var(--glass-muted); }
.horizon-readout .hr-margins b { color: #fff; }
.horizon-readout .hr-note { margin: 8px 0 0; font-size: 10.5px; color: var(--glass-muted); font-style: italic; }

.trim-strip { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.trim-chip { flex: 1; min-width: 110px; text-align: center; padding: 8px 10px; border: 1px solid var(--glass-line); border-radius: 8px; background: rgba(255,255,255,0.03); }
.trim-chip-v { font-family: var(--mono); font-size: 17px; font-weight: 600; color: #fff; }
.trim-chip-v small { font-size: 10px; font-weight: 400; color: var(--glass-muted); margin-left: 3px; }
.trim-chip-l { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--glass-muted); margin-top: 2px; }

.preview-footer {
  flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center;
  justify-content: space-between; padding: 8px 14px; border-top: 1px solid var(--glass-line);
}
.scene-tag, .preview-stat {
  margin: 0; font-family: var(--mono); font-size: 10px; letter-spacing: .02em; color: var(--glass-muted);
}

.scene-fallback {
  position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .3s; pointer-events: none; background: var(--glass);
}
.instrument-frame.scene-failed .scene-fallback { opacity: 1; }
.fallback-svg { width: 82%; max-width: 320px; }
.scene-caption { margin: 12px 2px 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.scene-caption .scene-note { display: block; margin-top: 3px; font-size: 11px; color: var(--muted-2); }

.bu3d-tooltip {
  position: absolute; z-index: 7; pointer-events: none; transform: translate(14px, -8px);
  background: rgba(10,13,18,0.92); border: 1px solid var(--glass-line); border-radius: 8px;
  padding: 8px 11px; font-family: var(--mono); font-size: 11.5px; color: var(--glass-ink);
  opacity: 0; transition: opacity .12s; max-width: 220px; line-height: 1.5;
}
.bu3d-tooltip.on { opacity: 1; }
.bu3d-tooltip .tt-id { font-weight: 600; color: #fff; font-size: 12px; }
.bu3d-tooltip .tt-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

/* ───────── sections ───────── */
.section { padding: 76px 0; }
.section.alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section h2 { font-family: var(--cond); font-size: 30px; margin: 0 0 14px; max-width: 660px; letter-spacing: -.2px; }
.section > .wrap > .lede { margin-bottom: 8px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 32px; }
.card {
  position: relative; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--red);
  border-radius: 12px; padding: 26px 22px; transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -22px rgba(17,22,28,.4); }
.section.alt .card { border-top-color: var(--ink); }
.card-ico {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 9px; background: var(--red-soft); color: var(--red-dark); margin-bottom: 14px;
}
.card-ico svg { width: 20px; height: 20px; }
.card-tag { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--muted-2); margin-bottom: 6px; }
.card h3 { font-family: var(--cond); font-size: 18px; margin: 0 0 10px; }
.card p { color: var(--muted); font-size: 14.5px; line-height: 1.55; margin: 0; }

/* --- documents/codes explainer strip (LDM/CPM/UCM/NOTOC/LMC) --- */
.docs-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
  margin-top: 28px; padding-top: 26px; border-top: 1px solid var(--line);
}
.docs-tag {
  display: inline-block; font-family: var(--mono); font-size: 12px; font-weight: 700;
  color: var(--red-dark); background: var(--red-soft); border-radius: 6px; padding: 3px 9px; margin-bottom: 10px;
}
.docs-item p { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin: 0; }
.docs-item p b { color: var(--ink); }

/* ───────── process flow ───────── */
.flow {
  list-style: none; margin: 36px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
}
.flow li {
  position: relative; padding: 0 22px 0 0; border-left: 2px solid var(--line);
  padding-left: 20px;
}
.flow li:first-child { border-left-color: transparent; padding-left: 0; }
.flow-step {
  display: inline-block; font-family: var(--mono); font-size: 12px; font-weight: 600;
  color: var(--red); background: var(--red-soft); border-radius: 6px; padding: 3px 8px; margin-bottom: 12px;
}
.flow h3 { font-family: var(--cond); font-size: 16.5px; margin: 0 0 8px; }
.flow p { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 0; }

/* ───────── agent section ───────── */
.agent-wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: start; }
.agent-copy h2 { max-width: 100%; }
.feature-list { list-style: none; padding: 0; margin: 24px 0 0; max-width: 560px; }
.feature-list li {
  position: relative; padding-left: 22px; margin-bottom: 14px;
  color: var(--muted); font-size: 15px; line-height: 1.5;
}
.feature-list li::before {
  content: ''; position: absolute; left: 0; top: 7px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--red);
}

.agent-trace {
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: 12px;
  padding: 18px; box-shadow: 0 20px 40px -28px rgba(0,0,0,.5);
}
.trace-label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--glass-muted); margin: 0 0 14px;
}
.trace-msg { border-radius: 9px; padding: 10px 13px; margin-bottom: 10px; max-width: 92%; }
.trace-msg:last-child { margin-bottom: 0; }
.trace-msg p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.5; }
.trace-who { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; }
.trace-user { background: rgba(255,255,255,.06); color: var(--glass-ink); margin-left: auto; }
.trace-user .trace-who { color: var(--glass-muted); }
.trace-agent { background: rgba(216,31,42,.12); color: var(--glass-ink); border: 1px solid rgba(216,31,42,.25); }
.trace-agent .trace-who { color: #ff8a91; }

/* ───────── demo form ───────── */
.demo-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.demo-form {
  background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--red);
  border-radius: 12px; padding: 26px;
}
.demo-form label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
.demo-form label:first-child { margin-top: 0; }
.demo-form input, .demo-form textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; font-family: var(--sans); outline: none; resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}
.demo-form input:focus, .demo-form textarea:focus {
  border-color: var(--red); box-shadow: 0 0 0 3px rgba(216,31,42,0.14);
}
.demo-form button {
  width: 100%; margin-top: 20px; padding: 12px; border: 0; border-radius: 10px;
  background: var(--red); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
  font-family: var(--sans); transition: background .15s;
}
.demo-form button:hover { background: var(--red-dark); }
.demo-form button:disabled { opacity: .7; cursor: default; }
.form-note { min-height: 18px; margin: 12px 0 0; font-size: 13.5px; color: var(--ink); text-align: center; }
.form-note.error { color: var(--red); }

/* ───────── footer ───────── */
.site-footer { border-top: 1px solid var(--line); padding: 26px 0; }
.site-footer .wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.site-footer, .site-footer a { color: var(--muted); font-size: 13px; }
.site-footer a { text-decoration: none; font-weight: 600; }
.site-footer a:hover { color: var(--ink); }

/* ───────── scroll reveal ───────── */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .55s var(--ease), transform .55s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.grid-3 .reveal:nth-child(2) { transition-delay: .08s; }
.grid-3 .reveal:nth-child(3) { transition-delay: .16s; }
.flow li:nth-child(2) { transition-delay: .08s; }
.flow li:nth-child(3) { transition-delay: .16s; }
.flow li:nth-child(4) { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; }
}

/* ───────── responsive (tablet → mobile, fluid throughout) ───────── */

/* Large tablet / small laptop: capability grid drops to 2 columns before
   anything else changes. */
@media (max-width: 1080px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .docs-strip { grid-template-columns: repeat(2, 1fr); }
}

/* Tablet: agent/demo panes stack (hero is already a single full-width column). */
@media (max-width: 980px) {
  .agent-wrap { grid-template-columns: 1fr; gap: 32px; }
  .demo-wrap { grid-template-columns: 1fr; gap: 28px; }
}

/* Phone: single-column everything, larger tap targets, tighter type scale. */
@media (max-width: 760px) {
  .wrap { padding: 0 18px; }
  .site-nav { display: none; }
  .nav-burger { display: flex; }
  .site-nav-mobile { display: flex; }

  .hero { padding: 36px 0 44px; }
  .hero h1 { font-size: 30px; }
  .lede { font-size: 15.5px; }
  .hero-stats { grid-template-columns: 1fr 1fr; row-gap: 18px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { text-align: center; }

  .preview-toolbar, .preview-footer { padding: 9px 12px; }
  .preview-toolbar-actions { gap: 6px 10px; }
  .preview-toggle button, .preview-replay { padding: 7px 10px; } /* bigger tap target */
  .preview-check { padding: 4px 0; }

  .horizon-wrap { flex-direction: column; text-align: center; }
  .trim-strip { justify-content: center; }

  .grid-3 { grid-template-columns: 1fr; }
  .card { padding: 22px 20px; }
  .docs-strip { grid-template-columns: 1fr; gap: 20px; }

  .flow { grid-template-columns: 1fr; gap: 24px; }
  .flow li { border-left: none; padding-left: 0; border-top: 2px solid var(--line); padding-top: 18px; }
  .flow li:first-child { border-top: none; padding-top: 0; }

  .agent-trace { padding: 16px; }
  .trace-msg { max-width: 100%; }

  .demo-form { padding: 22px; }

  .section { padding: 48px 0; }
  .section h2 { font-size: 24px; }

  .site-footer .wrap { flex-direction: column; align-items: flex-start; }
}

/* Small phone: drop to a single stat column, tighten further. */
@media (max-width: 420px) {
  .hero h1 { font-size: 26px; }
  .hero-stats { grid-template-columns: 1fr; row-gap: 14px; }
  .hero-stats dt { font-size: 24px; }
  .card-tag, .eyebrow { font-size: 11px; }
}
