/* stackd.sh — site styles. Tokens follow the product (reference/design-tokens.css). */

@font-face { font-family: 'Geist'; src: url('/fonts/geist-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('/fonts/geist-mono-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #07080a; --bg2: #0b0c0f; --panel: #0f1014; --panel2: #15161b;
  --line: rgba(255, 255, 255, 0.07); --line2: rgba(255, 255, 255, 0.13);
  --text: #ededf0; --muted: #a1a3ad; --faint: #80838e;
  --brand: #4f46e5; --brand-hi: #5b54ef; --brand-tx: #a5b4fc; --brand-soft: rgba(99, 102, 241, 0.14);
  --glow: rgba(99, 102, 241, 0.35); --dots: rgba(255, 255, 255, 0.06);
  --ok: #3ecf8e; --warn: #f5a524; --bad: #ff5a5f; --run: #818cf8;
  --s2: #2dd4bf; --s3: #f472b6; --s4: #fbbf24;
  --code: #0a0b0e; --log: #c9cbd3; --chip: rgba(21, 22, 27, 0.85);
  --shadow-lg: 0 50px 100px -30px rgba(0, 0, 0, 0.85), 0 30px 60px -40px rgba(79, 70, 229, 0.35);
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --radius: 14px;
  --wrap: 1180px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f6f8; --bg2: #fbfbfc; --panel: #fff; --panel2: #f4f4f7;
    --line: rgba(15, 16, 20, 0.08); --line2: rgba(15, 16, 20, 0.15);
    --text: #121317; --muted: #52555f; --faint: #666975;
    --brand-hi: #4338ca; --brand-tx: #4338ca; --brand-soft: rgba(79, 70, 229, 0.08);
    --glow: rgba(99, 102, 241, 0.22); --dots: rgba(15, 16, 20, 0.07);
    --ok: #15803d; --warn: #a16207; --bad: #d92d2f; --run: #4f46e5;
    --s2: #0d9488; --s3: #db2777; --s4: #b45309;
    --code: #fff; --log: #2a2c33; --chip: rgba(255, 255, 255, 0.9);
    --shadow-lg: 0 50px 100px -40px rgba(15, 16, 20, 0.35), 0 30px 60px -40px rgba(79, 70, 229, 0.3);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden; overflow-x: clip;
}
img, video { max-width: 100%; display: block; }
main { overflow-x: clip; }
a { color: inherit; text-decoration: none; }
code { font-family: var(--mono); font-size: 0.88em; }
p code, li code { background: var(--brand-soft); color: var(--brand-tx); padding: 0.1em 0.4em; border-radius: 6px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.025em; line-height: 1.1; font-weight: 600; }
::selection { background: rgba(99, 102, 241, 0.35); }
:focus-visible { outline: 2px solid var(--brand-tx); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(var(--wrap), 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
.muted { color: var(--faint); }
.eyebrow { margin: 0 0 14px; font: 500 12px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--brand-tx); }
.lead { font-size: clamp(17px, 1.6vw, 19px); color: var(--muted); max-width: 640px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent); flex: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 11px; font-weight: 500; font-size: 15px;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 9px; }
.btn-primary {
  background: var(--brand); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 8px 24px -8px rgba(79, 70, 229, 0.8);
}
.btn-primary:hover { background: var(--brand-hi); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 12px 32px -8px rgba(79, 70, 229, 0.95); }
.btn-ghost { border: 1px solid var(--line2); background: color-mix(in srgb, var(--panel) 60%, transparent); backdrop-filter: blur(8px); }
.btn-ghost:hover { border-color: color-mix(in srgb, var(--brand-tx) 50%, transparent); }
.btn-link { color: var(--brand-tx); padding: 0 8px; }
.more { display: inline-block; margin-top: 18px; color: var(--brand-tx); font-weight: 500; font-size: 15px; }
.more:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}
.nav.scrolled { background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px); border-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; letter-spacing: -0.02em; }
.brand img { border-radius: 7px; }
.brand em { font-style: normal; color: var(--faint); font-weight: 400; }
.nav-links { display: flex; gap: 6px; }
.nav-links a { padding: 8px 12px; border-radius: 8px; color: var(--muted); font-size: 15px; transition: color 0.2s, background 0.2s; }
.nav-links a:hover { color: var(--text); background: var(--line); }
.nav-cta { display: flex; align-items: center; gap: 8px; }
.menu { display: none; width: 40px; height: 40px; border: 1px solid var(--line2); background: transparent; border-radius: 10px; cursor: pointer; padding: 0; position: relative; }
.menu span { position: absolute; left: 11px; right: 11px; height: 1.5px; background: var(--text); transition: transform 0.25s; }
.menu span:first-child { top: 15px; } .menu span:last-child { top: 23px; }
.menu[aria-expanded='true'] span:first-child { transform: translateY(4px) rotate(45deg); }
.menu[aria-expanded='true'] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero { position: relative; padding: clamp(40px, 7vh, 80px) 0 0; isolation: isolate; overflow-x: clip; }
.hero-copy { position: relative; z-index: 2; }
.pill-short { display: none; }
.hero-bg {
  position: absolute; inset: -64px 0 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 50% at 50% 0%, var(--glow), transparent 70%),
    radial-gradient(40% 30% at 85% 60%, rgba(45, 212, 191, 0.08), transparent 70%),
    radial-gradient(40% 30% at 10% 70%, rgba(244, 114, 182, 0.06), transparent 70%);
}
.hero-bg::after {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(var(--dots) 1px, transparent 1px); background-size: 24px 24px;
  mask-image: radial-gradient(70% 60% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 30%, #000 30%, transparent 75%);
}
.hero-copy { text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero h1 { font-size: clamp(40px, 6.4vw, 78px); letter-spacing: -0.045em; line-height: 1.02; margin: 22px 0 22px; }
.grad {
  background: linear-gradient(100deg, var(--text) 10%, var(--brand-tx) 45%, #c4b5fd 60%, var(--s2) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 10px; border-radius: 999px;
  border: 1px solid var(--line2); background: color-mix(in srgb, var(--panel) 70%, transparent);
  font: 500 13px/1.4 var(--mono); color: var(--muted); transition: border-color 0.2s;
}
.pill:hover { border-color: var(--brand-tx); }
.pill .dot { width: 6px; height: 6px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.pill .arrow { color: var(--brand-tx); }
.cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 30px; }

.cmd {
  margin-top: 26px; display: flex; align-items: center; gap: 12px; max-width: 100%;
  padding: 10px 10px 10px 16px; border-radius: 12px; text-align: left;
  border: 1px solid var(--line2); background: color-mix(in srgb, var(--code) 85%, transparent);
  font-family: var(--mono); font-size: 13.5px; color: var(--muted);
}
.cmd code { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-size: inherit; }
.cmd b { color: var(--text); font-weight: 500; }
.cmd .prompt { color: var(--brand-tx); user-select: none; }
.copy {
  flex: none; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line2);
  background: var(--panel2); color: var(--muted); cursor: pointer; display: grid; place-items: center;
  transition: color 0.2s, border-color 0.2s;
}
.copy:hover { color: var(--text); border-color: var(--brand-tx); }
.copy svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.copy.done { color: var(--ok); border-color: var(--ok); }

/* ---------- device frames ---------- */
.frame {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--panel); border: 1px solid var(--line2); box-shadow: var(--shadow-lg);
}
.bar {
  display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  background: var(--panel2); border-bottom: 1px solid var(--line);
}
.bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line2); }
.bar span {
  margin: 0 auto; transform: translateX(-22px); font: 12px/1 var(--mono); color: var(--faint);
  padding: 5px 14px; border-radius: 6px; background: var(--line); max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.shot, .shot img { display: block; width: 100%; height: auto; }

/* floating chips that sit in front of a frame in 3D */
.chip {
  position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 12px; white-space: nowrap;
  font: 500 13px/1 var(--mono); color: var(--text);
  background: var(--chip); border: 1px solid var(--line2);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.5);
  transform: translateZ(80px);
  pointer-events: none;
}
.chip svg { width: 14px; height: 14px; fill: none; stroke: var(--ok); stroke-width: 2; }
.chip.c-run .dot { background: var(--run); box-shadow: 0 0 0 4px color-mix(in srgb, var(--run) 22%, transparent); animation: pulse 1.6s infinite; }
.chip.c-bad .dot { background: var(--bad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 22%, transparent); }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------- hero 3D stack ---------- */
/* --p: scroll progress 0..1 (set by JS). --mx/--my: pointer -1..1. */
.stage {
  --p: 0; --mx: 0; --my: 0;
  position: relative; perspective: 2600px; perspective-origin: 50% 0%;
  margin-top: clamp(56px, 8vh, 96px);
  height: clamp(420px, 60vw, 800px);
}
.stack {
  position: relative; width: min(1080px, 88vw); aspect-ratio: 1600 / 1034; margin: 0 auto;
  transform-style: preserve-3d;
  transform:
    translateY(calc(12% * (1 - var(--p)) - 6% * var(--p)))
    rotateX(calc((44deg - 6deg * var(--my)) * (1 - var(--p)) + 4deg * var(--p)))
    rotateZ(calc((-18deg + 3deg * var(--mx)) * (1 - var(--p))))
    rotateY(calc(4deg * var(--mx)));
  transition: transform 0.08s linear;
  will-change: transform;
}
.layer { position: absolute; inset: 0; transform-style: preserve-3d; transition: opacity 0.3s; }
.layer .frame { height: 100%; }
.layer.l1 { transform: translateZ(calc(170px * (1 - var(--p)) + 1px)); }
.layer.l2 { transform: translate3d(calc(7% * (1 - var(--p))), calc(-7% * (1 - var(--p))), 40px) translateZ(calc(-40px - 30px * var(--p))); opacity: calc(1 - var(--p) * 0.9); }
.layer.l3 { transform: translate3d(calc(14% * (1 - var(--p))), calc(-14% * (1 - var(--p))), 0) translateZ(calc(-140px - 60px * var(--p))); opacity: calc(1 - var(--p) * 0.95); }
.layer.l2 .frame, .layer.l3 .frame { filter: brightness(calc(0.8 + 0.2 * var(--p))); }
.stack::after { /* soft floor shadow */
  content: ''; position: absolute; inset: 8% -4% -10%; z-index: -1;
  background: radial-gradient(closest-side, rgba(79, 70, 229, 0.35), transparent);
  transform: translateZ(-260px); filter: blur(30px); opacity: calc(1 - var(--p));
}
.layer.l1 .c-ok { left: -4%; bottom: 18%; transform: translateZ(calc(90px * (1 - var(--p)) + 40px)); }
.layer.l1 .c-tls { right: -3%; top: 16%; transform: translateZ(calc(130px * (1 - var(--p)) + 40px)); }
.layer.l1 .chip { opacity: calc(1 - var(--p) * 1.4); }

