/* ============================================================
   GOTCHA — home page.

   One visual language with the store art (store_assets/v3/final_ios):
   white into pale sky, the glossy blue ribbon, soft clay props, a tilted
   phone with the real app inside, and two-line headlines — ink first,
   blue second, Inter 800. Colours are sampled from those images.

   The content pages load this file too (for the tokens, nav, buttons
   and footer) and add css/page.css for their prose.
   ============================================================ */

:root {
  color-scheme: light;

  --sky-1:   #D8EDFE;   /* top of the store art */
  --sky-2:   #EDF7FF;   /* its middle */
  --paper:   #FFFFFF;
  --tint:    #F4F9FF;   /* alternate section ground */

  --ink:     #0A1A33;   /* headline line one */
  --ink-2:   #3A4A63;   /* body */
  --muted:   #5E6C82;   /* small print — 5.4:1 on white */
  --line:    rgba(10, 26, 51, 0.10);

  --blue:      #1A8EF0; /* headline line two (store #1898F8, a shade deeper for text) */
  --blue-ink:  #0B6FD1; /* blue small text and links — AA on white */
  --blue-soft: #E3F1FF;
  --ok:        #12A150;
  --warn:      #C2410C;

  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 12px;
  --shadow: 0 30px 70px -36px rgba(16, 70, 160, 0.38);
  --shadow-sm: 0 12px 30px -18px rgba(16, 70, 160, 0.30);

  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --gut: clamp(20px, 5vw, 64px);
  --maxw: 1180px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue-ink); }
h1, h2, h3 { color: var(--ink); margin: 0; letter-spacing: -0.025em; }
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.04; font-weight: 800; }
h2 { font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.1; font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; }
.blue { color: var(--blue); }
.center { text-align: center; }
p { margin: 0; }

.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  padding: 10px 16px; border-radius: var(--r-sm);
  background: var(--ink); color: #fff; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: 0; border-radius: 999px;
  font: 600 1rem/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s ease;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #2B9BF7, #147FE6);
  box-shadow: 0 10px 24px -10px rgba(20, 127, 230, 0.7);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -10px rgba(20, 127, 230, 0.75); }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 0.92rem; }
.btn:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--blue) 45%, transparent);
  outline-offset: 2px;
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
.nav.is-scrolled {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 0 var(--line);
}
.nav-in { display: flex; align-items: center; gap: 28px; min-height: 68px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-weight: 800; letter-spacing: 0.04em;
}
.brand img { border-radius: 9px; box-shadow: var(--shadow-sm); }
.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a { color: var(--ink-2); text-decoration: none; font-size: 0.95rem; font-weight: 500; }
.nav-links a:hover { color: var(--blue-ink); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  margin-top: -68px;            /* sit under the transparent nav */
  padding-top: 68px;
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 55%, var(--paper) 100%);
  overflow: hidden;
}
.hero-in {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
  padding-block: clamp(40px, 7vh, 90px) clamp(10px, 3vh, 30px);
}
.eyebrow {
  display: inline-block;
  margin-bottom: 18px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--blue-ink);
  font-size: 0.85rem; font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.lede { margin: 22px 0 30px; font-size: 1.15rem; max-width: 34em; }
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 54px; padding: 0 20px 0 16px;
  border-radius: 14px;
  background: var(--ink); color: #fff; text-decoration: none;
  font-weight: 650; font-size: 1.05rem; line-height: 1.1;
  transition: transform 0.2s var(--ease);
}
.store:hover { transform: translateY(-2px); }
.store svg { width: 24px; height: 24px; }
.store small { display: block; font-size: 0.68rem; font-weight: 500; opacity: 0.8; }
.fine { margin-top: 16px; font-size: 0.88rem; color: var(--muted); }
.hero-art { justify-self: center; max-width: 430px; width: 100%; }
.hero-art img {
  /* The art is a crop of the store image, sky and all; as a card its edges
     read as a frame rather than a seam against the page gradient. */
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  /* The bottom of the crop is empty sky; keep the card to the phone. */
  aspect-ratio: 720 / 1080;
  object-fit: cover;
  object-position: top;
}

