/* AI Coder — landing page styles. Static rebuild of the design-system prototype.
 * Tokens: ../styles.css (terminal DS) + tokens/web.css (display/radius/elevation).
 * DS component styles live in ds-components.css (imported below). */

@import "./ds-components.css";

/* ── landing-scoped contrast overrides ────────────────────────────────
 * Judges flagged body copy near #8FA39E on the dark bg as too low-contrast
 * for marketing copy. Brighten muted/faint ONLY on this page (tokens stay
 * shared with the terminal DS). */
:root {
  --text-muted: #CBD5CF;
  --text-faint: #A3B2AB;
}

/* ── base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
/* the hidden attribute must win over component display rules (flex/grid) so JS show/hide works */
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
html { scroll-behavior: smooth; }
body { font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
img { display: block; }
a { color: inherit; }
section[id], a[id] { scroll-margin-top: 82px; }
::selection { background: var(--brand-900); }

/* keyboard focus — applies to every interactive element (WCAG 2.4.7) */
:focus-visible { outline: var(--focus-ring); outline-offset: var(--focus-offset); border-radius: 2px; }
:focus:not(:focus-visible) { outline: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.cur { animation: ai-cursor-blink var(--cursor-blink) steps(1, end) infinite; }

.section { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.center { text-align: center; }

/* ── nav ──────────────────────────────────────────────────────────────── */
.nav-frost {
  position: sticky; top: 0; z-index: 30;
  background: rgba(10, 15, 14, 0.55);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: inset 0 -1px 0 rgba(47, 216, 148, 0.07);
}
.nav-row { display: flex; align-items: center; height: 62px; gap: 26px; }
.nav-row .btn-primary { padding: 9px 18px; font-size: 13.5px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { height: 22px; }
.brand__word { font-family: var(--font-mono); font-size: 16px; font-weight: 700; color: var(--text); }
.brand__word span { color: var(--text-muted); font-weight: 500; }
.brand__word .brand__caret {
  color: var(--brand-400); font-weight: 700; margin-left: 1px;
  animation: ai-cursor-blink var(--cursor-blink) steps(1, end) infinite;
}
@media (prefers-reduced-motion: reduce) {
  .brand__word .brand__caret { animation: none; opacity: 1; }
}
.nav-links { display: flex; gap: 22px; font-family: var(--font-mono); font-size: 13px; }
.spacer { flex: 1; }
.navlink {
  border-radius: var(--radius-sm); padding: 6px 10px; color: var(--text-muted); text-decoration: none;
  transition: color var(--dur-fast), background var(--dur-fast);
}
.navlink:hover { color: var(--text); background: var(--surface-2); }
.nav-toggle { display: none; }

/* ── buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 13px; line-height: 1;
  border-radius: var(--radius-sm); padding: 9px 16px; text-decoration: none; cursor: pointer;
  border: none; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast);
}
.btn-lg { font-size: 14px; padding: 12px 22px; }
.btn-primary { background: var(--brand-400); color: var(--bg); }
.btn-primary:hover { background: var(--brand-300); }
.btn-primary:active { background: var(--brand-700); }
.btn-ghost { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-block { width: 100%; }

/* ── shared type ──────────────────────────────────────────────────────── */
.eyebrow {
  display: inline-block; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em;
  color: var(--brand-300); background: rgba(47, 216, 148, 0.08); border-radius: var(--radius-pill); padding: 6px 14px;
}
.kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--text-faint); margin-bottom: 4px; }
.h2 { font-family: var(--font-mono); font-size: var(--display-sm); font-weight: 700; line-height: 1.35; letter-spacing: 0.01em; color: var(--text); margin: 0; }
.sub { font-family: var(--font-sans); font-size: 16px; color: var(--text-muted); margin-top: 12px; }
.accent { color: var(--brand-400); }

/* ── install bar ──────────────────────────────────────────────────────── */
.install-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.install-note { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); }
.install-other { color: var(--brand-300); text-decoration: none; }
.install-other:hover { text-decoration: underline; }
.install-bar {
  display: inline-flex; align-items: stretch; gap: 10px; background: var(--surface); border-radius: var(--radius-lg); padding: 10px;
  box-shadow: inset 0 0 0 1.5px rgba(47, 216, 148, 0.4), 0 0 0 1px rgba(47, 216, 148, 0.12), 0 18px 50px -16px rgba(47, 216, 148, 0.30);
}
.install-btn {
  display: inline-flex; align-items: center; gap: 8px; flex: none; background: var(--brand-400); color: var(--bg);
  font-family: var(--font-mono); font-weight: 700; font-size: 16px; border-radius: var(--radius-sm); padding: 14px 32px; text-decoration: none; white-space: nowrap;
  transition: background var(--dur-fast), box-shadow var(--dur-fast); box-shadow: 0 6px 18px -6px rgba(47, 216, 148, 0.6);
}
.install-btn:hover { background: var(--brand-300); box-shadow: 0 8px 22px -6px rgba(47, 216, 148, 0.75); }
.install-cmd {
  position: relative; display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; cursor: pointer;
  font-family: var(--font-mono); font-size: 14px; padding: 0 52px 0 14px; overflow: hidden; white-space: nowrap; border-radius: var(--radius-sm);
  transition: background var(--dur-fast); background: transparent; border: none; text-align: left; color: var(--text);
}
.install-cmd__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.install-cmd:hover { background: var(--bg); }
.install-bar--windows { width: auto; max-width: none; }
.install-bar--windows .install-cmd { display: none; }
.tok-fn { color: var(--syntax-function); }
.tok-num { color: var(--syntax-number); }
.tok-type { color: var(--syntax-type); }
.tok-faint { color: var(--text-faint); }
.ib-copy {
  position: absolute; right: 12px; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-muted);
}
.ib-copy svg { width: 18px; height: 18px; }
.install-cmd:hover .ib-copy { color: var(--brand-400); }
.install-cmd.done .ib-copy { color: var(--brand-400); }

