/* ==========================================================================
   ALIYA waitlist — styles
   Mobile-first (designed at 390px), scales up to a 1080px content width.
   ========================================================================== */

/* ---------- Fonts (self-hosted, SIL Open Font License — see /fonts) ---------- */
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/Fraunces-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens (match the app) ---------- */
:root {
  --bg: #FFFFFF;
  --text: #202320;
  --text-2: #686B66;
  --text-3: #969892;
  --surface: #EEF3F7;
  --subtle: #F6F8FA;
  --border: #D7E1EC;
  --gold-surface: #F6F0D8;
  --gold: #C9A227;
  --green: #3F7D58;
  --success-bg: #E9F3EE;
  --error: #B3492F;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --radius-card: 24px;
  --radius-input: 16px;
  --gutter: 20px;
  --max: 1080px;
  --shadow-phone: 0 1px 2px rgba(32, 35, 32, 0.06), 0 24px 48px -16px rgba(32, 35, 32, 0.22);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }

a { color: inherit; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  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: 10;
  padding: 12px 18px;
  background: var(--text);
  color: #fff;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.container {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Type scale ---------- */
.display {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 32px;
  line-height: 1.12;
  letter-spacing: -0.01em;
}
.title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.005em;
}
.body-lg { font-size: 15px; line-height: 1.55; }
.label   { font-size: 13px; font-weight: 500; line-height: 1.4; }
.caption { font-size: 12px; line-height: 1.5; color: var(--text-2); }
.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
  line-height: 1.4;
}
.muted { color: var(--text-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.985); }
.btn-primary { background: var(--text); color: #fff; }
.btn-primary:hover { background: #343834; }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: #b9c7d6; }
.btn-block { width: 100%; }
.btn svg { flex: none; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--subtle);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
}
.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--text);
  text-decoration: none;
  padding: 12px 8px; /* 44px tap target */
}

/* ---------- Phone frame (CSS-drawn) ---------- */
/* One unit: a dark frame with an even inset, and a screen inside it.
   Set --phone-w to size it; the radii scale with it, and the screenshot
   keeps its exact proportions (720 x 1558), so nothing is ever cropped. */
.phone {
  --phone-w: 260px;
  --phone-inset: 6px;
  --phone-radius: calc(var(--phone-w) * 0.13);
  width: var(--phone-w);
  max-width: 100%;
  margin: 0 auto;
  padding: var(--phone-inset);
  background: var(--text);
  border-radius: var(--phone-radius);
  box-shadow: var(--shadow-phone);
}
.phone-screen {
  aspect-ratio: 720 / 1558;
  border-radius: calc(var(--phone-radius) - var(--phone-inset));
  overflow: hidden;
  background: #fff;
}
.phone-screen img {
  width: 100%;
  height: auto;
}

/* ---------- Hero ---------- */
.hero { padding: 28px 0 56px; }
.hero-grid { display: grid; gap: 40px; }
.hero-copy .eyebrow { margin-bottom: 12px; }
.hero-copy .display { margin-bottom: 12px; }
.hero-copy .lead { color: var(--text-2); max-width: 34em; }
.hero-copy .card { margin-top: 12px; }

/* Founding member offer badge (gold) */
.offer-badge {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 20px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--gold-surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}
.offer-badge svg { flex: none; margin-top: 2px; }
.thanks .offer-line { margin-top: 10px; color: var(--text); font-weight: 500; }
.hero-visual { display: flex; justify-content: center; }

/* ---------- Signup card ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 24px 20px;
}

.field { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.field-label,
.field legend {
  display: block;
  padding: 0;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.input {
  display: block;
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: #fff;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px; /* 16px stops iOS zooming on focus */
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: #b9c7d6; }
.input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.input[aria-invalid="true"] { border-color: var(--error); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 1px var(--error); }

/* Sister / Brother pills */
.choice-group { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { position: relative; }
.choice input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.choice input:hover + span { border-color: #b9c7d6; }
.choice input:checked + span { background: var(--text); border-color: var(--text); color: #fff; }
.choice input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 3px; }
.choice-group[aria-invalid="true"] .choice span { border-color: var(--error); }

/* Checkboxes */
.checks { display: grid; gap: 4px; margin-bottom: 18px; }
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  padding: 10px 0;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.45;
}
.check input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  border: 1.5px solid var(--text-2);
  border-radius: 7px;
  background: #fff center / 14px 14px no-repeat;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.check input:checked {
  background-color: var(--text);
  border-color: var(--text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3 7.4l2.6 2.6L11 4.4' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.check input:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.check input[aria-invalid="true"] { border-color: var(--error); }

.error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 6px;
  color: var(--error);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}
.error[hidden] { display: none; }
.error::before {
  content: "";
  flex: none;
  width: 14px; height: 14px;
  margin-top: 2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='7' fill='none' stroke='%23B3492F' stroke-width='1.6'/%3E%3Cpath d='M8 4.5v4.2' stroke='%23B3492F' stroke-width='1.6' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='11.3' r='1' fill='%23B3492F'/%3E%3C/svg%3E") no-repeat;
}
.check + .error { margin: -4px 0 6px 34px; }

.form-error-summary {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--error);
  color: var(--error);
  font-size: 13px;
  font-weight: 500;
}
.form-error-summary[hidden] { display: none; }

