/*
 * The whole site's stylesheet.
 *
 * Colours and radii are never written as literals here — they come from the
 * custom properties in src/theme.ts, which imports the app's own design tokens.
 * A hex typed into this file is a silent fork of the design system, which is
 * the exact failure CLAUDE.md's token rule exists to prevent. The only literal
 * colours below are neutral alphas (shadows, overlays) that have no token.
 *
 * No CSS framework, no reset library: the site is six pages, and a normalize
 * step small enough to read is worth more than a dependency to update.
 */

/* ------------------------------------------------------------------ base -- */

*,
*::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(--bg);
  color: var(--ink);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem);
}

h2 {
  font-size: clamp(1.4rem, 1.15rem + 1.1vw, 1.9rem);
}

h3 {
  font-size: 1.06rem;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

img {
  max-width: 100%;
  height: auto;
}

ul,
ol {
  padding-left: 1.25em;
}

li {
  margin-bottom: 0.35em;
}

/* ---------------------------------------------------------------- layout -- */

.shell {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.shell.narrow {
  max-width: 720px;
}

.shell.center {
  text-align: center;
}

.section {
  padding: 72px 0;
}

.section-alt {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

.section-title {
  margin-bottom: 28px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

.muted {
  color: var(--ink-muted);
  font-size: 0.94rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  z-index: 100;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

/* ---------------------------------------------------------------- header -- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 66px;
  flex-wrap: wrap;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.06rem;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
}

.nav-list {
  display: flex;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.93rem;
}

.nav-list a {
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 600;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  color: var(--ink);
}

/* ------------------------------------------------------------------ hero -- */

.hero {
  padding: 76px 0 84px;
  background:
    radial-gradient(
      1100px 420px at 12% -12%,
      var(--primary-soft),
      transparent 62%
    ),
    var(--bg);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}

.hero h1 {
  margin-bottom: 18px;
}

.lede {
  font-size: 1.16rem;
  color: var(--ink-muted);
  max-width: 34em;
}

.hero-disclaimer {
  margin-top: 18px;
  font-size: 0.88rem;
  color: var(--ink-subtle);
}

.store-soon {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 26px;
  padding: 11px 18px;
  background: var(--success-soft);
  color: var(--success);
  border-radius: var(--radius-pill);
  font-weight: 650;
  font-size: 0.92rem;
}

.store-soon-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.store-badges {
  display: flex;
  gap: 12px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.store-badge,
.button {
  display: inline-block;
  padding: 13px 24px;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #fff;
  font-weight: 650;
  text-decoration: none;
}

.store-badge:hover,
.button:hover {
  filter: brightness(0.94);
}

/* Phone mock — placeholder until real screenshots land. */

.hero-art {
  display: flex;
  justify-content: center;
}

.phone-frame {
  width: 260px;
  aspect-ratio: 9 / 19.5;
  border-radius: 34px;
  padding: 11px;
  background: var(--ink);
  box-shadow: var(--shadow-raised);
}

.phone-screen {
  height: 100%;
  border-radius: 25px;
  background: var(--bg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.skeleton-pill {
  width: 62px;
  height: 17px;
  border-radius: var(--radius-pill);
  background: var(--success-soft);
}

.skeleton-line {
  height: 9px;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
}

.skeleton-line.short {
  width: 58%;
}

.skeleton-chart {
  flex: 1;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background:
    linear-gradient(transparent 61%, var(--primary) 61%, transparent 63%),
    var(--surface);
}

/* -------------------------------------------------------------- features -- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin: 0;
  box-shadow: var(--shadow-card);
}

.feature h3 {
  margin-bottom: 8px;
}

.feature p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.96rem;
}

/* ----------------------------------------------------------------- steps -- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px;
}

.steps li {
  display: flex;
  gap: 16px;
  margin: 0;
}

.step-n {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.steps h3 {
  margin-bottom: 5px;
}

.steps p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

/* --------------------------------------------------------------- screens -- */

.screens {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 26px;
}

.screen {
  margin: 0;
  text-align: center;
}

.screen-placeholder {
  aspect-ratio: 9 / 19.5;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
  background: var(--surface);
}

.screen figcaption {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--ink-muted);
  font-weight: 600;
}

/* ----------------------------------------------------------------- legal -- */

.legal {
  max-width: 760px;
  padding-top: 56px;
  padding-bottom: 84px;
}

.legal-head {
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 34px;
}

.legal-updated {
  color: var(--ink-subtle);
  font-size: 0.88rem;
  margin: 0 0 14px;
}

.legal-intro {
  color: var(--ink-muted);
}

.legal-body h3 {
  margin-top: 1.4em;
  font-size: 1rem;
}

.clause {
  margin-bottom: 38px;
  scroll-margin-top: 84px;
}

.clause h2 {
  display: flex;
  gap: 11px;
  align-items: baseline;
  font-size: 1.26rem;
}

.clause-n {
  color: var(--ink-subtle);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.notice {
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin: 22px 0;
  background: var(--primary-soft);
  border: 1px solid var(--border);
}

.notice-warning {
  background: var(--warning-soft);
  border-color: transparent;
}

.notice p:last-child {
  margin-bottom: 0;
}

/* -------------------------------------------------------------- notfound -- */

.notfound {
  padding: 96px 24px 120px;
}

.notfound-links {
  margin: 26px 0 20px;
}

/* ---------------------------------------------------------------- footer -- */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-top: 46px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 34px;
  flex-wrap: wrap;
  padding-bottom: 30px;
}

.footer-links {
  display: flex;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  font-size: 0.92rem;
}

.footer-links a {
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--ink);
}

.footer-legal {
  border-top: 1px solid var(--border);
  padding-block: 18px 26px;
}

.footer-legal p {
  margin: 0;
  color: var(--ink-subtle);
  font-size: 0.84rem;
}

/* The medical disclaimer sits in the footer so it appears on every page, not
   only on Home and the terms. The text is MEDICAL_DISCLAIMER from
   constants/legal.ts — see src/content/legal.ts for why it is imported rather
   than retyped here. */
.footer-legal .footer-disclaimer {
  margin: 0 0 10px;
  max-width: 62em;
  color: var(--ink-muted);
  line-height: 1.55;
}

.footer-legal .footer-disclaimer strong {
  color: var(--ink);
  font-weight: 700;
}

/* ----------------------------------------------------------- narrow view -- */

@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .hero-art {
    order: -1;
  }

  .phone-frame {
    width: 216px;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 16px;
  }

  .section {
    padding: 52px 0;
  }

  .hero {
    padding: 48px 0 60px;
  }

  .header-inner {
    min-height: 58px;
    padding-block: 10px;
  }

  .nav-list {
    gap: 16px;
    font-size: 0.88rem;
  }
}

/* --------------------------------------------------------------- printed -- */

@media print {
  .site-header,
  .site-footer,
  .skip-link {
    display: none;
  }

  body {
    background: #fff;
    font-size: 11pt;
  }

  .legal {
    padding: 0;
    max-width: none;
  }

  .clause {
    break-inside: avoid;
  }
}
