/* ============================================================================
   SafeCheck Daily — marketing site
   Editorial / warm. Flat color only (no UI gradients). Mobile-first.
   ============================================================================ */

:root {
  /* Brand palette — flat */
  --cream:   #FFF8EC;
  --cream-2: #FFF3E0;
  --honey:   #FBCB6E;
  --amber:   #EDA340;
  --caramel: #BE742C;
  --gold:    #E6AE5C;
  --ink:     #34231A;
  --ink-2:   #4A3020;

  /* AA-safe accents on cream: small text needs 4.5:1, so accent text is a deeper
     caramel; the amber CTA carries ink text (7:1) rather than washed cream (2:1). */
  --accent-text: #9A5618;   /* 5.4:1 on cream — kicker, links */
  --amber-hover: #C77E2A;   /* CTA hover, 4.6:1 with ink text */

  /* Derived (solid/translucent helpers, never gradients) */
  --rule:        rgba(52, 35, 26, 0.14);
  --rule-strong: rgba(52, 35, 26, 0.26);
  --rule-light:  rgba(255, 248, 236, 0.18);
  --error:       #9A2F22;

  /* Type */
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-body: 'Hanken Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --step-hero: clamp(2.7rem, 8.6vw, 5.4rem);
  --step-h2:   clamp(2rem, 5.6vw, 3.3rem);
  --step-h3:   clamp(1.3rem, 3.2vw, 1.7rem);
  --step-lead: clamp(1.12rem, 2.4vw, 1.4rem);
  --step-body: 1.0625rem;          /* 17px */
  --step-small: 0.86rem;
  --numeral:   clamp(3.6rem, 13vw, 7.2rem);

  --measure: 60ch;
  --pad: clamp(1.25rem, 5vw, 2rem);          /* page side padding */
  --section-y: clamp(4.5rem, 11vw, 9rem);    /* vertical section rhythm */
  --maxw: 1200px;
}

/* ---- 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; } }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-body);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-variation-settings: 'SOFT' 40;
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.012em;
  line-height: 1.04;
  text-wrap: balance;
}
p { margin: 0; }

/* ---- Layout --------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }
.measure { max-width: var(--measure); }
.section { padding-block: var(--section-y); }
.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }

.kicker {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0;
}

/* Accessibility */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--cream); padding: 0.75rem 1rem; border-radius: 8px;
}
.skip:focus { left: var(--pad); top: 0.6rem; }
:focus-visible { outline: 3px solid var(--caramel); outline-offset: 3px; border-radius: 2px; }
.dark :focus-visible { outline-color: var(--honey); }

/* ---- Header --------------------------------------------------------------- */
.site-header { padding-block: clamp(1rem, 3vw, 1.5rem); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.brand img { width: 38px; height: 38px; border-radius: 9px; }
.brand span {
  font-family: var(--font-display); font-weight: 600; font-size: 1.16rem;
  letter-spacing: -0.01em; font-variation-settings: 'SOFT' 40;
}
.nav-link {
  font-weight: 600; font-size: 0.95rem; text-decoration: none; color: var(--ink-2);
  border-bottom: 2px solid transparent; padding-bottom: 2px; white-space: nowrap;
}
.nav-link:hover { border-color: var(--amber); color: var(--ink); }
.header-cta { display: none; }

/* ---- Hero ----------------------------------------------------------------- */
.hero { padding-top: clamp(1.5rem, 5vw, 3rem); padding-bottom: var(--section-y); }
.hero h1 { font-size: var(--step-hero); margin-top: 0.9rem; }
.hero h1 .line { display: block; }
.hero h1 .em { font-style: italic; font-weight: 400; color: var(--ink-2); }
.hero .lead {
  font-size: var(--step-lead); color: var(--ink-2); line-height: 1.55;
  margin-top: 1.4rem; max-width: 46ch;
}

/* Waitlist block — flat, bordered, no shadow/blur */
.waitlist {
  background: var(--cream-2);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--amber);
  border-radius: 12px;
  padding: clamp(1.25rem, 4.5vw, 1.9rem);
  margin-top: 2rem;
  max-width: 480px;
}
.waitlist .form-row { display: grid; gap: 1rem; }
.field { display: block; }
.field label {
  display: block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-2); margin-bottom: 0.4rem;
}
.field input {
  width: 100%; font-family: var(--font-body); font-size: 1.0625rem; /* >=16px: no iOS zoom */
  color: var(--ink); background: var(--cream);
  border: 1.5px solid var(--rule-strong); border-radius: 9px;
  padding: 0.85rem 0.95rem; min-height: 54px;
  transition: border-color 0.18s ease;
}
.field input::placeholder { color: rgba(74, 48, 32, 0.5); }
.field input:focus { border-color: var(--caramel); outline: 2px solid var(--caramel); outline-offset: 1px; }
.field.invalid input { border-color: var(--error); }
.field .error { display: none; color: var(--error); font-size: 0.85rem; font-weight: 500; margin-top: 0.4rem; }
.field.invalid .error { display: block; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; } /* honeypot */

