/* GlucoConvert — glucoconvert.app
   Self-contained stylesheet. No external requests: no webfont CDN, no icon font.
   Derived from the Nocturne design-system tokens, re-grounded to the light
   medical palette the pages actually use. */

:root {
  /* Type — system stack. On iOS/macOS this resolves to SF Pro, which is the
     right voice for an Apple-first product and costs zero network requests. */
  --font-heading: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading-weight: 600;

  /* Ground */
  --color-bg: #eef4ff;
  --color-surface: #ffffff;
  --color-text: #0d1f3c;

  /* Accent ramp */
  --color-accent: #2f7dff;
  --color-accent-100: #f2f7ff;
  --color-accent-200: #dceaff;
  --color-accent-300: #b9d4ff;
  --color-accent-400: #7eb0ff;
  --color-accent-500: #2f7dff;
  --color-accent-600: #1e5fd0;
  --color-accent-700: #17489f;
  --color-accent-800: #123770;
  --color-accent-900: #0d2547;

  --color-divider: color-mix(in srgb, #0d1f3c 14%, transparent);
  --color-muted: color-mix(in srgb, #0d1f3c 62%, transparent);
  --color-faint: color-mix(in srgb, #0d1f3c 52%, transparent);

  /* Clinical range signals */
  --ok: #2fae4f;
  --warn: #e08a2c;
  --bad: #e0342a;

  /* Elevation */
  --shadow-sm: 0 0 0 1px color-mix(in srgb, #0d1f3c 8%, transparent);
  --shadow-md: 0 0 0 1px color-mix(in srgb, #0d1f3c 8%, transparent),
    0 8px 24px rgba(13, 31, 60, 0.08);
  --shadow-lg: 0 0 0 1px color-mix(in srgb, #0d1f3c 10%, transparent),
    0 24px 60px rgba(13, 31, 60, 0.14);

  --radius: 12px;
  --wrap: 1120px;
  --wrap-prose: 820px;
}

/* ---------- Base ---------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  letter-spacing: -0.02em;
}

h6 {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

a { color: var(--color-accent-600); text-decoration: none; }
a:hover { color: var(--color-accent-700); text-decoration: underline; }
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

img { max-width: 100%; height: auto; display: block; }
::selection { background: color-mix(in srgb, var(--color-accent) 22%, transparent); }

/* Screen-reader-only, used for the skip link */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed; top: 12px; left: 12px; z-index: 100;
  width: auto; height: auto; clip: auto; margin: 0;
  padding: 10px 16px; background: var(--color-surface);
  border-radius: 8px; box-shadow: var(--shadow-md);
}

/* ---------- Layout ---------- */

.page {
  min-height: 100vh;
  background:
    radial-gradient(120% 70% at 88% -10%, #d7e8ff 0%, rgba(215, 232, 255, 0) 60%),
    radial-gradient(90% 60% at 0% 0%, #e6fbf5 0%, rgba(230, 251, 245, 0) 55%),
    var(--color-bg);
}
.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 28px; }
.wrap-prose { max-width: var(--wrap-prose); margin: 0 auto; padding-inline: 28px; }

.hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0, var(--color-divider) 48px,
    var(--color-divider) calc(100% - 48px), transparent 100%);
}

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

.site-header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, #eef4ff 82%, transparent);
  border-bottom: 1px solid var(--color-divider);
}
.site-header .bar {
  display: flex; align-items: center; gap: 20px;
  padding-block: 14px;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  color: var(--color-text); text-decoration: none;
}
.brand:hover { color: var(--color-text); text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; box-shadow: var(--shadow-sm); }
.brand span {
  font-family: var(--font-heading); font-weight: 600;
  font-size: 17px; letter-spacing: -0.01em;
}
.site-nav {
  margin-left: auto;
  display: flex; align-items: center; gap: 22px;
  font-size: 14px;
}
.site-nav a { color: color-mix(in srgb, var(--color-text) 70%, transparent); }
.site-nav a[aria-current="page"] { color: var(--color-accent-600); }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-heading); font-weight: 600; font-size: 15px;
  padding: 12px 20px; border-radius: 10px;
  border: 1.5px solid transparent; background: transparent;
  cursor: pointer; text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { color: var(--color-accent); border-color: var(--color-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--color-accent) 12%, transparent); color: var(--color-accent-700); }
.btn-primary:active { background: color-mix(in srgb, var(--color-accent) 22%, transparent); }
.btn-secondary { color: var(--color-text); border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); color: var(--color-text); }
.btn-secondary:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-sm { font-size: 14px; padding: 8px 14px; }

/* "Coming soon" — not a link, so it cannot 404 or be crawled as a dead URL */
.btn-soon {
  color: var(--color-faint);
  border-color: var(--color-divider);
  border-style: dashed;
  cursor: default;
}
.btn-soon:hover { background: none; color: var(--color-faint); }

/* ---------- Store badges ---------- */

