/* startiny landing — hand-rolled CSS, no framework, no build step.
   Designed to match the in-app palette (warm beige + sage accent)
   so users who hit the App Store after the landing page experience
   visual continuity, not a tonal shift.

   Color tokens mirror src/theme/colors.ts where possible:
   - canvas / surface / surfaceAlt: the warm-cream background family
   - text / textMuted: warm-dark foreground
   - calmAccent (#2F6E6D, sage): the brand accent
   - primary (#C96F3B, terracotta-amber): used sparingly for CTAs
*/

:root {
  --canvas: #F7F3EA;
  --surface: #FFFDF8;
  --surface-alt: #F4F0E7;
  --border: #E5E0D4;
  --text: #2B2622;
  --text-muted: #5C534C;
  --text-light: #9A8F84;
  --accent: #2F6E6D;       /* sage — calm */
  --accent-soft: #DDEAEA;
  --primary: #C96F3B;      /* terracotta-amber — CTAs only */
  --primary-on-dark: #FFFDF8;
  --error: #A94A3F;

  /* Spacing scale matches src/theme/spacing.ts (4 / 8 / 12 / 16 / 24 / 32 / 48). */
  --s-xs: 4px;
  --s-sm: 8px;
  --s-md: 12px;
  --s-lg: 16px;
  --s-xl: 24px;
  --s-xxl: 32px;
  --s-3xl: 48px;
  --s-4xl: 72px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Two typefaces max per the universal design rules. Headings use a
     warmer serif so the page doesn't look like every other SaaS
     landing page; body uses the system stack scaled to 17px so it
     reads at a calm pace, not a marketing pace. */
  --font-heading: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
}

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

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

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Visited link distinction (universal rule). */
a:visited { color: #4A5C5B; }

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

/* Visually hidden — accessible label / off-screen text.
   Source: WAI-ARIA Authoring Practices. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─────────────────────────────────────────────────────────────────
   Header. Brand on the left, single CTA on the right. Always 56pt
   tall — matches mobile Safari's default chrome. */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-md) var(--s-lg);
  max-width: 980px;
  margin: 0 auto;
}

.brand {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand-cta {
  display: inline-block;
  background: var(--accent);
  color: var(--primary-on-dark);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.brand-cta:visited { color: var(--primary-on-dark); }
.brand-cta:hover { background: #244D4C; }

/* ─────────────────────────────────────────────────────────────────
   Hero. First viewport reads as one composition: brand-toned
   headline > one supporting sentence > the form. No 3-column
   feature grid. The hero IS the conversion. */

main { max-width: 980px; margin: 0 auto; padding: 0 var(--s-lg); }

.hero {
  padding: var(--s-3xl) 0 var(--s-3xl);
  text-align: left;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text);
  text-wrap: balance;
  margin-bottom: var(--s-lg);
  max-width: 18ch;
}

.hero-sub {
  font-size: 19px;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 56ch;
  margin-bottom: var(--s-xl);
}

.hero-sub strong { color: var(--text); font-weight: 600; }
.hero-sub em { font-style: italic; color: var(--text); }

/* Waitlist form. Email + radio poll + button. Lives inside the
   hero so the conversion path is one viewport deep. */

.waitlist-form {
  display: flex;
  flex-direction: column;
  gap: var(--s-md);
  max-width: 480px;
}

.waitlist-form input[type="email"] {
  font-family: var(--font-body);
  font-size: 17px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  min-height: 50px;
  transition: border-color 0.15s ease;
}
.waitlist-form input[type="email"]:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.waitlist-form input[type="email"]::placeholder {
  color: var(--text-light);
}

.price-poll {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--s-md) var(--s-lg);
  background: var(--surface);
}

.price-poll legend {
  font-size: 14px;
  color: var(--text-muted);
  padding: 0 var(--s-xs);
  margin-left: -4px;
}
.price-poll legend strong { color: var(--text); font-weight: 600; }

.poll-option {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  padding: 8px 0;
  cursor: pointer;
  min-height: 36px;
}
.poll-option input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
}
.poll-option span {
  font-size: 15px;
  color: var(--text);
  line-height: 1.4;
}
.poll-option:hover span { color: var(--text); }

