/* QuickMed — download site. Same identity as the app (packages/shared/src/tokens.js). */

@font-face { font-family: 'Plex'; src: url('assets/fonts/plex-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Plex'; src: url('assets/fonts/plex-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Cairo'; src: url('assets/fonts/cairo-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light dark;
  --bg: #F7F6F1;
  --surface: #FFFFFF;
  --surface-muted: #F1EFE7;
  --border: #E4E0D3;
  --text: #161616;
  --text-2: #3D3A3B;
  --muted: #69655E;
  --primary: #054239;
  --primary-hover: #002623;
  --on-primary: #FFFFFF;
  --primary-soft: #E5EFEC;
  --accent: #988561;
  --accent-soft: #F3EFE3;
  --oncall: #6B1F2A;
  --oncall-soft: #F6E6E8;
  --focus: #B9A779;
  --hero-1: #054239;
  --hero-2: #002623;
  --hero-text: #EDEBE0;
  --hero-muted: #B9C7C1;
  --shadow: 0 1px 2px rgba(0, 38, 35, .06), 0 8px 24px rgba(0, 38, 35, .08);
  --shadow-lg: 0 2px 6px rgba(0, 20, 18, .18), 0 24px 60px rgba(0, 20, 18, .28);
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #001714;
    --surface: #002623;
    --surface-muted: #063530;
    --border: #124A42;
    --text: #EDEBE0;
    --text-2: #C8C3B0;
    --muted: #93A39D;
    --primary: #B9A779;
    --primary-hover: #CDBE95;
    --on-primary: #161616;
    --primary-soft: #1C3930;
    --accent: #B9A779;
    --accent-soft: #0A3D37;
    --oncall: #E07A88;
    --oncall-soft: #3A1A20;
    --hero-1: #03332D;
    --hero-2: #001714;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 clamp(15px, 1.4vw + 11px, 17px)/1.75 'Plex', system-ui, 'Segoe UI', Tahoma, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: 'Cairo', 'Plex', system-ui, sans-serif; font-weight: 700; line-height: 1.3; margin: 0; letter-spacing: 0; }
p { margin: 0; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
.icon { width: 1.25em; height: 1.25em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- header ---------- */
.site-header { position: absolute; inset-inline: 0; top: 0; z-index: 10; color: var(--hero-text); }
.site-header.solid { position: sticky; background: var(--hero-2); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 700 20px/1 'Cairo', sans-serif; }
.brand img { width: 40px; height: 40px; border-radius: 11px; }
.nav { display: flex; gap: 4px; }
.nav a {
  text-decoration: none; font-size: 15px; padding: 8px 12px; border-radius: var(--r-pill);
  color: var(--hero-muted); transition: background .2s, color .2s;
}
.nav a:hover { background: rgba(237, 235, 224, .1); color: var(--hero-text); }
@media (max-width: 640px) { .nav .opt { display: none; } }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; color: var(--hero-text);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(185, 167, 121, .18), transparent 60%),
    radial-gradient(700px 500px at 0% 110%, rgba(66, 129, 119, .35), transparent 60%),
    linear-gradient(180deg, var(--hero-1), var(--hero-2));
  padding: calc(68px + clamp(28px, 6vw, 72px)) 0 clamp(56px, 9vw, 112px);
}
.hero::after { /* subtle wheat hairline at the bottom edge */
  content: ''; position: absolute; inset-inline: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(185, 167, 121, .5), transparent);
}
.hero-grid { display: grid; gap: clamp(32px, 5vw, 64px); align-items: center; }
@media (min-width: 920px) { .hero-grid { grid-template-columns: 1.15fr .85fr; } }
@media (max-width: 919px) { .dl-card { margin: 44px auto 0; width: 100%; max-width: 520px; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px;
  padding: 6px 14px; border-radius: var(--r-pill); font-size: 14px;
  background: rgba(185, 167, 121, .14); color: #E2D6B4; border: 1px solid rgba(185, 167, 121, .3);
}
.hero h1 { font-size: clamp(30px, 4.6vw + 8px, 56px); margin-bottom: 18px; text-wrap: balance; }
.hero h1 em { font-style: normal; color: #D6C59A; }
.lead { font-size: clamp(16px, 1vw + 12px, 19px); color: var(--hero-muted); max-width: 34em; text-wrap: pretty; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 26px 0 0; padding: 0; list-style: none; color: var(--hero-text); font-size: 15px; }
.trust li { display: inline-flex; align-items: center; gap: 8px; }
.trust .icon { color: #D6C59A; width: 18px; height: 18px; }

/* ---------- download card ---------- */
.dl-card {
  position: relative; background: var(--surface); color: var(--text);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: clamp(22px, 3vw, 32px); text-align: center;
  animation: rise .7s var(--ease) both .1s;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.dl-logo { width: 96px; height: 96px; margin: -72px auto 8px; border-radius: 24px; box-shadow: 0 0 0 4px var(--surface), 0 12px 26px rgba(0, 20, 18, .35); }
.dl-card h2 { font-size: 24px; }
.dl-sub { color: var(--muted); font-size: 15px; margin-top: 2px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 26px; border-radius: var(--r-md); border: 0; cursor: pointer;
  font: 600 18px/1 'Plex', sans-serif; text-decoration: none;
  transition: transform .15s var(--ease), background .2s, box-shadow .2s;
}
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 8px 22px rgba(5, 66, 57, .28); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: scale(.98); }
.btn[aria-disabled='true'] { opacity: .55; pointer-events: none; box-shadow: none; }
.dl-card .btn { width: 100%; margin-top: 20px; }
.dl-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.dl-meta span + span::before { content: '·'; margin-inline-end: 14px; color: var(--border); }
.dl-note {
  margin-top: 16px; padding: 10px 14px; border-radius: var(--r-sm); font-size: 14px; line-height: 1.7;
  background: var(--accent-soft); color: var(--text-2); text-align: start;
}
.dl-note[hidden] { display: none; }

.qr { display: none; margin-top: 22px; padding-top: 20px; border-top: 1px dashed var(--border); }
.qr-row { display: flex; align-items: center; gap: 16px; text-align: start; }
.qr-box { flex: none; width: 116px; height: 116px; padding: 10px; background: #fff; border-radius: 12px; border: 1px solid var(--border); }
.qr-row b { display: block; font-size: 15px; margin-bottom: 2px; }
.qr-row span { font-size: 14px; color: var(--muted); }
html[data-device='desktop'] .qr { display: block; }

/* ---------- sections ---------- */
section.block { padding: clamp(56px, 8vw, 96px) 0; }
.section-head { max-width: 640px; margin: 0 auto clamp(28px, 4vw, 44px); text-align: center; }
.section-head h2 { font-size: clamp(24px, 2vw + 14px, 34px); margin-bottom: 10px; }
.section-head p { color: var(--muted); }

.features { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .features { grid-template-columns: repeat(4, 1fr); } }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 24px; box-shadow: var(--shadow); transition: transform .25s var(--ease), box-shadow .25s;
}
.feature:hover { transform: translateY(-3px); }
.feature .badge {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 16px;
  background: var(--primary-soft); color: var(--primary);
}
.feature .badge.oncall { background: var(--oncall-soft); color: var(--oncall); }
.feature .badge .icon { width: 24px; height: 24px; }
.feature h3 { font-size: 19px; margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: 15px; }

/* install steps */
.alt { background: var(--surface-muted); border-block: 1px solid var(--border); }
.steps { display: grid; gap: 16px; counter-reset: step; padding: 0; margin: 0; list-style: none; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 24px 24px 22px; counter-increment: step;
}
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 14px;
  border-radius: 50%; background: var(--primary); color: var(--on-primary); font: 700 17px/1 'Cairo', sans-serif;
}
.steps h3 { font-size: 18px; margin-bottom: 6px; }
.steps p { color: var(--muted); font-size: 15px; }
.steps kbd { white-space: nowrap; font: inherit; font-weight: 600; color: var(--text); background: var(--surface-muted); border: 1px solid var(--border); border-radius: 6px; padding: 0 6px; }
.update-note { display: flex; gap: 10px; align-items: flex-start; max-width: 760px; margin: 24px auto 0; color: var(--text-2); font-size: 15px; }
.update-note .icon { color: var(--primary); margin-top: 4px; }

/* faq */
.faq { max-width: 760px; margin: 0 auto; display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }
.faq summary {
  list-style: none; cursor: pointer; padding: 16px 20px; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { transition: transform .25s var(--ease); color: var(--muted); }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq .answer { padding: 0 20px 18px; color: var(--text-2); font-size: 15px; }
.hash { display: block; margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface-muted); font: 12px/1.6 ui-monospace, 'Cascadia Mono', Consolas, monospace; word-break: break-all; color: var(--text); }

/* ---------- footer ---------- */
.site-footer { background: var(--hero-2); color: var(--hero-muted); padding: 40px 0 28px; font-size: 14px; }
.site-footer .wrap { display: grid; gap: 22px; }
@media (min-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr auto; align-items: center; } }
.site-footer .brand { color: var(--hero-text); }
.footer-text { margin-top: 10px; max-width: 46em; line-height: 1.8; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 20px; margin-top: 4px; }
.footer-links a { color: var(--hero-text); text-decoration: none; display: inline-block; padding: 10px 0; }
.footer-links a:hover { text-decoration: underline; }
.socials { display: flex; gap: 10px; }
.socials[hidden] { display: none; }
.socials a {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(237, 235, 224, .08); color: var(--hero-text); transition: background .2s, transform .2s;
}
.socials a:hover { background: rgba(185, 167, 121, .25); transform: translateY(-2px); }
.socials svg { width: 20px; height: 20px; }
.copy { grid-column: 1 / -1; border-top: 1px solid rgba(237, 235, 224, .1); padding-top: 18px; font-size: 13px; }

/* ---------- policy pages ---------- */
.doc { max-width: 760px; margin: 0 auto; padding: clamp(32px, 6vw, 64px) var(--gutter) 72px; }
.doc h1 { font-size: clamp(26px, 2vw + 18px, 38px); margin-bottom: 6px; }
.doc .updated { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.doc .intro { font-size: 17px; color: var(--text-2); padding: 16px 18px; border-radius: var(--r-md); background: var(--surface-muted); border: 1px solid var(--border); }
.doc h2 { font-size: 21px; margin: 32px 0 10px; }
.doc p + p { margin-top: 10px; }
.doc ul { margin: 10px 0 0; padding-inline-start: 1.3em; }
.doc li + li { margin-top: 6px; }
.doc-switch { display: flex; gap: 8px; margin-bottom: 26px; flex-wrap: wrap; }
.doc-switch a { text-decoration: none; padding: 8px 16px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); font-size: 15px; }
.doc-switch a[aria-current='page'] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

.notfound { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 48px var(--gutter); }
.notfound h1 { font-size: 34px; margin-bottom: 8px; }
.notfound p { color: var(--muted); margin-bottom: 22px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print { .site-header, .site-footer, .doc-switch { display: none; } body { background: #fff; color: #000; } }
