/*
 * Landing page styles.
 *
 * The colour values below are copied verbatim from the `@theme` block in
 * apps/web/src/index.css, keeping the `--color-*` names so the two files can be
 * diffed by eye. They are plain custom properties here: the app needs Tailwind
 * because it has a hundred components, this page has one stylesheet, and adding
 * a build step to a single static file would cost more than it saves.
 *
 * If you change a token in the app, change it here too.
 */

:root {
  --color-surface: oklch(100% 0 0);
  --color-surface-muted: oklch(97.5% 0.005 250);
  --color-ink: oklch(23% 0.02 260);
  --color-ink-muted: oklch(52% 0.02 260);
  --color-line: oklch(91% 0.008 260);
  --color-brand: oklch(52% 0.16 258);
  --color-brand-soft: oklch(96% 0.03 258);
  --color-overdue: oklch(52% 0.19 22);
  --color-later: oklch(55% 0.08 200);

  /* On-brand text colour for filled buttons. White on the light brand is
     5.6:1; the dark-mode brand is light, so it flips to the dark surface. */
  --color-on-brand: oklch(100% 0 0);

  /* The app uses Tailwind's rounded-lg / rounded-xl on buttons and cards. */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;

  /* One section rhythm, scaled once at the 768px breakpoint. */
  --section-y: 3.5rem;
  --gutter: 1.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-surface: oklch(21% 0.015 260);
    --color-surface-muted: oklch(25% 0.015 260);
    --color-ink: oklch(95% 0.005 260);
    --color-ink-muted: oklch(70% 0.015 260);
    --color-line: oklch(32% 0.015 260);
    --color-brand: oklch(72% 0.14 258);
    --color-brand-soft: oklch(30% 0.05 258);
    --color-overdue: oklch(72% 0.16 22);
    --color-later: oklch(75% 0.08 200);
    --color-on-brand: oklch(21% 0.015 260);
  }
}

/* ---- Base ---------------------------------------------------------------- */

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

html {
  color-scheme: light dark;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  /* Matches the app: system fonts only, so there is no webfont request, no
     font-display decision to make and nothing to allow in a strict CSP. */
  font-family:
    ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-ink);
  background: var(--color-surface);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.018em;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
}

a {
  color: var(--color-brand);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

/* Visible focus everywhere, same treatment as the app. */
:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  padding: 0.625rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ---- Layout -------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: 64rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap.narrow {
  max-width: 44rem;
}

.section {
  padding-block: var(--section-y);
}

/* The header is sticky, so a jump to #faq would otherwise land with the heading
   hidden underneath it. Applies to the skip link's #main target too. */
:target,
[id] {
  scroll-margin-top: 4.5rem;
}

.section-alt {
  background: var(--color-surface-muted);
  border-block: 1px solid var(--color-line);
}

.section > .wrap > h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.section-lede {
  margin-top: 0.75rem;
  max-width: 46rem;
  color: var(--color-ink-muted);
  font-size: 1.0625rem;
}

.center {
  text-align: center;
}

/* ---- Buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.btn-lg {
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
}

.btn-primary {
  background: var(--color-brand);
  color: var(--color-on-brand);
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  background: var(--color-surface);
  border-color: var(--color-line);
  color: var(--color-ink);
}

.btn-secondary:hover {
  background: var(--color-surface-muted);
}

.btn-ghost {
  color: var(--color-ink-muted);
}

.btn-ghost:hover {
  background: var(--color-surface-muted);
  color: var(--color-ink);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.center-row {
  justify-content: center;
}

.cta-note {
  margin-top: 1rem;
  max-width: 34rem;
  font-size: 0.875rem;
  color: var(--color-ink-muted);
}

.center .cta-note {
  margin-inline: auto;
}

/* ---- Header -------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in oklab, var(--color-surface) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 3.5rem;
}

.brandmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--color-ink);
  text-decoration: none;
}

.brandmark-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--color-brand);
}

.site-nav {
  display: none;
  gap: 1.25rem;
  margin-left: 0.75rem;
  font-size: 0.9375rem;
}

.site-nav a {
  color: var(--color-ink-muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--color-ink);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

/* Two buttons plus a wordmark is already tight at 360px; drop "Sign in" and
   leave the primary action, which is the one that matters on a phone. */
.header-actions .btn-ghost {
  display: none;
}

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

.hero {
  padding-block: calc(var(--section-y) + 0.5rem) var(--section-y);
  background:
    radial-gradient(
      42rem 22rem at 12% -4rem,
      var(--color-brand-soft),
      transparent 70%
    );
}

.hero-grid {
  display: grid;
  gap: 2.5rem;
}

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
}