.btn {
  appearance: none; cursor: pointer; width: 100%;
  font-family: var(--font-body); font-weight: 700; font-size: 1.0625rem; letter-spacing: 0.005em;
  color: var(--ink); background: var(--amber);
  border: none; border-radius: 9px; padding: 1rem 1.4rem; min-height: 54px;
  transition: background 0.18s ease, transform 0.12s ease;
}
.btn:hover { background: var(--amber-hover); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.65; cursor: default; }

.microcopy { font-size: var(--step-small); color: var(--ink-2); margin-top: 0.9rem; }

/* Success state */
.waitlist-done { display: flex; gap: 0.9rem; align-items: flex-start; }
.waitlist-done .mark {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--amber); color: var(--cream);
  display: grid; place-items: center; font-size: 1.3rem; font-weight: 700;
}
.waitlist-done h3 { font-size: 1.4rem; margin-bottom: 0.25rem; }
.waitlist-done h3:focus, .waitlist-done h3:focus-visible { outline: none; } /* programmatic focus target */
.waitlist-done p { color: var(--ink-2); font-size: 0.98rem; }

/* ---- Origin story (essay) ------------------------------------------------- */
.origin { background: var(--cream-2); border-block: 1px solid var(--rule); }
.origin h2 { font-size: var(--step-h2); max-width: 16ch; }
.origin .essay {
  font-size: clamp(1.18rem, 2.6vw, 1.55rem); line-height: 1.6; color: var(--ink-2);
  max-width: 38ch; margin-top: 1.6rem;
}
.origin .essay em { font-family: var(--font-display); font-style: italic; color: var(--ink); font-weight: 500; }
/* tasteful editorial drop cap */
.origin .essay.lede::first-letter {
  font-family: var(--font-display); font-weight: 500;
  float: left; font-size: 3.6em; line-height: 0.74; padding-right: 0.08em; margin-top: 0.06em;
  color: var(--caramel);
}

/* ---- How it works (numbered editorial) ------------------------------------ */
.steps h2 { font-size: var(--step-h2); max-width: 14ch; margin-bottom: clamp(2rem, 6vw, 3.5rem); }
.step { padding-block: clamp(2rem, 5vw, 2.75rem); border-top: 1px solid var(--rule); }
.step:last-of-type { border-bottom: 1px solid var(--rule); }
.step .num {
  font-family: var(--font-display); font-weight: 400; font-variation-settings: 'SOFT' 50;
  font-size: var(--numeral); line-height: 0.8; color: var(--caramel);
  display: block; letter-spacing: -0.02em;
}
.step .step-body { margin-top: 0.9rem; }
.step h3 { font-size: var(--step-h3); margin-bottom: 0.55rem; }
.step p { color: var(--ink-2); max-width: 48ch; }

/* ---- The Stance (dark editorial spread) ----------------------------------- */
.stance { background: var(--ink); color: var(--cream); }
.stance h2 { font-size: var(--step-h2); color: var(--cream); max-width: 18ch; }
.stance .accent { width: 64px; height: 3px; background: var(--amber); border: 0; margin: 0 0 1.8rem; }
.stance p { color: rgba(255, 248, 236, 0.82); max-width: 56ch; margin-top: 1.5rem; font-size: var(--step-lead); line-height: 1.6; }
.stance p .hi { color: var(--honey); font-style: italic; font-family: var(--font-display); }

