/* Matches the app: SF Pro Rounded for headings, SF Pro for text (Apple devices).
   Other devices fall back to Nunito, the closest free match to SF Rounded. */
@font-face { font-family: "Nunito"; src: url("fonts/nunito.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }

:root {
  /* App colour tokens (ClinicalTokens.swift) */
  --ink: #1c1c1e;
  --ink-soft: #6a7684;
  --slate: #3e4c5e;
  --accent: #7a9bbf;
  --mist: #faf7f2;      /* app ground */
  --oat: #f1ede6;       /* app warm oat */
  --paper: #ffffff;
  --line: #e6e2db;      /* app hairline */
  --green: #3ca26b;
  --amber: #dd923e;
  --display: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --measure: 34rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--slate); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--slate); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(72rem, 100% - 2rem); margin-inline: auto; }

/* Header */
.site-header { padding-block: 1.25rem; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; font: 700 1.2rem/1 var(--display); }
.brand img { width: 2.1rem; height: 2.1rem; border-radius: 0.55rem; }
.site-nav { display: flex; gap: 1.25rem; font-size: 0.95rem; }
.site-nav a { color: var(--ink-soft); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

/* Buttons */
.store-btn {
  display: inline-flex; align-items: center; gap: 0.7rem;
  background: var(--slate); color: #fff; text-decoration: none;
  padding: 0.9rem 1.4rem; border-radius: 0.9rem;
  font: 700 1.05rem/1.1 var(--body);
}
.store-btn:hover { color: #fff; background: var(--ink); }
.store-btn svg { width: 1.3rem; height: 1.3rem; flex: none; }
.fine { color: var(--ink-soft); font-size: 0.9rem; margin: 0.75rem 0 0; }

/* Hero */
.hero { padding-block: 2.5rem 4rem; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 {
  font: 800 clamp(2.6rem, 6.2vw, 4.6rem)/0.98 var(--display);
  letter-spacing: -0.02em;
  
  margin: 0 0 1.25rem;
  max-width: 11ch;
}
.hero .lede { font-size: 1.2rem; color: var(--ink-soft); max-width: var(--measure); margin: 0 0 2rem; }

/* Before / after slider: the one bold thing on the page */
.compare {
  position: relative; aspect-ratio: 3 / 4; width: 100%; max-width: 30rem; justify-self: end;
  border-radius: 1.75rem; overflow: hidden; background: var(--line);
  box-shadow: 0 30px 60px -30px rgba(20, 32, 46, 0.45);
  touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: ew-resize;
  --pos: 50%;
}
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.compare .before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare .divider {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px;
  background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, 0.35); pointer-events: none;
}
.compare .handle {
  position: absolute; top: 50%; left: var(--pos); width: 3rem; height: 3rem; margin: -1.5rem 0 0 -1.5rem;
  border-radius: 50%; background: #fff; display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3); pointer-events: none; color: var(--slate);
}
.compare .tag {
  position: absolute; top: 0.9rem; padding: 0.45rem 0.75rem; border-radius: 0.7rem;
  background: rgba(20, 32, 46, 0.62); color: #fff; line-height: 1.2; pointer-events: none;
  transition: opacity 0.15s;
  max-width: calc(50% - 1.2rem);
}
.compare .tag small { display: block; font-size: 0.75rem; opacity: 0.8; }
.compare .tag strong { font: 700 0.95rem/1.2 var(--display); }
.compare .tag-before { left: 0.9rem; }
.compare .tag-after { right: 0.9rem; text-align: right; }
.compare input[type="range"] {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize;
}
.compare:has(input:focus-visible) { outline: 3px solid var(--slate); outline-offset: 4px; }
.compare-caption { margin: 0.9rem 0 0; font-size: 0.9rem; color: var(--ink-soft); max-width: 30rem; justify-self: end; }
.hero-media { display: grid; }

/* Sections */
.section { padding-block: 4.5rem; border-top: 1px solid var(--line); }
.section h2 {
  font: 800 clamp(1.9rem, 3.6vw, 2.6rem)/1.05 var(--display);
  letter-spacing: -0.02em; 
  margin: 0 0 1rem; max-width: 20ch;
}
.section p { max-width: var(--measure); }

.story { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 3rem; align-items: start; }
.story blockquote { margin: 0; font: 500 clamp(1.3rem, 2.4vw, 1.6rem)/1.4 var(--display); max-width: 30ch; }
.story blockquote p { margin: 0 0 1rem; max-width: none; }
.story cite { font: 400 1rem var(--body); font-style: normal; color: var(--ink-soft); }

.steps { list-style: none; padding: 0; margin: 2.5rem 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; counter-reset: step; }
.steps li { counter-increment: step; border-top: 3px solid var(--ink); padding-top: 1rem; }
.steps li::before { content: counter(step); font: 800 1rem var(--display); color: var(--slate); }
.steps .step-visual {
  margin: 0.9rem 0 1.1rem; padding: 1rem; border-radius: 1.25rem; background: var(--oat);
  aspect-ratio: 1 / 1.05; display: flex; flex-direction: column; justify-content: center; gap: 0.6rem; overflow: hidden;
}
.steps .step-visual img { width: 100%; height: auto; border-radius: 0.9rem; }
.scores-layout { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.scores-layout .metrics { grid-template-columns: 1fr; background: none; border-radius: 0; margin-top: 1.5rem; }
.scores-layout .metrics div { border-left: 0; border-top: 1px solid var(--line); padding: 0.8rem 0; display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; }
.scores-layout .metrics div:first-child { border-top: 0; }
.scores-layout .metrics dt { margin: 0; font-size: 1.05rem; }
.scores-visual { background: var(--oat); border-radius: 1.5rem; padding: 1.25rem; max-width: 30rem; justify-self: end; width: 100%; }
.scores-visual img { width: 100%; border-radius: 1rem; }
.steps h3 { font: 700 1.3rem/1.2 var(--display); margin: 0.35rem 0 0.5rem; }
.steps p { margin: 0; color: var(--ink-soft); }

.metrics { margin: 2.5rem 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; background: var(--paper); border-radius: 1.25rem; overflow: hidden; }
.metrics div { padding: 1.4rem 1.2rem; border-left: 1px solid var(--line); }
.metrics div:first-child { border-left: 0; }
.metrics dt { font: 700 1.15rem var(--display); margin-bottom: 0.3rem; }
.metrics dd { margin: 0; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.45; }

.honest { background: var(--paper); border-radius: 1.25rem; padding: clamp(1.5rem, 4vw, 2.5rem); display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; }
.honest h2 { margin: 0; }
.honest p { margin: 0; }

.cta-band { text-align: left; }
.cta-band .wrap { display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; }
.cta-band h2 { margin: 0; }

/* Document pages (support, privacy) */
.doc { padding-block: 2.5rem 5rem; }
.doc .wrap { max-width: 44rem; }
.doc h1 { font: 800 clamp(2.2rem, 5vw, 3.2rem)/1.02 var(--display); letter-spacing: -0.02em; margin: 0 0 0.75rem; }
.doc .updated { color: var(--ink-soft); margin: 0 0 2.5rem; }
.doc h2 { font: 700 1.45rem/1.2 var(--display); margin: 2.75rem 0 0.6rem; }
.doc h3 { font: 700 1.1rem/1.3 var(--display); margin: 1.75rem 0 0.4rem; }
.doc p, .doc li { max-width: 40rem; }
.doc ul { padding-left: 1.25rem; }
.doc li { margin-bottom: 0.4rem; }
.summary { background: var(--paper); border-radius: 1rem; padding: 1.25rem 1.5rem; }
.summary ul { margin: 0.5rem 0 0; }
.contact-card { background: var(--paper); border-radius: 1rem; padding: 1.5rem; margin: 0 0 1rem; }
.contact-card p { margin: 0 0 0.25rem; }
.contact-card a { font: 700 1.3rem var(--display); }
details { background: var(--paper); border-radius: 0.9rem; padding: 1rem 1.25rem; margin-bottom: 0.6rem; }
summary { font: 700 1.1rem/1.3 var(--display); cursor: pointer; }
details[open] summary { margin-bottom: 0.5rem; }
details p { margin: 0.5rem 0 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 2rem 3rem; color: var(--ink-soft); font-size: 0.9rem; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-footer a { color: var(--ink-soft); }

@media (max-width: 860px) {
  .hero .wrap, .story, .honest, .scores-layout { grid-template-columns: 1fr; }
  .scores-layout .metrics div, .scores-layout .metrics div:nth-child(even), .scores-layout .metrics div:last-child { grid-column: auto; border-left: 0; border-top: 1px solid var(--line); }
  .scores-layout .metrics div:first-child { border-top: 0; }
  .hero { padding-top: 1rem; }
  .compare, .compare-caption { justify-self: start; }
  .steps { grid-template-columns: 1fr; gap: 1.5rem; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metrics div { border-left: 0; border-top: 1px solid var(--line); }
  .metrics div:nth-child(-n+2) { border-top: 0; }
  .metrics div:nth-child(even) { border-left: 1px solid var(--line); }
  .metrics div:last-child { grid-column: 1 / -1; border-left: 0; }
}
@media (max-width: 480px) {
  .compare .tag { top: 0.7rem; padding: 0.4rem 0.6rem; }
  .compare .tag-before { left: 0.7rem; }
  .compare .tag-after { right: 0.7rem; }
  .compare .tag strong { font-size: 0.85rem; }
  .site-nav { gap: 0.9rem; font-size: 0.9rem; }
  .store-btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
