/* ──────────────────────────────────────────────────────────────────────────
   Breath — Landing page
   Builds on styles.css tokens (dark-first, brand cyan/teal/blue).
   Motion follows Emil Kowalski: transform/opacity only, custom easing,
   scale-on-press, reduced-motion aware. Anti-slop: one locked accent, the
   orange/violet/cyan only appear where they map to real app metrics.
   ────────────────────────────────────────────────────────────────────────── */

.landing {
  /* functional app gradients — mirror the in-app spent/tar/nicotine trackers */
  --spent-grad:    linear-gradient(135deg, #F5A623 0%, #FF7A45 100%);
  --tar-grad:      linear-gradient(135deg, #B06CF7 0%, #7C3AED 100%);
  --nicotine-grad: linear-gradient(135deg, #2BD4E8 0%, #46B89C 100%);
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:   cubic-bezier(0.77, 0, 0.175, 1);
}

/* ── Animated blurry background blobs ────────────────────────────────────────
   Three giant radial gradients, heavy blur, fixed behind everything. Each
   has its own lerp coefficient in JS so they trail the cursor at different
   speeds (depth via parallax). transform/opacity only — GPU-friendly.    */
.lp-blobs {
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none; overflow: hidden;
}
.lp-blob {
  position: absolute;
  width: 62vmax; aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}
.lp-blob-1 {
  top: -22%; left: -18%;
  background: radial-gradient(circle at 50% 50%,
              rgba(45,127,242,0.55) 0%, rgba(45,127,242,0) 60%);
}
.lp-blob-2 {
  top: 6%; right: -22%;
  background: radial-gradient(circle at 50% 50%,
              rgba(70,184,156,0.42) 0%, rgba(70,184,156,0) 60%);
}
.lp-blob-3 {
  bottom: -28%; left: 28%;
  background: radial-gradient(circle at 50% 50%,
              rgba(43,212,232,0.36) 0%, rgba(43,212,232,0) 60%);
}
[data-theme="light"] .lp-blob { opacity: 0.45; }
[data-theme="light"] .lp-blob-1 { background: radial-gradient(circle at 50% 50%, rgba(45,127,242,0.34) 0%, rgba(45,127,242,0) 60%); }
[data-theme="light"] .lp-blob-2 { background: radial-gradient(circle at 50% 50%, rgba(70,184,156,0.26) 0%, rgba(70,184,156,0) 60%); }
[data-theme="light"] .lp-blob-3 { background: radial-gradient(circle at 50% 50%, rgba(56,164,190,0.22) 0%, rgba(56,164,190,0) 60%); }

/* The page already has subtle ambient radial gradients via body::before in
   styles.css. On the landing the dynamic blobs take over — turn the static
   ones off so they don't muddy the cleaner cursor-driven motion. */
body:has(> .lp-blobs)::before { display: none; }

/* ── Scroll-reveal (progressive enhancement) ─────────────────────────────── */
/* JS adds .is-in. Without JS, or before observe, content stays visible. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 620ms var(--ease-out), transform 620ms var(--ease-out);
  transition-delay: var(--rd, 0ms);
  will-change: transform, opacity;
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1 !important; transform: none !important; transition: none; }
}

/* ── Header additions ────────────────────────────────────────────────────── */
.nav-cta {
  display: inline-flex; align-items: center;
  padding: 9px 16px; border-radius: var(--radius-pill);
  font-size: 14.5px; font-weight: 600; color: #06121A;
  background: var(--brand-gradient);
  box-shadow: 0 6px 18px rgba(45,127,242,0.24);
  transition: transform 160ms var(--ease-out), box-shadow 220ms var(--ease-out);
}
.nav-cta:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 10px 24px rgba(45,127,242,0.32); }
.nav-cta:active { transform: scale(0.97); }
[data-theme="light"] .nav-cta { color: #FFFFFF; }

@media (max-width: 640px) { .hide-sm { display: none; } }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.lp-hero { padding-block: clamp(40px, 8vw, 88px) clamp(40px, 7vw, 72px); }
.lp-hero-inner {
  display: grid; grid-template-columns: 1fr; gap: clamp(36px, 6vw, 56px);
  align-items: center;
}
@media (min-width: 920px) {
  .lp-hero-inner { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
}

.lp-kicker {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted);
}
.lp-kicker::before {
  content: ""; width: 30px; height: 2px; border-radius: 2px; background: var(--brand-gradient);
}

.lp-hero h1 {
  margin-top: 20px;
  font-size: clamp(38px, 6.4vw, 68px);
  line-height: 1.03; font-weight: 720; letter-spacing: -0.04em;
}
.lp-hero h1 .grad {
  background: var(--brand-gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lp-lead {
  margin-top: 22px; max-width: 30ch;
  font-size: clamp(16px, 2.1vw, 19.5px); color: var(--text-muted); line-height: 1.6;
}

.lp-cta-row { margin-top: 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.lp-cta-row.center { justify-content: center; margin-top: 26px; }

/* Apple App Store button */
.btn-apple {
  display: inline-flex; align-items: center; gap: 11px;
  padding: 12px 22px 12px 18px; border-radius: 15px;
  background: #000; color: #fff; border: 1px solid rgba(255,255,255,0.12);
  transition: transform 150ms var(--ease-out), box-shadow 240ms var(--ease-out);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.btn-apple:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 16px 38px rgba(0,0,0,0.42); }
.btn-apple:active { transform: scale(0.97); }
.btn-apple .apple-glyph { width: 26px; height: 26px; flex: none; }
.btn-apple-text { display: grid; line-height: 1; text-align: left; }
.btn-apple-text small { font-size: 11px; font-weight: 500; opacity: 0.82; letter-spacing: 0.01em; }
.btn-apple-text strong { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; margin-top: 3px; }
[data-theme="light"] .btn-apple { border-color: rgba(0,0,0,0.9); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 14px;
  font-size: 15.5px; font-weight: 600; color: var(--text);
  border: 1px solid var(--border-strong); background: var(--bg-elev);
  transition: transform 150ms var(--ease-out), border-color 200ms var(--ease-out), background 200ms var(--ease-out);
}
.btn-ghost:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); background: var(--bg-elev-2); }
.btn-ghost:active { transform: scale(0.97); }
.btn-ghost svg { width: 17px; height: 17px; transition: transform 200ms var(--ease-out); }
@media (hover: hover) { .btn-ghost:hover svg { transform: translateX(3px); } }

/* ── Hero visual: the logo, animated with intent ─────────────────────────── */
.lp-hero-visual { display: grid; place-items: center; }
.hv-stage {
  position: relative;
  width: min(92%, 440px); aspect-ratio: 1 / 1;
  display: grid; place-items: center;
  isolation: isolate;
}

/* Soft halo behind the logo — same family as the legal page's drop-shadow
   (the cyan / teal "Breath" glow), but rendered as a blurred radial layer
   so it actually sits *behind* the logo rather than under it. */
.hv-stage::before {
  content: "";
  position: absolute; inset: 0; margin: auto;
  width: 62%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%,
              rgba(56,164,190,0.42) 0%,
              rgba(45,127,242,0.20) 42%,
              transparent 72%);
  filter: blur(22px);
  pointer-events: none;
}
[data-theme="light"] .hv-stage::before {
  background: radial-gradient(circle at 50% 50%,
              rgba(56,164,190,0.28) 0%,
              rgba(45,127,242,0.12) 42%,
              transparent 72%);
  filter: blur(20px);
}

/* Orbits — concentric thin rings, each with a single orbiting dot.
   Geometric, calm, motivated: a steady cadence under the logo. */
.hv-orbit {
  position: absolute; inset: 0; margin: auto;
  border-radius: 50%;
  border: 1px solid var(--c, rgba(70,184,156,0.32));
  width: var(--sz, 80%); height: var(--sz, 80%);
  animation: hv-spin var(--t, 30s) linear infinite;
  pointer-events: none;
  will-change: transform;
}
.hv-orbit::after {
  /* The orbiting dot sits on the top edge of the circle and travels with it. */
  content: ""; position: absolute;
  top: -4.5px; left: 50%;
  width: 9px; height: 9px; margin-left: -4.5px;
  border-radius: 50%;
  background: var(--dot, #46B89C);
  box-shadow: 0 0 14px var(--dot, #46B89C);
}
.hv-o1 { --sz: 100%; --t: 42s; --c: rgba(70,184,156,0.22); --dot: #46B89C; }
.hv-o2 { --sz: 78%;  --t: 26s; --c: rgba(45,127,242,0.28); --dot: #2D7FF2; animation-direction: reverse; }
.hv-o3 { --sz: 56%;  --t: 18s; --c: rgba(43,212,232,0.30); --dot: #38A4BE; }
@keyframes hv-spin { to { transform: rotate(360deg); } }

/* Spark particles — three soft dots drifting up, each on its own timing. */
.hv-spark {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  bottom: 28%; opacity: 0;
  background: radial-gradient(circle, rgba(70,184,156,0.9), rgba(70,184,156,0));
  animation: hv-drift 7s var(--ease-out) infinite;
  pointer-events: none;
}
.hv-spark.hv-s1 { left: 32%; animation-delay: -0.4s; }
.hv-spark.hv-s2 { left: 54%; animation-delay: -3.1s; width: 5px; height: 5px;
                   background: radial-gradient(circle, rgba(45,127,242,0.85), rgba(45,127,242,0)); }
.hv-spark.hv-s3 { left: 68%; animation-delay: -5.2s; width: 4px; height: 4px;
                   background: radial-gradient(circle, rgba(56,164,190,0.9), rgba(56,164,190,0)); }
@keyframes hv-drift {
  0%   { opacity: 0;    transform: translateY(0) scale(0.6); }
  15%  { opacity: 0.85; }
  100% { opacity: 0;    transform: translateY(-150px) scale(1.4); }
}

/* Float wrapper — owns the slow vertical lift loop. Independent from
   tilt/magnetic so the two transforms never fight each other. */
.hv-logo-float {
  position: relative; z-index: 1;
  width: 52%; aspect-ratio: 1 / 1;
  display: grid; place-items: center;
  animation: hv-float 6.5s ease-in-out infinite;
  will-change: transform;
}
@keyframes hv-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* The logo itself — entry, tilt, magnetic-follow, and a slow brand-color
   hue cycle on the drop shadow. Transform is the *single* knob, driven by
   four CSS vars JS writes per element (Emil: never propagate via parent). */
.hv-logo {
  width: 100%; aspect-ratio: 1 / 1;
  display: grid; place-items: center;
  transform:
    perspective(1000px)
    rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg))
    translate3d(var(--mx, 0px), var(--my, 0px), 0)
    scale(var(--s, 1));
  transition: transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
.hv-logo img {
  width: 100%; height: auto;
  -webkit-user-select: none; user-select: none;
  animation: hv-glow 12s ease-in-out infinite;
}

/* Drop-shadow cycles through the brand palette — same family, different
   tint per beat, so the logo always reads as Breath but never looks frozen. */
@keyframes hv-glow {
  0%   { filter: drop-shadow(0 22px 38px rgba(70,184,156,0.34)); }
  33%  { filter: drop-shadow(0 22px 38px rgba(56,164,190,0.40)); }
  66%  { filter: drop-shadow(0 22px 38px rgba(45,127,242,0.36)); }
  100% { filter: drop-shadow(0 22px 38px rgba(70,184,156,0.34)); }
}

/* The parent .lp-hero-visual handles the entry fade (data-reveal). The
   logo itself starts from --s: 0.92 and JS bumps it to 1 on reveal — that
   keeps the transform composition intact (Emil: don't fight your own rules). */

/* ── Numbers band ────────────────────────────────────────────────────────── */
.lp-stats { padding-block: clamp(30px, 6vw, 56px); }
.lp-stats-title {
  text-align: center; font-size: clamp(20px, 3vw, 26px); font-weight: 660;
  letter-spacing: -0.02em; color: var(--text-muted);
}
.lp-stats-grid {
  margin-top: 34px; display: grid; gap: 24px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 680px) { .lp-stats-grid { grid-template-columns: 1fr; gap: 10px; } }
.lp-stat {
  text-align: center; padding: 14px 10px;
  border-left: 1px solid var(--border);
}
.lp-stat:first-child { border-left: 0; }
@media (max-width: 680px) {
  .lp-stat { border-left: 0; border-top: 1px solid var(--border); display: flex; align-items: baseline; justify-content: center; gap: 10px; }
  .lp-stat:first-child { border-top: 0; }
}
.lp-stat-num {
  display: block; font-size: clamp(38px, 6.5vw, 62px); font-weight: 740;
  letter-spacing: -0.03em; line-height: 1;
  font-variant-numeric: tabular-nums;
  background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lp-stat-label { display: block; margin-top: 12px; font-size: 15px; color: var(--text-muted); }
@media (max-width: 680px) { .lp-stat-label { margin-top: 0; } }
.lp-stats-foot { margin-top: 26px; text-align: center; font-size: 13.5px; color: var(--text-hint); }

/* ── Generic section heads ───────────────────────────────────────────────── */
.lp-section { padding-block: clamp(48px, 9vw, 96px); }
.lp-head { max-width: 720px; margin-bottom: clamp(30px, 5vw, 48px); }
.lp-eyebrow {
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.lp-head h2 {
  font-size: clamp(27px, 4.4vw, 44px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.08;
}

/* ── Bento ───────────────────────────────────────────────────────────────── */
.bento {
  display: grid; gap: 16px;
  grid-template-columns: repeat(6, 1fr);
}
.bento-cell {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 26px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-elev);
  box-shadow: var(--shadow);
  transition: transform 240ms var(--ease-out), border-color 240ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .bento-cell:hover { transform: translateY(-3px); border-color: var(--border-strong); }
}
.bento-cell h3 { font-size: 19px; font-weight: 660; letter-spacing: -0.02em; }
.bento-cell p { margin-top: 9px; color: var(--text-muted); font-size: 14.5px; line-height: 1.55; }

.bento-a { grid-column: span 3; grid-row: span 2; display: flex; flex-direction: column; justify-content: space-between; gap: 24px;
  background:
    radial-gradient(420px 320px at 80% 0%, rgba(45,127,242,0.16), transparent 64%),
    var(--bg-elev);
}
.bento-b { grid-column: span 3; }
.bento-c { grid-column: span 3; }
.bento-d { grid-column: span 3; }
.bento-e { grid-column: span 3; }

@media (max-width: 860px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .bento-a { grid-column: 1 / -1; grid-row: auto; }
  .bento-b, .bento-c, .bento-d, .bento-e { grid-column: span 1; }
}
@media (max-width: 560px) {
  .bento { grid-template-columns: 1fr; }
  .bento-b, .bento-c, .bento-d, .bento-e { grid-column: 1 / -1; }
}

.bento-icon {
  display: inline-grid; place-items: center; width: 48px; height: 48px;
  border-radius: 14px; margin-bottom: 16px;
  background: var(--bg-elev-2); border: 1px solid var(--border); color: var(--accent);
}
.bento-icon.cyan { color: var(--accent-cyan); }
.bento-icon svg { width: 24px; height: 24px; }

/* bento-a mock: an honest mini readout, not a fake full screenshot */
.bento-mock {
  position: relative; align-self: stretch;
  border-radius: 18px; padding: 22px 24px;
  background: linear-gradient(160deg, rgba(45,127,242,0.14), rgba(70,184,156,0.06));
  border: 1px solid var(--border);
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 16px;
}
.mock-label { grid-column: 1; font-size: 13px; color: var(--text-muted); }
.mock-count {
  grid-column: 1; grid-row: 2; font-size: 54px; font-weight: 760; letter-spacing: -0.04em;
  line-height: 1; font-variant-numeric: tabular-nums; color: var(--text);
}
.mock-sub { grid-column: 1; grid-row: 3; margin-top: 6px; font-size: 13px; color: var(--text-hint); }
.mock-ring {
  grid-column: 2; grid-row: 1 / 4; width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(from 220deg, var(--accent-cyan) 0%, #46B89C 64%, var(--border) 64%);
  -webkit-mask: radial-gradient(circle, transparent 56%, #000 57%);
  mask: radial-gradient(circle, transparent 56%, #000 57%);
}

/* tracker chips reflect real app spent/tar/nicotine gradients */
.tracker-chips { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  padding: 7px 14px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 600; color: #08121A;
}
.chip.spent { background: var(--spent-grad); }
.chip.tar   { background: var(--tar-grad); color: #fff; }
.chip.nic   { background: var(--nicotine-grad); }

/* ── How it works steps ──────────────────────────────────────────────────── */
.steps {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 22px; grid-template-columns: repeat(3, 1fr);
  counter-reset: step;
}
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; gap: 14px; } }
.step {
  position: relative; padding: 28px 24px;
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-elev);
}
/* connecting line between steps on desktop */
@media (min-width: 761px) {
  .step::after {
    content: ""; position: absolute; top: 52px; right: -22px; width: 22px; height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
  }
  .step:last-child::after { display: none; }
}
.step-icon {
  display: inline-grid; place-items: center; width: 50px; height: 50px; border-radius: 15px;
  background: linear-gradient(160deg, rgba(45,127,242,0.18), rgba(70,184,156,0.08));
  border: 1px solid var(--border); color: var(--accent); margin-bottom: 18px;
}
.step-icon svg { width: 24px; height: 24px; }
.step h3 { font-size: 20px; font-weight: 660; letter-spacing: -0.02em; }
.step p { margin-top: 10px; color: var(--text-muted); font-size: 15px; line-height: 1.55; }

/* ── Closing CTA ─────────────────────────────────────────────────────────── */
.lp-final { padding-block: clamp(56px, 10vw, 120px); }
.lp-final-inner {
  position: relative; overflow: hidden;
  padding: clamp(40px, 7vw, 80px) clamp(24px, 5vw, 48px);
  border-radius: 30px; text-align: center;
  border: 1px solid var(--border);
  background:
    radial-gradient(680px 360px at 50% -10%, rgba(45,127,242,0.20), transparent 62%),
    radial-gradient(520px 320px at 50% 120%, rgba(70,184,156,0.14), transparent 60%),
    var(--bg-elev);
}
.lp-final-inner h2 {
  font-size: clamp(28px, 5vw, 52px); font-weight: 720; letter-spacing: -0.035em; line-height: 1.06;
}
.lp-final-note { margin-top: 20px; font-size: 14px; color: var(--text-hint); }

/* ── Magnetic Apple button (desktop only, JS-driven) ─────────────────────── */
.btn-apple {
  transform: translate3d(var(--mx, 0px), var(--my, 0px), 0);
}

/* ── Bento spotlight (cursor-tracking, hover devices only) ───────────────── */
.bento-cell { --bx: 50%; --by: -20%; }
.bento-cell::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(380px circle at var(--bx) var(--by),
              color-mix(in srgb, var(--accent) 16%, transparent), transparent 62%);
  opacity: 0; transition: opacity 320ms var(--ease-out);
}
.bento-cell > * { position: relative; z-index: 1; }
@media (hover: hover) and (pointer: fine) {
  .bento-cell:hover::before { opacity: 1; }
}

/* ── Mobile: simpler, lighter, still beautiful ──────────────────────────── */
@media (max-width: 760px) {
  .lp-hero { padding-block: 32px 24px; }
  .lp-hero-inner { gap: 28px; }
  .lp-hero h1 { margin-top: 14px; }
  .lp-lead { max-width: none; }

  /* Hide the big logo on the landing on mobile — the headline alone carries
     the fold. (The /download page keeps its big logo: it has no
     .lp-hero-visual wrapper, so this rule doesn't touch it.) */
  .lp-hero-visual { display: none; }

  /* Animated background blobs are mouse-driven — pointless on touch, and
     blur(80px) is GPU-expensive on phones. Drop them, restore the static
     body::before ambient gradients that were disabled on desktop. */
  .lp-blobs { display: none; }
  body:has(> .lp-blobs)::before { display: block; }

  /* CTAs comfortable for touch */
  .lp-cta-row { gap: 10px; }
  .btn-apple, .btn-ghost { width: 100%; justify-content: center; }
  .btn-apple { padding: 14px 18px; }

  /* Stats: stacked rows look cleaner than 1-col card grid */
  .lp-stats { padding-block: 24px 32px; }
  .lp-stats-grid { gap: 4px; }
  .lp-stat { padding: 14px 8px; }
  .lp-stat-num { font-size: 36px; }

  /* Sections tighter, but still breathing */
  .lp-section { padding-block: 56px; }
  .lp-final-inner { padding: 36px 22px; border-radius: 22px; }

  /* Bento spotlight off on touch (no hover) */
  .bento-cell::before { display: none; }
}

/* ── Reduced motion: stop ambient loops, keep things still and legible ──── */
@media (prefers-reduced-motion: reduce) {
  .hv-orbit, .hv-logo-float, .hv-logo img, .hv-spark { animation: none; }
  .hv-logo { transition: none; transform: none !important; }
  .hv-spark { display: none; }
  .btn-apple { transform: none !important; }
  .lp-blob { transform: none !important; transition: none; }
}