/* ---------- facts ---------- */
.facts { border-block: 1px solid var(--line); background: color-mix(in srgb, var(--bg2) 60%, transparent); position: relative; z-index: 1; }
.facts-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.facts-grid div { padding: 28px 20px; display: flex; flex-direction: column; gap: 4px; border-left: 1px solid var(--line); }
.facts-grid div:first-child { border-left: 0; }
.facts strong { font: 600 clamp(22px, 2.4vw, 30px)/1.1 var(--mono); letter-spacing: -0.03em; }
.facts span { color: var(--faint); font-size: 14px; }

/* ---------- sections ---------- */
.section { padding: clamp(80px, 12vw, 150px) 0; position: relative; }
.head { max-width: 760px; margin-bottom: clamp(48px, 7vw, 88px); }
.head h2, .cli h2, .install h2 { font-size: clamp(32px, 4.6vw, 54px); letter-spacing: -0.035em; }
.head p:not(.eyebrow) { color: var(--muted); font-size: 18px; margin: 18px 0 0; }

/* 3D tilt cards: --rx/--ry set by JS on hover; base angle comes from layout */
.tilt {
  --base-y: -14deg; --base-x: 6deg; --rx: 0deg; --ry: 0deg; --settle: 0;
  position: relative; transform-style: preserve-3d;
  transform: perspective(1800px)
    rotateY(calc(var(--base-y) * (1 - var(--settle) * 0.55) + var(--ry)))
    rotateX(calc(var(--base-x) * (1 - var(--settle) * 0.55) + var(--rx)));
  transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.tilt.hovering { transition: transform 0.15s ease-out; }
.in .tilt, .tilt.in { --settle: 1; }

/* ---------- steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: clamp(80px, 10vw, 140px); }
.step, .feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.step:nth-child(even), .feature.flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.step:nth-child(even) .step-copy, .feature.flip .feature-copy { order: 2; }
.step:nth-child(even) .tilt, .feature.flip .tilt { --base-y: 14deg; }
.num { display: inline-block; font: 500 13px/1 var(--mono); color: var(--brand-tx); padding: 6px 10px; border-radius: 8px; background: var(--brand-soft); margin-bottom: 18px; }
.step h3, .feature h3 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 14px; }
.step p { color: var(--muted); font-size: 17px; margin: 0; }
.tilt .chip { right: -18px; bottom: 12%; }
.step:nth-child(even) .tilt .chip, .feature.flip .tilt .chip { right: auto; left: -18px; }

/* terminals */
.term { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line2); background: var(--code); box-shadow: var(--shadow-lg); }
.term-body { margin: 0; padding: 20px 22px 24px; font: 13px/1.75 var(--mono); color: var(--log); white-space: pre; overflow-x: auto; }
.term-body .p { color: var(--brand-tx); user-select: none; }
.term-body .m { color: var(--muted); }
.term-body .ok { color: var(--ok); }
.term-body .k { color: var(--s3); }
.term-body .s { color: var(--s2); }
.term-body .n { color: var(--s4); }
.term-body u { color: var(--brand-tx); text-decoration-color: color-mix(in srgb, var(--brand-tx) 40%, transparent); }
.term-body .ln { display: block; opacity: 0; transform: translateX(-6px); transition: opacity 0.35s, transform 0.35s; }
.term-body .ln.on { opacity: 1; transform: none; }
.cursor { display: inline-block; width: 8px; height: 1.1em; vertical-align: -0.2em; margin-left: 4px; background: var(--brand-tx); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- tour ---------- */
.tour .head { margin-inline: auto; text-align: center; }
.tour .head p:not(.eyebrow) { margin-inline: auto; max-width: 620px; }
.video-stage { --v: 0; perspective: 2200px; perspective-origin: 50% 100%; }
.video-frame {
  width: min(1200px, 92vw); margin: 0 auto; border-radius: 18px; overflow: hidden;
  border: 1px solid var(--line2); background: var(--panel); box-shadow: var(--shadow-lg);
  transform: rotateX(calc((1 - var(--v)) * 28deg)) scale(calc(0.86 + var(--v) * 0.14));
  transform-origin: 50% 100%;
  will-change: transform;
}
.video-frame video { width: 100%; aspect-ratio: 1440 / 900; background: var(--panel); object-fit: cover; }
.phones { display: none; }

/* ---------- features ---------- */
.feature { margin-bottom: clamp(90px, 11vw, 150px); }
.feature-copy ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.feature-copy li { position: relative; padding-left: 26px; color: var(--muted); font-size: 16.5px; }
.feature-copy li::before {
  content: ''; position: absolute; left: 0; top: 0.55em; width: 12px; height: 8px;
  border-left: 2px solid var(--brand-tx); border-bottom: 2px solid var(--brand-tx); transform: rotate(-45deg) scale(0.8);
}

.bento, .who { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  position: relative; padding: 28px; border-radius: 18px; border: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel2) 90%, transparent), var(--panel));
  transition: border-color 0.3s, transform 0.3s;
}
a.card:hover { border-color: color-mix(in srgb, var(--brand-tx) 45%, transparent); transform: translateY(-3px); }
.card svg { width: 40px; height: 40px; padding: 9px; border-radius: 10px; background: var(--brand-soft); fill: none; stroke: var(--brand-tx); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 20px; }
.card h3 { font-size: 19px; margin-bottom: 10px; letter-spacing: -0.015em; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- cli ---------- */
.cli { background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--bg2) 80%, transparent) 30%, transparent); }
.cli-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(40px, 6vw, 80px); align-items: center; }
.cli-copy p:not(.eyebrow) { color: var(--muted); font-size: 17px; margin: 20px 0 0; }
.cli-copy .cta { justify-content: flex-start; }
.cli-stage { position: relative; perspective: 1800px; padding: 130px 0 20px; transform-style: preserve-3d; }
.cli-stage .term { transform-style: preserve-3d; }
.cli-stage .back { position: absolute; top: 0; right: -4%; width: 62%; transform: rotateY(-18deg) rotateX(8deg) translateZ(-120px); opacity: 0.8; }
.cli-stage .front { position: relative; width: 94%; transform: rotateY(-12deg) rotateX(5deg) translateZ(0); transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.cli-stage.in .front { transform: rotateY(-6deg) rotateX(3deg); }

/* ---------- install ---------- */
.install-card {
  position: relative; overflow: hidden; text-align: center; padding: clamp(48px, 7vw, 88px) clamp(20px, 5vw, 64px);
  border-radius: 28px; border: 1px solid var(--line2);
  background: radial-gradient(80% 60% at 50% 0%, var(--brand-soft), transparent 70%), var(--panel);
  display: flex; flex-direction: column; align-items: center;
}
.install-glow { position: absolute; inset: -40% 20% auto; height: 60%; background: radial-gradient(closest-side, var(--glow), transparent); filter: blur(40px); pointer-events: none; }
.install-logo { border-radius: 16px; margin-bottom: 24px; box-shadow: 0 20px 50px -10px rgba(79, 70, 229, 0.7); position: relative; animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px) rotate(-3deg); } }
.install-card > p { color: var(--muted); font-size: 17px; margin: 16px 0 0; position: relative; }
.install-card .note { font-size: 14px; color: var(--faint); margin-top: 18px; }
.cmd.big { font-size: 14px; position: relative; align-items: flex-start; padding: 16px 12px 16px 20px; }
.cmd.big code { white-space: normal; line-height: 1.7; }
.cmd.big .prompt { line-height: 1.7; }
.reqs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; width: 100%; margin-top: 56px; border-radius: 16px; overflow: hidden; background: var(--line); border: 1px solid var(--line); text-align: left; position: relative; }
.reqs div { background: var(--panel); padding: 24px; }
.reqs h3 { font: 500 12px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand-tx); margin-bottom: 12px; }
.reqs p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 36px 0 calc(36px + env(safe-area-inset-bottom)); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer nav { display: flex; gap: 22px; flex-wrap: wrap; }
.footer nav a { color: var(--muted); font-size: 15px; }
.footer nav a:hover { color: var(--text); }
.footer p { margin: 0; font-size: 14px; }

