/* Speak Easy by Sunday — cream/gold, loosely matching the app. Legal-pages
   simple: readable typography, one accent, responsive. No framework. */
:root {
  --cream: #faf5e8;
  --cream-50: #fffdf6;
  --gold: #c9a227;
  --gold-dark: #a8851c;
  --ink: #33302a;
  --ink-soft: #6b665c;
  --line: rgba(168, 133, 28, 0.22);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--gold-dark); }
a:hover { color: var(--gold); }

/* Header */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--cream-50);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--gold-dark);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 1.9rem;
  height: 1.9rem;
  flex: none;
  border-radius: 8px;
  display: block;
}
.brand span { font-weight: 600; color: var(--ink-soft); }
.site-header nav { display: flex; gap: 1.25rem; }
.site-header nav a {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.site-header nav a[aria-current="page"] { color: var(--gold-dark); }

/* Main */
main { flex: 1; width: 100%; }

/* Landing hero */
.hero {
  max-width: 40rem;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 3rem;
  text-align: center;
}
.hero .mark { font-size: 3.5rem; line-height: 1; }
.hero h1 {
  margin: 1rem 0 0.5rem;
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  color: var(--gold-dark);
  letter-spacing: -0.02em;
}
.hero h1 span { display: block; font-size: 0.5em; font-weight: 600; color: var(--ink-soft); margin-top: 0.35rem; }
.hero .tagline { font-size: 1.15rem; color: var(--ink); margin: 1rem auto 2rem; max-width: 34rem; }
.hero .badge {
  display: inline-block;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold-dark);
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--cream-50);
}

/* Document pages (privacy, support, 404) */
.doc {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3.5rem;
}
.doc h1 {
  font-size: clamp(1.6rem, 4.5vw, 2.2rem);
  color: var(--gold-dark);
  letter-spacing: -0.015em;
  margin: 0 0 0.5rem;
}
.doc h2 {
  font-size: 1.25rem;
  color: var(--ink);
  margin: 2.25rem 0 0.5rem;
  padding-top: 0.5rem;
}
.doc a.contact { font-size: 1.15rem; font-weight: 700; }

/* Privacy policy specifics */
.policy > h1 + p strong { color: var(--ink); }
.policy blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--cream-50);
  border-left: 4px solid var(--gold);
  border-radius: 0 12px 12px 0;
}
.policy blockquote p { margin: 0; }
.policy hr { border: none; border-top: 1px solid var(--line); margin: 2rem 0; }
.policy ul { padding-left: 1.25rem; }
.policy li { margin: 0.35rem 0; }
.policy strong { color: var(--ink); }

/* Tables — scroll horizontally on small screens rather than overflow the page */
.policy table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.95rem;
  display: block;
  overflow-x: auto;
}
.policy th, .policy td {
  border: 1px solid var(--line);
  padding: 0.6rem 0.8rem;
  text-align: left;
  vertical-align: top;
}
.policy th { background: var(--cream-50); color: var(--gold-dark); }

/* Trailing italic disclaimer note */
.policy > p:last-child em { color: var(--ink-soft); font-size: 0.9rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
  background: var(--cream-50);
}
.site-footer p { margin: 0.25rem 0; }

@media (prefers-color-scheme: dark) {
  /* Keep the cream identity — this is a brand page, not a themed app. No dark
     inversion; the cream palette is the point. */
}

/* ═══════════════════════════════════════════════════════════════════════════
   LANDING PAGE (/ and /es)
   Everything below is scoped to body.landing so the legal pages above are
   completely unaffected by it.
   ═══════════════════════════════════════════════════════════════════════════ */

body.landing {
  --night: #05070d;              /* matches the rendered sky, so the hero has no seam */
  /* The brand gold (#a8851c) is only 3.41:1 on cream — under the 4.5:1 floor for
     small text. This darker gold reads as the same colour at a glance but clears
     4.8:1. Scoped to the landing so the legal pages stay byte-for-byte as shipped. */
  --gold-text: #8a6e15;
  display: block;
  background: var(--cream);
}

/* Header sits OVER the dark hero and scrolls away with it (absolute, not fixed):
   a fixed header would carry cream-on-cream text into the sections below. */
