/* =========================================================================
   SurfPopup — "Eggshell" marketing site
   Matches the app's warm eggshell light theme (Pop/DesignSystem/Theme.swift):
   cream paper backdrop, white cards, deep navy ink, sky-blue accent, and
   media framed on a dark navy "stage" — exactly like the app.
   Light-only, like the app. WCAG 2.1 AA: contrast verified per background.
   ========================================================================= */

/* ---- Tokens (app palette) ----------------------------------------------- */
:root {
  --ink:        #f1eada;  /* page background — Theme.bg                     */
  --ink-2:      #e9e0cc;  /* recessed bands — deeper eggshell               */
  --card:       #ffffff;  /* raised cards — Theme.surface                   */
  --line:       rgba(23, 39, 58, 0.12);
  --line-2:     rgba(23, 39, 58, 0.20);

  --text:       #17273a;  /* headings — Palette.ink     13.1:1 on eggshell  */
  --body:       #2e3d50;  /* body copy                   9.6:1 on eggshell  */
  --muted:      #605c53;  /* captions — warm stone       5.3:1 on eggshell  */

  --sky:        #2c5ead;  /* links / accent text — Palette.ocean  5.3:1     */
  --sky-solid:  #1591dc;  /* graphic fills — Palette.cyan                   */
  --flame:      #4bb8fa;  /* CTA fill — Palette.sky (the app's accent)      */
  --on-flame:   #0a1220;  /* text on CTA — Palette.abyss          9.0:1     */

  --stage:      #122645;  /* dark media stage — Palette.stage               */
  --focus:      #2c5ead;  /* focus ring                                     */

  --shadow:     0 24px 50px -28px rgba(23, 39, 58, 0.30);
  --glow:       0 0 0 1px var(--line), 0 40px 90px -44px rgba(21, 145, 220, 0.30);

  --wrap:       1160px;
  --radius:     18px;
  --radius-lg:  28px;

  --font-head:  "Barlow Condensed", "Helvetica Neue", "Arial Narrow", -apple-system, system-ui, sans-serif;
  --font-body:  "Barlow", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  color-scheme: light;
}