.primary-btn {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 600;
  background: var(--primary);
  color: var(--primary-on-dark);
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 24px;
  cursor: pointer;
  min-height: 50px;
  transition: background 0.15s ease, transform 0.05s ease;
}
.primary-btn:hover { background: #B5602F; }
.primary-btn:active { transform: translateY(1px); }
.primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.primary-btn:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 2px;
}

.form-note {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

.form-status {
  font-size: 14px;
  min-height: 1.4em;
}
.form-status-error { color: var(--error); }
.form-status-success { color: var(--accent); font-weight: 600; }

/* ─────────────────────────────────────────────────────────────────
   Promises section. Three articles, each a left-aligned text +
   right-aligned screenshot pair. Alternating layout (.promise-flip
   reverses on second one) avoids the SaaS 3-column-grid trap. */

.section-eyebrow {
  font-family: var(--font-body);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: var(--s-xl);
}

.promises {
  padding: var(--s-3xl) 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-3xl);
  border-top: 1px solid var(--border);
}

.promise {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--s-xxl);
  align-items: center;
}

.promise-flip {
  grid-template-columns: 280px 1fr;
}
.promise-flip .promise-figure { order: -1; }

.promise-text h3 {
  font-family: var(--font-heading);
  font-size: 28px;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: var(--s-md);
  letter-spacing: -0.01em;
}

.promise-text p {
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: var(--s-md);
}
.promise-text p strong { font-weight: 600; }
.promise-text p em { color: var(--accent); font-style: italic; }

.promise-detail {
  color: var(--text-muted);
  font-size: 16px;
}

.promise-figure {
  background: var(--surface-alt);
  border-radius: var(--radius-lg);
  padding: var(--s-lg);
  aspect-ratio: 1 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.promise-figure img {
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(43, 38, 34, 0.08);
  max-height: 100%;
}

/* ─────────────────────────────────────────────────────────────────
   Closer. Single-job section: tells late-scrollers when beta opens
   and points them back to the form. Centered because it's a
   declarative line, not a list. */

.closer {
  padding: var(--s-3xl) 0;
  border-top: 1px solid var(--border);
  text-align: center;
}
.closer h2 {
  font-family: var(--font-heading);
  font-size: clamp(28px, 4vw, 36px);
  letter-spacing: -0.01em;
  margin-bottom: var(--s-sm);
}
.closer p { color: var(--text-muted); }

/* ─────────────────────────────────────────────────────────────────
   FAQ. Three <details> elements. Native disclosure widget — no JS.
   ADHD users skim; the closed state is the default. */

.faq {
  padding: var(--s-3xl) 0;
  border-top: 1px solid var(--border);
}

.faq details {
  border-bottom: 1px solid var(--border);
  padding: var(--s-md) 0;
}
.faq details:last-of-type { border-bottom: none; }

.faq summary {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  padding: var(--s-sm) 0;
  position: relative;
  padding-right: 32px;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }

.faq details p {
  color: var(--text-muted);
  padding: 0 0 var(--s-md);
  max-width: 64ch;
}

/* ─────────────────────────────────────────────────────────────────
   Footer. Single line, centered, calm. */

.site-footer {
  text-align: center;
  padding: var(--s-xl) var(--s-lg) var(--s-3xl);
  font-size: 14px;
  color: var(--text-muted);
}
.site-footer a { color: var(--text-muted); }

/* ─────────────────────────────────────────────────────────────────
   Responsive — single breakpoint at 720px. Below: promise sections
   stack, hero shrinks, header CTA hides (the form is right there).
   Mobile is where this product lives, so this is the primary
   breakpoint, not a fallback. */

@media (max-width: 720px) {
  .hero { padding: var(--s-xl) 0 var(--s-xxl); }
  .promise,
  .promise-flip {
    grid-template-columns: 1fr;
    gap: var(--s-lg);
  }
  .promise-figure {
    max-width: 280px;
    margin: 0 auto;
  }
  .promise-flip .promise-figure { order: 0; }
  .brand-cta { display: none; } /* form is one scroll away — header CTA is redundant */
  .promises { gap: var(--s-xxl); }
}

/* ─────────────────────────────────────────────────────────────────
   prefers-reduced-motion. Respect it — disable the smooth-scroll
   and the small button transforms. */

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