.trust { margin-top: 24px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; font-family: var(--font-mono); font-size: 12.5px; color: var(--text-muted); }
.trust-chip { white-space: nowrap; background: var(--surface); border-radius: var(--radius-pill); padding: 6px 13px; box-shadow: inset 0 0 0 1px var(--border); }
.trust .accent { font-weight: 700; }

/* ── hero mobile card (shown by JS on Android / iOS instead of the install bar) ── */
.install-wrap--mobile { flex-direction: column; align-items: center; }
.hero-mob-card { width: 100%; max-width: 420px; text-align: left; box-shadow: inset 0 0 0 1.5px var(--brand-700); }
.hero-mob-card .chip { box-shadow: inset 0 0 0 1.5px var(--brand-700); }

/* ── hero ─────────────────────────────────────────────────────────────── */
.hero { padding-top: 88px; padding-bottom: 24px; text-align: center; position: relative; }
.hero-inner { position: relative; z-index: 1; }
.hero h1 {
  font-family: var(--font-mono); font-size: var(--display-lg); line-height: 1.18; letter-spacing: -0.02em; font-weight: 700;
  color: var(--text); margin: 26px auto 22px; max-width: 20ch;
}
.hero p.lede { font-family: var(--font-sans); font-size: clamp(16px, 1vw + 10px, 17px); line-height: 1.75; color: rgba(255, 255, 255, 0.75); max-width: 52ch; margin: 0 auto 30px; }
.hero p.lede .accent { color: #4ade80; white-space: nowrap; }
.hero p.lede .strong { color: var(--text); }

.orb { position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none; z-index: 0; transition: transform .3s var(--ease-out); }
.orb-1 { width: 720px; height: 720px; top: -240px; left: 50%; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(47, 216, 148, 0.18), transparent 68%); }
.orb-2 { width: 520px; height: 520px; top: 360px; right: -160px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.08), transparent 70%); }

.hero-globe { position: absolute; top: -90px; left: 50%; transform: translateX(-50%); width: min(1040px, 140%); height: 860px; z-index: 0; pointer-events: none; }
.hero-baseglow { position: absolute; top: 300px; left: 50%; transform: translateX(-50%); width: min(720px, 110%); height: 360px; z-index: 0; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, rgba(47, 216, 148, 0.30), rgba(47, 216, 148, 0.10) 45%, transparent 72%); filter: blur(44px); }