.form-note { margin-top: 12px; text-align: center; }
.form-note a { color: var(--text); font-weight: 500; }

.btn[aria-busy="true"] { opacity: .7; cursor: progress; }

/* Thank-you state */
.thanks { text-align: center; padding: 12px 4px 4px; }
.thanks[hidden] { display: none; }
.thanks-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--green);
}
.thanks .title { margin-bottom: 8px; outline: none; }
.thanks p { color: var(--text-2); max-width: 26em; margin: 0 auto; }
.thanks-actions { display: grid; gap: 10px; margin-top: 22px; }
.copy-status { min-height: 18px; margin-top: 10px; color: var(--green); font-weight: 500; }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-alt { background: var(--subtle); }
.section-head { margin-bottom: 28px; max-width: 36em; }
.section-head .eyebrow { margin-bottom: 10px; }
.section-head p { margin-top: 10px; color: var(--text-2); }

/* How it works */
.steps { display: grid; gap: 12px; counter-reset: step; }
.step {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: #fff;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
}
.step-num {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gold-surface);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}

/* The Sitting — carousel on phones, row on desktop */
.stages {
  display: flex;
  gap: 16px;
  padding: 4px 0 28px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.stages::-webkit-scrollbar { display: none; }
.stages:focus-visible { outline-offset: -2px; border-radius: 0; }
.stage {
  flex: 0 0 76%;
  max-width: 300px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.stage .phone { --phone-w: 240px; }
.stage figcaption { margin-top: 22px; max-width: 280px; }
.stage .eyebrow { margin-bottom: 6px; }
.stage h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.25;
  margin-bottom: 6px;
}
.stage p { color: var(--text-2); }

.swipe-hint {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: -8px;
}
.swipe-hint span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--border);
  transition: background-color .2s ease, width .2s ease;
}
.swipe-hint span.is-active { background: var(--text); width: 18px; border-radius: 3px; }

.sitting-line {
  margin-top: 28px;
  text-align: center;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.35;
}

/* Built on trust */
.trust-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.trust-item {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 16px;
  border-radius: var(--radius-card);
  background: var(--surface);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}
.trust-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gold-surface);
  color: var(--text);
}

/* FAQ */
.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 14px 0;
  cursor: pointer;
  list-style: none;
  font-size: 15px;
  font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 3.5v9M3.5 8h9' stroke='%23202320' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / 14px no-repeat;
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 48px 20px 0; color: var(--text-2); font-size: 15px; }

/* ---------- Footer ---------- */
.site-footer {
  padding: 40px 0 48px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.site-footer .wordmark { display: inline-block; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 20px;
  margin: 8px 0 12px;
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  color: var(--text);
}

/* ---------- Privacy page ---------- */
.prose { max-width: 680px; margin: 0 auto; padding: 32px 0 64px; }
.prose .back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
}
.prose .back:hover { color: var(--text); }
.prose h1 { margin-bottom: 8px; }
.prose .updated { margin-bottom: 28px; }
.prose h2 {
  margin: 28px 0 8px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
}
.prose p { font-size: 15px; color: var(--text); }
.prose p + p { margin-top: 10px; }
.prose .card { margin-top: 32px; }

/* ==========================================================================
   Phones only (under 600px)
   ========================================================================== */
@media (max-width: 599px) {
  /* The Sitting carousel: phones ~15% smaller so phone + caption fit one screen */
  .stage .phone { --phone-w: 204px; }
}

/* ==========================================================================
   Larger screens
   ========================================================================== */
@media (min-width: 600px) {
  :root { --gutter: 32px; }
  .card { padding: 28px; }
  .thanks-actions { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .stage { flex-basis: 46%; }
}

@media (min-width: 900px) {
  .display { font-size: 46px; }
  .title { font-size: 30px; }
  .site-header .container { height: 72px; }

  .hero { padding: 56px 0 88px; }
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: center;
    gap: 64px;
  }
  .hero-copy { max-width: 520px; }
  .hero-copy .card { margin-top: 14px; }
  .offer-badge { margin-top: 24px; }
  .hero-visual .phone { --phone-w: 300px; }

  .section { padding: 88px 0; }
  .section-head { margin-bottom: 40px; }

  .steps { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .step {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 24px;
  }

  .stages {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin: 0;
    padding: 4px 0 8px;
    overflow: visible;
  }
  .stage { max-width: none; }
  .stage .phone { --phone-w: 260px; }
  .swipe-hint { display: none; }
  .sitting-line { margin-top: 48px; font-size: 24px; }

  .trust-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .trust-item { padding: 24px; }

  .faq { max-width: 760px; }
}
