/* ------------------------------------------------------------------
   Firstlight — launch page styles
   Clinical editorial: matches the desktop app design system.
   Paper white, ink text, one teal action color, amber horizon accent.
------------------------------------------------------------------- */

:root {
  --bg:          #faf9f5;   /* paper */
  --bg-shade:    #f3f1ea;   /* shaded paper for alternating sections */
  --bg-deep:     #212722;   /* ink — closing band */
  --surface:     #ffffff;
  --ink:         #212722;
  --ink-soft:    #5d655f;
  --ink-faint:   #899088;
  --accent:      #166156;   /* deep teal — the one action color */
  --accent-strong: #0e463e;
  --line:        #e5e2d9;
  --line-strong: #d2cfc4;
  --horizon:     #c98a2b;   /* amber horizon — brand mark only */
  --radius:      6px;

  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #1d201d;
    --bg-shade:    #232723;
    --bg-deep:     #141714;
    --surface:     #242824;
    --ink:         #ecefe9;
    --ink-soft:    #b3bab2;
    --ink-faint:   #848b84;
    --accent:      #5eb3a4;
    --accent-strong: #7cc6b8;
    --line:        #353a35;
    --line-strong: #454b45;
    --horizon:     #d99c43;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.narrow { max-width: 720px; }

h1, h2, h3, figcaption {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.25rem);
  line-height: 1.15;
  margin: 0 0 0.75rem;
}

a { color: var(--accent); }
a:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.muted { color: var(--ink-soft); font-weight: 400; }

/* ---------- Top bar ---------- */

.topbar {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}
.wordmark {
  position: relative;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--ink);
  text-decoration: none;
  padding-top: 8px;
}
.wordmark::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1px;
  width: 30px;
  height: 2px;
  background: var(--horizon);
}
.topbar nav {
  display: flex;
  gap: 1.5rem;
}
.topbar nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.9rem;
}
.topbar nav a:hover { color: var(--ink); }

/* ---------- Hero ---------- */

.hero {
  padding: clamp(4rem, 10vw, 7rem) 0 clamp(3.5rem, 8vw, 6rem);
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  max-width: 820px;
  text-align: center;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin: 0 0 1.5rem;
}
h1 {
  font-size: clamp(2.3rem, 1.4rem + 4.2vw, 3.9rem);
  line-height: 1.08;
  margin: 0 0 1.5rem;
}
.lede {
  font-size: clamp(1.0325rem, 1rem + 0.3vw, 1.175rem);
  color: var(--ink-soft);
  max-width: 42em;
  margin: 0 auto 2.25rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}
.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
}
.btn-primary:hover {
  background: #000000;
  border-color: #000000;
}
@media (prefers-color-scheme: dark) {
  .btn-primary { background: var(--ink); color: var(--bg-deep); }
  .btn-primary:hover { background: #ffffff; border-color: #ffffff; }
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { border-color: var(--ink-soft); }

.hero-note {
  margin: 1.5rem 0 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ink-faint);
}

/* ---------- Sections shared ---------- */

section {
  padding: clamp(3.5rem, 8vw, 5.5rem) 0;
}
.section-lede {
  color: var(--ink-soft);
  font-size: 1.0625rem;
  margin: 0 0 2.5rem;
  max-width: 40em;
}

/* ---------- Story ---------- */

.story {
  background: var(--bg-shade);
  border-bottom: 1px solid var(--line);
}
.story h2 { margin-bottom: 1.5rem; }
.story-body p {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.7;
  margin: 0 0 1.25rem;
  color: var(--ink);
}
.story-body strong { font-weight: 600; }

.promise {
  margin: 2.5rem 0 0;
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  background: var(--surface);
  border-radius: var(--radius);
}
.promise blockquote {
  margin: 0 0 0.75rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.55;
}
.promise figcaption {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* ---------- How it works ---------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.steps li {
  padding: 1.6rem 1.4rem;
}
.steps li + li {
  border-left: 1px solid var(--line);
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem;
  height: 1.7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 0.9rem;
}
.steps h3 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
  line-height: 1.3;
}
.steps p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

/* ---------- Sources ---------- */

.sources {
  background: var(--bg-shade);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.source-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.source-grid li {
  padding: 1.4rem;
}
.source-grid li + li {
  border-left: 1px solid var(--line);
}
.source-grid h3 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}
.source-grid p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.sources-note {
  margin: 1.75rem 0 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ink-faint);
}

/* ---------- Privacy ---------- */

.narrow-lede { max-width: 44em; }

.privacy-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem 3rem;
}
.privacy-grid li {
  border-top: 1px solid var(--line-strong);
  padding-top: 1.1rem;
}
.privacy-grid h3 {
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
}
.privacy-grid p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* ---------- Safety ---------- */

.safety { padding-top: 0; }
.safety-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 4vw, 2.5rem);
}
.safety-box h2 {
  font-size: clamp(1.4rem, 1.2rem + 1vw, 1.75rem);
}
.safety-box ul {
  margin: 1.25rem 0;
  padding-left: 1.25rem;
}
.safety-box li {
  margin-bottom: 0.625rem;
  color: var(--ink-soft);
}
.safety-box li strong { color: var(--ink); }
.safety-final {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  margin: 1.5rem 0 0;
}

/* ---------- Closing ---------- */

.closing {
  background: var(--bg-deep);
  color: #ecefe9;
}
.closing-inner { text-align: center; }
.closing h2 { color: #f5f6f2; }
.closing p {
  color: #b3bab2;
  font-size: 1.0625rem;
  margin: 0 0 2rem;
}
.closing .btn-primary {
  background: #ecefe9;
  border-color: #ecefe9;
  color: var(--bg-deep);
}
.closing .btn-primary:hover {
  background: #ffffff;
  border-color: #ffffff;
}
.closing .btn-ghost {
  color: #ecefe9;
  border-color: #454b45;
}
.closing .btn-ghost:hover { border-color: #848b84; }

/* ---------- Footer ---------- */

.footer {
  background: var(--bg-deep);
  border-top: 1px solid rgba(236, 239, 233, 0.12);
  padding: 2.5rem 0 3rem;
}
.footer-inner {
  text-align: center;
  color: #b3bab2;
  font-size: 0.9rem;
}
.footer-inner p { margin: 0 0 0.625rem; }
.footer-inner a { color: #d7dcd5; }
.footer-memory {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: #ecefe9;
  margin-bottom: 1rem !important;
}
.footer-fine {
  font-family: var(--mono);
  color: #848b84;
  font-size: 0.78rem;
  margin-top: 1rem !important;
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .steps,
  .source-grid {
    grid-template-columns: 1fr 1fr;
  }
  .steps li + li,
  .source-grid li + li {
    border-left: 0;
  }
  .steps li:nth-child(even),
  .source-grid li:nth-child(even) {
    border-left: 1px solid var(--line);
  }
  .steps li:nth-child(n + 3),
  .source-grid li:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  .topbar nav { gap: 1rem; }
  .topbar nav a:not(:last-child) { display: none; }

  .steps,
  .source-grid,
  .privacy-grid {
    grid-template-columns: 1fr;
  }
  .steps li:nth-child(even),
  .source-grid li:nth-child(even) {
    border-left: 0;
  }
  .steps li + li,
  .source-grid li + li {
    border-top: 1px solid var(--line);
  }

  .cta-row .btn {
    width: 100%;
    max-width: 22rem;
    text-align: center;
  }

  .promise {
    padding: 1.5rem 1.25rem;
  }
}
