/* ============================================================
   HigherStack Forms — landing page styles (self-contained)
   Part A: design tokens + base + used components (from styles.css)
   Part B: landing.css (verbatim from the design bundle)
   ============================================================ */

/* ---- Part A.1: tokens — :root and [data-theme="dark"] verbatim from styles.css ---- */
:root {
  /* ---- Brand / accent (tweakable) ---- */
  --accent: #2563eb;
  --accent-press: color-mix(in oklab, var(--accent) 86%, black);
  --accent-soft: color-mix(in oklab, var(--accent) 12%, white);
  --accent-softer: color-mix(in oklab, var(--accent) 7%, white);
  --on-accent: #ffffff;

  /* ---- Radius (tweakable base --r) ---- */
  --r: 12px;
  --r-xs: calc(var(--r) * 0.4);
  --r-sm: calc(var(--r) * 0.66);
  --r-md: var(--r);
  --r-lg: calc(var(--r) * 1.5);
  --r-xl: calc(var(--r) * 2);
  --r-pill: 999px;

  /* ---- Density (tweakable) ---- */
  --pad: 1;               /* multiplier */
  --ctrl-h: 42px;
  --gap: 14px;

  /* ---- Type (tweakable) ---- */
  --font-ui: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-display: "Space Grotesk", system-ui, sans-serif;

  /* ---- Light palette ---- */
  --bg: #fbfbfc;
  --surface: #ffffff;
  --panel: #f5f6f8;
  --panel-2: #eef0f3;
  --line: #e7e9ee;
  --line-strong: #d6dae1;
  --ink: #0a0a0b;
  --text: #16181d;
  --text-2: #5a626f;
  --text-3: #99a0ad;
  --shadow-sm: 0 1px 2px rgba(16,18,23,.05), 0 1px 1px rgba(16,18,23,.04);
  --shadow-md: 0 4px 14px rgba(16,18,23,.07), 0 2px 5px rgba(16,18,23,.05);
  --shadow-lg: 0 18px 50px -12px rgba(16,18,23,.22), 0 6px 18px rgba(16,18,23,.08);
  --logo-invert: 0;
  --ok: #15a06b;
  --warn: #e0a000;
  --grid-dot: rgba(20,22,28,.055);
  --band: #0c0e14;          /* always-dark marketing bands */
  --on-band: #ffffff;
}

