/* HearAge — shared styles. Design tokens mirror the app (Theme.swift). */

:root {
  --paper: #fbfaf7;
  --cream: #efede6;        /* alternating section ground */
  --ink: #1e2a2e;
  --ink-2: #46545a;        /* >=7:1 on paper */
  --hairline: #e4e1d8;
  --brand: #14646b;
  --brand-deep: #0e4a50;
  --gold: #a6761f;
  --ear-red: #b23a32;
  --ear-blue: #2e63b8;
  --card: #ffffff;
  --shadow: 24px 40px -24px rgba(20, 30, 34, 0.30);

  --serif: ui-serif, "New York", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue",
    system-ui, sans-serif;

  --wrap: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14191b;
    --cream: #1b2225;
    --ink: #e9e6de;
    --ink-2: #a6b1b5;
    --hairline: #2c3639;
    --brand: #3fa9b0;
    --brand-deep: #2c8087;
    --gold: #d3a656;
    --card: #1d2528;
    --shadow: 24px 40px -24px rgba(0, 0, 0, 0.55);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.015em; line-height: 1.08; text-wrap: balance; margin: 0; }

.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-2);
}

/* ---------- top bar ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--serif); font-size: 22px; font-weight: 600; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand .age { color: var(--brand); font-style: italic; }
.nav-links { display: flex; gap: 26px; align-items: center; font-size: 15px; }
.nav-links a { color: var(--ink-2); font-weight: 500; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 15px 26px; border-radius: 15px; font-weight: 650; font-size: 17px;
  background: var(--brand); color: #fbfaf7; border: 0; cursor: pointer;
}
.btn:hover { background: var(--brand-deep); text-decoration: none; }
.btn .sub { font-weight: 400; opacity: 0.7; font-size: 13px; }

/* App Store badge — fixed near-black in both themes, per Apple's convention */
.btn.appstore { background: #111a1d; color: #fbfaf7; padding: 13px 24px; }
.btn.appstore:hover { background: #000; }
.btn.appstore span { font-size: 15px; font-weight: 500; line-height: 1.1; text-align: left; }
.btn.appstore b { display: block; font-size: 20px; font-weight: 650; }

/* ---------- hero ---------- */
.hero { padding: 76px 0 68px; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(46px, 6vw, 78px); margin: 16px 0 0; }
.hero .lede { font-size: 21px; color: var(--ink-2); margin: 20px 0 30px; max-width: 30ch; }
.hero-cta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.trust { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink-2); margin-top: 26px; }

/* phone frame */
.phone { position: relative; width: 300px; margin: 0 auto; }
.phone::before {
  content: ""; position: absolute; inset: -14px; border-radius: 54px;
  background: #10181b; box-shadow: var(--shadow);
}
.phone img { position: relative; width: 100%; border-radius: 40px; display: block; }

/* ---------- sections ---------- */
section { padding: 72px 0; }
.section-head { max-width: 40ch; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(32px, 4vw, 44px); margin-top: 10px; }
.section-head p { color: var(--ink-2); font-size: 19px; margin: 14px 0 0; }
.alt { background: var(--cream); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.step .n { font-family: var(--serif); font-size: 42px; color: var(--brand); line-height: 1; }
.step h3 { font-size: 22px; margin: 14px 0 8px; }
.step p { color: var(--ink-2); margin: 0; font-size: 16.5px; }

/* feature grid */
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.feature {
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: 20px; padding: 26px 28px;
}
.feature .ic {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--brand) 12%, transparent); margin-bottom: 16px;
}
.feature .ic svg { width: 24px; height: 24px; stroke: var(--brand); fill: none; stroke-width: 1.8; }
.feature h3 { font-size: 21px; margin: 0 0 8px; }
.feature p { color: var(--ink-2); margin: 0; font-size: 16.5px; }

/* showcase (screens row) */
.screens { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; align-items: start; }
.screens figure { margin: 0; text-align: center; }
.screens .phone { width: 240px; }
.screens .phone::before { inset: -11px; border-radius: 44px; }
.screens .phone img { border-radius: 32px; }
.screens figcaption { margin-top: 22px; color: var(--ink-2); font-size: 16px; }
.screens figcaption b { color: var(--ink); font-weight: 600; display: block; font-size: 18px; margin-bottom: 3px; }

