/* FolioMed website — shared design system (landing, privacy, status).
   System font, the app's own palette, light + dark, and full respect for
   motion / transparency / contrast preferences. */

:root {
  --bg: #f5f5f7;
  --bg-raised: #ffffff;
  --bg-sunken: #ebebf0;
  --ink: #1d1d1f;
  --ink-2: #545458;
  --ink-3: #86868b;
  --line: rgba(0, 0, 0, 0.1);
  --tint: #0f6d99;
  --tint-ink: #ffffff;
  --tint-soft: rgba(15, 109, 153, 0.1);
  --mint: #00c7be;
  --red: #d70015;
  --red-dot: #ff3b30;
  --orange-dot: #ff9500;
  --green-dot: #34c759;
  --chrome: rgba(245, 245, 247, 0.78);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --radius: 18px;
  --radius-sm: 12px;
  --max: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui,
    "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-raised: #1c1c1e;
    --bg-sunken: #2c2c2e;
    --ink: #f5f5f7;
    --ink-2: #aeaeb2;
    --ink-3: #8e8e93;
    --line: rgba(255, 255, 255, 0.12);
    --tint: #5aaddb;
    --tint-ink: #000000;
    --tint-soft: rgba(90, 173, 219, 0.16);
    --red: #ff6961;
    --chrome: rgba(0, 0, 0, 0.72);
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font: 17px/1.47 var(--font);
  letter-spacing: -0.022em;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--tint); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--tint); outline-offset: 3px; border-radius: 8px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 22px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--bg-raised); padding: 8px 14px; border-radius: 10px; }
.skip:focus { left: 8px; }

/* ── Type ─────────────────────────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-display); margin: 0; color: var(--ink); }
.display { font-size: clamp(40px, 7vw, 72px); line-height: 1.05; letter-spacing: -0.03em; font-weight: 700; }
.headline { font-size: clamp(30px, 4.6vw, 48px); line-height: 1.08; letter-spacing: -0.025em; font-weight: 700; }
.title { font-size: 24px; line-height: 1.17; letter-spacing: -0.02em; font-weight: 600; }
.lede { font-size: clamp(19px, 2.2vw, 22px); line-height: 1.4; color: var(--ink-2); letter-spacing: -0.016em; }
.eyebrow { font-size: 14px; font-weight: 600; letter-spacing: 0; color: var(--tint); margin: 0 0 12px; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; line-height: 1.43; letter-spacing: -0.01em; }
.num { font-variant-numeric: tabular-nums; }

/* ── Nav (translucent material) ───────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--chrome);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 24px; height: 52px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 650; font-size: 17px; letter-spacing: -0.02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; background: var(--tint);
  color: var(--tint-ink); display: grid; place-items: center;
  font: 800 16px/1 var(--font-display); letter-spacing: -0.04em;
}
.nav-links { display: flex; gap: 22px; margin-left: auto; font-size: 14px; }
.nav-links a { color: var(--ink-2); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); text-decoration: none; }
@media (max-width: 720px) { .nav-links { display: none; } .nav .btn { margin-left: auto; } }

/* ── Buttons (instant press feedback) ─────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 980px; border: 0;
  font: 600 16px/1 var(--font); letter-spacing: -0.01em; cursor: pointer;
  background: var(--tint); color: var(--tint-ink);
  -webkit-tap-highlight-color: transparent;
  transition: transform 100ms ease-out, filter 150ms ease, background-color 150ms ease;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn:active { transform: scale(0.97); transition-duration: 60ms; }
.btn-sm { min-height: 32px; padding: 0 14px; font-size: 14px; }
.btn-plain { background: transparent; color: var(--tint); padding: 0 6px; }
.btn-plain:hover { filter: none; text-decoration: underline; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 32px;
  padding: 0 14px; border-radius: 980px; background: var(--bg-sunken);
  color: var(--ink-2); font-size: 14px; font-weight: 500;
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

/* ── Sections ─────────────────────────────────────────────────────────── */
section { padding: 96px 0; }
section + section { border-top: 0.5px solid var(--line); }
.section-head { max-width: 680px; margin: 0 0 48px; }
.section-head.center { margin: 0 auto 48px; text-align: center; }
.section-head .lede { margin-top: 16px; }
@media (max-width: 720px) { section { padding: 64px 0; } }

