/* Health Decoder — site styles
   Colours follow the Health.Decoder Colour Style Guide (29 Sep 2026).
   Token names in comments refer to the guide. */

:root {
  --bg: #F3F2F8;            /* ground */
  --surface: #F8F9FC;       /* surface */
  --surface-2: #F0EDFF;     /* lavender (attia) */
  --text: #090933;          /* Text 1 · ink */
  --muted: #5B586E;         /* Text 2 · ink-2 */
  --border: #E4E2EE;        /* line */
  --accent: #6A55D8;        /* violet: links, buttons, focus */
  --accent-strong: #6A55D8;
  --accent-soft: #D3D3FF;   /* lilac (fixed) */
  --on-accent: #FFFFFF;
  --ink-fixed: #090933;     /* text on fixed light surfaces */
  --brand-lavender: #A596FF;/* logo lavender (icon background, "Decoder") */
  --brand-ink: #090933;     /* logo navy ("Health") */
  --check: #E74C3C;         /* tagline colours, from the word mark */
  --chart: #F5A623;
  --change: #9EE344;
  --phone-frame: #090933;
  --todo-bg: #fff3bf;
  --todo-text: #5c4400;
  --radius: 18px;
  --max: 1120px;
  --shadow: 0 1px 2px rgb(9 9 51 / 0.04), 0 12px 32px rgb(9 9 51 / 0.08);
  --serif: "Hoefler Text", "Libre Caslon Text", Garamond, Georgia, serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15141F;
    --surface: #1F1D2C;
    --surface-2: #262238;
    --text: #F1F0F7;
    --muted: #B4B1C6;
    --border: #2E2B40;
    --accent: #A596FF;
    --accent-strong: #A596FF;
    --on-accent: #090933;
    --brand-ink: #F1F0F7;
    --phone-frame: #000000;
    --todo-bg: #4a3b00;
    --todo-text: #ffe8a3;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 32px rgb(0 0 0 / 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15141F;
  --surface: #1F1D2C;
  --surface-2: #262238;
  --text: #F1F0F7;
  --muted: #B4B1C6;
  --border: #2E2B40;
  --accent: #A596FF;
  --accent-strong: #A596FF;
  --on-accent: #090933;
  --brand-ink: #F1F0F7;
  --phone-frame: #000000;
  --todo-bg: #4a3b00;
  --todo-text: #ffe8a3;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 32px rgb(0 0 0 / 0.35);
  color-scheme: dark;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Word mark, set as live text in the logo's fonts:
   "Health" Hoefler Text (built into every Apple device), "Decoder" Helvetica Neue Bold Italic */
.wordmark { font-weight: 400; letter-spacing: -0.01em; white-space: nowrap; }
.wordmark .w-health { font-family: var(--serif); color: var(--brand-ink); }
.wordmark .w-decoder { font-family: var(--sans); font-weight: 700; font-style: italic; color: var(--brand-lavender); letter-spacing: -0.02em; }
.tagline { font-family: var(--sans); font-weight: 700; letter-spacing: -0.01em; }
.tagline .t1 { color: var(--check); }
.tagline .t2 { color: var(--chart); }
.tagline .t3 { color: var(--change); }

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--accent-strong); }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
}
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.brand .wordmark { font-size: 22px; }
.nav { display: flex; align-items: center; gap: 24px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav a:hover { color: var(--text); }
.nav .btn { color: var(--on-accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.15s ease;
}
.btn:hover { filter: brightness(1.08); }

/* App Store badge placeholder — replace with Apple's official badge (see README) */
.store-badge {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  height: 56px;
  padding: 0 22px;
  border-radius: 12px;
  background: #000;
  color: #fff;
  text-decoration: none;
  line-height: 1.15;
  border: 1px solid #a6a6a6;
}
.store-badge small { font-size: 11px; letter-spacing: 0.02em; }
.store-badge span { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.store-badge-img { height: 56px; width: auto; }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 56px; overflow: hidden; }
.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 48px;
}
.eyebrow {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink-fixed);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 18px;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.hero h1 em { font-family: var(--sans); font-weight: 700; font-style: italic; letter-spacing: -0.03em; color: var(--accent); }
.hero .tagline { font-size: clamp(20px, 2.4vw, 26px); margin: 0 0 20px; }
.hero p.lead {
  font-size: clamp(18px, 2.2vw, 21px);
  color: var(--muted);
  margin: 0 0 32px;
  max-width: 34ch;
}
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.hero-note { font-size: 14px; color: var(--muted); }
.hero-visual { display: flex; justify-content: center; position: relative; }
.hero-visual::before {
  content: "";
  position: absolute;
  inset: 10% -10%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand-lavender) 45%, transparent), transparent);
  z-index: 0;
}