.hero-window { max-width: 880px; margin: 60px auto 0; position: relative; text-align: left; will-change: transform; transition: transform .25s var(--ease-out); }
.hero-glow { position: absolute; inset: -8% -5% 0% -5%; border-radius: 28px;
  background: radial-gradient(60% 70% at 50% 0%, rgba(47, 216, 148, 0.28), transparent 70%); filter: blur(34px); z-index: 0; pointer-events: none; transition: transform .25s var(--ease-out); }
.hero-window > *:not(.hero-glow) { position: relative; z-index: 1; box-shadow: var(--elevation-3); }

.diff-cause { color: var(--text-muted); font-family: var(--font-mono); font-size: 13px; line-height: 1.6; }
.hero-window .mac-terminal { background: #141a17; }
.hero-window .mac-terminal, .hero-window .mac-terminal * { --text-muted: #D2DBD6; --text-faint: #AEBCB6; }

/* ── cards (shared hover) ─────────────────────────────────────────────── */
.card { transition: transform var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-standard); }
.card:hover { transform: translateY(-3px); background: var(--surface-2); }

/* ── workflow ─────────────────────────────────────────────────────────── */
.workflow-wrap { background: linear-gradient(180deg, rgba(18, 26, 24, 0.55), transparent); }
.workflow { padding-top: 72px; padding-bottom: 72px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.wf-card { background: var(--surface); border-radius: var(--radius-lg); padding: 28px; box-shadow: inset 0 0 0 1px var(--border); }
.wf-card--lead { background: var(--surface-2); }
.wf-card__n { font-family: var(--font-mono); font-size: 13px; color: var(--brand-400); margin-bottom: 16px; }
.wf-card__t { font-family: var(--font-mono); font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.wf-card__d { font-family: var(--font-sans); font-size: 15px; line-height: 1.7; color: #CBD5CF; }

/* ── downloads ────────────────────────────────────────────────────────── */
.downloads { padding-top: 72px; padding-bottom: 48px; }
/* asymmetric layout: detected platform = large feature card (left), other two = mini cards (right).
 * Differs structurally from Pricing's 3-equal-column cards, removing the repeated rhythm. */
/* left = large feature card; right = column of two compact mini cards. */
.dl-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: stretch; }
.plat-card {
  background: var(--surface); border-radius: var(--radius-lg); padding: 26px; display: flex; flex-direction: column; gap: 16px;
}
.plat-card.is-feature { box-shadow: inset 0 0 0 1.5px var(--brand-700); }
/* right column matches the feature card's height via space-between, while each mini card keeps its
 * natural (compact) height — no stretching, no sunk button, no dead space */
.dl-side { display: flex; flex-direction: column; gap: 18px; justify-content: space-between; }
.plat-card.is-mini { position: relative; padding: 20px; gap: 8px; }
.plat-card.is-mini .cmd,
.plat-card.is-mini .plat-note,
.plat-card.is-mini .cli-alt,
.plat-card.is-mini .plat-badge,
.plat-card.is-mini .plat-grow { display: none; }

/* download button: feature = full-width labelled button; mini = compact icon button, inline with the meta row */
.plat-dl { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.plat-dl .dl-ico { display: none; }
.plat-card.is-mini .plat-dl {
  position: absolute; right: 20px; bottom: 16px; width: auto; height: 38px; padding: 0 14px;
  box-shadow: inset 0 0 0 1px #22c55e; color: #22c55e; gap: 7px;
}
.plat-card.is-mini { display: flex; flex-direction: column; }
.plat-card.is-mini .plat-head { margin-bottom: 10px; }
.plat-card.is-mini .plat-meta { padding-right: 0; margin-bottom: 46px; }
.plat-card.is-mini .plat-dl { left: 20px; right: 20px; justify-content: center; }
.plat-card.is-mini .plat-dl .dl-label { display: inline; font-size: 12.5px; }
.plat-card.is-mini .plat-dl .dl-ico { display: block; }
.plat-head { display: flex; align-items: center; gap: 14px; }
.plat-headtext { flex: 1; min-width: 0; }
.chip {
  width: 44px; height: 44px; border-radius: var(--radius-window); flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border);
}
.plat-card.is-feature .chip { box-shadow: inset 0 0 0 1.5px var(--brand-700); }
.chip img { width: 22px; height: 22px; object-fit: contain; display: block; }
.plat-name-row { display: flex; align-items: center; gap: 8px; }
.plat-name { font-family: var(--font-mono); font-size: 18px; font-weight: 700; color: var(--text); }
.plat-badge { font-family: var(--font-mono); font-size: 11px; color: var(--bg); background: var(--brand-400); border-radius: var(--radius-pill); padding: 2px 8px; font-weight: 700; }
.plat-sub { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.plat-meta { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); }
.cli-alt { color: var(--text-faint); margin-top: 2px; }
.plat-grow { flex: 1; }
.plat-note { font-family: var(--font-sans); font-size: 14.5px; color: var(--text-muted); line-height: 1.65; }
.dl-foot { margin-top: 18px; font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); text-align: center; }

/* mobile download cards (Android / iOS) — always shown alongside the desktop platforms.
 * margin-top keeps the gap to the desktop block at 18px; the `+ .dl-layout` rule covers the
 * mobile-device case where JS moves this row above the desktop platforms (device leads). */
.dl-mobile { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.dl-mobile + .dl-layout { margin-top: 18px; }
.mob-card { background: var(--surface); border-radius: var(--radius-lg); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.mob-card.is-feature { box-shadow: inset 0 0 0 1.5px var(--brand-700); }
.mob-card.is-feature .chip { box-shadow: inset 0 0 0 1.5px var(--brand-700); }
.mob-card .btn { gap: 8px; }
.mob-card .btn[disabled] { opacity: 0.55; cursor: default; pointer-events: none; }
.plat-badge--soon { background: var(--surface-2); color: var(--text-muted); box-shadow: inset 0 0 0 1px var(--border); }

/* copy-command block (Cmd) */
.cmd { position: relative; cursor: pointer; background: var(--bg); border-radius: var(--radius-window); }
.cmd { overflow-x: auto; }
.cmd pre { margin: 0; padding: 11px 56px 11px 14px; font-family: var(--font-mono); font-size: 13px; color: var(--text); white-space: pre; line-height: 1.6; }
.cmd pre .dollar { color: var(--text-faint); }
.cmd__copy { position: absolute; top: 9px; right: 10px; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-muted); }
.cmd.done .cmd__copy { color: var(--brand-400); }

/* unified copy icon: clipboard by default, check on .done — shared by install bar + command blocks */
.ib-copy .ico-check, .cmd__copy .ico-check { display: none; }
.install-cmd.done .ib-copy .ico-copy, .cmd.done .cmd__copy .ico-copy { display: none; }
.install-cmd.done .ib-copy .ico-check, .cmd.done .cmd__copy .ico-check { display: inline; }

/* ── mobile hero cards: visible secondary buttons ── */
.hero-mob-card .btn-ghost,
.mob-card .btn-ghost { box-shadow: inset 0 0 0 1px #34d399; color: #34d399; }
.hero-mob-card .btn-ghost:hover,
.mob-card .btn-ghost:hover { background: rgba(52, 211, 153, 0.08); }

/* ── delivered: acceptance timeline + evidence receipts (merged section) ── */
.delivered-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 44px; align-items: start; }
.tl { display: flex; flex-direction: column; position: relative; }
.tl-step { display: flex; gap: 18px; position: relative; padding-bottom: 34px; }
.tl-step:last-child { padding-bottom: 0; }
.tl-step::before {
  content: ""; position: absolute; left: 21px; top: 46px; bottom: 2px; width: 2px;
  background: linear-gradient(180deg, var(--brand-700), rgba(14, 126, 84, 0.15));
}
.tl-step:last-child::before { display: none; }
.tl-marker {
  flex: none; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--brand-700);
}
.tl-n { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--brand-300); }
.tl-t { font-family: var(--font-mono); font-size: 17px; font-weight: 700; color: var(--text); margin: 8px 0 8px; }
.tl-d { font-family: var(--font-sans); font-size: 15px; line-height: 1.7; color: #CBD5CF; max-width: 46ch; }
.receipts {
  background: var(--surface); border-radius: var(--radius-lg); padding: 26px;
  box-shadow: inset 0 0 0 1px var(--border); display: flex; flex-direction: column; gap: 16px;
}
.receipts-kicker { font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: var(--brand-300); letter-spacing: 0.03em; margin-bottom: 8px; }
.receipts-sub { font-family: var(--font-sans); font-size: 14px; line-height: 1.65; color: var(--text-muted); margin: 0; }
.receipt { display: flex; gap: 12px; align-items: flex-start; font-family: var(--font-sans); font-size: 14.5px; line-height: 1.65; color: #CBD5CF; margin-bottom: 22px; }
.receipt:last-of-type { margin-bottom: 0; }
.receipt-d { color: var(--text-muted); font-size: 14px; line-height: 1.65; margin-top: 3px; }
.receipt-n {
  flex: none; font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--brand-300);
  width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(47, 216, 148, 0.10); transform: translateY(3px);
}
.receipt-t { color: var(--text); font-weight: 600; }
.receipts .btn-replay { margin-top: 6px; align-self: flex-start; }
@media (max-width: 900px) {
  .delivered-grid { grid-template-columns: 1fr; gap: 36px; }
}

.plan__price--custom { font-size: 28px; font-weight: 700; }

/* ── proof (evidence receipts) ────────────────────────────────────────── */
.proof-replay { margin-top: 34px; }
.btn-replay {
  min-height: 44px; padding: 12px 26px; font-size: 14px;
  box-shadow: inset 0 0 0 1.5px #34d399; color: var(--brand-300);
}
.btn-replay:hover { background: rgba(47, 216, 148, 0.08); }

/* ── pricing ──────────────────────────────────────────────────────────── */
.pricing { padding-top: 72px; padding-bottom: 76px; }
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
.plan { position: relative; background: var(--surface); border-radius: var(--radius-lg); padding: 30px; }
.plan--pop { background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--brand-700); }
.plan__tag { position: absolute; top: 18px; right: 18px; font-family: var(--font-mono); font-size: 11px; color: var(--bg); background: var(--brand-400); border-radius: var(--radius-pill); padding: 2px 9px; font-weight: 700; }
.plan__name { font-family: var(--font-mono); font-size: 15px; font-weight: 700; color: var(--text); }
.plan__price-row { display: flex; align-items: baseline; gap: 6px; margin: 14px 0 18px; }
.plan__price { font-family: var(--font-mono); font-size: var(--display-md); font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.plan__unit { font-family: var(--font-mono); font-size: 13px; color: var(--text-faint); }
.plan__cta { margin-bottom: 20px; }
.plan__feats { display: flex; flex-direction: column; gap: 10px; }
.feat { display: flex; align-items: baseline; gap: 8px; font-family: var(--font-sans); font-size: 15px; line-height: 1.5; color: var(--text-muted); }
.feat__tick { color: var(--brand-400); flex: none; }
.price-foot { margin-top: 18px; text-align: center; font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); }

/* ── closing ──────────────────────────────────────────────────────────── */
.closing-wrap { background: linear-gradient(180deg, transparent, rgba(18, 26, 24, 0.4)); }
.closing { padding-top: 68px; padding-bottom: 72px; text-align: center; }
.closing h2 { font-family: var(--font-mono); font-size: var(--display-md); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; color: var(--text); margin: 0 0 14px; }
.closing p { font-family: var(--font-sans); font-size: 16px; color: var(--text-muted); margin: 0 auto 28px; max-width: 44ch; }
.closing .btn { font-size: 17px; padding: 16px 36px; border-radius: var(--radius-md); }
.closing__foot { margin-top: 16px; font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); }

