/* ============================================================
   Avalanche IQ — marketing site
   Tokens lifted from the app: Deep Navy #0b1e33, Frost #7FD1E8,
   glass cards (~15% fill + blur), slow gentle snow.
   ============================================================ */

:root {
  --bg: #0b1e33;
  --bg-deep: #071526;
  /* Liquid Glass — app's exact fills (0x260B1E33 → 0x1F132A45), frost border + sheen */
  --glass-grad: linear-gradient(160deg, rgba(11, 30, 51, 0.16), rgba(19, 42, 69, 0.12));
  --glass-border: 1px solid rgba(255, 255, 255, 0.10);
  --glass-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0) 32%);
  --card: rgba(19, 42, 69, 0.55);
  --card-strong: rgba(19, 42, 69, 0.78);
  --frost: #7fd1e8;
  --frost-soft: rgba(127, 209, 232, 0.55);
  --amber: #ffc94d;
  --text: #eaf4fb;
  --muted: #9fb6c9;
  --border: rgba(127, 209, 232, 0.16);
  --radius: 20px;
  --maxw: 1080px;
  --font: "Sora", system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--bg); }

body {
  font-family: var(--font);
  /* background stays transparent so the snow layer shows through; solid
     sections (how, footer) cover it locally, glass cards blur it (bokeh) */
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: var(--frost); }

/* content sits above the snow layer; snow shows through transparent areas
   (hero sky) and blurs behind the glass cards — never in front of content */
main, footer { position: relative; z-index: 1; }

::selection { background: rgba(127, 209, 232, 0.3); }

/* ---------- snow ---------- */
#snow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0; /* behind all content — snow falls in the sky, never in front of screenshots */
}
/* two-layer flake: outer layer falls (vertical, linear), inner layer sways
   (pendulum: ease-in-out + alternate = slow at the edges, fast through the
   middle — a real sway, not a bounce) */
#snow .flake {
  position: absolute;
  top: -12px;
  animation: fall var(--d, 13s) linear infinite;
  animation-delay: var(--delay, 0s);
}
#snow .flake__inner {
  display: block;
  width: var(--s, 4px);
  height: var(--s, 4px);
  border-radius: 50%;
  background: #dff3fb;
  opacity: var(--o, 0.5);
  animation: sway var(--sway-d, 3s) ease-in-out infinite alternate;
}
@keyframes fall {
  0%   { transform: translate3d(0, -2vh, 0); }
  100% { transform: translate3d(0, 104vh, 0); }
}
@keyframes sway {
  from { transform: translateX(var(--sway, 18px)); }
  to   { transform: translateX(calc(var(--sway, 18px) * -1)); }
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px clamp(20px, 5vw, 48px);
  background: linear-gradient(180deg, rgba(11, 30, 51, 0.55), rgba(11, 30, 51, 0.32));
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.nav__cta {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--bg-deep);
  background: var(--frost);
  padding: 9px 18px;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}
