/* ============================================================
   Brain Alarm — landing page styles
   Ported from the "Brain Alarm v2" React prototype to static
   HTML/CSS. Values mirror the prototype's inline styles exactly.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans, system-ui);
  background: var(--surface);
  color: var(--on-surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; }
a:hover { color: var(--primary); }
img { max-width: 100%; }
h1, h2, h3 { text-wrap: balance; }
::selection { background: var(--primary-container); color: var(--on-primary-container); }

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  user-select: none;
  line-height: 1;
  flex-shrink: 0;
}

/* Visually-hidden (skip link / a11y) */
.visually-hidden {
  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; left: 12px; top: -60px; z-index: 100;
  background: var(--primary); color: var(--on-primary);
  padding: 10px 16px; border-radius: var(--shape-small);
  font-size: 14px; font-weight: 600; text-decoration: none;
  transition: top .18s;
}
.skip-link:focus { top: 12px; color: var(--on-primary); }

/* ── Layout ─────────────────────────────────────────────── */
.section--alt { background: var(--surface-container-low); }
.wrap { max-width: 1180px; margin: 0 auto; padding: clamp(56px, 8vw, 104px) 24px; }

/* ── Brand mark ─────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { display: block; }
.brand-name { font-weight: 700; color: var(--on-surface); letter-spacing: -0.02em; white-space: nowrap; }

/* ── Google Play badge ──────────────────────────────────── */
.play-badge { display: inline-block; line-height: 0; border-radius: 10px; text-decoration: none; }
.play-badge svg { display: block; height: 56px; width: auto; }
.play-badge--sm svg { height: 44px; }
.ba-play { transition: transform .15s, box-shadow .15s; }
.ba-play:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(16,20,24,.28); }
.ba-play:active { transform: translateY(0); }

/* ── Ghost button ───────────────────────────────────────── */
.ghost-btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  color: var(--on-surface); font-size: 15px; font-weight: 600;
  border: 1.5px solid var(--outline-variant); border-radius: var(--shape-full);
  padding: 12px 22px; background: transparent;
}
.ghost-btn:hover { color: var(--on-surface); border-color: var(--outline); }

/* ── Eyebrow + section head ─────────────────────────────── */
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--primary); text-transform: uppercase;
}
.eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 999px; background: var(--primary); }
.section-head { max-width: 660px; }
.section-head.center { margin: 0 auto; text-align: center; }
.section-head h2 {
  margin: 14px 0 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.08;
  font-weight: 700; letter-spacing: -0.025em; color: var(--on-surface);
}
.section-head p {
  margin: 14px 0 0; font-size: 17px; line-height: 1.5;
  color: var(--on-surface-variant); text-wrap: pretty;
}

/* ── Nav ────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--outline-variant);
  transition: box-shadow .2s;
}
.nav.scrolled { box-shadow: var(--elevation-2); }
.nav-in {
  max-width: 1180px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.nav-links { display: flex; gap: 26px; }
.nav-link { font-size: 14.5px; font-weight: 500; color: var(--on-surface-variant); text-decoration: none; }
.ba-navlink { position: relative; transition: color .15s; }
.ba-navlink:hover { color: var(--on-surface) !important; }
.ba-navlink::after {
  content: ''; position: absolute; left: 0; right: 100%; bottom: -3px;
  height: 2px; border-radius: 2px; background: var(--primary);
  transition: right .22s cubic-bezier(.2,0,0,1);
}
.ba-navlink:hover::after { right: 0; }
@media (max-width: 760px) { .nav-links { display: none; } }

/* ── Phone frame ────────────────────────────────────────── */
.phone {
  width: var(--w); flex-shrink: 0; background: #07090c;
  border-radius: calc(var(--w) * 0.13);
  padding: max(6px, calc(var(--w) * 0.028));
  box-shadow: 0 1px 2px rgba(0,0,0,.3), 0 30px 60px -20px rgba(20,30,50,.45), 0 0 0 1px rgba(0,0,0,.5);
}
.phone img {
  display: block; width: 100%; background: #101418;
  border-radius: calc(var(--w) * 0.13 - max(6px, calc(var(--w) * 0.028)) * 0.5);
}

/* ── Hero ───────────────────────────────────────────────── */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.hero-copy { flex: 1 1 360px; }
.hero-copy-inner { max-width: 560px; }
.hero h1 {
  margin: 18px 0 0; font-size: clamp(38px, 5.4vw, 64px); line-height: 1.03;
  font-weight: 700; letter-spacing: -0.035em; color: var(--on-surface);
}
.hero-sub { margin: 20px 0 0; font-size: 18px; line-height: 1.5; color: var(--on-surface-variant); text-wrap: pretty; }
.hero-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; align-items: center; }
.hero-phones { flex: 0 1 auto; display: flex; justify-content: center; gap: 20px; align-items: flex-start; margin: 0 auto; }
.hero-phone-alarms { transform: rotate(-4deg); margin-top: 52px; }