.store-badges { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.store-badge { display: inline-block; line-height: 0; }
.store-badge img { height: 52px; width: auto; display: block; border-radius: 10px; }
a.store-badge { transition: opacity 0.15s ease; }
a.store-badge:hover { opacity: 0.82; }
/* App Store: app not yet published — badge shown dimmed, no link, until the URL exists */
.store-badge-soon { opacity: 0.45; cursor: default; }
.store-badge-caption {
  display: block; margin-top: 6px; line-height: 1.3;
  font-size: 11px; text-align: center; color: var(--color-faint);
}
.store-badges-sm { gap: 10px; align-items: center; }
.store-badges-sm .store-badge img { height: 34px; border-radius: 7px; }

/* ---------- Tags ---------- */

.tag {
  display: inline-flex; align-items: center;
  font-family: var(--font-heading); font-weight: 600; font-size: 12px;
  padding: 4px 10px; border-radius: 999px;
}
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent-600); }

/* ---------- Cards ---------- */

.card {
  background: var(--color-surface);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 24px;
}
.card-lg { border-radius: 20px; box-shadow: var(--shadow-md); padding: 28px; }
.card h3 {
  font-size: 17px; font-weight: 600; margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.card p { margin: 0; font-size: 14.5px; color: color-mix(in srgb, var(--color-text) 70%, transparent); }

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 56px; align-items: center;
  padding-block: 88px 72px;
}
.hero h1 {
  font-size: clamp(34px, 4.6vw, 60px);
  line-height: 1.04; letter-spacing: -0.03em;
  margin: 0 0 22px; max-width: 16em;
}
.hero .lede {
  font-size: 19px; line-height: 1.55; max-width: 34em;
  color: color-mix(in srgb, var(--color-text) 76%, transparent);
  margin: 0 0 14px;
}
.hero-shot {
  border-radius: 32px; overflow: hidden;
  box-shadow: var(--shadow-lg); max-width: 310px; margin-inline: auto;
}
.cta-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.fineprint { margin: 18px 0 0; font-size: 13px; color: var(--color-faint); }

/* ---------- Sections ---------- */

.section { padding-bottom: 88px; }
.section > .hr { margin: 0 0 48px; }
.section h2 { font-size: 34px; margin: 0 0 16px; }
.kicker { color: var(--color-accent-600); margin: 0 0 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.split-converter { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 56px; align-items: start; }

.range-key { display: grid; gap: 8px; font-size: 14px; color: color-mix(in srgb, var(--color-text) 68%, transparent); }
.range-key div { display: flex; align-items: center; gap: 9px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }

figure { margin: 0; }
figure .frame { border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-md); }
figcaption { font-size: 13px; margin-top: 12px; color: var(--color-muted); }

/* ---------- Converter widget ---------- */

