/* WristVitals website. Colours and typefaces follow the app and dashboard (web/src/app.css,
   android ui/theme/Brand.kt). Light by default, dark with prefers-color-scheme. No external requests. */

@font-face { font-family: "Manrope"; src: url("fonts/manrope.ttf") format("truetype"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Sora"; src: url("fonts/sora.ttf") format("truetype"); font-weight: 100 800; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains_mono.ttf") format("truetype"); font-weight: 100 800; font-display: swap; }

:root {
  --bg: #f4f6f9; --raised: #eef2f6; --surface: #ffffff; --line: #e1e7ee; --line-strong: #cbd4de;
  --text: #0e141b; --muted: #586677; --pulse: #d9442a; --pulse-ink: #ffffff; --pulse-soft: #ffe6e0;
  --night: #3b66db; --air: #08819a; --move: #4a7f0a; --warm: #9e5f00; --calm: #7448d0;
  --ok-bg: #edf7df; --warn-bg: #fff4e0; --shadow: 0 1px 2px rgba(14, 20, 27, .06), 0 8px 24px rgba(14, 20, 27, .06);
  --sans: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --display: "Sora", "Manrope", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0e13; --raised: #121922; --surface: #121922; --line: #263243; --line-strong: #3a4757;
    --text: #eaf0f6; --muted: #9aa8b9; --pulse: #ff6a4d; --pulse-ink: #0a0e13; --pulse-soft: #3d1912;
    --night: #5b8cff; --air: #3dd6f0; --move: #b6f35a; --warm: #ffb547; --calm: #b98cff;
    --ok-bg: #1b2a10; --warn-bg: #2f2410; --shadow: none;
    color-scheme: dark;
  }
}

*, *::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(--text);
  font: 16px/1.6 var(--sans); font-weight: 450; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -0.01em; line-height: 1.15; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--pulse); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--night); outline-offset: 2px; border-radius: 4px; }
code, kbd { font-family: var(--mono); font-size: .9em; background: var(--raised); border: 1px solid var(--line); border-radius: 6px; padding: .05em .35em; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
img { max-width: 100%; height: auto; display: block; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }

/* Layout */
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
.narrow { max-width: 46rem; }
section { padding: 3.5rem 0; }
section + section { border-top: 1px solid var(--line); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 42rem; }
.eyebrow { font-family: var(--display); font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--pulse); margin-bottom: .5rem; }
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 1.25rem; padding: 1.25rem; box-shadow: var(--shadow); }
.card h3 { margin-top: .25rem; }
.card p:last-child { margin-bottom: 0; }
.icon { width: 2.5rem; height: 2.5rem; border-radius: 999px; display: grid; place-items: center; margin-bottom: .5rem; color: var(--c, var(--pulse)); background: color-mix(in srgb, var(--c, var(--pulse)) 14%, transparent); }
.icon svg { width: 1.3rem; height: 1.3rem; }

/* Header and footer */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 1rem; padding-top: .6rem; padding-bottom: .6rem; }
.brand { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.brand b { font-weight: inherit; }
.brand img { width: 2rem; height: 2rem; border-radius: .5rem; }
.brand span { color: var(--pulse); }
.top nav { margin-left: auto; min-width: 0; display: flex; gap: .15rem; overflow-x: auto; scrollbar-width: none; }
.top nav a { color: var(--muted); text-decoration: none; padding: .35rem .7rem; border-radius: 999px; white-space: nowrap; font-size: .95rem; }
.top nav a:hover, .top nav a[aria-current="page"] { background: var(--raised); color: var(--text); }
footer { border-top: 1px solid var(--line); padding: 2rem 0 3rem; color: var(--muted); font-size: .9rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; }
footer nav { display: flex; gap: 1rem; flex-wrap: wrap; }
footer a { color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .5rem; border-radius: 999px; padding: .75rem 1.3rem; font-weight: 700; font-family: var(--display); font-size: 1rem; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: transform .1s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--pulse); color: var(--pulse-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--raised); }
.btn svg { width: 1.1rem; height: 1.1rem; }