/* ---------- reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1); }
.js .reveal.in { opacity: 1; transform: none; }
.js .hero .reveal { transition-delay: calc(var(--i, 0) * 80ms); }

/* =================== tablet =================== */
@media (max-width: 1023px) {
  .step, .feature, .step:nth-child(even), .feature.flip, .cli-grid { grid-template-columns: minmax(0, 1fr); }
  .step:nth-child(even) .step-copy, .feature.flip .feature-copy { order: 0; }
  .tilt { --base-y: -8deg; --base-x: 4deg; max-width: 760px; }
  .step:nth-child(even) .tilt, .feature.flip .tilt { --base-y: 8deg; }
  .facts-grid { grid-template-columns: repeat(2, 1fr); }
  .facts-grid div:nth-child(3) { border-left: 0; }
  .facts-grid div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .bento, .who { grid-template-columns: 1fr 1fr; }
  .bento .card:last-child, .who .card:last-child { grid-column: 1 / -1; }
}

/* =================== phones =================== */
/* Below 768px every <x-shot> serves the 390px mobile capture, so frames turn into phones. */
@media (max-width: 767px) {
  body { font-size: 15.5px; }
  .nav-links {
    position: fixed; inset: 64px 0 auto; flex-direction: column; gap: 0; padding: 8px 20px 20px;
    background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 14px 4px; font-size: 17px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .menu { display: block; }
  .nav.menu-open { background: var(--bg); }

  .hero h1 { font-size: clamp(38px, 11vw, 52px); }
  .hero h1 br { display: none; }
  .pill-long { display: none; }
  .pill-short { display: inline; }
  .cta { width: 100%; }
  .cta .btn { flex: 1 1 100%; }
  .cmd { width: 100%; font-size: 12.5px; }

  /* phone frame */
  .frame {
    border-radius: 42px; padding: 9px; border: 1px solid var(--line2);
    background: linear-gradient(145deg, #2a2b31, #0c0d10 40%, #1c1d22);
    box-shadow: inset 0 0 0 1.5px #3a3b42, var(--shadow-lg);
  }
  .frame .bar { display: none; }
  .frame .shot img { border-radius: 33px; }
  .frame { padding-top: 22px; padding-bottom: 14px; }
  .frame::before { /* speaker slit in the top bezel */
    content: ''; position: absolute; top: 9px; left: 50%; width: 22%; height: 5px; border-radius: 5px;
    background: #050507; box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08); transform: translateX(-50%); z-index: 1;
  }

  /* hero: three phones fanned out in 3D */
  .stage { height: auto; perspective: 1200px; perspective-origin: 50% 40%; margin-top: 44px; padding-bottom: 12px; }
  .stack {
    width: min(62vw, 270px); aspect-ratio: 600 / 1299;
    transform: translateY(calc(-3% * var(--p))) rotateX(calc(8deg * (1 - var(--p)))) rotateY(calc(10deg * var(--mx)));
  }
  .layer.l1 { transform: translateZ(40px); }
  .layer.l2 { transform: translate3d(calc(48% - 8% * var(--p)), 4%, -120px) rotateY(-24deg); opacity: 1; }
  .layer.l3 { transform: translate3d(calc(-48% + 8% * var(--p)), 4%, -120px) rotateY(24deg); opacity: 1; }
  .layer.l2 .frame, .layer.l3 .frame { filter: brightness(0.6); }
  .layer .frame { height: auto; }
  .stack::after { inset: auto -20% -6%; height: 20%; transform: none; }
  .layer.l1 .c-ok { left: -10%; bottom: 14%; transform: translateZ(60px); font-size: 11.5px; padding: 8px 11px; }
  .layer.l1 .c-tls { right: -8%; top: 22%; transform: translateZ(80px); font-size: 11.5px; padding: 8px 11px; }

  .facts-grid div { padding: 20px 4px 20px 16px; }

  .tilt { --base-y: -10deg; --base-x: 3deg; width: min(78vw, 320px); margin: 0 auto; }
  .step:nth-child(even) .tilt, .feature.flip .tilt { --base-y: 10deg; }
  .tilt .chip { right: -8%; font-size: 12px; }
  .step:nth-child(even) .tilt .chip, .feature.flip .tilt .chip { left: -8%; }
  .step .tilt:has(.term) { width: 100%; }
  .term-body { font-size: 11.5px; padding: 16px; }

  /* tour: swap the desktop video for a 3D carousel of phone screens */
  .video-stage { display: none; }
  .phones { display: block; }
  .phones-track {
    position: relative; display: flex; gap: 0; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    padding: 20px calc(50vw - 110px) 30px; overscroll-behavior-x: contain;
  }
  .phones-track::-webkit-scrollbar { display: none; }
  .phone {
    --r: 0deg; --s: 1; --o: 1;
    flex: 0 0 220px; margin: 0; scroll-snap-align: center;
    transform: perspective(900px) rotateY(var(--r)) scale(var(--s)); opacity: var(--o);
    transition: transform 0.1s linear;
  }
  .phone img {
    width: 100%; height: auto;
    border-radius: 34px; padding: 7px; background: linear-gradient(145deg, #2a2b31, #0c0d10 40%, #1c1d22);
    box-shadow: inset 0 0 0 1.5px #3a3b42, 0 30px 50px -20px rgba(0, 0, 0, 0.7);
  }
  .phone figcaption { text-align: center; margin-top: 14px; font: 500 13px/1 var(--mono); color: var(--faint); }

  .bento, .who, .reqs { grid-template-columns: 1fr; }
  .bento .card:last-child, .who .card:last-child { grid-column: auto; }
  .cli-stage { padding-top: 110px; }
  .cli-stage .front { width: 100%; }
  .cli-stage .back { right: 0; width: 80%; }
  .cli-stage .front, .cli-stage.in .front { transform: rotateY(-5deg) rotateX(3deg); }
  .install-card { border-radius: 22px; }
  .cmd.big { font-size: 12px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