/* ---------- Phone frame ---------- */
.phone {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1179 / 2556;
  border: 10px solid var(--phone-frame);
  border-radius: 48px;
  background: var(--phone-frame);
  overflow: hidden;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 38px; }

/* ---------- Sections ---------- */
section { padding: 80px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-head h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 4vw, 46px);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 12px;
}
.section-head p { color: var(--muted); margin: 0; font-size: 18px; }

.features { background: var(--surface); border-block: 1px solid var(--border); }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.feature {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.feature .icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--ink-fixed);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}
.feature .icon svg { width: 24px; height: 24px; }
.feature h3 { font-size: 19px; margin: 0 0 8px; letter-spacing: -0.01em; }
.feature p { margin: 0; color: var(--muted); font-size: 16px; }

/* Screenshot strip */
.shots {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 8px 20px 24px;
  margin: 0 -20px;
  scrollbar-width: thin;
}
.shot { scroll-snap-align: center; flex: 0 0 auto; width: 240px; text-align: center; }
.shot .phone { max-width: 240px; border-width: 8px; border-radius: 40px; }
.shot .phone img { border-radius: 32px; }
.shot figcaption { margin-top: 14px; font-size: 15px; color: var(--muted); }
@media (min-width: 1200px) { .shots { justify-content: center; } }

/* Privacy band */
.privacy-band .card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 36px 40px;
}
.privacy-band .icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--brand-lavender);
  color: var(--ink-fixed);
  display: grid;
  place-items: center;
}
.privacy-band .icon svg { width: 32px; height: 32px; }
.privacy-band h2 { margin: 0 0 6px; font-family: var(--serif); font-weight: 400; font-size: 30px; }
.privacy-band p { margin: 0; color: var(--muted); }

/* Final CTA */
.cta { text-align: center; padding-top: 40px; }
.cta img.app-icon { width: 96px; height: 96px; border-radius: 22px; margin: 0 auto 24px; box-shadow: var(--shadow); }
.cta h2 { font-size: clamp(36px, 5vw, 52px); font-weight: 400; margin: 0 0 8px; }
.cta .tagline { font-size: 22px; margin: 0 0 28px; }
.cta p { color: var(--muted); margin: 0 0 28px; font-size: 18px; }

/* Support */
.support { padding-top: 0; }
.support .card {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 28px;
}
.support h2 { margin: 0 0 8px; font-family: var(--serif); font-weight: 400; font-size: 30px; }
.support p { margin: 0 0 6px; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 40px;
  font-size: 14px;
  color: var(--muted);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
}
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.disclaimer { flex-basis: 100%; font-size: 13px; margin: 8px 0 0; }

/* ---------- Legal pages ---------- */
.legal { padding: 56px 0 80px; }
.legal article { max-width: 720px; margin: 0 auto; }
.legal h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 5vw, 50px); letter-spacing: -0.01em; margin: 0 0 8px; line-height: 1.1; }
.legal .meta { color: var(--muted); margin: 0 0 40px; }
.legal h2 { font-size: 22px; margin: 44px 0 12px; letter-spacing: -0.01em; }
.legal h3 { font-size: 18px; margin: 28px 0 8px; }
.legal p, .legal li { color: var(--text); }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 6px; }
.legal table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 16px 0; }
.legal th, .legal td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.legal th { color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.summary {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.summary ul { margin: 0; }

/* Placeholders you still need to fill in. These are meant to be impossible to miss. */
.todo {
  background: var(--todo-bg);
  color: var(--todo-text);
  border-radius: 4px;
  padding: 0 4px;
  font-weight: 600;
}
.todo-banner {
  background: var(--todo-bg);
  color: var(--todo-text);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 32px;
  font-size: 15px;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .hero { padding: 48px 0 32px; }
  .hero .container { grid-template-columns: 1fr; text-align: center; gap: 40px; }
  .hero p.lead { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .phone { max-width: 260px; }
  .privacy-band .card { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 32px 24px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .nav a:not(.btn) { display: none; }
  section { padding: 56px 0; }
  .feature-grid { grid-template-columns: 1fr; }
  .shots { margin: 0 -16px; padding-inline: 16px; }
  .shot { width: 200px; }
  .shot .phone { max-width: 200px; }
}