/* Hero */
.hero { padding: 3.5rem 0 2.5rem; }
.hero .wrap { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 60rem) { .hero .wrap { grid-template-columns: 5fr 6fr; gap: 3rem; } }
.hero .actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0 1rem; }
.hero .note { font-size: .85rem; color: var(--muted); }
.shot { border: 1px solid var(--line); border-radius: 1rem; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.shot img { width: 100%; aspect-ratio: 1280 / 800; object-fit: cover; object-position: top; }
.shot.phone img { aspect-ratio: 390 / 844; }

/* Feature rows: text beside a screenshot, alternating sides on wide screens */
.feature { display: grid; gap: 1.25rem; align-items: center; padding: 1.5rem 0; }
.feature + .feature { border-top: 1px dashed var(--line); }
@media (min-width: 56rem) {
  .feature { grid-template-columns: 2fr 3fr; gap: 2.5rem; }
  .feature:nth-child(even) > .text { order: 2; }
}
.feature .text h3 { font-size: 1.35rem; }
.feature ul { padding-left: 1.1rem; margin: 0; }
.feature li { margin-bottom: .25rem; }

/* App screenshots (phone), hidden until the images exist */
.phones { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: 1.25rem; justify-items: center; max-width: 64rem; margin: 0 auto; }
.phones .shot { width: 100%; max-width: 15rem; border-radius: 1.5rem; }
.phones .shot img { aspect-ratio: 1080 / 2400; object-fit: cover; }

/* Privacy model diagram */
.flow { display: grid; gap: .75rem; grid-template-columns: 1fr; counter-reset: step; margin: 1.5rem 0; }
@media (min-width: 56rem) { .flow { grid-template-columns: repeat(4, 1fr); } }
.flow .step { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; padding: 1rem 1rem 1rem 3.1rem; }
.flow .step::before { counter-increment: step; content: counter(step); position: absolute; left: 1rem; top: 1rem; width: 1.6rem; height: 1.6rem; border-radius: 999px; background: var(--pulse); color: var(--pulse-ink); font: 700 .85rem/1.6rem var(--display); text-align: center; }
.flow .step strong { display: block; font-family: var(--display); margin-bottom: .2rem; }
.flow .step p { margin: 0; font-size: .95rem; color: var(--muted); }
.two { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.list-ok, .list-no { padding-left: 0; list-style: none; margin: 0; }
.list-ok li, .list-no li { padding-left: 1.7rem; position: relative; margin-bottom: .35rem; }
.list-ok li::before, .list-no li::before { position: absolute; left: 0; top: .05em; font-weight: 700; }
.list-ok li::before { content: "✓"; color: var(--move); }
.list-no li::before { content: "✕"; color: var(--pulse); }

/* Editions */
.editions .card { display: flex; flex-direction: column; }
.editions .card .tag { font-family: var(--display); font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.editions .card ul { padding-left: 1.1rem; margin: .5rem 0 1rem; flex: 1; }
.editions .card li { margin-bottom: .3rem; }
.editions .card.highlight { border-color: var(--pulse); }

/* Download */
.download-box { background: var(--surface); border: 1px solid var(--line); border-radius: 1.25rem; padding: 1.5rem; box-shadow: var(--shadow); max-width: 44rem; }
.download-box .meta { font-size: .9rem; color: var(--muted); margin-top: 1rem; }
.download-box code { display: inline-block; max-width: 100%; }

/* FAQ */
.faq details { border-top: 1px solid var(--line); padding: .25rem 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-family: var(--display); font-weight: 600; padding: .75rem 0; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--pulse); font-size: 1.3rem; line-height: 1; flex-shrink: 0; }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 0 1rem; color: var(--muted); }
.faq details > div p:last-child { margin-bottom: 0; }

/* Legal pages and other long text */
.doc { padding: 2.5rem 0 4rem; }
.doc h1 { margin-bottom: .25rem; }
.doc .dates { color: var(--muted); margin-bottom: 2rem; }
.doc h2 { font-size: 1.5rem; margin-top: 2.5rem; scroll-margin-top: 5rem; }
.doc h3 { font-size: 1.1rem; margin-top: 1.5rem; }
.doc ul, .doc ol { padding-left: 1.3rem; }
.doc li { margin-bottom: .35rem; }
.summary { background: var(--surface); border: 1px solid var(--pulse); border-left-width: .35rem; border-radius: 1rem; padding: 1.25rem 1.5rem; margin: 1.5rem 0 2rem; }
.summary h2 { margin-top: 0; font-size: 1.2rem; }
.summary ul { margin: 0; }
.toc { background: var(--raised); border-radius: 1rem; padding: 1rem 1.5rem; margin-bottom: 2rem; font-size: .95rem; }
.toc ol { margin: 0; columns: 2; column-gap: 2rem; }
@media (max-width: 40rem) { .toc ol { columns: 1; } }
.toc a { color: var(--text); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; margin: 1rem 0 1.5rem; }
th, td { text-align: left; vertical-align: top; padding: .55rem .6rem; border-bottom: 1px solid var(--line); }
th { font-family: var(--display); font-weight: 600; background: var(--raised); }
.table-wrap { overflow-x: auto; }
.callout { background: var(--warn-bg); border-radius: .75rem; padding: .9rem 1.1rem; margin: 1rem 0; }
.callout.ok { background: var(--ok-bg); }
blockquote { margin: 1rem 0; padding: .5rem 1.25rem; border-left: 3px solid var(--line-strong); color: var(--muted); font-style: italic; }

/* Forms (contact page) */
form.contact { display: grid; gap: 1rem; max-width: 36rem; }
form.contact label { display: grid; gap: .3rem; font-weight: 600; font-size: .95rem; }
form.contact input, form.contact select, form.contact textarea { font: inherit; font-weight: 450; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: .6rem; padding: .6rem .75rem; width: 100%; }
form.contact textarea { min-height: 10rem; resize: vertical; }
form.contact .hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.status { border-radius: .75rem; padding: .9rem 1.1rem; margin-top: 1rem; }
.status.ok { background: var(--ok-bg); }
.status.err { background: var(--warn-bg); }
[hidden] { display: none !important; }