.nav__cta:hover { background: #a5e0f2; transform: translateY(-1px); }
.nav__cta:focus-visible { outline: 2px solid var(--frost); outline-offset: 2px; }
.nav__cta--ghost {
  background: transparent;
  color: var(--frost);
  border: 1px solid var(--border);
}
.nav__cta--ghost:hover { background: rgba(127, 209, 232, 0.08); color: var(--frost); }

/* ---------- language switcher ---------- */
.lang {
  display: flex;
  gap: 2px;
  margin-left: auto;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(7, 21, 38, 0.5);
}
.lang__link {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}
.lang__link:hover { color: var(--frost); }
.lang__link.is-active { background: var(--frost); color: var(--bg-deep); }
.lang__link:focus-visible { outline: 2px solid var(--frost); outline-offset: 2px; }

/* ---------- shared ---------- */
.section-title {
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-align: center;
}
.frost { color: var(--frost); }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--frost);
  border: 1px solid var(--border);
  background: rgba(127, 209, 232, 0.08);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(56px, 9vh, 110px) clamp(20px, 5vw, 48px) clamp(48px, 7vh, 80px);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 480px at 78% 12%, rgba(127, 209, 232, 0.10), transparent 60%),
    radial-gradient(700px 500px at 8% 88%, rgba(19, 42, 69, 0.55), transparent 65%);
}
.hero h1 {
  font-size: clamp(2.3rem, 5.4vw, 3.7rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 20px;
}
.hero__sub {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--muted);
  max-width: 34em;
  margin-bottom: 30px;
}
.hero__cta {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.link-more { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.link-more:hover { color: var(--frost); }
.hero__facts {
  list-style: none;
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
}
.hero__facts li::before {
  content: "✦";
  color: var(--frost);
  margin-right: 8px;
  font-size: 0.7rem;
}

/* ---------- phone mockup ---------- */
.phone {
  position: relative;
  width: min(300px, 74vw);
  aspect-ratio: 9 / 19.5;
  border-radius: 44px;
  background: #060f1d;
  border: 7px solid #060f1d;
  box-shadow:
    0 40px 80px -20px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(127, 209, 232, 0.14);
  overflow: hidden;
  margin: 0 auto;
}
.phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 36px;
}
.hero__phone { display: flex; justify-content: center; }
.phone--small { width: min(240px, 60vw); border-radius: 36px; }
.phone--small img { border-radius: 29px; }

/* ---------- features ---------- */
.features { padding: clamp(60px, 9vh, 110px) clamp(20px, 5vw, 48px); max-width: var(--maxw); margin: 0 auto; }
.features .section-title { margin-bottom: clamp(48px, 8vh, 90px); }
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  margin-bottom: clamp(64px, 10vh, 110px);
}
.feature-row--flip .feature-row__copy { order: 2; }
.feature-row--flip .feature-row__media { order: 1; }
.feature-row__copy {
  /* Liquid Glass card — snow bokeh blurs through behind the text */
  position: relative;
  background: var(--glass-grad);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border: var(--glass-border);
  border-radius: 24px;
  padding: clamp(26px, 4vw, 40px);
  box-shadow: 0 24px 50px -28px rgba(0, 0, 0, 0.65);
}
.feature-row__copy::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--glass-sheen);
  pointer-events: none;
}
.feature-row__copy h3 {
  position: relative;
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.feature-row__copy p {
  position: relative;
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 30em;
}
.feature-row__media { display: flex; justify-content: center; }

/* ---------- how it works ---------- */
.how {
  padding: clamp(60px, 9vh, 100px) clamp(20px, 5vw, 48px);
  /* transparent so snow shows through the glass step cards */
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.how .section-title { margin-bottom: clamp(40px, 6vh, 64px); }
.how__steps {
  list-style: none;
  max-width: 760px;
  margin: 0 auto;
  counter-reset: step;
}
.how__steps li {
  position: relative;
  display: flex;
  gap: 22px;
  align-items: flex-start;
  padding: 26px;
  margin-bottom: 16px;
  background: var(--glass-grad);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border: var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 24px 50px -28px rgba(0, 0, 0, 0.65);
}
.how__steps li::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--glass-sheen);
  pointer-events: none;
}
.how__num {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--bg-deep);
  background: var(--frost);
  border-radius: 50%;
}
.how__steps h3 { position: relative; font-size: 1.15rem; font-weight: 800; margin-bottom: 4px; }
.how__steps p { position: relative; color: var(--muted); font-size: 0.98rem; max-width: 34em; }

/* ---------- FAQ ---------- */
.faq {
  padding: clamp(60px, 9vh, 100px) clamp(20px, 5vw, 48px);
  max-width: 760px;
  margin: 0 auto;
}
.faq .section-title { margin-bottom: clamp(32px, 5vh, 48px); }
.faq details {
  position: relative;
  background: var(--glass-grad);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border: var(--glass-border);
  border-radius: 20px;
  padding: 20px 24px;
  margin-bottom: 14px;
  box-shadow: 0 18px 40px -26px rgba(0, 0, 0, 0.6);
}
.faq details::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--glass-sheen);
  pointer-events: none;
}
.faq summary {
  position: relative;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.02rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--frost);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); margin-top: 12px; font-size: 0.98rem; }
.faq summary:hover { color: var(--frost); }