/* ── footer ───────────────────────────────────────────────────────────── */
.footer-row { display: flex; align-items: center; gap: 16px; min-height: 66px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); padding-top: 14px; padding-bottom: 14px; }
.footer-row img { height: 16px; }

/* ── back to top ──────────────────────────────────────────────────────── */
.backtotop {
  position: fixed; right: 24px; bottom: 24px; z-index: 40; width: 46px; height: 46px; border-radius: var(--radius-md);
  background: var(--surface-2); color: var(--text); display: flex; align-items: center; justify-content: center; cursor: pointer; border: none;
  box-shadow: inset 0 0 0 1.5px var(--border), var(--elevation-1);
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: opacity .25s var(--ease-out), transform .25s var(--ease-out), box-shadow var(--dur-fast);
}
.backtotop.show { opacity: 1; pointer-events: auto; transform: none; }
.backtotop:hover { color: var(--brand-400); box-shadow: inset 0 0 0 1.5px var(--brand-700), var(--elevation-1); }

/* ── scroll reveal ────────────────────────────────────────────────────── */
/* Decoration only, never a display gate: content is visible by default; JS
   arms ONLY below-fold elements (.reveal-armed) right before observing, so
   no-JS, slow-JS and reader modes always see the full page. */
html.js [data-reveal].reveal-armed {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .72s var(--ease-out), transform .72s var(--ease-out);
  will-change: opacity, transform;
}
html.js [data-reveal].reveal-armed.is-visible { opacity: 1; transform: none; will-change: auto; }
@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal].reveal-armed { opacity: 1; transform: none; transition: none; }
}

