/* ============================================================
   HabitRacer — landing page
   Dark, dimensional. Depth comes from layered translucency,
   real perspective and light — not from illustration.

   Rule that governs this file: the page must be fully readable
   with CSS alone. Every entrance animation is gated behind
   html.js, so a failed script degrades to plain visible content.
   ============================================================ */

:root {
  /* Ground */
  --bg: #05070f;
  --bg-2: #080c18;
  --ink: #f2f5ff;
  --body: #97a2c0;
  --muted: #6b7699;

  /* Accents */
  --violet: #7c5cff;
  --cyan: #22d3ee;
  --mint: #2bd98b;

  /* Glass */
  --glass: rgba(255, 255, 255, .045);
  --glass-2: rgba(255, 255, 255, .07);
  --edge: rgba(255, 255, 255, .1);
  --edge-2: rgba(255, 255, 255, .18);

  --radius: 22px;
  --radius-lg: 30px;
  --shell: 1180px;

  --ease: cubic-bezier(.22, 1, .36, 1);
  --shadow: 0 30px 70px -20px rgba(0, 0, 0, .75);

  /* Driven by JS pointer parallax; harmless at 0. */
  --mx: 0;
  --my: 0;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.65 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
/* height:auto is not optional here. The <img> tags carry width/height
   attributes to reserve layout space, and those map to CSS width/height.
   Without this, max-width shrinks the width while the height stays at the
   attribute value, and any aspect-ratio rule is ignored because both
   dimensions are then explicitly set. */
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { margin: 0; letter-spacing: -.03em; line-height: 1.05; }

.shell { width: min(var(--shell), 100% - 44px); margin-inline: auto; }

.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;
}

.skip-link {
  position: absolute; z-index: 200; top: -60px; left: 16px;
  padding: 10px 16px; border-radius: 0 0 12px 12px;
  background: var(--violet); color: #fff; font-weight: 600;
  transition: top .2s;
}
.skip-link:focus { top: 0; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

/* ── Ambient depth ─────────────────────────────────────────── */

.atmosphere { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
  will-change: transform;
}
.aurora-1 {
  width: 60vw; height: 60vw; max-width: 780px; max-height: 780px;
  top: -18vh; left: -12vw;
  background: radial-gradient(circle, rgba(124, 92, 255, .75), transparent 68%);
  animation: drift-1 22s ease-in-out infinite alternate;
}
.aurora-2 {
  width: 52vw; height: 52vw; max-width: 660px; max-height: 660px;
  top: 8vh; right: -14vw;
  background: radial-gradient(circle, rgba(34, 211, 238, .5), transparent 68%);
  animation: drift-2 26s ease-in-out infinite alternate;
}
.aurora-3 {
  width: 46vw; height: 46vw; max-width: 580px; max-height: 580px;
  top: 120vh; left: 32vw;
  background: radial-gradient(circle, rgba(43, 217, 139, .34), transparent 70%);
  animation: drift-3 30s ease-in-out infinite alternate;
}
@keyframes drift-1 { to { transform: translate3d(8vw, 10vh, 0) scale(1.15); } }
@keyframes drift-2 { to { transform: translate3d(-10vw, 14vh, 0) scale(1.2); } }
@keyframes drift-3 { to { transform: translate3d(6vw, -12vh, 0) scale(1.1); } }

/* Grain keeps the big gradients from banding on cheap panels. */
.grain {
  position: absolute; inset: -50%;
  opacity: .16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

main, .nav, .footer { position: relative; z-index: 1; }

/* ── Nav ───────────────────────────────────────────────────── */

.nav {
  position: sticky; top: 0; z-index: 100;
  padding: 14px 0;
  transition: background .3s, backdrop-filter .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  background: rgba(5, 7, 15, .72);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom-color: var(--edge);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 700; font-size: 19px; letter-spacing: -.03em; }
.brand img { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 6px 18px rgba(124, 92, 255, .4); }
.brand em { font-style: normal; color: var(--cyan); }

.nav-links { display: flex; gap: 30px; font-size: 14.5px; color: var(--body); }
.nav-links a { position: relative; transition: color .2s; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  width: 100%; height: 1.5px; border-radius: 2px;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }

/* ── Buttons ───────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 24px; border: 1px solid transparent; border-radius: 999px;
  font: 600 14.5px/1 Inter, sans-serif; cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s, background .25s, border-color .25s;
}
.btn-sm { padding: 10px 19px; font-size: 13.5px; }

.btn-primary {
  background: linear-gradient(135deg, var(--violet), #5b8cff 55%, var(--cyan));
  color: #060915;
  font-weight: 700;
  box-shadow: 0 12px 34px -8px rgba(124, 92, 255, .75);
}
.btn-primary:hover { box-shadow: 0 18px 44px -8px rgba(124, 92, 255, .95); }

.btn-ghost {
  background: var(--glass); border-color: var(--edge); color: var(--ink);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.btn-ghost:hover { background: var(--glass-2); border-color: var(--edge-2); }
.btn b { font-weight: 500; }

/* ── Hero ──────────────────────────────────────────────────── */

.hero { padding: clamp(48px, 8vw, 92px) 0 0; }
.hero-grid {
  display: grid; grid-template-columns: 1.02fr .98fr; gap: clamp(30px, 5vw, 64px);
  align-items: center;
}

.pill {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 15px 7px 11px; margin-bottom: 26px;
  border: 1px solid var(--edge); border-radius: 999px;
  background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size: 13px; color: var(--body);
  transition: border-color .25s, background .25s;
}
.pill:hover { border-color: var(--edge-2); background: var(--glass-2); }
.pill b { color: var(--cyan); font-weight: 600; }
.dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--mint);
  box-shadow: 0 0 0 4px rgba(43, 217, 139, .18);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(43, 217, 139, 0); } }