/* privacy band */
.privacy-band { text-align: center; }
.privacy-band .wrap { max-width: 720px; }
.privacy-band h2 { font-size: clamp(30px, 4vw, 42px); }
.privacy-band p { color: var(--ink-2); font-size: 19px; margin: 18px 0 0; }

.mt-l { margin-top: 22px; }
.narrow { max-width: 820px; }

/* disclaimer strip */
.disclaimer { background: var(--card); border: 1px solid var(--hairline); border-radius: 16px; padding: 20px 24px; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.disclaimer b { color: var(--ink); }

/* ---------- footer ---------- */
footer { padding: 54px 0 46px; border-top: 1px solid var(--hairline); }
footer .wrap { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; align-items: flex-start; }
footer .brand { font-size: 20px; margin-bottom: 12px; }
footer .col-links { display: flex; gap: 40px; }
footer .col h4 { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 12px; font-weight: 600; }
footer .col a, footer .col span { display: block; color: var(--ink-2); font-size: 15px; margin-bottom: 8px; }
footer .col a:hover { color: var(--ink); text-decoration: none; }
.legal-note { color: var(--ink-2); font-size: 13.5px; margin-top: 34px; line-height: 1.55; max-width: 62ch; }

/* ---------- legal document pages ---------- */
.doc { padding: 56px 0 80px; }
.doc .wrap { max-width: 720px; }
.doc h1 { font-size: clamp(38px, 5vw, 52px); }
.doc .updated { color: var(--ink-2); font-size: 15px; margin: 14px 0 40px; }
.doc h2 { font-size: 24px; margin: 40px 0 12px; }
.doc h3 { font-size: 19px; font-family: var(--sans); font-weight: 650; margin: 26px 0 8px; }
.doc p, .doc li { color: var(--ink-2); font-size: 17px; line-height: 1.66; }
.doc strong { color: var(--ink); }
.doc ul { padding-left: 22px; }
.doc li { margin-bottom: 8px; }
.doc .callout {
  background: color-mix(in srgb, var(--gold) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  border-radius: 14px; padding: 18px 22px; margin: 22px 0;
}
.doc .callout p { color: var(--ink); margin: 0; font-size: 16px; }
.doc a.back { display: inline-block; margin-bottom: 8px; font-weight: 600; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 44px; text-align: center; }
  .hero .lede { margin-left: auto; margin-right: auto; }
  .hero-cta, .trust { justify-content: center; }
  .steps, .features, .screens { grid-template-columns: 1fr; }
  .screens { max-width: 320px; margin: 0 auto; gap: 46px; }
  .nav-links { display: none; }
}

.center { text-align: center; }

/* ---------- articles & learn hub ---------- */
.byline { color: var(--ink-2); font-size: 15px; margin: 14px 0 36px; }
.doc table { width: 100%; border-collapse: collapse; margin: 18px 0 26px; }
.doc th, .doc td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--hairline); color: var(--ink-2); font-size: 16px; }
.doc th { color: var(--ink); font-weight: 650; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; }
.doc tr td:first-child { color: var(--ink); font-weight: 600; }
.doc .table-scroll { overflow-x: auto; }
.refs li { font-size: 15px; margin-bottom: 6px; }
.cta-card { background: color-mix(in srgb, var(--brand) 8%, transparent); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); border-radius: 16px; padding: 24px 26px; margin: 36px 0 8px; }
.cta-card p { color: var(--ink); margin: 0 0 16px; font-size: 17px; }
.article-list { display: grid; gap: 16px; margin-top: 34px; }
.article-card { display: block; background: var(--card); border: 1px solid var(--hairline); border-radius: 16px; padding: 22px 24px; }
.article-card:hover { text-decoration: none; border-color: var(--brand); }
.article-card h2 { font-size: 22px; color: var(--ink); margin: 0 0 6px; }
.article-card p { color: var(--ink-2); margin: 0; font-size: 16px; }