/* Hero */
.hero { padding: 72px 0 0; text-align: center; border: 0; }
.hero .lede { max-width: 640px; margin: 20px auto 0; }
.hero-cta { display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; margin: 32px 0 0; }
.hero-art { display: flex; justify-content: center; align-items: flex-end; gap: 28px; margin: 64px auto 0; padding: 0 22px; max-width: 900px; }
.hero-art .phone:nth-child(2) { margin-bottom: 40px; }
@media (max-width: 720px) { .hero-art .phone:nth-child(2) { display: none; } }

.facts { display: flex; justify-content: center; gap: 12px 32px; flex-wrap: wrap; padding: 36px 22px; margin: 0; list-style: none; color: var(--ink-2); font-size: 15px; border-bottom: 0.5px solid var(--line); }
.facts li { display: inline-flex; align-items: center; gap: 8px; }
.facts svg { width: 18px; height: 18px; color: var(--tint); }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; list-style: none; padding: 0; margin: 0; }
.step { background: var(--bg-raised); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--tint-soft); color: var(--tint); font-weight: 700; margin-bottom: 18px;
}
.step h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 6px; }
.step p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.47; }
.code-chip { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: 0.12em; background: var(--bg-sunken); padding: 1px 7px; border-radius: 6px; color: var(--ink); }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }

/* Feature rows */
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.feature + .feature { margin-top: 96px; }
.feature.flip .feature-art { order: -1; }
.feature-copy p { color: var(--ink-2); margin: 14px 0 0; font-size: 17px; }
.feature-copy ul { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; color: var(--ink-2); font-size: 15px; }
.feature-copy li { display: flex; gap: 10px; }
.feature-copy li::before { content: ""; width: 6px; height: 6px; margin-top: 9px; border-radius: 50%; background: var(--tint); flex: none; }
.feature-art { display: flex; justify-content: center; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--bg-sunken); border-radius: 6px; padding: 2px 8px; margin-left: 8px; vertical-align: middle; }
@media (max-width: 820px) {
  .feature { grid-template-columns: 1fr; gap: 36px; }
  .feature.flip .feature-art { order: 0; }
  .feature + .feature { margin-top: 72px; }
}

/* Privacy cards */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: var(--bg-raised); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.card svg { width: 28px; height: 28px; color: var(--tint); margin-bottom: 14px; }
.card h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 6px; }
.card p { margin: 0; color: var(--ink-2); font-size: 15px; }
@media (max-width: 820px) { .grid-3 { grid-template-columns: 1fr; } }

/* Numbers */
.numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; }
.numbers div { background: var(--bg-raised); padding: 26px 22px; }
.numbers strong { display: block; font: 700 40px/1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.numbers span { display: block; margin-top: 8px; color: var(--ink-2); font-size: 14px; }
@media (max-width: 720px) { .numbers { grid-template-columns: repeat(2, 1fr); } }

/* FAQ */
.faq { max-width: 760px; }
.faq details { border-bottom: 0.5px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 36px 20px 0; position: relative;
  font-weight: 600; font-size: 18px; letter-spacing: -0.02em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px;
  border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3);
  transform: translateY(-70%) rotate(45deg); transition: transform 200ms ease;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(225deg); }
.faq details p { margin: 0 0 22px; color: var(--ink-2); font-size: 16px; }

/* Closing CTA */
.cta { text-align: center; }
.cta .lede { max-width: 560px; margin: 16px auto 0; }