.stats {
  list-style: none;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding-block: 10px clamp(48px, 8vh, 80px);
  margin: 0 auto;
}
.stats li {
  padding: 20px 22px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-sm);
}
.stats b { display: block; font-size: 1.6rem; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.stats span { font-size: 0.92rem; color: var(--muted); }

/* ---------- features ---------- */
.features { padding-block: clamp(40px, 8vh, 90px); }
.feature {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: center;
  gap: clamp(28px, 6vw, 90px);
  padding-block: clamp(28px, 5vh, 56px);
}
.feature--flip .feature-art { order: 2; }
.feature-art {
  justify-self: center;
  width: 100%; max-width: 380px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--sky-1), var(--paper));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.feature-copy p { margin-top: 20px; font-size: 1.08rem; max-width: 32em; }

/* ---------- how ---------- */
.how { padding-block: clamp(60px, 10vh, 110px); background: var(--tint); }
.steps {
  list-style: none; padding: 0;
  margin: clamp(36px, 6vh, 60px) 0 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
}
.steps li {
  padding: 26px 22px;
  border-radius: var(--r-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.step-n {
  display: grid; place-items: center;
  width: 38px; height: 38px; margin-bottom: 16px;
  border-radius: 50%;
  background: var(--blue-soft); color: var(--blue-ink);
  font-weight: 800;
}
.steps p { margin-top: 8px; font-size: 0.97rem; }

/* ---------- record ---------- */
.record { padding-block: clamp(60px, 10vh, 110px); }
.record-in { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(28px, 6vw, 80px); align-items: center; }
.record-copy > p { margin-top: 18px; font-size: 1.08rem; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.compare > div { padding: 20px; border-radius: var(--r-md); background: var(--tint); }
.compare h3 { font-size: 0.98rem; margin-bottom: 10px; }
.compare ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 0.94rem; }
.compare li { position: relative; padding-left: 24px; }
.compare li::before { position: absolute; left: 0; top: 0; font-weight: 800; }
.compare .x li::before { content: '✕'; color: #C0392B; }
.compare .ok li::before { content: '✓'; color: var(--ok); }
.card-record {
  padding: 26px;
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.cr-head { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.cr-seal, .cr-ok {
  padding: 5px 12px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 700;
}
.cr-seal { background: var(--blue-soft); color: var(--blue-ink); }
.cr-ok { background: #E4F6EC; color: #0E7A3E; }
.card-record dl { margin: 0; display: grid; gap: 0; }
.card-record dl div { display: flex; justify-content: space-between; gap: 18px; padding: 12px 0; border-top: 1px solid var(--line); }
.card-record dt { color: var(--muted); font-size: 0.92rem; }
.card-record dd { margin: 0; color: var(--ink); font-weight: 600; font-size: 0.94rem; text-align: right; }

/* ---------- pricing ---------- */
.pricing { padding-block: clamp(60px, 10vh, 110px); background: linear-gradient(180deg, var(--paper), var(--sky-2)); }
.plan {
  max-width: 440px; margin: clamp(32px, 5vh, 50px) auto 0;
  padding: 34px 32px;
  border-radius: var(--r-lg);
  background: var(--paper);
  box-shadow: var(--shadow);
  text-align: center;
}
.plan-name { font-weight: 800; letter-spacing: 0.08em; color: var(--blue-ink); }
.plan-price { margin-top: 8px; color: var(--ink); }
.plan-price b { font-size: 3.2rem; font-weight: 800; letter-spacing: -0.03em; }
.plan-price span { color: var(--muted); }
.plan-trial { color: var(--ok); font-weight: 600; }
.plan ul { list-style: none; padding: 0; margin: 22px 0 26px; display: grid; gap: 10px; text-align: left; }
.plan li { position: relative; padding-left: 28px; }
.plan li::before { content: '✓'; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.plan .btn { width: 100%; }

/* ---------- GOTCHA-CAM ---------- */
.cam { padding-block: clamp(60px, 10vh, 110px); }
.cam-in { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(28px, 6vw, 80px); align-items: start; }
.flag {
  display: inline-block; margin-bottom: 16px;
  padding: 5px 12px; border-radius: 999px;
  border: 1.5px solid var(--warn); color: var(--warn);
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.cam-copy p:not(.flag) { margin-top: 18px; font-size: 1.05rem; }
.wl-form {
  display: grid; gap: 16px;
  padding: 28px;
  border-radius: var(--r-lg);
  background: var(--tint);
}
.field { display: grid; gap: 6px; font-size: 0.9rem; font-weight: 600; color: var(--ink); }
.field input, .field select {
  min-height: 48px; padding: 0 14px;
  border: 1px solid rgba(10, 26, 51, 0.18); border-radius: var(--r-sm);
  background: var(--paper);
  font: 400 1rem var(--sans); color: var(--ink);
}
.wl-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.wl-msg { display: none; margin: 0; font-size: 0.95rem; }
.wl-msg.is-shown { display: block; }
.wl-msg.is-ok { color: #0E7A3E; }
.wl-msg.is-err { color: #B42318; }

/* ---------- FAQ ---------- */
.faq { padding-block: clamp(60px, 10vh, 110px); background: var(--tint); }
.faq-in { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(28px, 6vw, 80px); align-items: start; }
.faq-list { display: grid; gap: 10px; }
.faq details {
  border-radius: var(--r-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 52px 18px 22px;
  position: relative;
  font-weight: 650; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  position: absolute; right: 22px; top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem; font-weight: 500; color: var(--blue-ink);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 22px 20px; font-size: 0.98rem; }

/* ---------- footer ---------- */
.foot { padding-block: 56px 30px; border-top: 1px solid var(--line); font-size: 0.92rem; }
.foot-in { display: grid; grid-template-columns: 1fr 1.4fr; gap: 40px; }
.foot-brand p { margin-top: 12px; color: var(--muted); max-width: 26em; }
.foot-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.foot-cols h4 { margin: 0 0 10px; color: var(--ink); font-size: 0.9rem; }
.foot-cols a, .foot-cols span { display: block; margin-bottom: 8px; color: var(--ink-2); text-decoration: none; }
.foot-cols a:hover { color: var(--blue-ink); }
.foot-base {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
  margin-top: 36px; padding-top: 20px;
  /* A line drawn inside the gutters, not across them. */
  background: linear-gradient(var(--line), var(--line)) var(--gut) 0 / calc(100% - 2 * var(--gut)) 1px no-repeat;
  color: var(--muted); font-size: 0.85rem;
}

/* ---------- motion ---------- */
.reveal-on [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal-on [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- narrow ---------- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-in { justify-content: space-between; }
  .hero-in, .feature, .record-in, .cam-in, .faq-in, .foot-in { grid-template-columns: 1fr; }
  .hero-art { max-width: 340px; }
  .feature--flip .feature-art { order: 0; }
  .feature-art { max-width: 320px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .steps, .compare, .foot-cols { grid-template-columns: 1fr; }
  .stores .store { flex: 1 1 100%; justify-content: center; }
}

/* ---------- the 3D world (js/home.bundle.js) ----------
   One fixed canvas behind the whole document. Sections are see-through
   so the ribbon and clouds run unbroken from the hero to the footer;
   cards stay opaque white, which is what lets the ribbon pass *behind*
   them. Until the script has drawn its first frame — or if it never
   runs — the static art in each slot is what shows. */
.stage {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  z-index: 0;
  pointer-events: none;
}
.has-3d main, .has-3d .foot { position: relative; z-index: 1; }
.has-3d body {
  background: linear-gradient(180deg, var(--sky-1) 0, var(--sky-2) 900px, var(--paper) 1600px, var(--paper) 55%, var(--sky-2) 100%);
}
.has-3d .hero, .has-3d .how, .has-3d .pricing, .has-3d .faq { background: transparent; }
.has-3d [data-3d] img { visibility: hidden; }
.has-3d .feature-art, .has-3d .hero-art img { background: none; box-shadow: none; }

/* GOTCHA-CAM's slot exists only for the 3D world: there is no photo of
   the prototype to fall back to, so without WebGL it takes no space. */
.cam-art { display: none; }
.has-3d .cam-art { display: block; height: clamp(220px, 26vw, 320px); margin-bottom: 28px; }

/* ---------- the record card types itself in (see index.html) ---------- */
.ty-wrap { position: relative; display: inline-block; }
.is-typing .ty { display: inline-block; clip-path: inset(-2px calc((1 - var(--p, 0)) * 100%) -2px -2px); }
.ty-caret {
  position: absolute; top: 0.15em; bottom: 0.15em; left: calc(var(--p, 0) * 100%);
  width: 2px; border-radius: 1px; background: var(--blue);
  opacity: 0;
}
.ty-wrap.is-on .ty-caret { opacity: 1; }
.is-typing .cr-seal, .is-typing .cr-ok {
  display: inline-block;
  transform: scale(0.6); opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}
.is-typing.is-done .cr-seal, .is-typing.is-done .cr-ok { transform: none; opacity: 1; }
.is-typing.is-done .cr-ok { transition-delay: 0.12s; }
.stats b { font-variant-numeric: tabular-nums; }