.hero h1 {
  margin-top: 0.875rem;
  font-size: clamp(2rem, 6.5vw, 3.25rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  max-width: 22ch;
}

.lede {
  margin-top: 1.25rem;
  max-width: 40rem;
  font-size: 1.0625rem;
  color: var(--color-ink-muted);
}

/* ---- Hero timeline figure ------------------------------------------------ */

.timeline-card {
  margin: 0;
  padding: 1.25rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

/* Capped at the viewBox's own width. Text inside an SVG scales with the
   viewBox, so letting this fill a 768px single-column card renders "10 Feb" at
   40px and the illustration reads as a mistake. */
.timeline {
  display: block;
  width: 100%;
  max-width: 23.75rem;
  height: auto;
  margin-inline: auto;
}

.timeline .rail-live,
.timeline .rail-gone {
  stroke-width: 3;
  stroke-linecap: round;
}

.timeline .rail-live {
  stroke: var(--color-brand);
}

.timeline .rail-gone {
  stroke: var(--color-line);
  stroke-dasharray: 2 7;
}

.timeline .dot-live {
  fill: var(--color-brand);
}

.timeline .dot-mute {
  fill: var(--color-surface);
  stroke: var(--color-ink-muted);
  stroke-width: 2;
}

.timeline .brace {
  fill: none;
  stroke: var(--color-line);
  stroke-width: 1.5;
}

.timeline text {
  font-family: inherit;
}

.timeline .tl-caption {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.timeline .tl-date {
  font-size: 20px;
  font-weight: 650;
}

.timeline .tl-small {
  font-size: 12px;
}

.timeline .tl-live {
  fill: var(--color-brand);
}

.timeline .tl-mute {
  fill: var(--color-ink-muted);
}

.timeline-card figcaption {
  margin-top: 0.875rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--color-line);
  font-size: 0.875rem;
  color: var(--color-ink-muted);
}

.timeline-card figcaption strong {
  color: var(--color-ink);
  font-weight: 600;
}

/* ---- Steps --------------------------------------------------------------- */

.steps {
  display: grid;
  gap: 1.5rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.steps > li {
  padding-top: 1.25rem;
  border-top: 2px solid var(--color-brand-soft);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: var(--color-brand-soft);
  color: var(--color-brand);
  font-size: 0.8125rem;
  font-weight: 600;
}

.steps h3 {
  margin-top: 0.75rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

.steps p {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  color: var(--color-ink-muted);
}

.formula code {
  display: inline-block;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius-sm);
  background: var(--color-surface-muted);
  border: 1px solid var(--color-line);
  color: var(--color-ink);
}

.section-alt .formula code {
  background: var(--color-surface);
}

/* ---- Cards --------------------------------------------------------------- */

.cards {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.card {
  padding: 1.25rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.card-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--color-brand);
}

.card h3 {
  margin-top: 0.75rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

.card p {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  color: var(--color-ink-muted);
}

/* ---- Cost section -------------------------------------------------------- */

.split {
  display: grid;
  gap: 2rem;
  align-items: start;
}

.split h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.split > div > p {
  margin-top: 1rem;
  color: var(--color-ink-muted);
}

.facts {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.facts > li {
  padding: 1.125rem 1.25rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
}

.fact-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-ink-muted);
}

.fact-value {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.75rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.fact-unit {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-ink-muted);
}

.fact-note {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.8125rem;
  color: var(--color-ink-muted);
}

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

.privacy-list {
  display: grid;
  gap: 1.25rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.privacy-list > li {
  padding-left: 1.125rem;
  border-left: 2px solid var(--color-later);
}

.privacy-list h3 {
  font-size: 1rem;
  font-weight: 600;
}

.privacy-list p {
  margin-top: 0.375rem;
  font-size: 0.9375rem;
  color: var(--color-ink-muted);
}

/* ---- FAQ ----------------------------------------------------------------- */

.faq {
  margin: 2rem 0 0;
}

.faq dt {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-line);
  font-size: 1.0625rem;
  font-weight: 600;
}

.faq dt:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.faq dd {
  margin: 0.5rem 0 0;
  color: var(--color-ink-muted);
}

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

.closing {
  border-top: 1px solid var(--color-line);
}

.closing h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.closing > .wrap > p {
  margin-top: 0.875rem;
  margin-inline: auto;
  max-width: 34rem;
  color: var(--color-ink-muted);
}

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

.site-footer {
  background: var(--color-surface-muted);
  border-top: 1px solid var(--color-line);
  padding-block: 2rem;
}

.footer-inner {
  display: grid;
  gap: 0.375rem;
}

.footer-brand {
  font-weight: 600;
}

.footer-tagline {
  font-size: 0.875rem;
  color: var(--color-ink-muted);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 0.75rem;
  font-size: 0.875rem;
}

/* ---- Breakpoints --------------------------------------------------------- */

/* Tablet: the section rhythm opens up and the three record types go side by
   side. Mobile-first, so everything above is the 360px layout. */
@media (min-width: 48rem) {
  :root {
    --section-y: 5rem;
    --gutter: 2rem;
  }

  .site-nav {
    display: flex;
  }

  .header-actions .btn-ghost {
    display: inline-flex;
  }

  .cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
  }

  .split {
    grid-template-columns: 1.15fr 1fr;
    gap: 3rem;
  }

  .privacy-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 2.5rem;
  }

  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .footer-nav {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-top: 0;
  }
}

/* Desktop: the hero becomes two columns with the timeline beside the copy. */
@media (min-width: 64rem) {
  :root {
    --section-y: 6rem;
  }

  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 4rem;
  }

  .timeline-card {
    padding: 1.75rem;
  }
}