.seg {
  display: flex; gap: 6px; padding: 4px;
  background: color-mix(in srgb, var(--color-text) 5%, transparent);
  border-radius: 12px; margin-bottom: 24px;
}
.seg button {
  flex: 1; cursor: pointer;
  border: 1px solid transparent; background: transparent;
  color: color-mix(in srgb, var(--color-text) 62%, transparent);
  font-family: var(--font-heading); font-weight: 600; font-size: 14px;
  padding: 9px 10px; border-radius: 9px;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.seg button[aria-selected="true"] {
  border-color: var(--color-accent);
  background: var(--color-surface);
  color: var(--color-accent-600);
  box-shadow: 0 1px 3px rgba(13, 31, 60, 0.1);
}
.field-label {
  display: block; font-size: 13px;
  color: var(--color-muted); margin-bottom: 6px;
}
.input {
  width: 100%;
  font-family: var(--font-heading); font-size: 40px; font-weight: 600;
  letter-spacing: -0.02em; padding: 6px 12px;
  border: 1px solid var(--color-divider); border-radius: 12px;
  background: color-mix(in srgb, var(--color-text) 3%, transparent);
  color: var(--color-text);
}
.input:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.readout {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-top: 26px; padding-top: 22px;
  border-top: 1px solid var(--color-divider);
}
.readout .unit { font-size: 13px; color: var(--color-muted); margin-bottom: 4px; }
.readout .value {
  font-family: var(--font-heading); font-size: 56px; line-height: 1;
  font-weight: 600; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.readout .flag {
  font-family: var(--font-heading); font-size: 15px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
}
.formula { margin: 22px 0 0; font-size: 12.5px; color: var(--color-faint); }

/* ---------- Pricing ---------- */

.price-card { display: grid; gap: 18px; }
.price-figure {
  font-family: var(--font-heading); font-size: 44px; font-weight: 600;
  letter-spacing: -0.03em; line-height: 1;
}
.price-list {
  display: grid; gap: 10px; font-size: 14.5px;
  border-top: 1px solid var(--color-divider); padding-top: 18px;
  margin: 0; padding-left: 0; list-style: none;
}
.price-terms {
  margin: 0; font-size: 12.5px; line-height: 1.55;
  color: var(--color-faint);
  border-top: 1px solid var(--color-divider); padding-top: 16px;
}

/* ---------- Legal / prose pages ---------- */

.legal { padding-block: 72px 96px; }
.legal h1 { font-size: clamp(32px, 4vw, 50px); letter-spacing: -0.03em; margin: 0 0 16px; }
.legal .updated { font-size: 14px; color: color-mix(in srgb, var(--color-text) 58%, transparent); margin: 0 0 8px; }
.legal .intro {
  font-size: 17px; line-height: 1.6; margin: 0 0 12px;
  color: color-mix(in srgb, var(--color-text) 78%, transparent);
}
.legal h2 { font-size: 22px; letter-spacing: -0.015em; margin: 0 0 10px; }
.legal p, .legal li { font-size: 15.5px; line-height: 1.65; }
.legal p { margin: 0 0 10px; }
.legal p:last-child { margin-bottom: 0; }
.legal ol.clauses { list-style: none; padding: 0; margin: 0; display: grid; gap: 34px; }
.legal ul { margin: 0 0 10px; padding-left: 20px; }
.legal ul li { margin-bottom: 6px; }

.callout {
  margin-top: 36px; padding: 20px 22px; border-radius: 14px;
  background: color-mix(in srgb, var(--bad) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--bad) 25%, transparent);
}
.callout .title {
  font-family: var(--font-heading); font-weight: 600;
  font-size: 16px; margin-bottom: 6px;
}
.callout p { margin: 0; font-size: 15px; line-height: 1.6; }

.callout-info {
  background: color-mix(in srgb, var(--color-accent) 7%, transparent);
  border-color: color-mix(in srgb, var(--color-accent) 25%, transparent);
}

.faq { display: grid; gap: 0; }
.faq details {
  border-bottom: 1px solid var(--color-divider);
  padding: 18px 0;
}
.faq summary {
  cursor: pointer; list-style: none;
  font-family: var(--font-heading); font-weight: 600; font-size: 17px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-size: 22px; font-weight: 400;
  color: var(--color-accent-600); line-height: 1; flex: none;
}
.faq details[open] summary::after { content: "\2013"; }
.faq details p { margin: 12px 0 0; font-size: 15.5px; line-height: 1.65; color: color-mix(in srgb, var(--color-text) 78%, transparent); }

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

.site-footer {
  border-top: 1px solid var(--color-divider);
  background: color-mix(in srgb, #ffffff 55%, transparent);
}
.site-footer .cols {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px; padding-block: 56px 40px;
}
.site-footer .label {
  font-family: var(--font-heading); font-size: 12px;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
  margin-bottom: 10px;
}
.site-footer .links { display: grid; gap: 9px; font-size: 14px; align-content: start; }
.site-footer .addr {
  font-size: 13.5px; color: color-mix(in srgb, var(--color-text) 62%, transparent);
  display: grid; gap: 4px; align-content: start; font-style: normal;
}
.site-footer .disclaimer {
  margin: 0; font-size: 13.5px; max-width: 30em;
  color: color-mix(in srgb, var(--color-text) 62%, transparent);
}
.site-footer .copy {
  padding-bottom: 40px; font-size: 12.5px;
  color: color-mix(in srgb, var(--color-text) 48%, transparent);
}

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

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-block: 56px 56px; }
  .hero h1 { max-width: none; }
  .split, .split-converter { grid-template-columns: 1fr; gap: 32px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer .cols { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 620px) {
  .wrap, .wrap-prose { padding-inline: 20px; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section h2 { font-size: 27px; }
  .site-nav { gap: 14px; font-size: 13px; }
  .site-nav .nav-secondary { display: none; }
  .readout { flex-direction: column; align-items: flex-start; gap: 10px; }
  .readout .value { font-size: 46px; }
  .legal { padding-block: 48px 64px; }
}

/* ---------- Dynamic Type on iOS ---------- */

/* Safari does not apply the system text-size setting to ordinary CSS: a
   `font-size` in px stays that size no matter how large the user has set
   Larger Text. The only opt-in is the `font` shorthand with one of Apple's
   system text-style keywords, which then tracks Dynamic Type live.

   This matters here specifically because the app links to /terms and /privacy
   from the paywall — a user who has enlarged their text to read the app was
   dropped into a page rendered at a fixed 15.5px. Applied to reading prose
   only; the marketing layout keeps its typographic scale.

   @supports keeps it to WebKit — the keyword is invalid elsewhere, so other
   browsers skip the block and keep the px sizes. */

@supports (font: -apple-system-body) {
  .legal p,
  .legal li,
  .legal .intro,
  .callout p,
  .faq details p {
    font: -apple-system-body;
    line-height: 1.6;
  }

  .legal h2 {
    font: -apple-system-title3;
    font-weight: 600;
    letter-spacing: -0.015em;
  }

  .faq summary {
    font: -apple-system-headline;
  }

  /* The version/date line stays subordinate to the body it labels. */
  .legal .updated {
    font: -apple-system-subheadline;
  }
}

/* ---------- Print (legal pages get printed / attached to filings) ---------- */

@media print {
  .site-header, .site-nav, .cta-row, .skip-link { display: none !important; }
  .page { background: #fff; }
  body { font-size: 11pt; color: #000; }
  a { color: #000; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
}