/* ── mobile: desktop downloads collapsed behind a toggle ─────────────── */
.dl-collapse-btn {
  display: block; width: 100%; margin-top: 18px; padding: 12px 16px;
  background: none; border: 1px solid var(--line, rgba(255,255,255,.14));
  border-radius: 10px; color: inherit; font: inherit; cursor: pointer;
  text-align: center;
}
.dl-collapse-btn[aria-expanded="true"]::after { content: " \25B4"; }
.dl-collapse-btn[aria-expanded="false"]::after { content: " \25BE"; }
.dl-layout.dl-desktop-collapsed { display: none; }

/* decorative wrapper that clips orbs/globe (must NOT be the sticky scroll ancestor) */
.clip { position: relative; overflow: hidden; }
.clip-inner { position: relative; z-index: 1; }
.page { background: var(--bg); min-height: 100vh; position: relative; }

/* ── responsive ───────────────────────────────────────────────────────── */
/* Mid range (tablets / small laptops / split-screen): 3-col grids are too tight,
 * so drop to 2 columns and shrink card padding + gaps before the full mobile stack. */
@media (max-width: 1024px) {
  .grid-3, .price-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .wf-card { padding: 24px; }
  .plan { padding: 22px; }
  .hero { padding-top: 72px; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; gap: 6px; position: absolute; top: 62px; left: 0; right: 0;
    background: rgba(10, 15, 14, 0.96); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    padding: 12px 24px; box-shadow: inset 0 -1px 0 rgba(47, 216, 148, 0.07); font-size: 15px;
  }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
    background: var(--surface); border: none; border-radius: var(--radius-sm); color: var(--text); cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--border);
  }
  .nav-row { gap: 12px; }
  .nav-row .btn-primary { display: none; }

  .hero { padding-top: 56px; }
  .hero h1 { margin-top: 20px; }            /* size handled by clamp() */
  .install-bar { flex-direction: column; }
  .install-note { white-space: normal; text-align: center; padding: 4px 0 0; }
  /* let the install command wrap so it's fully readable on narrow screens (no truncation) */
  .install-cmd { padding: 12px 52px 12px 14px; white-space: normal; word-break: break-all; line-height: 1.6; }
  .install-btn { justify-content: center; }
  .trust { font-size: 12px; }
  .trust-chip { padding: 5px 11px; }
  .hero-window { margin-top: 44px; }
  .hero-globe { height: 560px; top: -40px; }

  /* single column on phones — feature card and the mini column stack */
  .grid-3, .price-grid { grid-template-columns: 1fr; }
  .dl-layout { grid-template-columns: 1fr; }
  .dl-mobile { grid-template-columns: 1fr; }
  /* bump secondary info text so it stays legible on small screens */
  .plat-sub, .plat-meta, .plan__unit { font-size: 13px; }
}