h1 { font-size: clamp(42px, 6.4vw, 74px); font-weight: 700; }
.grad {
  background: linear-gradient(105deg, var(--violet) 5%, #6ea8ff 45%, var(--cyan) 78%, var(--mint));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-weight: 400;
  letter-spacing: -.01em;
}

.lede { max-width: 30em; margin: 24px 0 0; color: var(--body); font-size: clamp(15.5px, 1.5vw, 17.5px); }
.lede strong { color: var(--ink); font-weight: 600; }

.stores { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 32px; }
.store {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 11px 22px 11px 18px;
  border: 1px solid var(--edge); border-radius: 16px;
  background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform .25s var(--ease), border-color .25s, background .25s, box-shadow .25s;
}
.store svg { width: 25px; height: 25px; flex: none; }
.store span { display: grid; gap: 2px; text-align: left; }
.store small { font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.store strong { font-size: 16px; font-weight: 600; letter-spacing: -.02em; }

.store-live:hover {
  border-color: rgba(124, 92, 255, .6); background: var(--glass-2);
  box-shadow: 0 16px 40px -14px rgba(124, 92, 255, .8);
}
.store-soon { color: var(--muted); cursor: default; opacity: .72; }
.store-soon strong { color: var(--body); }
.store-soon svg { opacity: .8; }

.hero-facts {
  display: flex; flex-wrap: wrap; gap: 10px 24px;
  margin: 26px 0 0; padding: 0; list-style: none;
  font-size: 13px; color: var(--muted);
}
.hero-facts li { display: flex; align-items: center; gap: 8px; }
.hero-facts li::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
}

/* ── 3D device stage ───────────────────────────────────────── */

.stage { perspective: 1500px; perspective-origin: 50% 45%; }
.stage-inner {
  position: relative;
  height: clamp(430px, 62vw, 620px);
  transform-style: preserve-3d;
  transform: rotateX(calc(var(--my) * -5deg)) rotateY(calc(var(--mx) * 9deg));
  transition: transform .5s var(--ease);
}

.halo {
  position: absolute; inset: 12% 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 92, 255, .5), transparent 62%);
  filter: blur(52px);
  transform: translateZ(-140px);
}

/* Sized from HEIGHT, not width. The stage has a fixed height, so driving the
   phones off a width percentage let their derived height exceed it and spill
   over the nav and the section below. Height-first plus aspect-ratio means a
   phone can never be taller than the stage that contains it. */