/* Footer */
footer { padding: 36px 0 56px; border-top: 0.5px solid var(--line); color: var(--ink-2); font-size: 13px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
footer nav { display: flex; gap: 20px; margin-left: auto; }
footer a { color: var(--ink-2); }

/* ── Phone illustration of the app (pure CSS, not a screenshot) ─────── */
.phone {
  --p-bg: #f2f2f7; --p-card: #fff; --p-ink: #1c1c1e; --p-ink-2: #636366;
  --p-line: #d1d1d6; --p-fill: rgba(118, 118, 128, 0.12); --p-tint: #0f6d99;
  width: 290px; flex: none; border-radius: 44px; padding: 10px;
  background: #1d1d1f; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0,0,0,0.1);
  font-family: var(--font); letter-spacing: -0.01em; text-align: left;
}
@media (prefers-color-scheme: dark) {
  .phone {
    --p-bg: #000; --p-card: #1c1c1e; --p-ink: #fff; --p-ink-2: #8e8e93;
    --p-line: #38383a; --p-fill: rgba(118, 118, 128, 0.24); --p-tint: #5aaddb;
    background: #2c2c2e; box-shadow: 0 0 0 1px rgba(255,255,255,0.08);
  }
}
.screen { position: relative; height: 580px; border-radius: 35px; overflow: hidden; background: var(--p-bg); color: var(--p-ink); }
.sb { display: flex; justify-content: space-between; padding: 14px 26px 0; font-size: 13px; font-weight: 600; }
.island { position: absolute; top: 10px; left: 50%; width: 92px; height: 26px; margin-left: -46px; border-radius: 20px; background: #000; }
.nb { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 14px 0; }
.nb i { width: 28px; height: 28px; border-radius: 50%; background: var(--p-fill); display: block; position: relative; }
.nb i.badge::after { content: "3"; position: absolute; top: -3px; right: -4px; min-width: 15px; height: 15px; border-radius: 8px; background: #ff3b30; color: #fff; font: 700 9px/15px var(--font); text-align: center; }
.lt { padding: 6px 16px 10px; }
.lt small { display: block; font-size: 12px; color: var(--p-ink-2); font-weight: 500; }
.lt b { display: block; font: 700 27px/1.1 var(--font-display); letter-spacing: 0.01em; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 0 12px; }
.stats div { background: var(--p-card); border-radius: 11px; padding: 9px; font-size: 10px; color: var(--p-ink-2); }
.stats div.urgent { box-shadow: inset 0 0 0 1.5px #ff3b30; }
.stats b { display: block; font: 700 19px/1.1 var(--font-display); color: var(--p-ink); font-variant-numeric: tabular-nums; margin-top: 3px; }
.sh { padding: 14px 16px 6px; font: 600 14px/1 var(--font-display); }
.ncard { position: relative; margin: 0 12px 7px; padding: 10px 10px 10px 14px; border-radius: 11px; background: var(--p-card); overflow: hidden; font-size: 10.5px; }
.ncard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--edge, var(--p-tint)); }
.ncard .row { display: flex; align-items: center; gap: 6px; color: var(--p-ink-2); font-size: 9.5px; }
.ncard .row .pr { font-weight: 600; color: var(--p-ink); } /* colour lives in the edge strip; text stays legible */
.ncard .row .t { margin-left: auto; }
.ncard p { margin: 6px 0 0; color: var(--p-ink); line-height: 1.35; }
.ncard .by { display: flex; align-items: center; gap: 6px; margin-top: 7px; color: var(--p-ink-2); font-size: 9.5px; }
.av { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font: 600 7.5px/1 var(--font); color: var(--av, #007aff); background: color-mix(in srgb, var(--av, #007aff) 18%, transparent); position: relative; flex: none; }
.av.ack::after { content: "✓"; position: absolute; right: -3px; bottom: -3px; width: 10px; height: 10px; border-radius: 50%; background: #34c759; color: #fff; font-size: 6.5px; line-height: 10px; text-align: center; box-shadow: 0 0 0 1.5px var(--p-card); }
.tabbar { position: absolute; left: 0; right: 0; bottom: 0; height: 64px; display: flex; justify-content: space-around; padding-top: 8px; background: color-mix(in srgb, var(--p-card) 82%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 0.5px solid var(--p-line); font-size: 9px; color: var(--p-ink-2); }
.tabbar span { display: grid; justify-items: center; gap: 3px; }
.tabbar span::before { content: ""; width: 20px; height: 20px; border-radius: 6px; background: currentColor; opacity: 0.3; }
.tabbar span.on { color: var(--p-tint); }
.tabbar span.on::before { opacity: 0.9; }
/* Thread screen */
.thread-head { padding: 12px 16px 8px; border-bottom: 0.5px solid var(--p-line); }
.thread-head b { display: block; font: 600 15px/1.2 var(--font-display); }
.thread-head small { color: var(--p-ink-2); font-size: 11px; }
.bubble { margin: 10px 14px 0; padding: 9px 11px; border-radius: 14px; background: var(--p-card); font-size: 11px; line-height: 1.35; max-width: 80%; }
.bubble small { display: block; color: var(--p-ink-2); font-size: 9.5px; margin-bottom: 3px; font-weight: 600; }
.bubble.me { margin-left: auto; background: var(--p-tint); color: #fff; }
.bubble.me small { color: rgba(255, 255, 255, 0.8); }
@media (prefers-color-scheme: dark) { .bubble.me { color: #000; } .bubble.me small { color: rgba(0,0,0,0.65); } }
.ackbar { position: absolute; left: 12px; right: 12px; bottom: 16px; display: flex; gap: 8px; }
.ackbar i { flex: 1; height: 38px; border-radius: 11px; background: var(--p-fill); font: 600 11.5px/38px var(--font); font-style: normal; text-align: center; color: var(--p-tint); }
.ackbar i.go { background: var(--p-tint); color: #fff; }
@media (prefers-color-scheme: dark) { .ackbar i.go { color: #000; } }
/* Compact art used in feature rows */
.mini { width: 340px; max-width: 100%; background: var(--bg-raised); border-radius: 24px; padding: 18px; box-shadow: var(--shadow); --p-card: var(--bg-sunken); --p-ink: var(--ink); --p-ink-2: var(--ink-2); --p-tint: var(--tint); }
.mini .ncard { margin: 0 0 8px; font-size: 13px; }
.mini .ncard .row { font-size: 11.5px; }
.mini .ncard .by { font-size: 11.5px; }
.mini .av { width: 24px; height: 24px; font-size: 9px; }
.mini .av.ack::after { width: 12px; height: 12px; font-size: 8px; line-height: 12px; }
.codebox { text-align: center; padding: 22px 10px; }
.codebox .digits { display: flex; justify-content: center; gap: 8px; margin: 14px 0 6px; }
.codebox .digits span { width: 46px; height: 58px; border-radius: 12px; background: var(--bg-sunken); display: grid; place-items: center; font: 600 28px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.vitals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vitals div { background: var(--bg-sunken); border-radius: 14px; padding: 14px; font-size: 13px; color: var(--ink-2); }
.vitals b { display: block; font: 700 30px/1.1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; margin-top: 4px; }
.vitals b small { font-size: 13px; font-weight: 500; color: var(--ink-2); margin-left: 3px; }
.vitals .warn b { color: var(--red); }

/* ── Reveal on scroll (subtle; off under Reduce Motion) ─────────────── */
/* Hidden only once site.js has started (it adds .js-reveal), so content
   stays visible if the script is blocked or fails. */
.js-reveal .reveal { opacity: 0; transform: translateY(16px); transition: opacity 600ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.js-reveal .reveal.in { opacity: 1; transform: none; }

/* ── Accessibility preferences ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .js-reveal .reveal { opacity: 1; transform: none; }
  .btn:active { transform: none; opacity: 0.7; }
}
@media (prefers-reduced-transparency: reduce) {
  .nav { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .tabbar { background: var(--p-card); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --line: rgba(127, 127, 127, 0.6); --ink-2: var(--ink); }
  .card, .step, .mini { box-shadow: 0 0 0 1px var(--line); }
}
@media (hover: none) { .btn:hover { filter: none; } }
