/* ============================================================
   MED Diary marketing site
   Palette and type are drawn from the app itself:
   lavender-gray canvas, deep navy ink, Poppins display,
   per-vital accents (BP coral, glucose raspberry, weight green).
   ============================================================ */

@font-face {
  font-family: "Poppins";
  src: url("assets/fonts/Poppins-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("assets/fonts/Poppins-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("assets/fonts/Poppins-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("assets/fonts/Poppins-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --canvas: #f2f2f8;
  --card: #ffffff;
  --ink: #1c2b4b;
  --ink-soft: #55617d;
  --line: #e3e3ee;

  --bp: #f16a6f;
  --glucose: #c9236a;
  --weight: #3fbe7b;
  --indigo: #5f51e8;
  --amber: #f0a93c;

  --night: #12141c;
  --night-card: #1d2029;
  --night-line: #2b2f3c;

  --radius: 20px;
  --radius-lg: 28px;
  --shadow: 0 2px 6px rgba(28, 43, 75, 0.06), 0 18px 44px -18px rgba(28, 43, 75, 0.22);
  --shadow-soft: 0 1px 3px rgba(28, 43, 75, 0.07);

  --display: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

.shell {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}
.shell-narrow { width: min(760px, calc(100% - 48px)); }

h1, h2, h3 {
  font-family: var(--display);
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 5.4vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }

p { margin: 0 0 1em; }

a { color: var(--indigo); }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: var(--display);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.18s ease;
}
.skip-link:focus { transform: translateY(0); }

.eyebrow {
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--glucose);
  margin-bottom: 0.9em;
}
.eyebrow-light { color: #ff8fb0; }

.section-head {
  max-width: 640px;
  margin-bottom: 48px;
}
.section-sub { color: var(--ink-soft); font-size: 1.05rem; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  background: var(--ink);
  border-radius: 999px;
  padding: 14px 28px;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); background: #27395f; }
.btn-small { padding: 9px 20px; font-size: 0.9rem; }

.ghost-link {
  font-family: var(--display);
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--line);
  padding-bottom: 2px;
  transition: border-color 0.25s ease;
}
.ghost-link:hover { border-color: var(--glucose); }

.appstore-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--ink);
  color: #fff;
  border-radius: 14px;
  padding: 10px 22px 10px 16px;
  text-decoration: none;
  line-height: 1.15;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.appstore-badge:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.appstore-badge small { display: block; font-size: 0.68rem; opacity: 0.85; }