@media (max-width: 480px) {
  .workflow, .downloads, .pricing { padding-top: 56px; padding-bottom: 56px; }
  .closing { padding-top: 52px; padding-bottom: 56px; }
}

@media (max-width: 420px) {
  /* only tighten the horizontal gutter — must NOT use the `padding` shorthand here, or it would
   * reset every section's padding-top/bottom to 0 and collapse all vertical spacing on small phones. */
  .section { padding-left: 16px; padding-right: 16px; }
}

/* ── reduced motion ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .hero-window, .hero-glow, .orb { transition: none !important; }
}

/* ── hero terminal replay animation ─────────────────────────────────── */
.mt-say { display: flex; gap: 8px; margin: 10px 0 2px; color: var(--mut, #9fb2ab); font-size: 12.5px; }
.mt-say__dot { color: var(--acc, #35e0a1); }
.diff__dur { margin-left: auto; padding-left: 12px; opacity: .55; font-size: 11px; }
.diff__line--sum { opacity: .9; }
[data-replay] [data-rp].rp-hidden { opacity: 0; transform: translateY(6px); }
[data-replay] [data-rp] { transition: opacity .45s ease, transform .45s ease; }
[data-replay].rp-playing .prompt__caret { animation: rp-blink 1s steps(1) infinite; }
@keyframes rp-blink { 50% { opacity: 0; } }
.hero-globe { transition: opacity .6s ease; }
@media (prefers-reduced-motion: reduce) {
  [data-replay] [data-rp].rp-hidden { opacity: 1 !important; transform: none !important; }
}

/* ── language dropdown (i18n, 8 locales) ─────────────────────────────── */
.lang-menu { position: relative; padding: 0; }
.lang-menu__btn {
  font: inherit; color: inherit; background: none; border: 0; cursor: pointer;
  padding: 8px 12px; border-radius: 8px;
}
.lang-menu__btn::after { content: " ▾"; font-size: 10px; opacity: 0.7; }
.lang-menu__btn:hover { color: var(--text); background: var(--surface-2); }
.lang-menu__list {
  /* Hover-gap fix (DRSC1879): the panel hangs directly off the trigger
     (top: 100%) and the 6px visual gap is carried by a transparent
     padding-top bridge, so the pointer never leaves the :hover area on the
     way down. The visible panel chrome moves to the inner ::before layer. */
  display: none; position: absolute; right: 0; top: 100%; z-index: 60;
  min-width: 168px; padding: 12px 6px 6px; border-radius: 12px;
  background: none; border: 0;
}
.lang-menu__list::before {
  content: ""; position: absolute; inset: 6px 0 0 0; z-index: -1;
  border-radius: 12px;
  background: var(--surface, #101614); border: 1px solid var(--border, #1f2a27);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
/* .open is the single persistent JS state (click/keyboard, DRSC1879 F1);
   :hover stays a pure pointer enhancement. No :focus-within display rule —
   it pinned the menu open after real clicks focused the button, so neither
   a second click nor Esc could visibly close it. Keyboard reachability is
   provided by JS focusin/focusout syncing .open. */
.lang-menu:hover .lang-menu__list,
.lang-menu.open .lang-menu__list { display: block; }
.lang-menu__list a {
  display: block; padding: 7px 10px; border-radius: 8px;
  color: var(--muted, #9db3ad); text-decoration: none; font-size: 13px;
}
.lang-menu__list a:hover { color: var(--text); background: var(--surface-2); }
@media (max-width: 860px) {
  .lang-menu__list { position: static; display: block; padding: 0; }
  .lang-menu__list::before { display: none; }
  .lang-menu__btn { display: none; }
  .lang-menu__list a { display: inline-block; }
}
:lang(ko) .hero h1 { word-break: keep-all; }
