/* ═══════════════════════════════════════════════════════════════════════════
   SITE LAYER — ports the visual language of design/option-3-quiet-confidence.html
   onto the marketing site's existing class names.

   Load order matters:  tokens.css -> styles.css -> mockups.css
                        -> components.css -> site.css -> motion.css

   styles.css is the legacy sheet from the dark/Sora era. Rather than pick it
   apart rule by rule, this layer restates the pieces that carry the look —
   section rhythm, the serif heading scale, panels, callouts, buttons, forms —
   in the design document's own terms. It sits last, so it wins on equal
   specificity.

   What "looks like the doc" concretely means here:
     · 96px section rhythm, hairline dividers instead of alternating bands
     · teal 12px uppercase eyebrow  ->  clamp(30–46px) Fraunces 500 heading
       ->  16.5px/1.68 muted lede capped at 70ch
     · white cards on warm paper, 1px warm border, barely-there shadow
     · pill buttons, teal primary, outlined secondary
     · generous whitespace over dividers and boxes
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Page rhythm ──────────────────────────────────────────────────────── */
html {
  /* Sticky header (~4.5–5rem) — keep in-page #demo / #how / video jumps visible */
  scroll-padding-top: 5.5rem;
}

body {
  font-size: 16.5px;
}

.section[id],
.purpose-band[id] {
  scroll-margin-top: 5.5rem;
}

.container {
  width: min(100% - 2.5rem, var(--max));
}

.section {
  padding: var(--s-12) 0;
  border-top: 1px solid var(--border);
}

/* The doc separates sections with a hairline, not alternating fills. */
.section-surface {
  background: transparent;
}

.section:first-of-type {
  border-top: 0;
}

/* ── Section heads ────────────────────────────────────────────────────── */
.section-head {
  max-width: 70ch;
  margin-bottom: var(--s-7);
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 0.9rem;
}

.section-head h2,
.split h2,
.about-box h2,
.contact-copy h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 0.85rem;
  max-width: 26ch;
}

.section-head p,
.split p,
.about-box p,
.contact-copy p {
  font-size: 1.03rem;
  line-height: 1.68;
  color: var(--muted);
  max-width: 70ch;
}

.section-head p strong,
.split p strong,
.about-box p strong {
  color: var(--text);
  font-weight: 600;
}

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero {
  padding: var(--s-12) 0 var(--s-10);
  background:
    radial-gradient(ellipse 70% 60% at 78% 34%, rgb(var(--primary-rgb) / 0.09), transparent 58%),
    radial-gradient(ellipse 46% 38% at 12% 0%, rgb(var(--accent-rgb) / 0.06), transparent 54%),
    var(--bg);
}

.hero-grid {
  gap: var(--s-9);
  align-items: center;
}

.hero-tagline {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.032em;
  color: var(--text);
  max-width: 17ch;
  margin: 0 0 1.1rem;
}

.hero-lede {
  font-size: 1.08rem;
  line-height: 1.68;
  color: var(--muted);
  max-width: 44ch;
  margin: 0 0 1.9rem;
}

.hero-lede strong {
  color: var(--text);
  font-weight: 600;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.hero-stage {
  width: min(100%, 420px);
  justify-self: end;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn-primary,
.nav-cta,
.form-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: var(--tap-primary);
  padding: 0 1.6rem;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: var(--primary);
  color: var(--primary-text);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--elev-1);
  transition:
    background var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}

.nav-cta {
  min-height: 44px;
  padding: 0 1.15rem;
  font-size: 0.94rem;
}

.btn-primary:hover,
.nav-cta:hover,
.form-submit:hover {
  background: var(--primary-hover);
  box-shadow: var(--elev-2);
  filter: none;
  transform: none;
  text-decoration: none;
}

.btn-primary:active,
.nav-cta:active,
.form-submit:active {
  transform: scale(0.985);
}

.btn-primary:focus-visible,
.nav-cta:focus-visible,
.form-submit:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-min);
  padding: 0 1.1rem;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--primary);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease);
}

.btn-ghost:hover {
  background: var(--primary-ghost);
  text-decoration: none;
}

/* ── Nav ──────────────────────────────────────────────────────────────── */
.nav {
  padding: 0.85rem 0;
}

.brand {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.22rem;
  letter-spacing: -0.02em;
  gap: 0.6rem;
}

.brand img {
  border-radius: 9px;
}

.nav-text {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-text:hover {
  color: var(--text);
}

/* ── Purpose band — the OAuth surface. Calm, not a coloured slab. ─────── */
.purpose-band {
  padding: var(--s-10) 0 var(--s-9);
  background:
    radial-gradient(ellipse 50% 70% at 94% 30%, rgb(var(--primary-rgb) / 0.07), transparent 58%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}

.purpose-band h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 6vw, 4rem);
  line-height: 1;
  letter-spacing: -0.035em;
  margin: 0 0 0.7rem;
  color: var(--text);
}

.purpose-lead {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 1.7rem;
  max-width: 30ch;
}

.purpose-band h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.3rem;
  letter-spacing: -0.015em;
  margin: 1.8rem 0 0.7rem;
  color: var(--text);
}

.purpose-band p {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.68;
  max-width: 70ch;
}

.purpose-band-grid {
  gap: var(--s-9);
}

.purpose-watch {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--primary);
}

/* ── How-it-works steps: numbered cards, doc "panel" treatment ────────── */
.how-steps {
  display: grid;
  /* Match .phone-row columns so the three cards sit over the three phones */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-6);
  list-style: none;
  margin: 0 0 var(--s-8);
  padding: 0;
  counter-reset: step;
  max-width: none; /* override legacy 56rem + left-align from styles.css */
  width: 100%;
}