.appstore-badge strong { font-family: var(--display); font-size: 1.15rem; font-weight: 600; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--canvas) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark { display: inline-flex; border-radius: 8px; overflow: hidden; }
.site-nav { display: flex; gap: 26px; }
.site-nav a {
  font-family: var(--display);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------- Hero ---------- */

.hero { padding: 72px 0 40px; overflow: hidden; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 48px;
}

.hero-copy .lede {
  font-size: 1.18rem;
  color: var(--ink-soft);
  max-width: 34em;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 26px;
  margin: 30px 0 14px;
  flex-wrap: wrap;
}
.hero-footnote { font-size: 0.86rem; color: var(--ink-soft); }

/* Hero page-load sequence */
.hero-copy > * {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-copy > *:nth-child(1) { animation-delay: 0.05s; }
.hero-copy > *:nth-child(2) { animation-delay: 0.12s; }
.hero-copy > *:nth-child(3) { animation-delay: 0.22s; }
.hero-copy > *:nth-child(4) { animation-delay: 0.32s; }
.hero-copy > *:nth-child(5) { animation-delay: 0.4s; }

@keyframes rise {
  to { opacity: 1; transform: translateY(0); }
}

/* The stage: two phones + floating reading chips */
.hero-stage {
  position: relative;
  height: clamp(460px, 52vw, 620px);
}

.phone {
  margin: 0;
  border-radius: 40px;
  border: 10px solid #10131b;
  background: #10131b;
  overflow: hidden;
  box-shadow: 0 30px 70px -25px rgba(28, 43, 75, 0.45);
}
.phone img { border-radius: 30px; }

.phone-front {
  position: absolute;
  width: min(62%, 300px);
  left: 6%;
  bottom: 0;
  z-index: 3;
  opacity: 0;
  animation: rise 0.9s 0.25s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.phone-back {
  position: absolute;
  width: min(56%, 270px);
  right: 2%;
  top: 0;
  transform: rotate(5deg);
  z-index: 1;
  opacity: 0;
  animation: rise-tilt 0.9s 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes rise-tilt {
  from { opacity: 0; transform: translateY(18px) rotate(5deg); }
  to { opacity: 1; transform: translateY(0) rotate(5deg); }
}

/* Reading chips — the app's logbook cells, escaped into the hero */
.chip {
  position: absolute;
  z-index: 4;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--ink);
  background: var(--card);
  border-radius: 999px;
  padding: 9px 18px;
  box-shadow: var(--shadow);
  opacity: 0;
  animation: chip-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             drift 7s 1.2s ease-in-out infinite;
}
.chip small { font-weight: 500; font-size: 0.72rem; color: var(--ink-soft); }
.chip em { font-style: normal; opacity: 0.45; }
.chip-dot {
  align-self: center;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}
.chip-bp    { top: 6%;  left: -2%;  animation-delay: 0.9s, 1.2s; }
.chip-bp .chip-dot { background: var(--bp); }
.chip-glucose { top: 38%; right: -4%; animation-delay: 1.5s, 2.4s; }
.chip-glucose .chip-dot { background: var(--glucose); }
.chip-weight { bottom: 20%; left: -6%; animation-delay: 2.1s, 3.1s; }
.chip-weight .chip-dot { background: var(--weight); }
.chip-logged {
  bottom: 4%;
  right: 6%;
  background: var(--weight);
  color: #fff;
  font-size: 0.9rem;
  animation-delay: 2.8s, 3.6s;
}

@keyframes chip-pop {
  0% { opacity: 0; transform: scale(0.6) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ---------- Scroll reveals ---------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Features ---------- */

.features { padding: 84px 0; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.feature-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 30px 28px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s ease, box-shadow 0.3s ease,
              opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.feature-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.feature-card p { color: var(--ink-soft); font-size: 0.96rem; margin: 0; }

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  margin-bottom: 18px;
}
.feature-icon svg { width: 26px; height: 26px; }
.icon-bp      { background: #fdeaea; color: var(--bp); }
.icon-meds    { background: #f9e3ec; color: var(--glucose); }
.icon-labs    { background: #eceafb; color: var(--indigo); }
.icon-results { background: #fdf3e0; color: var(--amber); }
.icon-share   { background: #e4f6ec; color: #23985d; }
.icon-devices { background: #e6f0fb; color: #3572c9; }

/* "Also inside" — the smaller features, set as quiet logbook chips */
.also-inside {
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 34px;
}
.also-inside-label {
  font-family: var(--display);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin: 0;
  flex: none;
}
.also-inside-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 0;
}
.also-inside-list li {
  font-family: var(--display);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.also-inside-list li:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }

/* Stagger cards a touch */
.feature-grid .feature-card:nth-child(2) { transition-delay: 0.08s; }
.feature-grid .feature-card:nth-child(3) { transition-delay: 0.16s; }
.feature-grid .feature-card:nth-child(5) { transition-delay: 0.08s; }
.feature-grid .feature-card:nth-child(6) { transition-delay: 0.16s; }
.feature-card.is-visible { transition-delay: 0s, 0s; }

/* ---------- Split (medication compare) ---------- */

.split { padding: 40px 0 84px; }
.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 64px;
  align-items: center;
}
.phone-static {
  width: min(100%, 300px);
  margin-inline: auto;
}
.split-copy p { color: var(--ink-soft); }

.check-list {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
}
.check-list li {
  position: relative;
  padding-left: 32px;
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 0.98rem;
}
.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--weight);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Privacy (dark band) ---------- */

.privacy {
  background: var(--night);
  color: #eef0f6;
  padding: 96px 0;
  border-radius: 44px;
  margin: 0 12px;
}
.privacy h2 { color: #fff; }
.privacy .section-sub { color: #a7adbf; }

.privacy-steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding: 0;
  margin: 0;
}
.privacy-step { counter-increment: step; }
.privacy-step .phone-static { width: min(100%, 260px); margin: 0 auto 24px; }
.privacy-step .phone {
  border-color: #262a36;
  background: #262a36;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
}
.privacy-step h3 {
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}
.privacy-step h3::before {
  content: counter(step);
  font-size: 0.8rem;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  background: var(--glucose);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.privacy-step p { color: #a7adbf; font-size: 0.95rem; }

.privacy-step:nth-child(2) { transition-delay: 0.1s; }
.privacy-step:nth-child(3) { transition-delay: 0.2s; }

.privacy-extra {
  margin: 52px auto 0;
  max-width: 520px;
  text-align: center;
  color: #cdd2e0;
  font-size: 1.02rem;
}

/* ---------- iPad ---------- */

.ipad-section { padding: 96px 0 40px; }
.ipad-frame {
  margin: 0 auto;
  width: min(680px, 100%);
  border-radius: 34px;
  border: 12px solid #10131b;
  background: #10131b;
  overflow: hidden;
  box-shadow: 0 40px 90px -35px rgba(28, 43, 75, 0.5);
}
.ipad-frame img { border-radius: 22px; }

/* ---------- Gallery ---------- */

.gallery { padding: 64px 0 40px; }
.gallery-scroll {
  display: flex;
  gap: 26px;
  overflow-x: auto;
  padding: 12px max(24px, calc((100vw - 1120px) / 2)) 32px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.gallery-scroll figure {
  flex: 0 0 232px;
  margin: 0;
  scroll-snap-align: start;
}
.gallery-scroll img {
  border-radius: 26px;
  border: 7px solid #10131b;
  background: #10131b;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
}
.gallery-scroll figure:hover img { transform: translateY(-6px); }
.gallery-scroll figcaption {
  font-family: var(--display);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-align: center;
  margin-top: 12px;
}

/* ---------- FAQ ---------- */

.faq { padding: 72px 0; }

.faq-item {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  margin-bottom: 14px;
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.02rem;
  padding: 20px 56px 20px 24px;
  position: relative;
  transition: color 0.2s ease;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  position: absolute;
  right: 24px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--ink-soft);
  border-bottom: 2px solid var(--ink-soft);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.3s ease;
}
.faq-item[open] summary::after { transform: translateY(-30%) rotate(225deg); }
.faq-item summary:hover { color: var(--glucose); }
.faq-item p {
  padding: 0 24px 22px;
  margin: 0;
  color: var(--ink-soft);
}

/* ---------- Contact ---------- */

.contact { padding: 24px 0 96px; }
.contact-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 56px 48px;
  text-align: center;
}
.contact-card p { color: var(--ink-soft); max-width: 32em; margin-inline: auto; }
.contact-card .btn { margin-top: 10px; }
.contact-footnote { font-size: 0.85rem; margin-top: 22px; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 44px;
}
.footer-row p {
  margin: 0 0 6px;
  font-size: 0.86rem;
  color: var(--ink-soft);
}
.footer-note { opacity: 1; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-bottom: 18px;
}
.footer-links a {
  color: var(--ink);
  font-family: var(--display);
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
}
.footer-links a:hover,
.footer-links a[aria-current="page"] { color: var(--glucose); }

/* ---------- Legal documents ---------- */

.legal-page { padding-bottom: 96px; }

.legal-hero,
.support-hero {
  padding: 72px 0 58px;
  background:
    radial-gradient(circle at 12% 20%, color-mix(in srgb, var(--glucose) 12%, transparent), transparent 28%),
    radial-gradient(circle at 88% 4%, color-mix(in srgb, var(--indigo) 12%, transparent), transparent 32%);
}
.legal-hero .lede,
.support-hero .lede {
  color: var(--ink-soft);
  font-size: 1.14rem;
  max-width: 42em;
}
.legal-updated {
  color: var(--ink-soft);
  font-size: 0.88rem;
  margin-top: 28px;
}

.legal-layout {
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(0, 760px);
  justify-content: center;
  align-items: start;
  gap: 64px;
  padding-top: 58px;
}
.legal-toc {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  border-left: 2px solid var(--line);
  padding-left: 18px;
}
.legal-toc-title {
  color: var(--ink);
  font-family: var(--display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.legal-toc ol { list-style: none; padding: 0; margin: 0; }
.legal-toc li { margin-bottom: 7px; }
.legal-toc a {
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.35;
  text-decoration: none;
}
.legal-toc a:hover { color: var(--glucose); }

.legal-document { min-width: 0; }
.legal-document > section {
  scroll-margin-top: 100px;
  margin-bottom: 52px;
}
.legal-document h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  margin-bottom: 18px;
}
.legal-document h3 {
  font-size: 1.02rem;
  margin: 26px 0 8px;
}
.legal-document p,
.legal-document li { color: var(--ink-soft); }
.legal-document ul,
.legal-document ol { padding-left: 1.3em; }
.legal-document li { margin-bottom: 10px; }
.legal-document strong { color: var(--ink); }
.legal-document a { overflow-wrap: anywhere; }

.legal-summary {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 32px 34px;
}
.legal-summary h2 { margin-bottom: 16px; }
.legal-checks { list-style: none; padding: 0 !important; margin: 0; }
.legal-checks li { position: relative; padding-left: 30px; }
.legal-checks li:last-child { margin-bottom: 0; }
.legal-checks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.05em;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  color: #fff;
  background: var(--weight);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
}
.legal-warning {
  color: #5f3c03;
  background: #fff4d9;
  border: 1px solid #f5d78e;
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 18px 0 24px;
}
.legal-warning p { color: inherit; margin: 0; }
.legal-warning strong { color: inherit; }
.legal-contact {
  background: color-mix(in srgb, var(--indigo) 7%, var(--card));
  border: 1px solid color-mix(in srgb, var(--indigo) 20%, var(--line));
  border-radius: var(--radius-lg);
  padding: 32px 34px;
}
.legal-contact p:last-child { margin-bottom: 0; }

/* ---------- Support ---------- */

.support-page { padding-bottom: 72px; }
.support-hero { text-align: center; }
.support-hero .lede { margin-inline: auto; }
.support-hero .btn { margin: 12px 0 18px; }
.support-note {
  color: var(--ink-soft);
  font-size: 0.86rem;
  max-width: 42em;
  margin-inline: auto;
}
.support-content { padding: 58px 0 28px; }
.support-emergency { max-width: 820px; margin: 0 auto 38px; }
.support-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.support-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 28px;
}
.support-card h2 { font-size: 1.15rem; }
.support-card p { color: var(--ink-soft); font-size: 0.94rem; }
.support-card .ghost-link { display: inline; font-size: 0.9rem; }
.support-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  color: var(--indigo);
  background: color-mix(in srgb, var(--indigo) 12%, var(--card));
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 16px;
}
.support-faq { padding-top: 58px; }

/* ---------- Dark scheme ---------- */

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #12141c;
    --card: #1d2029;
    --ink: #eef0f6;
    --ink-soft: #a7adbf;
    --line: #2b2f3c;
    --shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 18px 44px -18px rgba(0, 0, 0, 0.6);
    --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
  .btn { background: var(--indigo); }
  .btn:hover { background: #6f62f0; }
  .appstore-badge { background: #fff; color: #12141c; }
  .privacy { background: #090a0f; }
  .chip { background: var(--card); }
  .icon-bp      { background: #3a2326; }
  .icon-meds    { background: #381f2c; }
  .icon-labs    { background: #262242; }
  .icon-results { background: #3a3122; }
  .icon-share   { background: #1e3529; }
  .icon-devices { background: #1f2c3f; }
  .legal-warning { color: #ffe4a6; background: #302919; border-color: #5c4a22; }
}

/* ---------- Responsive ---------- */

@media (max-width: 920px) {
  .site-nav { display: none; }

  .hero { padding-top: 48px; }
  .hero-grid { grid-template-columns: 1fr; gap: 56px; }
  .hero-stage {
    height: auto;
    aspect-ratio: 1 / 1.18;
    width: min(100%, 440px);
    margin-inline: auto;
  }

  .feature-grid { grid-template-columns: repeat(2, 1fr); }

  .split-grid { grid-template-columns: 1fr; gap: 40px; }
  .split-copy { text-align: left; }

  .privacy-steps { grid-template-columns: 1fr; max-width: 420px; margin-inline: auto; }
  .privacy-step { text-align: center; }
  .privacy-step h3 { justify-content: center; }

  .legal-layout { grid-template-columns: 1fr; gap: 32px; }
  .legal-toc {
    position: static;
    max-height: none;
    border-left: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 24px;
  }
  .legal-toc ol { columns: 2; column-gap: 30px; }
  .legal-toc li { break-inside: avoid; }
  .support-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .feature-grid { grid-template-columns: 1fr; }
  .hero-actions { gap: 18px; }
  .chip { font-size: 0.9rem; padding: 8px 14px; }
  .chip-bp { left: -4%; }
  .chip-glucose { right: -5%; }
  .chip-weight { left: -7%; }
  .contact-card { padding: 40px 24px; }
  .privacy { border-radius: 28px; margin: 0 8px; }
  .legal-hero, .support-hero { padding: 48px 0 42px; }
  .legal-layout { padding-top: 38px; }
  .legal-toc ol { columns: 1; }
  .legal-summary, .legal-contact { padding: 26px 22px; }
  .support-grid { grid-template-columns: 1fr; }
  .support-card { padding: 24px; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-copy > *,
  .phone-front,
  .phone-back,
  .chip {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .phone-back { transform: rotate(5deg); }
  .reveal { opacity: 1; transform: none; transition: none; }
  .feature-card, .btn, .appstore-badge, .gallery-scroll img { transition: none; }
}

/* ---------- Focus visibility ---------- */

a:focus-visible,
summary:focus-visible,
.gallery-scroll:focus-visible {
  outline: 3px solid var(--indigo);
  outline-offset: 3px;
  border-radius: 6px;
}