.fact-badges { display: flex; gap: 18px; margin-top: 22px; flex-wrap: wrap; }
.fact-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--on-surface-variant); font-weight: 500; }
.fact-badge .material-symbols-outlined { color: var(--primary); }

/* ── Cycling phone ──────────────────────────────────────── */
.cycling { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.cycling-stack { position: relative; width: var(--w); }
.cphone { opacity: 0; transition: opacity .6s cubic-bezier(.2,0,0,1); }
.cphone:first-child { position: relative; }
.cphone:not(:first-child) { position: absolute; inset: 0; }
.cphone.is-active { opacity: 1; }
.cycling-cap { display: inline-flex; align-items: center; gap: 10px; }
.cycling-name { font-size: 13px; font-weight: 600; color: var(--on-surface-variant); min-width: 78px; text-align: right; }
.cycling-dots { display: inline-flex; gap: 5px; }
.cycling-dot { width: 7px; height: 7px; border-radius: 999px; border: none; padding: 0; cursor: pointer; background: var(--surface-container-highest); transition: background .3s; }
.cycling-dot.is-active { background: var(--primary); }
.cycling-cap .spacer { min-width: 78px; }

/* ── How it works — timeline ────────────────────────────── */
.timeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-top: 48px; }
.timeline-card {
  background: var(--surface-container-low); border-radius: var(--shape-large); padding: 24px;
  border: 1px solid var(--outline-variant); display: flex; flex-direction: column;
  align-items: center; gap: 20px; height: 100%;
}
.timeline-duo { position: relative; width: 232px; max-width: 100%; height: 355px; flex-shrink: 0; }
.timeline-duo .phone { position: absolute; }
.timeline-duo .duo-a { left: 0; top: 16px; transform: rotate(-5deg); }
.timeline-duo .duo-b { right: 0; top: 0; transform: rotate(4deg); }
.timeline-text { text-align: center; }
.timeline-num { font-size: 13px; font-weight: 700; color: var(--outline); font-variant-numeric: tabular-nums; letter-spacing: 0.06em; }
.timeline-card h3 { margin: 6px 0 0; font-size: 21px; font-weight: 700; letter-spacing: -0.015em; color: var(--on-surface); }
.timeline-card p { margin: 8px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--on-surface-variant); }

/* ── Challenge carousel ─────────────────────────────────── */
.carousel { position: relative; margin-top: 36px; overflow: hidden; }
.carousel-track { display: flex; gap: 12px; width: max-content; padding: 4px 0 14px; animation: baMarquee 90s linear infinite; will-change: transform; }
.carousel:hover .carousel-track { animation-play-state: paused; }
.carousel-item { flex: 0 0 180px; width: 180px; }
.carousel-fade { position: absolute; top: 0; bottom: 0; width: 72px; pointer-events: none; z-index: 1; }
.carousel-fade.left { left: 0; background: linear-gradient(to right, var(--surface), transparent); }
.carousel-fade.right { right: 0; background: linear-gradient(to left, var(--surface), transparent); }
@keyframes baMarquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.tile {
  background: var(--surface-container-lowest); border-radius: var(--shape-medium); padding: 18px 14px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  box-shadow: var(--elevation-1); height: 100%;
}
.tile-icon { width: 44px; height: 44px; border-radius: var(--shape-small); background: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tile-icon .material-symbols-outlined { color: var(--on-primary); }
.tile-icon svg { display: block; fill: var(--on-primary); }
.tile-name { font-size: 15.5px; font-weight: 600; color: var(--on-surface); }
.tile-tag { font-size: 12.5px; line-height: 1.35; color: var(--on-surface-variant); margin-top: 3px; }
.ba-tile { transition: transform .18s cubic-bezier(.2,0,0,1), box-shadow .18s; }
.ba-tile:hover { transform: translateY(-4px); box-shadow: var(--elevation-3); }

/* ── Reliability ────────────────────────────────────────── */
.reliability { display: flex; gap: 48px; align-items: center; flex-wrap: wrap; }
.reliability-phones { flex: 0 0 auto; margin: 0 auto; position: relative; width: 432px; height: 600px; max-width: 100%; }
.reliability-phones .phone { position: absolute; }
.reliability-phones .rel-a { left: 4px; top: 60px; transform: rotate(-5deg); }
.reliability-phones .rel-b { right: 4px; top: 0; transform: rotate(4deg); }
.reliability-copy { flex: 1 1 360px; }
.rel-points { display: flex; flex-direction: column; gap: 18px; margin-top: 28px; }
.rel-point { display: flex; gap: 14px; align-items: flex-start; }
.rel-point-ic { width: 40px; height: 40px; border-radius: 999px; background: var(--primary-container); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rel-point-ic .material-symbols-outlined { color: var(--on-primary-container); }
.rel-point h3 { margin: 0; font-size: 17px; font-weight: 600; color: var(--on-surface); }
.rel-point p { margin: 4px 0 0; font-size: 15px; line-height: 1.5; color: var(--on-surface-variant); }

/* ── More than an alarm — shot cards ────────────────────── */
.shot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: clamp(28px, 3vw, 48px); margin-top: 52px; justify-items: center; }
.shot-card { display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 280px; margin: 0 auto; }
.shot-card h3 { margin: 20px 0 0; font-size: 18.5px; font-weight: 600; letter-spacing: -0.01em; color: var(--on-surface); }
.shot-card p { margin: 5px 0 0; font-size: 14.5px; line-height: 1.45; color: var(--on-surface-variant); }
.ba-lift { transition: transform .18s cubic-bezier(.2,0,0,1), box-shadow .18s; }
.ba-lift:hover { transform: translateY(-6px); }

/* ── Features ───────────────────────────────────────────── */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 40px; }
.feature { display: flex; gap: 14px; align-items: flex-start; padding: 6px 4px; }
.feature > .material-symbols-outlined { color: var(--primary); margin-top: 2px; }
.feature h3 { margin: 0; font-size: 16px; font-weight: 600; color: var(--on-surface); }
.feature p { margin: 3px 0 0; font-size: 14.5px; line-height: 1.45; color: var(--on-surface-variant); }