.landing-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1.25rem 1.5rem;
}
.landing-header .brand { color: var(--cream); text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6); }
.landing-header .brand span { color: rgba(250, 245, 232, 0.72); }
.landing-header nav { display: flex; align-items: center; gap: 1.25rem; }
.landing-header nav a {
  color: rgba(250, 245, 232, 0.82);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
}
.landing-header nav a:hover { color: var(--cream-50); }
.lang-toggle {
  border: 1px solid rgba(250, 245, 232, 0.45);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.85rem !important;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
/* The container's own height IS the scrub length. S9 injects a sticky stage as
   the first child; .hero-copy sticks on top of it. */
.hero-scrub {
  position: relative;
  height: 420vh;
  background: var(--night);
}
.hero-copy {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1.5rem;
  /* Let scroll/drag pass through to the page; the CTA opts back in below. */
  pointer-events: none;
}
.hero-copy > * { max-width: 30rem; position: relative; z-index: 1; }

/* Contrast scrim. At fullness the moon is a bright cream disc directly behind the
   copy, and gold-on-cream is unreadable — text-shadow alone does not save it. A
   soft radial pool of night behind the text block keeps the type legible while
   leaving the moon's limb and the surrounding stars untouched. */
.hero-copy::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 46% 30% at 50% 47%,
    rgba(5, 7, 13, 0.55) 0%,
    rgba(5, 7, 13, 0.34) 50%,
    rgba(5, 7, 13, 0.10) 75%,
    transparent 88%
  );
}
.hero-scrub.is-static .hero-copy::before { background: rgba(5, 7, 13, 0.55); }
/* Static (reduced-motion) hero is a single 100vh screen with all copy already shown,
   so the cue still points the way down — just without the motion. */
.hero-scrub.is-static .scroll-cue { animation: none; }

/* No-JS: show all hero copy immediately. The inline head script adds .js, and only
   THEN do we hide the overlays for the scrub to reveal — so a JS failure degrades
   to a readable page rather than an empty black screen. */
.js .hero-copy [data-overlay] { opacity: 0; transform: translateY(2rem); }
/* S9 writes opacity every tick (smooth) but flips transform as a binary step —
   transitioning transform ONLY smooths that step without fighting the scrub. */
.hero-copy [data-overlay] { transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1); }

#hero-title {
  margin: 0;
  font-size: clamp(2.4rem, 9vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--cream-50);
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.55);
}
.hero-tagline {
  margin: 1rem 0 0;
  font-size: clamp(1.1rem, 3.6vw, 1.5rem);
  font-weight: 600;
  color: var(--cream);
  text-shadow: 0 1px 20px rgba(0, 0, 0, 0.6);
}
.hero-subtitle {
  margin: 0.65rem 0 0;
  font-size: clamp(0.95rem, 2.8vw, 1.1rem);
  /* Lighter than --gold: the brand gold is mid-tone and vanishes against the cream
     moon behind it. This keeps the gold read while staying legible at fullness. */
  color: #e8cd82;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 3px rgba(5, 7, 13, 0.9), 0 1px 16px rgba(0, 0, 0, 0.7);
}
.hero-cta { margin-top: 2rem; pointer-events: auto; }
.appstore-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Sized to an App Store badge so dropping the real one in causes no reflow. */
  min-width: 12rem;
  min-height: 3rem;
  padding: 0.5rem 1.4rem;
  border: 1px solid rgba(201, 162, 39, 0.85);
  border-radius: 12px;
  /* Opaque enough to hold its own over the full moon, since the scrim is now light. */
  background: rgba(5, 7, 13, 0.72);
  backdrop-filter: blur(6px);
  color: #e8cd82;
  font-weight: 700;
  font-size: 0.95rem;
}
/* Scroll cue — the "this page is alive, keep going" affordance. Absolutely
   positioned on .hero-scrub (NOT inside .hero-copy, which is off-screen at scroll 0),
   pinned to the bottom of the first viewport so it shows the instant the page loads,
   then scrolls away with the hero. z-index 3 keeps it above the moon stage. */