[data-theme="dark"] {
  --accent-soft: color-mix(in oklab, var(--accent) 22%, #11141a);
  --accent-softer: color-mix(in oklab, var(--accent) 12%, #0d1014);
  --bg: #0a0c10;
  --surface: #14171e;
  --panel: #0f1217;
  --panel-2: #1b1f28;
  --line: #232834;
  --line-strong: #313846;
  --ink: #f3f5f8;
  --text: #eef1f6;
  --text-2: #9aa3b1;
  --text-3: #6b7383;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 6px 20px rgba(0,0,0,.45);
  --shadow-lg: 0 24px 60px -12px rgba(0,0,0,.7), 0 6px 18px rgba(0,0,0,.5);
  --logo-invert: 1;
  --ok: #2bd093;
  --warn: #f0c14b;
  --grid-dot: rgba(255,255,255,.05);
  --band: #11151d;
  --on-band: #ffffff;
}

/* ---- Part A.2: base reset ---- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 15px;
  line-height: 1.5;
}
::selection { background: color-mix(in oklab, var(--accent) 28%, transparent); }
h1,h2,h3,h4,h5 { font-family: var(--font-display); margin: 0; letter-spacing: -.02em; font-weight: 600; }
p { margin: 0; }
button { font-family: inherit; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font-family: inherit; }

/* ---- Part A.3: buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--ctrl-h); padding: 0 16px; border-radius: var(--r-sm);
  font-weight: 600; font-size: 14px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  transition: background .14s, border-color .14s, transform .06s, box-shadow .14s;
  white-space: nowrap;
}
.btn:hover { background: var(--panel); }
.btn:active { transform: translateY(1px); }
.btn svg { flex: none; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.lg { height: 50px; padding: 0 22px; font-size: 15px; }
.btn.block { width: 100%; }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: transparent; box-shadow: 0 1px 2px color-mix(in oklab, var(--accent) 40%, transparent); }
.btn-primary:hover { background: var(--accent-press); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--panel); color: var(--text); }
.btn-soft { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
[data-theme="dark"] .btn-soft { color: color-mix(in oklab, var(--accent) 60%, white); }
.btn-soft:hover { background: color-mix(in oklab, var(--accent) 18%, var(--surface)); }

/* ---- Part A.4: form controls (demos) ---- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .lbl { font-size: 13px; font-weight: 600; color: var(--text); }
.lbl .req { color: var(--accent); margin-left: 2px; }
.input, .textarea, .selectbox {
  width: 100%; height: var(--ctrl-h); padding: 0 13px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font-size: 14px; outline: none;
  transition: border-color .14s, box-shadow .14s; appearance: none;
}
.textarea { height: auto; padding: 11px 13px; resize: vertical; min-height: 84px; line-height: 1.5; }
.input:focus, .textarea:focus, .selectbox:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }

/* ---- Part A.5: segmented toggle (modes) ---- */
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg button { border: none; background: transparent; color: var(--text-2); font-weight: 600; font-size: 13px; padding: 6px 13px; border-radius: calc(var(--r-sm) - 3px); cursor: pointer; transition: all .14s; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .seg button.on { background: var(--panel-2); }

/* ---- Part A.6: helpers + keyframes + landing micro-helpers ---- */
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.grid-bg { background-image: radial-gradient(var(--grid-dot) 1.4px, transparent 1.4px); background-size: 22px 22px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
@keyframes fadeUp { from { transform: translateY(9px); } to { transform: none; } }
@keyframes pop { from { transform: scale(.97); } to { transform: none; } }
/* landing markup helpers (colored icon boxes use .ic-box so the .ic icon-slot span never collides) */
.float-chip .ic-box { width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center; flex: none; }
.dot-r { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.hero-prog-track { height: 3px; background: var(--line); }
.hero-prog-fill { height: 100%; width: 0; background: var(--accent); transition: width .35s; border-radius: 0 99px 99px 0; }

/* ============================================================
   Part B: landing.css — verbatim from the design bundle
   (only the .float-chip/.fcard/.tpl-mini icon-box selectors renamed to .ic-box)
   ============================================================ */
/* ============================================================
   HigherStack Forms — landing page
   Builds on styles.css tokens. Marketing-specific layout only.
   ============================================================ */

.lp { background: var(--bg); color: var(--text); }
.lp-wrap { max-width: 1320px; margin: 0 auto; padding: 0 28px; }
.lp section { position: relative; }

/* ---------- Nav ---------- */
.lp-nav { position: sticky; top: 0; z-index: 50; background: color-mix(in oklab, var(--bg) 82%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.lp-nav-in { display: flex; align-items: center; gap: 28px; height: 66px; }
.lp-logo { display: flex; align-items: center; gap: 11px; }
.lp-logo img { width: 32px; height: 32px; object-fit: contain; filter: invert(var(--logo-invert)); }
.lp-logo b { font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: -.03em; }
.lp-logo b span { color: var(--text-3); font-weight: 500; }
.lp-links { display: flex; gap: 4px; margin-left: 8px; }
.lp-links a { padding: 8px 13px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500; color: var(--text-2); cursor: pointer; transition: all .12s; }
.lp-links a:hover { background: var(--panel); color: var(--text); }
.lp-nav-cta { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ---------- Hero ---------- */
.hero { padding: 84px 0 60px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(40px, 5.4vw, 62px); line-height: 1.02; letter-spacing: -.035em; }
.hero h1 .hl { color: var(--accent); position: relative; white-space: nowrap; }
.hero h1 .hl::after { content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 10px; background: var(--accent-soft); z-index: -1; border-radius: 3px; }
.hero p.sub { font-size: 19px; line-height: 1.55; color: var(--text-2); margin-top: 22px; max-width: 480px; }
.hero-cta { display: flex; align-items: center; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.hero-trust { display: flex; align-items: center; gap: 18px; margin-top: 26px; color: var(--text-3); font-size: 13px; }
.hero-trust .av { display: flex; }
.hero-trust .av span { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--bg); margin-left: -8px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; }
.pill-tag { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 13px 0 8px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 22px; box-shadow: var(--shadow-sm); }
.pill-tag b { color: var(--accent); }
.pill-tag .nw { background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .04em; padding: 3px 7px; border-radius: 99px; text-transform: uppercase; }

/* hero demo card */
.hero-demo { position: relative; }
.hero-demo .browser { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.hero-demo .bbar { height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 15px; border-bottom: 1px solid var(--line); }
.hero-demo .bbar .url { flex: 1; height: 26px; border-radius: 99px; background: var(--panel); display: flex; align-items: center; gap: 7px; padding: 0 12px; font-size: 12px; color: var(--text-3); }
.hero-demo .bdy { padding: 30px; }
.float-chip { position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 12px 15px; display: flex; align-items: center; gap: 11px; font-size: 13px; font-weight: 600; }
.float-chip .ic-box { width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center; flex: none; }
.float-chip small { display: block; color: var(--text-3); font-weight: 500; font-size: 11.5px; }
.fc-1 { top: -22px; left: -28px; animation: floaty 5s ease-in-out infinite; }
.fc-2 { bottom: 34px; right: -30px; animation: floaty 5s ease-in-out infinite .8s; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* ---------- logo strip ---------- */
.logos { padding: 30px 0 14px; }
.logos > p { text-align: center; font-size: 12.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 26px; }
.logos-marquee {
  position: relative;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.logos-track { display: flex; align-items: center; width: max-content; animation: logo-marquee 52s linear infinite; }
.logos-marquee:hover .logos-track { animation-play-state: paused; }
.logos-track .lg { flex: none; padding: 0 30px; display: grid; place-items: center; }
.logos-track .lg img {
  height: 30px; width: auto; max-width: 150px; object-fit: contain; display: block;
  filter: grayscale(1) opacity(.5);
  transition: filter .25s ease;
}
.logos-track .lg img:hover { filter: grayscale(0) opacity(1); }
@keyframes logo-marquee { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }

[data-theme="dark"] .logos-track .lg img { filter: grayscale(1) brightness(0) invert(1) opacity(.55); }
[data-theme="dark"] .logos-track .lg img:hover { filter: grayscale(0) brightness(1) invert(0) opacity(1); }

@media (prefers-reduced-motion: reduce) {
  .logos-track { animation: none; width: auto; flex-wrap: wrap; justify-content: center; gap: 18px 20px; }
  .logos-track .dup { display: none; }
}

/* ---------- section heading ---------- */
.sec { padding: 80px 0; }
.sec-head { max-width: 640px; margin: 0 auto 52px; text-align: center; }
.sec-head .kicker { display: block; margin-bottom: 14px; }
.sec-head h2 { font-size: clamp(30px, 3.6vw, 44px); letter-spacing: -.03em; line-height: 1.06; }
.sec-head p { font-size: 17.5px; color: var(--text-2); margin-top: 16px; line-height: 1.55; }

/* ---------- big feature split ---------- */
.feat { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; padding: 30px 0; }
.feat.rev .feat-copy { order: 2; }
.feat-copy .kicker { margin-bottom: 14px; }
.feat-copy h3 { font-size: clamp(26px, 3vw, 36px); letter-spacing: -.025em; line-height: 1.1; }
.feat-copy p { font-size: 16.5px; color: var(--text-2); margin-top: 16px; line-height: 1.6; }
.feat-list { display: flex; flex-direction: column; gap: 13px; margin-top: 24px; }
.feat-list li { display: flex; gap: 11px; align-items: flex-start; font-size: 15px; color: var(--text); list-style: none; }
.feat-list .ck { width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-top: 1px; }
.feat-visual { position: relative; }
.panel-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-md); overflow: hidden; }

/* mini builder visual */
.mini-builder { display: grid; grid-template-columns: 120px 1fr; min-height: 340px; }
.mini-pal { background: var(--panel); border-right: 1px solid var(--line); padding: 14px 11px; display: flex; flex-direction: column; gap: 7px; }
.mini-pal .mp { display: flex; align-items: center; gap: 8px; padding: 8px 9px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--text-2); }
.mini-pal .mp.drag { border-color: var(--accent); color: var(--accent); box-shadow: var(--shadow-md); transform: translateX(6px) rotate(-1.5deg); background: var(--accent-softer); }
.mini-canvas { padding: 20px; display: flex; flex-direction: column; gap: 13px; }
.mini-canvas .mf { border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 11px 13px; background: var(--surface); }
.mini-canvas .mf.sel { border-color: var(--accent); background: var(--accent-softer); }
.mini-canvas .mf .ml { font-size: 12px; font-weight: 600; margin-bottom: 7px; }
.mini-canvas .mf .mi { height: 30px; border-radius: var(--r-xs); background: var(--panel); border: 1px solid var(--line); }
.drop-line { height: 2px; background: var(--accent); border-radius: 2px; position: relative; }
.drop-line::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ---------- feature small grid ---------- */
.fgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.fcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 26px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.fcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.fcard .ic-box { width: 46px; height: 46px; border-radius: var(--r-sm); display: grid; place-items: center; margin-bottom: 18px; }
.fcard h4 { font-size: 18px; letter-spacing: -.02em; }
.fcard p { font-size: 14.5px; color: var(--text-2); margin-top: 9px; line-height: 1.55; }

/* ---------- stats band ---------- */
.stats-band { background: var(--band); color: #fff; border-radius: var(--r-xl); padding: 52px 40px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; position: relative; overflow: hidden; }
.stats-band .st b { font-family: var(--font-display); font-size: clamp(34px, 4vw, 48px); font-weight: 600; letter-spacing: -.03em; display: block; }
.stats-band .st span { color: rgba(255,255,255,.55); font-size: 14.5px; margin-top: 4px; display: block; }
.stats-band .glow { position: absolute; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, color-mix(in oklab, var(--accent) 60%, transparent), transparent 70%); top: -160px; right: -80px; opacity: .8; }

/* ---------- embed/code ---------- */
.code-card { background: var(--ink); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.code-card .cbar { height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 15px; border-bottom: 1px solid rgba(255,255,255,.08); }
.code-card .cbar .fn { color: rgba(255,255,255,.5); font-size: 12.5px; font-family: ui-monospace, monospace; margin-left: 6px; }
.code-card pre { margin: 0; padding: 22px 22px; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13.5px; line-height: 1.75; color: #e8eaf0; overflow-x: auto; }
.code-card .tok-tag { color: #7aa2ff; }
.code-card .tok-attr { color: #6fd3b8; }
.code-card .tok-str { color: #e6b673; }
.code-card .tok-com { color: rgba(255,255,255,.35); }

/* ---------- modes toggle demo ---------- */
.modes-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-md); padding: 30px; min-height: 360px; display: flex; flex-direction: column; }

/* ---------- templates strip ---------- */
.tpl-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tpl-mini { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.tpl-mini:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.tpl-mini .ic-box { width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center; margin-bottom: 14px; }
.tpl-mini b { font-size: 15px; font-family: var(--font-display); }
.tpl-mini small { display: block; color: var(--text-3); font-size: 12.5px; margin-top: 4px; }

/* ---------- pricing ---------- */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.price-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px; display: flex; flex-direction: column; }
.price-card.feat-plan { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-lg); position: relative; }
.price-card.feat-plan::before { content: "Most popular"; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; padding: 5px 13px; border-radius: 99px; letter-spacing: .03em; }
.price-card h4 { font-size: 17px; }
.price-card .amt { font-family: var(--font-display); font-size: 46px; font-weight: 600; letter-spacing: -.03em; margin: 14px 0 2px; }
.price-card .amt small { font-size: 15px; color: var(--text-3); font-weight: 500; font-family: var(--font-ui); }
.price-card .pdesc { color: var(--text-2); font-size: 14px; min-height: 40px; }
.price-feats { display: flex; flex-direction: column; gap: 11px; margin: 22px 0; flex: 1; }
.price-feats li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; list-style: none; }
.price-feats .ck { color: var(--accent); flex: none; margin-top: 2px; }

/* ---------- final CTA ---------- */
.cta-band { background: var(--band); border-radius: var(--r-xl); padding: 64px 40px; text-align: center; position: relative; overflow: hidden; }
.cta-band h2 { color: #fff; font-size: clamp(32px, 4vw, 48px); letter-spacing: -.03em; line-height: 1.05; position: relative; }
.cta-band p { color: rgba(255,255,255,.62); font-size: 18px; margin-top: 16px; position: relative; }
.cta-band .glow { position: absolute; width: 520px; height: 360px; border-radius: 50%; background: radial-gradient(circle, color-mix(in oklab, var(--accent) 50%, transparent), transparent 68%); left: 50%; top: 30%; transform: translate(-50%,-50%); opacity: .55; filter: blur(6px); }

/* ---------- footer ---------- */
.lp-foot { border-top: 1px solid var(--line); padding: 54px 0 36px; margin-top: 80px; }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.foot-grid h5 { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 14px; }
.foot-grid a { display: block; font-size: 14px; color: var(--text-2); padding: 5px 0; cursor: pointer; }
.foot-grid a:hover { color: var(--accent); }
.foot-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-3); flex-wrap: wrap; gap: 12px; }

/* theme toggle btn in nav */
.theme-btn { width: 38px; height: 38px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; color: var(--text-2); cursor: pointer; transition: all .12s; }
.theme-btn:hover { color: var(--text); border-color: var(--line-strong); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s cubic-bezier(.2,.7,.2,1), transform .6s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 940px) {
  .lp-wrap { padding: 0 22px; }
  .hero-grid, .feat, .feat.rev .feat-copy { grid-template-columns: 1fr; order: 0; }
  .hero-demo { display: none; }
  .fgrid, .tpl-strip, .price-grid, .stats-band, .foot-grid { grid-template-columns: repeat(2, 1fr); }
  .lp-links { display: none; }
  .feat-visual { order: -1; }
  .hero { padding: 56px 0 40px; }
  .sec { padding: 60px 0; }
  .feat { gap: 36px; padding: 24px 0; }
  .sec-head { margin-bottom: 40px; }
}
@media (max-width: 560px) {
  .lp-wrap { padding: 0 18px; }
  .fgrid, .tpl-strip, .price-grid, .stats-band, .foot-grid { grid-template-columns: 1fr; }
  /* Nav can't fit four items on a phone — keep the logo + primary CTA, drop the
     theme toggle and the secondary "Sign in" link (both lead to /admin/ anyway). */
  .lp-nav-in { gap: 12px; height: 58px; }
  .lp-nav-cta { gap: 8px; }
  .theme-btn, .lp-nav-cta a.btn:not(.btn-primary) { display: none; }
  .lp-nav-cta .btn-primary { padding: 9px 14px; font-size: 13px; }
  .lp-logo b { font-size: 16px; }
  /* Tighter vertical rhythm + less side padding on the full-bleed dark bands. */
  .hero { padding: 40px 0 30px; }
  .hero h1 { font-size: clamp(31px, 8.6vw, 40px); }
  .hero p.sub { font-size: 16.5px; margin-top: 18px; }
  .hero-cta { margin-top: 24px; }
  .sec { padding: 48px 0; }
  .sec-head { margin-bottom: 30px; }
  .sec-head h2 { font-size: clamp(26px, 7vw, 34px); }
  .sec-head p { font-size: 16px; }
  .stats-band, .cta-band { padding: 34px 22px; }
  .stats-band { gap: 24px 22px; }
  .cta-band p { font-size: 16px; }
  .lp-foot { padding: 40px 0 28px; margin-top: 48px; }
  .foot-grid { gap: 26px 20px; }
  .price-card, .fcard { padding: 24px; }
}

/* page-level (from the bundle's landing.html inline <style>) */
html { scroll-behavior: smooth; }
html, body { height: auto; min-height: 100%; }
/* Clip on BOTH html and body: iOS Safari ignores body-only clipping and zooms
   the visual viewport out to fit any overflowing element, which makes the
   whole page render half-width on phones. */
html, body { overflow-x: clip; }

/* Overflow guards: grid/flex children default to min-width:auto, so one wide
   child (e.g. an unwrappable code line) can silently stretch the page beyond
   the viewport. Pin the layout containers down instead. */
.hero-grid > *, .feat > *, .fgrid > *, .tpl-strip > *, .price-grid > *, .stats-band > * { min-width: 0; }
.feat-visual, .feat-copy, .code-card { min-width: 0; max-width: 100%; }
img, svg, video { max-width: 100%; }
.logos-track .lg img { max-width: 150px; } /* keep the marquee logos' own cap */

/* ---------- legal pages (privacy / terms) ---------- */
.legal { max-width: 760px; margin: 0 auto; padding: 64px 0 48px; }
.legal h1 { font-size: 34px; letter-spacing: -.02em; }
.legal .legal-meta { color: var(--text-3); font-size: 14px; margin-top: 8px; }
.legal .legal-note { margin: 20px 0 36px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.legal h2 { font-size: 20px; margin-top: 38px; margin-bottom: 8px; letter-spacing: -.01em; }
.legal p { color: var(--text-2); line-height: 1.7; margin-top: 10px; }
.legal ul { margin: 10px 0 0; padding-left: 22px; }
.legal li { color: var(--text-2); line-height: 1.7; margin-top: 6px; }
.legal a { color: var(--accent); }