.how-steps li {
  counter-increment: step;
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: 1.6rem 1.5rem;
  box-shadow: var(--elev-1);
  width: 100%;
  max-width: 260px;
  margin-inline: auto; /* center each card in its column, same as phones */
  box-sizing: border-box;
}

.how-steps li::before {
  content: counter(step);
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--border-strong);
}

.how-steps h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.22rem;
  letter-spacing: -0.02em;
  margin: 0 0 0.45rem;
  color: var(--text);
}

.how-steps p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.65;
}

/* ── Phone row / showcase / purpose phones — one deliberate size ladder ──
   Hero 300 > how-it-works 260 > purpose 230 > showcase 220 > team 220.
   Each mockup fills the width it is given, so these caps are the only place
   size is decided. Never override --u.                                    */
.hero-stage .lv-phone {
  max-width: 300px;
  margin-inline: auto;
}

.phone-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-6);
  align-items: stretch; /* equal card columns → phone frame bottoms line up */
  justify-items: center;
}

.phone-row .lv-phone {
  max-width: 260px;
  width: 100%;
  margin-inline: auto;
}

.purpose-phones .lv-phone {
  max-width: 230px;
  margin-inline: auto;
}

.showcase-rail {
  grid-auto-columns: 220px;
  gap: var(--s-5);
  padding: 0.35rem 0.15rem 0.35rem;
  /* Hide the OS scrollbar chrome — swipe / trackpad still works */
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0,
    #000 1.5rem,
    #000 calc(100% - 1.5rem),
    transparent 100%
  );
  mask-image: linear-gradient(
    90deg,
    transparent 0,
    #000 1.5rem,
    #000 calc(100% - 1.5rem),
    transparent 100%
  );
}

.showcase-rail::-webkit-scrollbar {
  display: none;
  height: 0;
  width: 0;
}

.showcase-hint {
  margin: 0.65rem 0 0;
  text-align: center;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
}

/* Deliberately NOT .team-side-phone: that legacy selector carries its own
   border/padding/shadow (a second frame around .lv-frame) and a
   `.team-side-phone img { width: 100% }` rule that inflated the brand logo
   inside the mockup. A separate class keeps the live mockup out of its reach. */
.team-phone-inline {
  max-width: 220px;
  margin: var(--s-5) 0 0;
}

.phone-card {
  gap: 1.1rem;
  width: 100%;
  max-width: 260px;
  /* Room for frame lift without shifting the row baseline */
  padding-top: 0.5rem;
  align-self: stretch;
  height: 100%;
}

.phone-card .lv-frame {
  transition:
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}

/* Legacy rise animation fights hover transform on the how-it-works phones */
@media (prefers-reduced-motion: no-preference) {
  .phone-row .phone-card {
    animation: none;
  }
}

@media (hover: none) {
  .phone-row .lift:hover .lv-frame {
    transform: none;
  }
}

.phone-card figcaption h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
}

.phone-card figcaption p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

.phone-card .step-num {
  display: inline-grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  background: var(--primary-muted);
  color: var(--primary);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
}

.showcase-item figcaption,
.purpose-phone figcaption {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

/* ── Split / team section ─────────────────────────────────────────────── */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: var(--s-9);
  align-items: center;
}

.team-illustration {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  padding: 1.75rem;
  box-shadow: var(--elev-1);
}

/* ── About box — the doc's "callout" ──────────────────────────────────── */
.about-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--r-2);
  padding: 2rem 2.2rem;
  box-shadow: var(--elev-1);
  max-width: 80ch;
}

.about-box h2 {
  font-size: 1.6rem;
  margin-bottom: 0.9rem;
}

.about-box p {
  font-size: 1rem;
}

/* ── Contact ──────────────────────────────────────────────────────────── */
.contact-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: var(--s-8);
  align-items: start;
}

.contact-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: 1.9rem;
  box-shadow: var(--elev-1);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.contact-form .field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-form label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text);
}

.contact-form input,
.contact-form textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface);
  /* borderStrong, not border — this is a control and needs 3:1 */
  border: 1px solid var(--border-strong);
  border-radius: var(--r-2);
  min-height: var(--tap-comfort);
  padding: 0.85rem 1rem;
  width: 100%;
  transition:
    border-color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}

.contact-form textarea {
  min-height: 7rem;
  resize: vertical;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--faint);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-ghost);
}

.form-hint {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--muted);
}

.form-status {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
}

.form-status.ok {
  color: var(--primary);
}

.form-status.err {
  color: var(--danger);
}

.field.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--s-8) 0;
  background: var(--bg);
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--text);
}

/* ── Legal pages ──────────────────────────────────────────────────────── */
.legal h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -0.028em;
  line-height: 1.08;
}

.legal h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: -0.018em;
  margin: 2.2rem 0 0.7rem;
}

.legal p,
.legal li {
  color: var(--muted);
  line-height: 1.68;
  max-width: 70ch;
}

/* ── Store badge sizing (kept honest across contexts) ─────────────────── */
.store-badge img {
  display: block;
  height: 44px;
  width: auto;
}

.store-badge-footer img,
.nav .store-badge img {
  height: 38px;
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-stage {
    justify-self: center;
  }
  .hero-tagline {
    max-width: 22ch;
  }
  .purpose-band-grid {
    grid-template-columns: 1fr;
  }
  .how-steps,
  .phone-row {
    grid-template-columns: 1fr;
  }
  .how-steps li,
  .phone-card {
    max-width: 280px;
  }
  .section {
    padding: var(--s-9) 0;
  }
}

@media (max-width: 560px) {
  .nav .store-badge {
    display: none;
  }
  .purpose-phones {
    grid-template-columns: 1fr;
    max-width: 240px;
  }
  .hero-stats {
    gap: 1.25rem;
  }
}