.scroll-cue {
  position: absolute;
  top: calc(100vh - 5.75rem);
  top: calc(100dvh - 5.75rem);   /* dvh: clears mobile browser chrome */
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: rgba(250, 245, 232, 0.92);
  /* Gentle entrance so it reads as deliberate, not a flash of leftover markup. */
  animation: cue-rise 0.8s 0.35s ease both;
}
.scroll-cue__label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.75), 0 0 2px rgba(0, 0, 0, 0.6);
  /* Slow breathing glow — the primary "alive" signal in the dark space. */
  animation: cue-glow 2.8s ease-in-out infinite;
}
.scroll-cue__chev {
  display: block;
  width: 1.75rem;
  height: 1rem;
  color: #e6c765;              /* brand gold-light, legible over the moon */
  filter: drop-shadow(0 1px 8px rgba(0, 0, 0, 0.55));
  animation: cue-bob 1.9s ease-in-out infinite;
}
.scroll-cue__chev svg { width: 100%; height: 100%; display: block; }
.scroll-cue:hover { color: var(--cream-50); }
.scroll-cue:hover .scroll-cue__chev { color: var(--gold-light, #e6c765); }
@keyframes cue-bob  { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(7px); } }
@keyframes cue-glow { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }
@keyframes cue-rise { from { opacity: 0; transform: translateY(0.9rem); } to { opacity: 1; transform: none; } }

/* Reduced motion: no scrub, no video decode — one static full moon. */
.hero-scrub.is-static {
  height: 100vh;
  background: var(--night) url('/moon-full.jpg') center / cover no-repeat;
}
.hero-scrub.is-static .hero-hint { display: none; }

/* ── Story sections ───────────────────────────────────────────────────────── */
.story {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  max-width: 68rem;
  margin: 0 auto;
  padding: clamp(4rem, 11vw, 8rem) 1.5rem;
}
.story--flip .story-text { order: 2; }
.story .eyebrow {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-text);
}
.story h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 4.2vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}
.story p { margin: 0; font-size: 1.05rem; color: var(--ink); }
.story em { font-style: normal; font-weight: 700; color: var(--gold-text); }

.story-shot { display: flex; justify-content: center; }
.story-shot img {
  width: 100%;
  max-width: 17rem;
  height: auto;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--cream-50);
  box-shadow: 0 18px 50px -20px rgba(58, 46, 18, 0.45);
}

/* ── Browser-access waitlist ──────────────────────────────────────────────── */
.web-cta {
  max-width: 40rem;
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 5.5rem) 1.5rem clamp(3.5rem, 9vw, 6rem);
  text-align: center;
}
.web-cta .eyebrow {
  margin: 0 0 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-text);
}
.web-cta h2 {
  margin: 0 0 0.9rem;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.web-cta__body { margin: 0 auto 1.75rem; max-width: 34rem; font-size: 1.05rem; color: var(--ink); }
.web-form {
  display: flex;
  gap: 0.6rem;
  max-width: 27rem;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}
.web-form__input {
  flex: 1 1 14rem;
  min-width: 0;
  padding: 0.85rem 1.1rem;
  font-size: 1rem;
  color: var(--ink);
  background: var(--cream-50);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
}
.web-form__input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18); }
.web-form__btn {
  flex: 0 0 auto;
  padding: 0.85rem 1.6rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--cream-50);
  background: var(--gold-dark);
  border: 1px solid var(--gold-dark);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}
.web-form__btn:hover { background: var(--gold); border-color: var(--gold); }
.web-form__btn:active { transform: translateY(1px); }
.web-cta__note { margin: 1rem auto 0; font-size: 0.9rem; color: var(--ink-soft); }
.web-cta__note a { font-weight: 600; color: var(--gold-text); }
.web-cta.is-success .web-cta__body,
.web-cta.is-success .web-form { display: none; }
.web-cta__success {
  margin: 0.5rem auto 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold-text);
}
.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;
}

.reveal { opacity: 0; transform: translateY(1.5rem); }
.reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.landing-footer {
  border-top: 1px solid var(--line);
  background: var(--cream-50);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.landing-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}
.landing-footer nav a { font-weight: 600; text-decoration: none; color: var(--gold-text); }
.landing-footer nav a:hover { text-decoration: underline; }
.landing-footer .built { margin: 0 0 0.35rem; font-weight: 600; color: var(--gold-text); }
.landing-footer .legal { margin: 0; font-size: 0.85rem; }
/* Attribution, not a headline — quiet, but present on every page. Kept quiet with
   SIZE only: an opacity of 0.75 computed to #908c83 on cream, which is 3.29:1 and
   fails the 4.5:1 floor. Full-strength --ink-soft measures 5.7:1. */
.landing-footer .credit { margin: 0.5rem 0 0; font-size: 0.78rem; }

@media (max-width: 720px) {
  .story { grid-template-columns: 1fr; }
  /* Text always leads on mobile — the alternating order only reads on two columns. */
  .story--flip .story-text { order: 0; }
  .story-shot img { max-width: 14rem; }
  .landing-header { padding: 1rem; }
  .landing-header nav { gap: 0.9rem; }
  /* Phones get the portrait master here too — same reason the scrub does. */
  .hero-scrub.is-static { background-image: url('/moon-portrait-full.jpg'); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.is-in { opacity: 1; transform: none; transition: none; }
  .hero-copy [data-overlay] { transition: none; }
  .scroll-cue, .scroll-cue__label, .scroll-cue__chev { animation: none; }
}