/* ---- Closing CTA ---------------------------------------------------------- */
.closing { background: var(--cream-2); border-top: 1px solid var(--rule); }
.closing h2 { font-size: var(--step-h2); max-width: 16ch; }
.closing .waitlist { background: var(--cream); }
.closing .after { font-size: var(--step-small); letter-spacing: 0.04em; color: var(--ink-2); margin-top: 1.4rem; }

/* ---- Footer --------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--rule); padding-block: clamp(2.5rem, 6vw, 4rem); }
.site-footer .wrap { display: flex; flex-direction: column; gap: 1.6rem; }
.footer-brand { display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none; color: var(--ink); }
.footer-brand img { width: 30px; height: 30px; border-radius: 7px; }
.footer-brand span { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.4rem; align-items: center; }
.footer-links a { font-weight: 600; text-decoration: none; color: var(--ink-2); border-bottom: 2px solid transparent; padding-bottom: 1px; }
.footer-links a:hover { border-color: var(--amber); color: var(--ink); }
.footer-meta { font-size: var(--step-small); color: var(--ink-2); }
.footer-meta .made { display: block; margin-top: 0.4rem; letter-spacing: 0.04em; }

/* ---- Legal pages ---------------------------------------------------------- */
.legal { padding-block: clamp(3rem, 8vw, 5.5rem); }
.legal .doc { max-width: 70ch; }
.legal .back { font-weight: 600; text-decoration: none; color: var(--accent-text); font-size: 0.95rem; }
.legal .back:hover { text-decoration: underline; }
.legal h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); margin-top: 1.2rem; }
.legal .updated { color: var(--ink-2); font-size: var(--step-small); letter-spacing: 0.04em; margin-top: 0.8rem; }
.legal h2 { font-size: clamp(1.3rem, 3vw, 1.65rem); margin-top: 2.6rem; margin-bottom: 0.7rem; }
.legal p, .legal li { color: var(--ink-2); }
.legal p { margin-top: 0.9rem; }
.legal ul { margin: 0.9rem 0 0; padding-left: 1.2rem; }
.legal li { margin-top: 0.5rem; }
.legal p a, .legal li a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.legal .note {
  margin-top: 2.8rem; padding: 1.1rem 1.25rem; background: var(--cream-2);
  border: 1px solid var(--rule); border-left: 3px solid var(--amber); border-radius: 8px;
  font-size: 0.95rem; color: var(--ink-2);
}

/* ---- Motion: a single fade/rise (hero on load; sections on first view) ----- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes riseIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
  /* Hero — pure CSS, no JS dependency, staggered */
  .hero .rise { animation: riseIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: var(--d, 0ms); }
  /* Sections — gated behind .js so content is never hidden without JS */
  .js .reveal { opacity: 0; transform: translateY(16px); }
  .js .reveal.in { opacity: 1; transform: none; transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); }
}

/* ============================================================================
   Breakpoints — enhance the mobile layout upward
   ============================================================================ */
@media (min-width: 600px) {
  .waitlist .form-row.two { grid-template-columns: 1fr 1fr; }
  .waitlist .form-row .field.full, .waitlist .btn { grid-column: 1 / -1; }
  .header-cta { display: inline-block; }
}

@media (min-width: 900px) {
  .hero .hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
  .hero .waitlist { margin-top: 0.4rem; }
  .hero .lead { margin-bottom: 0; }

  .origin .origin-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
  .origin .essay { margin-top: 0; max-width: 46ch; }

  .step { display: grid; grid-template-columns: clamp(7rem, 12vw, 10rem) 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
  .step .step-body { margin-top: 0; }

  .stance .stance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
  .stance p { margin-top: 0; }

  .closing .closing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }

  .site-footer .wrap { flex-direction: row; justify-content: space-between; align-items: flex-end; }
  .footer-left { display: flex; flex-direction: column; gap: 1rem; }
}

@media (min-width: 1200px) {
  .hero h1 { letter-spacing: -0.018em; }
}