/* ---- Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--body);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }

a { color: var(--sky); text-underline-offset: 3px; }
a:hover { color: var(--text); }

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

/* ---- Focus (keyboard) --------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---- Skip link ---------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  background: var(--flame);
  color: var(--on-flame);
  font-family: var(--font-body);
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 10px;
  text-decoration: none;
  transition: top 180ms ease;
}
.skip-link:focus { top: 12px; color: var(--on-flame); }

/* ---- Layout helpers ----------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: clamp(20px, 5vw, 44px);
}

.section { padding-block: clamp(64px, 10vw, 132px); }
.section--tight { padding-block: clamp(48px, 7vw, 88px); }
.section--sunken { background: var(--ink-2); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sky);
  margin: 0 0 18px;
}

.lede {
  font-size: clamp(1.125rem, 2.2vw, 1.375rem);
  line-height: 1.55;
  color: var(--body);
  max-width: 56ch;
}

/* ---- Display type ------------------------------------------------------- */
h1, h2, h3 {
  font-family: var(--font-head);
  color: var(--text);
  margin: 0;
  line-height: 0.98;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.h-hero {
  font-size: clamp(3.1rem, 9vw, 6.25rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.94;
}

.h-section {
  font-size: clamp(2.15rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.h-feature {
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.025em;
}

/* ========================================================================= */
/*  Header                                                                    */
/* ========================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  min-height: 68px;
  gap: 0 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  padding: 8px 4px;
}
.brand:hover { color: var(--text); }
.brand-mark { flex: none; border-radius: 7px; }

.site-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: color 180ms ease, background-color 180ms ease;
}
.site-nav a:hover { color: var(--text); background: var(--line); }

/* ========================================================================= */
/*  Hero                                                                      */
/* ========================================================================= */
.hero { position: relative; overflow: hidden; }
.hero::before {  /* ambient swell glow */
  content: "";
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 620px;
  background:
    radial-gradient(60% 70% at 20% 10%, rgba(75, 184, 250, 0.22), transparent 70%),
    radial-gradient(50% 60% at 90% 0%, rgba(215, 154, 36, 0.14), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero .wrap { position: relative; z-index: 1; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding-block: clamp(48px, 8vw, 104px);
}

.hero h1 { margin-bottom: 22px; }
.hero .lede { margin: 0 0 32px; }

/* Store CTA (coming-soon, non-interactive) */
.store-cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 10px 26px 10px 22px;
  border: none;
  border-radius: 16px;
  background: var(--flame);
  color: var(--on-flame);
  font-family: var(--font-body);
  text-align: left;
  cursor: not-allowed;
}
.store-cta .apple { fill: var(--on-flame); flex: none; }
.store-cta-copy { display: flex; flex-direction: column; line-height: 1.1; }
.store-cta-copy small { font-size: 0.75rem; font-weight: 600; opacity: 0.85; }
.store-cta-copy strong {
  color: var(--on-flame);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}
.cta-note {
  margin: 16px 0 0;
  font-size: 0.9375rem;
  color: var(--muted);
}
.cta-note svg { display: inline-block; vertical-align: -3px; margin-right: 6px; stroke: var(--sky); }

/* ---- Device frame ------------------------------------------------------- */
.device {
  position: relative;
  width: min(300px, 78vw);
  margin-inline: auto;
  border-radius: 40px;
  padding: 10px;
  background: linear-gradient(160deg, #1b3a63, var(--stage) 55%, #0a1220);
  border: 1px solid var(--line-2);
  box-shadow: var(--glow), var(--shadow);
}
.device img {
  width: 100%;
  border-radius: 30px;
  display: block;
}
.hero-device { transform: rotate(-1.5deg); }

/* ========================================================================= */
/*  Steps ("How it works")                                                   */
/* ========================================================================= */
.section-head { max-width: 60ch; margin-bottom: clamp(36px, 6vw, 64px); }
.section-head .lede { margin-top: 18px; }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  counter-reset: step;
}
.step {
  counter-increment: step;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px 28px;
}
.step-icon {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, var(--sky-solid) 16%, transparent);
  margin-bottom: 18px;
}
.step-icon svg { stroke: var(--sky); }
.step h3 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.step h3::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  color: var(--sky);
  margin-bottom: 10px;
}
.step p { margin: 0; color: var(--muted); font-size: 0.9875rem; }

/* ========================================================================= */
/*  Phase strip (signature: the five phases of a pop-up)                      */
/* ========================================================================= */
.phase-block {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.phase-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.phase {
  border-radius: 12px;
  padding: 16px 12px 14px;
  border: 1px solid var(--line);
  background: var(--card);
}
.phase-bar { height: 6px; border-radius: 999px; margin-bottom: 12px; }
.phase:nth-child(1) .phase-bar { background: #c4e2f5; }  /* sand    */
.phase:nth-child(2) .phase-bar { background: #4bb8fa; }  /* sky     */
.phase:nth-child(3) .phase-bar { background: #1591dc; }  /* cyan    */
.phase:nth-child(4) .phase-bar { background: #d79a24; }  /* gold    */
.phase:nth-child(5) .phase-bar { background: #2b9348; }  /* seaweed */
.phase svg { stroke: var(--text); margin-bottom: 8px; }
.phase span {
  display: block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.05;
}
.phase small { color: var(--muted); font-size: 0.8125rem; }

/* ========================================================================= */
/*  Analytics spotlight (single feature, copy + full screenshot)              */
/* ========================================================================= */
.spotlight {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
/* Alternating rhythm: screenshot on the left, copy on the right. */
.spotlight--reverse { grid-template-columns: 0.8fr 1fr; }
.spotlight-copy .lede { margin-bottom: 22px; }
.spotlight-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.spotlight-list li {
  position: relative;
  padding-left: 30px;
  color: var(--body);
  max-width: 46ch;
}
.spotlight-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 3px;
  width: 18px; height: 18px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--sky-solid) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--sky-solid) 34%, transparent);
}
.spotlight-list li::after {
  content: "";
  position: absolute;
  left: 5px; top: 8px;
  width: 8px; height: 5px;
  border-left: 2px solid var(--sky-solid);
  border-bottom: 2px solid var(--sky-solid);
  transform: rotate(-45deg);
}
.spotlight-shot { display: flex; justify-content: center; }
/* Framed in the same phone mockup as the hero so the status bar reads as a
   real device edge instead of a clipped screenshot corner. */
.spotlight-shot .device { width: min(300px, 100%); margin: 0; }

/* ========================================================================= */
/*  Feature grid (compact cards, cropped screenshot previews)                 */
/* ========================================================================= */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.feature-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.feature-card-body { padding: 30px 30px 24px; }

.feature-icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: color-mix(in srgb, var(--sky-solid) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--sky-solid) 28%, transparent);
  margin-bottom: 18px;
}
.feature-icon svg { stroke: var(--sky); }

.feature-card h3 {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 2.6vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.feature-card p { color: var(--body); margin: 0; max-width: 52ch; }

/* Top slice of the app screenshot, cropped by the card bottom. */
.feature-shot {
  margin-top: auto;
  height: clamp(300px, 34vw, 420px);
  padding: 28px 28px 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;   /* never stretch: keep the screenshot's aspect ratio */
  overflow: hidden;
}
.feature-shot img {
  width: min(400px, 94%);
  height: auto;
  border-radius: 22px 22px 0 0;
  border: 5px solid var(--stage);
  border-bottom: none;
  box-shadow: var(--shadow);
}

/* ========================================================================= */
/*  Callout bands (privacy / drills / final CTA)                              */
/* ========================================================================= */
.callout {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 28px;
  align-items: start;
  max-width: 900px;
}
.callout-icon {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  border-radius: 18px;
  background: color-mix(in srgb, var(--sky-solid) 14%, transparent);
  border: 1px solid var(--line);
}
.callout-icon svg { stroke: var(--sky); }
.callout h2 { margin-bottom: 16px; }
.callout p { color: var(--body); margin: 0 0 14px; max-width: 62ch; }
.callout p:last-child { margin-bottom: 0; }

.final-cta {
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 12px;
}
.final-cta .h-section { margin-bottom: 6px; }
.final-cta p { color: var(--muted); margin: 0 0 20px; }

/* ========================================================================= */
/*  Footer                                                                    */
/* ========================================================================= */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--ink-2);
  padding-block: clamp(44px, 7vw, 72px);
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 48px;
  align-items: flex-start;
  justify-content: space-between;
}
.footer-brand { max-width: 34ch; }
.footer-brand p { color: var(--muted); font-size: 0.9375rem; margin: 12px 0 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.footer-col h2 {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 0; }
.footer-col a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--body);
  text-decoration: none;
  font-weight: 500;
  transition: color 180ms ease;
}
.footer-col a:hover { color: var(--sky); }
.footer-legal {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

/* ========================================================================= */
/*  Document pages (privacy / support)                                        */
/* ========================================================================= */
.doc { padding-block: clamp(48px, 7vw, 88px); }
.doc-inner { max-width: 760px; margin: 0 auto; }
.doc h1 {
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.doc .updated { color: var(--muted); font-size: 0.9375rem; margin: 0 0 8px; }
.doc-intro { font-size: 1.1875rem; color: var(--body); margin: 24px 0 8px; }
.doc h2 {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 44px 0 14px;
  padding-top: 8px;
}
.doc h3 {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  margin: 28px 0 6px;
}
.doc p { margin: 0 0 16px; }
.doc ul { padding-left: 22px; margin: 0 0 18px; }
.doc li { margin-bottom: 10px; }
.doc a { font-weight: 500; }

.faq { margin-top: 8px; }
.faq h3 { color: var(--text); }
.faq p { color: var(--body); }

/* ========================================================================= */
/*  Responsive                                                                */
/* ========================================================================= */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; text-align: left; }
  .hero-device { transform: none; margin-top: 8px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .phase-block { grid-template-columns: 1fr; }
  .spotlight, .spotlight--reverse { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-shot { height: clamp(260px, 55vw, 340px); }
}

@media (max-width: 620px) {
  body { font-size: 1rem; }
  .site-header .wrap { padding-block: 6px; }
  .site-nav { gap: 0; }
  .site-nav a { padding: 6px 8px; font-size: 0.92rem; min-height: 40px; }
  .steps { grid-template-columns: 1fr; }
  .phase-strip { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .callout { grid-template-columns: 1fr; gap: 18px; }
  .store-cta { width: 100%; }
}

@media (max-width: 380px) {
  .device { width: min(260px, 88vw); }
}