/* ── Download CTA ───────────────────────────────────────── */
.cta {
  background: var(--primary); border-radius: var(--shape-extra-large); padding: clamp(36px, 6vw, 64px);
  display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
}
.cta-left { flex: 1 1 380px; }
.cta h2 { margin: 0; font-size: clamp(28px, 4vw, 42px); line-height: 1.08; font-weight: 700; letter-spacing: -0.03em; color: var(--on-primary); }
.cta p { margin: 14px 0 0; font-size: 17px; line-height: 1.5; color: var(--on-primary); opacity: 0.88; }
.cta-right { flex: 0 0 auto; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.cta-note { font-size: 13px; color: var(--on-primary); opacity: 0.85; padding-left: 4px; }

/* ── Footer ─────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--outline-variant); margin-top: 8px; }
.footer-top { max-width: 1180px; margin: 0 auto; padding: 56px 24px 40px; display: flex; gap: 48px; flex-wrap: wrap; justify-content: space-between; }
.footer-blurb { max-width: 320px; }
.footer-blurb p { margin: 16px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--on-surface-variant); }
.footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col-title { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--on-surface-variant); }
.footer-col-links { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.footer-col-links a { font-size: 14.5px; color: var(--on-surface); text-decoration: none; opacity: 0.82; }
.footer-col-links a:hover { opacity: 1; }
.footer-bottom { border-top: 1px solid var(--outline-variant); }
.footer-bottom-in { max-width: 1180px; margin: 0 auto; padding: 20px 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.footer-bottom-in span { font-size: 13px; color: var(--on-surface-variant); }

/* ── Scroll-reveal + motion ─────────────────────────────── */
[data-reveal] {
  opacity: 0; transform: translateY(var(--rv-y, 18px));
  transition: opacity .6s cubic-bezier(.2,0,0,1), transform .6s cubic-bezier(.2,0,0,1);
}
[data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .ba-lift, .ba-tile, .ba-play { transition: none !important; }
  .carousel-track { animation: none !important; }
  .cphone { transition: none !important; }
}

/* ── Responsive tightening ──────────────────────────────── */
@media (max-width: 900px) {
  .reliability-phones { width: 360px; height: 520px; }
  .reliability-phones .rel-a { --w: 190px !important; }
  .reliability-phones .rel-b { --w: 210px !important; }
}
@media (max-width: 760px) {
  /* Stack the hero: copy on top, phones centered below. */
  .hero { flex-direction: column; align-items: stretch; }
  .hero-copy { flex: none; }
  .hero-phones { width: 100%; margin-top: 4px; justify-content: center; }
}
@media (max-width: 560px) {
  /* Drop the decorative secondary phone; center the animated one so the
     hero never exceeds the viewport on narrow screens. */
  .hero-phone-alarms { display: none; }
  .hero-phones { gap: 0; width: 100%; }
  .cycling { --w: min(224px, 76vw) !important; }
  .reliability-phones { width: 300px; height: 470px; }
  .reliability-phones .rel-a { --w: 165px !important; left: 0; }
  .reliability-phones .rel-b { --w: 185px !important; right: 0; }
  .footer-top { gap: 32px; }
  .footer-cols { gap: 32px; }
}