.phone {
  position: absolute; margin: 0;
  aspect-ratio: 1080 / 2424;
  border-radius: 34px;
  border: 1px solid var(--edge-2);
  background: linear-gradient(150deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .03));
  padding: 7px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.phone img {
  width: 100%; height: 100%;
  border-radius: 27px;
  object-fit: cover; object-position: top;
}

.phone-front {
  z-index: 3; height: 94%; width: auto; left: 6%; top: 50%;
  transform: translateY(-50%) translateZ(60px) rotateY(9deg) rotateZ(-2.5deg);
}
.phone-back {
  z-index: 2; height: 78%; width: auto; right: 2%; top: 46%;
  transform: translateY(-50%) translateZ(-40px) rotateY(-11deg) rotateZ(3.5deg);
  opacity: .92;
}

.chip {
  position: absolute; z-index: 4;
  display: flex; align-items: center; gap: 9px;
  padding: 11px 16px;
  border: 1px solid var(--edge-2); border-radius: 15px;
  background: rgba(10, 14, 28, .82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .9);
  font-size: 12.5px; white-space: nowrap;
}
.chip span { color: var(--body); }
.chip-streak {
  left: -2%; top: 13%;
  transform: translateZ(110px);
  animation: float-a 7s ease-in-out infinite;
}
.chip-streak b {
  font-size: 20px; font-weight: 700;
  background: linear-gradient(135deg, #ffb347, #ff5f6d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.chip-done {
  right: 0; bottom: 12%;
  transform: translateZ(95px);
  animation: float-b 8.5s ease-in-out infinite;
}
.chip-done i {
  display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%;
  background: rgba(43, 217, 139, .18); color: var(--mint); font-style: normal; font-size: 11px;
}
@keyframes float-a { 50% { transform: translateZ(110px) translateY(-13px); } }
@keyframes float-b { 50% { transform: translateZ(95px) translateY(11px); } }

/* ── Marquee ───────────────────────────────────────────────── */

.marquee {
  margin-top: clamp(46px, 7vw, 80px);
  padding: 17px 0;
  border-block: 1px solid var(--edge);
  background: rgba(255, 255, 255, .015);
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex; align-items: center; gap: 30px; width: max-content;
  animation: slide 38s linear infinite;
  font-size: 14px; color: var(--body); white-space: nowrap;
}
.marquee-track i { color: var(--violet); font-style: normal; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ── Section furniture ─────────────────────────────────────── */

.section { padding: clamp(64px, 10vw, 128px) 0; }
.section-head { max-width: 660px; margin-bottom: clamp(34px, 5vw, 54px); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px; margin: 0 0 16px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.eyebrow i {
  width: 22px; height: 1.5px; border-radius: 2px;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
}
h2 { font-size: clamp(31px, 4.3vw, 50px); font-weight: 700; }
.sub { margin: 18px 0 0; color: var(--body); font-size: clamp(15px, 1.4vw, 17px); max-width: 34em; }

/* ── Bento ─────────────────────────────────────────────────── */

.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }

.card {
  position: relative; overflow: hidden;
  padding: 30px;
  border: 1px solid var(--edge); border-radius: var(--radius);
  background: linear-gradient(160deg, var(--glass), rgba(255, 255, 255, .012));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: transform .35s var(--ease), border-color .3s, background .3s;
}
.card:hover { transform: translateY(-5px); border-color: var(--edge-2); }
.card-wide { grid-column: span 2; }
.card h3 { font-size: 20px; margin-bottom: 11px; }
.card p { margin: 0; color: var(--body); font-size: 14.5px; }
.card p strong { color: var(--ink); font-weight: 600; }

/* Cursor-tracked specular highlight. --gx/--gy are set by JS; the
   fallback keeps a soft top-left sheen when no pointer is present. */
.glow::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border-radius: inherit; opacity: 0; transition: opacity .35s;
  background: radial-gradient(360px circle at var(--gx, 30%) var(--gy, 0%),
              rgba(124, 92, 255, .17), transparent 62%);
}
.glow:hover::before { opacity: 1; }

.ico {
  display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 17px;
  border: 1px solid var(--edge); border-radius: 13px;
  background: linear-gradient(150deg, rgba(124, 92, 255, .3), rgba(34, 211, 238, .12));
  color: var(--ink);
}
.ico svg { width: 20px; height: 20px; }

/* 60-day grid — decorative proof of the streak feature. */
.grid60 {
  display: grid; grid-template-columns: repeat(20, 1fr); gap: 5px; margin-top: 24px;
}
.grid60 span {
  aspect-ratio: 1; border-radius: 3px; background: rgba(255, 255, 255, .06);
}
.grid60 span.on { background: linear-gradient(140deg, var(--violet), var(--cyan)); }
.grid60 span.hot { background: linear-gradient(140deg, var(--cyan), var(--mint)); }

.card-secure { display: grid; grid-template-columns: 1.35fr .65fr; gap: 26px; align-items: center; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tags li {
  padding: 7px 13px; border: 1px solid var(--edge); border-radius: 999px;
  background: rgba(255, 255, 255, .03); font-size: 12.5px; color: var(--body);
}

/* ── Leo ───────────────────────────────────────────────────── */

.leo-grid { display: grid; grid-template-columns: 1fr .82fr; gap: clamp(30px, 5vw, 70px); align-items: center; }
.ticks { display: grid; gap: 12px; margin: 26px 0 30px; padding: 0; list-style: none; font-size: 14.5px; color: var(--body); }
.ticks li { display: flex; align-items: flex-start; gap: 11px; }
.ticks li::before {
  content: "✓"; flex: none;
  display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px;
  border-radius: 50%; background: rgba(43, 217, 139, .15); color: var(--mint); font-size: 11px;
}
.ticks strong { color: var(--ink); font-weight: 600; }

.leo-shot { perspective: 1300px; }
.phone-solo {
  position: relative; width: min(300px, 76%); margin-inline: auto;
  transform: rotateY(-12deg) rotateX(4deg) rotateZ(1.5deg);
  transition: transform .55s var(--ease);
}
.leo-shot:hover .phone-solo { transform: rotateY(-4deg) rotateX(1deg); }

/* ── Pricing ───────────────────────────────────────────────── */

.plans { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; max-width: 900px; }
.plan {
  position: relative; overflow: hidden;
  padding: 34px;
  border: 1px solid var(--edge); border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--glass), rgba(255, 255, 255, .012));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.plan h3 { font-size: 15px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.price { margin: 14px 0 24px; font-size: 38px; font-weight: 700; letter-spacing: -.04em; }
.price small { font-size: 14px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.plan .btn { width: 100%; }
.plan-pro { border-color: rgba(124, 92, 255, .45); background: linear-gradient(160deg, rgba(124, 92, 255, .14), rgba(34, 211, 238, .05)); }
.ribbon {
  position: absolute; top: 20px; right: -34px;
  padding: 5px 42px;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #060915; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  transform: rotate(38deg);
}
.fineprint { margin: 16px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--muted); }

/* ── CTA + signup ──────────────────────────────────────────── */

.cta {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(28px, 4vw, 56px); align-items: center;
  padding: clamp(32px, 5vw, 58px);
  border: 1px solid var(--edge-2); border-radius: var(--radius-lg);
  background: linear-gradient(150deg, rgba(124, 92, 255, .17), rgba(34, 211, 238, .06) 55%, rgba(255, 255, 255, .02));
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.cta h2 { font-size: clamp(29px, 3.6vw, 42px); }
.cta-copy > p { margin: 16px 0 0; color: var(--body); font-size: 15px; max-width: 30em; }

.signup {
  padding: 26px;
  border: 1px solid var(--edge); border-radius: var(--radius);
  background: rgba(5, 7, 15, .55);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.signup h3 { font-size: 18px; }
.signup > p { margin: 9px 0 18px; color: var(--muted); font-size: 13px; }
.field { display: flex; gap: 9px; }
.field input {
  flex: 1; min-width: 0;
  padding: 13px 16px;
  border: 1px solid var(--edge); border-radius: 999px;
  background: rgba(255, 255, 255, .05); color: var(--ink);
  font: 400 14.5px Inter, sans-serif;
  transition: border-color .25s, background .25s;
}
.field input::placeholder { color: var(--muted); }
.field input:focus { outline: none; border-color: var(--violet); background: rgba(255, 255, 255, .08); }
.field .btn { flex: none; }

.form-msg { min-height: 19px; margin: 11px 0 0; font-size: 12.5px; color: var(--muted); }
.form-msg.ok { color: var(--mint); }
.form-msg.err { color: #ff8095; }

/* ── FAQ ───────────────────────────────────────────────────── */

.faq-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(26px, 4vw, 60px); align-items: start; }
.faq-grid .section-head { margin-bottom: 0; }

.faq details {
  border-bottom: 1px solid var(--edge);
  transition: border-color .3s;
}
.faq details[open] { border-bottom-color: var(--edge-2); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 19px 0; cursor: pointer; list-style: none;
  font-size: 16px; font-weight: 600; letter-spacing: -.015em;
  transition: color .2s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none;
  display: grid; place-items: center; width: 26px; height: 26px;
  border: 1px solid var(--edge); border-radius: 50%;
  color: var(--body); font-weight: 400; font-size: 17px;
  transition: transform .3s var(--ease), background .25s, color .25s;
}
.faq summary:hover::after { background: var(--glass-2); color: var(--ink); }
.faq details[open] summary::after { transform: rotate(45deg); background: var(--violet); color: #060915; border-color: transparent; }
.faq details p { margin: 0 0 20px; padding-right: 42px; color: var(--body); font-size: 14.5px; }
.faq details a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }

/* ── Footer ────────────────────────────────────────────────── */

.footer { padding: 44px 0; border-top: 1px solid var(--edge); background: rgba(5, 7, 15, .6); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px; }
.footer-brand p { margin: 9px 0 0; font-size: 12.5px; color: var(--muted); letter-spacing: .05em; }
.footer-links { display: flex; flex-wrap: wrap; gap: 22px; font-size: 13.5px; color: var(--body); }
.footer-links a:hover { color: var(--cyan); }
.copy { margin: 0; font-size: 12.5px; color: var(--muted); }

/* ── Reveal on scroll — only when JS is running ────────────── */

.js .reveal { opacity: 0; transform: translateY(24px); }
.js .reveal.in {
  opacity: 1; transform: none;
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 1000px) {
  .hero-grid, .leo-grid, .cta, .faq-grid { grid-template-columns: 1fr; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .card-wide { grid-column: span 2; }
  .nav-links { display: none; }
  .stage { order: -1; }
  .stage-inner { height: clamp(390px, 78vw, 520px); }
  .leo-shot { max-width: 340px; margin-inline: auto; }
  .plans { max-width: none; }
}

@media (max-width: 640px) {
  .shell { width: min(var(--shell), 100% - 32px); }
  .bento, .plans { grid-template-columns: 1fr; }
  .card-wide { grid-column: span 1; }
  .card-secure { grid-template-columns: 1fr; gap: 20px; }
  .card { padding: 24px; }
  .stage-inner { height: 400px; }
  .phone-front { height: 92%; width: auto; left: 2%; }
  .phone-back { height: 74%; width: auto; right: 0; }
  .chip { font-size: 11.5px; padding: 9px 13px; }
  /* translateZ scales these up against the perspective origin, so a flush
     edge ends up clipped by body's overflow-x. Inset them instead. */
  .chip-streak { left: 2%; top: 8%; }
  .chip-done { right: 4%; bottom: 7%; }
  .field { flex-direction: column; }
  .field .btn { width: 100%; }
  .stores { gap: 10px; }
  .store { flex: 1 1 100%; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .grid60 { grid-template-columns: repeat(15, 1fr); }
}

/* ── Reduced motion: kill movement, keep every word ────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .aurora, .marquee-track, .chip-streak, .chip-done, .dot { animation: none !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .stage-inner, .phone-solo { transform: none !important; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