/* ---------- final CTA ---------- */
.final {
  position: relative;
  text-align: center;
  padding: clamp(70px, 11vh, 130px) clamp(20px, 5vw, 48px);
}
.final::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(700px 340px at 50% 100%, rgba(127, 209, 232, 0.12), transparent 65%);
}
.final > h2, .final > p, .final > .final__cta { position: relative; }
.final__cta {
  /* Liquid Glass panel holding the final download buttons */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: clamp(28px, 5vw, 44px) clamp(30px, 7vw, 72px);
  background: var(--glass-grad);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border: var(--glass-border);
  border-radius: 28px;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.7);
}
.final__cta::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--glass-sheen);
  pointer-events: none;
}
.final h2 {
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.final p { color: var(--muted); margin-bottom: 34px; }

/* ---------- store badge ---------- */
/* Both badges are self-contained pills (black body + white border baked into the
   artwork) — no CSS box. Same height, official proportions (Apple's artwork is
   intrinsically ~12% narrower than Google's; never stretched). */
.store-badge {
  display: inline-block;
  line-height: 0;
  flex-shrink: 0;               /* never squish in tight flex rows */
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.store-badge:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -8px rgba(127, 209, 232, 0.35); }
.store-badge:focus-visible { outline: 2px solid var(--frost); outline-offset: 3px; }
.store-badge img { height: 50px; width: auto; }

/* Google Play badge — PNG pill, same height */
.store-badge--play { border-radius: 10px; }
.store-badge--play img { height: 50px; width: auto; }
.store-badge--play:hover { box-shadow: 0 12px 30px -8px rgba(127, 209, 232, 0.35); }

/* larger badges in the final CTA panel — same height */
.final__cta .store-badge img { height: 54px; }
.final__cta .store-badge--play img { height: 54px; }

/* ---------- "coming soon" dialog ---------- */
.soon {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 12, 22, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.soon.is-open { display: flex; }
.soon__card {
  max-width: 420px;
  width: 100%;
  padding: 34px 30px;
  text-align: center;
  background: var(--glass-grad);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  backdrop-filter: blur(24px) saturate(1.5);
  border: var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8);
}
.soon__card h3 { font-size: 1.35rem; font-weight: 800; margin-bottom: 10px; }
.soon__card p { color: var(--muted); font-size: 0.98rem; margin-bottom: 24px; }
.soon__close {
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--bg-deep);
  background: var(--frost);
  border: none;
  border-radius: 999px;
  padding: 11px 28px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}
.soon__close:hover { background: #a5e0f2; transform: translateY(-1px); }
.soon__close:focus-visible { outline: 2px solid var(--frost); outline-offset: 3px; }

/* ---------- legal pages (privacy / terms) ---------- */
.legal {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(48px, 8vh, 90px) clamp(20px, 5vw, 48px) clamp(64px, 10vh, 110px);
}
.legal h1 {
  font-size: clamp(2rem, 4.6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}
.legal__date { color: var(--muted); font-size: 0.9rem; margin-bottom: 34px; }
.legal h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 34px 0 10px;
  color: var(--frost);
}
.legal p, .legal li { color: var(--muted); line-height: 1.7; }
.legal p { margin-bottom: 14px; }
.legal ul { margin: 0 0 14px 22px; }
.legal li { margin-bottom: 8px; }
.legal strong { color: var(--text); }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-deep);
  padding: 34px clamp(20px, 5vw, 48px);
}
.footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.footer__brand { display: flex; align-items: center; gap: 9px; font-weight: 800; }
.footer__links { display: flex; gap: 22px; }
.footer__links a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.footer__links a:hover { color: var(--frost); }
.footer__note { color: var(--muted); font-size: 0.85rem; width: 100%; text-align: center; margin-top: 18px; }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero__cta { justify-content: center; }
  .hero__facts { justify-content: center; }
  .hero__sub { margin-left: auto; margin-right: auto; }
  .hero__phone { margin-top: 8px; }
  .feature-row, .feature-row--flip { grid-template-columns: 1fr; }
  .feature-row--flip .feature-row__copy { order: 1; }
  .feature-row--flip .feature-row__media { order: 2; }
  .feature-row__copy { text-align: center; }
  .feature-row__copy p { margin: 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  #snow span { animation: none; display: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .store-badge, .nav__cta { transition: none; }
}
