/* =============================================================================
   ShiftHawk — www.shifthawk.ai design system
   Mirrors the app's Tamagui tokens (app/tamagui.config.ts) so web ⇄ app match.
   Type: Plus Jakarta Sans (display/body) + JetBrains Mono (codes, chains).
   Icons: Phosphor (duotone primary), loaded via @phosphor-icons/web CDN.
   ========================================================================== */

:root {
  /* ---- Brand: cyan medical ---- */
  --primary: #0891B2;
  --primary-deep: #0E7490;
  --primary-bright: #22D3EE;
  --primary-soft: #ECFEFF;
  --primary-tint: #A5F3FC;

  /* ---- Playful accents (deliberate, curated — not algorithmic) ---- */
  --pink: #F472B6;
  --banana: #FACC15;
  --mint: #6EE7B7;
  --lilac: #C4B5FD;
  --peach: #FCA5A5;
  --orange: #F97316;
  --indigo: #6366F1;
  --rose: #F43F5E;
  --amber: #F59E0B;

  /* ---- Semantic ---- */
  --success: #059669;
  --warning: #F59E0B;
  --danger: #DC2626;

  /* ---- Light surfaces (default) ---- */
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --text-1: #0F172A;
  --text-2: #475569;
  --text-3: #94A3B8;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;

  /* ---- Dark band (hero / footer) ---- */
  --ink: #0B1220;
  --ink-2: #0F172A;
  --ink-surface: #1E293B;
  --ink-border: #334155;
  --ink-text-1: #F1F5F9;
  --ink-text-2: #94A3B8;

  /* ---- Type ---- */
  --font-display: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* ---- Radius (app scale: 6/12/16/24/pill) ---- */
  --r-1: 6px;
  --r-2: 12px;
  --r-3: 16px;
  --r-4: 24px;
  --r-pill: 9999px;

  /* ---- Spacing (app scale: 4·8·12·16·24·32·48·64) ---- */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --s-9: 96px; --s-10: 128px;

  /* ---- Shadows (soft, layered — never harsh) ---- */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, .08), 0 2px 4px rgba(15, 23, 42, .04);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, .12), 0 6px 12px rgba(15, 23, 42, .06);
  --shadow-cyan: 0 12px 40px rgba(8, 145, 178, .28);

  --container: 1120px;
  --nav-h: 68px;
}

/* ============================ Dark theme (additive) ============================
   Default LIGHT is a visual no-op (no [data-theme] attr OR data-theme="light").
   Under html[data-theme="dark"] we REDEFINE the light-surface tokens to dark
   equivalents so the whole site re-themes through the var() cascade. Sections
   already dark in light mode (.hero, .site-footer, .band-cyan) keep their own
   ink/cyan tokens and stay dark/colored in BOTH modes. Per-component hardcoded
   hex is overridden in each component's own stylesheet.
   ========================================================================== */
html[data-theme="dark"] {
  /* surfaces flip to dark; --ink* (hero/footer) stay as-is so those bands persist */
  --bg: #0B1220;
  --surface: #131C2E;
  --surface-2: #0F172A;
  --text-1: #F1F5F9;
  --text-2: #B6C2D4;
  --text-3: #8595AD;
  --border: #2A3852;
  --border-strong: #3A4A66;

  /* primary stays vivid cyan; soft/tint become dark-friendly translucent tints
     so eyebrows / chips / step-numbers read on dark surfaces */
  --primary: #22D3EE;
  --primary-deep: #67E8F9;
  --primary-soft: rgba(34, 211, 238, .12);
  --primary-tint: rgba(34, 211, 238, .35);

  /* soften the heavy light-mode shadows on dark (mostly imperceptible, but
     keeps the cyan glow controlled) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .25);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, .45), 0 2px 4px rgba(0, 0, 0, .30);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, .55), 0 6px 12px rgba(0, 0, 0, .35);
  --shadow-cyan: 0 12px 40px rgba(34, 211, 238, .22);
}

/* ============================ Reset / 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; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--primary-deep); text-decoration: none; }
a:hover { color: var(--primary); }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text-1); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
h3 { font-size: 1.3rem; font-weight: 700; }
p { margin: 0 0 1rem; color: var(--text-2); }
strong { color: var(--text-1); font-weight: 700; }

/* ============================ Layout ============================ */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--s-5); }
.section { padding: var(--s-9) 0; }
.section-sm { padding: var(--s-7) 0; }
.center { text-align: center; }
.measure { max-width: 720px; margin-left: auto; margin-right: auto; }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-family: var(--font-mono); font-size: .8rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--primary-deep);
  background: var(--primary-soft); border: 1px solid var(--primary-tint);
  padding: 6px 12px; border-radius: var(--r-pill); margin-bottom: var(--s-4);
}
.lead { font-size: 1.2rem; color: var(--text-2); }

/* ============================ Header / nav ============================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  /* Solid fallback FIRST so iOS Safari (which renders the sticky bar dark when
     it can't apply the translucent layer) always paints a light bar. */
  background: var(--surface);
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--border);
}
/* backdrop-filter is a progressive enhancement only — applied where supported,
   it lets a hint of the content blur through without ever making the bar dark. */
@supports ((-webkit-backdrop-filter: blur(12px)) or (backdrop-filter: blur(12px))) {
  .site-header {
    background: rgba(255, 255, 255, .8);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
  }
}
/* Dark mode: a solid dark surface with a translucent enhancement, light text. */
html[data-theme="dark"] .site-header {
  background: var(--surface-2);
  background: rgba(11, 18, 32, .96);
  border-bottom-color: var(--border);
}
@supports ((-webkit-backdrop-filter: blur(12px)) or (backdrop-filter: blur(12px))) {
  html[data-theme="dark"] .site-header {
    background: rgba(15, 23, 42, .78);
  }
}
html[data-theme="dark"] .brand { color: var(--text-1); }
/* wordmark.png has dark text — invert it to white only in dark mode header */
html[data-theme="dark"] .site-header .brand img { filter: brightness(0) invert(1); }
html[data-theme="dark"] .nav-links a { color: var(--text-2); }
html[data-theme="dark"] .nav-links a:hover { color: var(--text-1); }
/* toggle button stays visible on the dark bar */
html[data-theme="dark"] .theme-toggle { border-color: var(--border-strong); color: var(--text-1); }
html[data-theme="dark"] .theme-toggle:hover { background: var(--surface); }
.nav { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); }
.brand { display: flex; align-items: center; gap: var(--s-2); font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: var(--text-1); letter-spacing: -0.02em; }
.brand img { height: 44px; width: auto; }
.brand .ph { color: var(--primary); font-size: 1.6rem; }
.nav-links { display: flex; align-items: center; gap: var(--s-6); }
.nav-links a { color: var(--text-2); font-weight: 600; font-size: .95rem; }
.nav-links a:hover { color: var(--text-1); }
@media (max-width: 820px) { .nav-links .nav-collapse { display: none; } }

/* ============================ Buttons ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  min-height: 48px; padding: 0 var(--s-5);
  border-radius: var(--r-2); border: 1.5px solid transparent;
  cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: var(--shadow-cyan); }
.btn-primary:hover { background: var(--primary-deep); color: #fff; box-shadow: 0 16px 48px rgba(8,145,178,.36); }
.btn-ghost { background: var(--surface); color: var(--text-1); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text-1); }
.btn-on-dark { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.22); }
.btn-on-dark:hover { background: rgba(255,255,255,.16); color: #fff; }
.btn-lg { min-height: 56px; padding: 0 var(--s-6); font-size: 1.08rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.center .btn-row { justify-content: center; }

/* ============================ Cards ============================ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-4); padding: var(--s-6); box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card .ph { font-size: 2.2rem; margin-bottom: var(--s-3); display: block; }
.card h3 { margin-bottom: var(--s-2); }
.card p { margin-bottom: 0; font-size: .98rem; }

.grid { display: grid; gap: var(--s-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ============================ Hero (dark band) ============================ */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(1200px 600px at 70% -10%, rgba(34,211,238,.18), transparent 60%), linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
  color: var(--ink-text-1);
  padding: calc(var(--nav-h) + var(--s-8)) 0 var(--s-9);
}
.hero h1 { color: #fff; }
.hero p { color: var(--ink-text-2); }
.hero .eyebrow { background: rgba(34,211,238,.12); border-color: rgba(34,211,238,.3); color: var(--primary-tint); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: var(--s-8); align-items: center; }
@media (max-width: 920px) { .hero-grid { grid-template-columns: 1fr; gap: var(--s-7); } }
.hero-glow { position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(8,145,178,.35), transparent 70%); filter: blur(40px); right: -120px; top: -80px; pointer-events: none; }

/* dotted accent motif (echoes the Schedule donor-dots) */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.dot-row { display: inline-flex; gap: 7px; align-items: center; }

/* ============================ Phone mockup ============================ */
.phone {
  position: relative; width: 280px; max-width: 78vw; margin: 0 auto;
  border-radius: 42px; padding: 12px;
  background: linear-gradient(160deg, #2b3648, #0c121e);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,.06) inset;
}
.phone::before { /* notch */
  content: ""; position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  width: 110px; height: 26px; background: #0c121e; border-radius: var(--r-pill); z-index: 2;
}
.phone img { border-radius: 32px; width: 100%; display: block; }
.phone-row { display: flex; gap: var(--s-5); justify-content: center; flex-wrap: wrap; }

/* ============================ Steps (how it works) ============================ */
.steps { counter-reset: step; display: grid; gap: var(--s-5); }
.step { display: grid; grid-template-columns: 56px 1fr; gap: var(--s-4); align-items: start; }
.step-num {
  counter-increment: step; width: 56px; height: 56px; border-radius: var(--r-3);
  display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: 1.3rem;
  background: var(--primary-soft); color: var(--primary-deep); border: 1px solid var(--primary-tint);
}
.step-num::before { content: counter(step); }
.step h3 { margin-bottom: 4px; }
.step p { margin-bottom: 0; }

/* ============================ Named-chain chips (Mirror/Triple/Mega/Karma) ===== */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: .82rem; font-weight: 600;
  padding: 5px 11px; border-radius: var(--r-pill); border: 1px solid;
}
.chip .ph { font-size: 1rem; }
.chip-mirror { background: var(--primary-soft); color: var(--primary-deep); border-color: var(--primary-tint); }
.chip-triple { background: #FFF7ED; color: #C2410C; border-color: #FED7AA; }
.chip-mega { background: #FFF1F2; color: #BE123C; border-color: #FECDD3; }
.chip-karma { background: #FDF2F8; color: #BE185D; border-color: #FBCFE8; }
.chip-quad { background: #EEF2FF; color: #4338CA; border-color: #C7D2FE; }
.chip-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* monospace shift-code inline */
.code { font-family: var(--font-mono); font-size: .9em; background: var(--surface-2); padding: 2px 7px; border-radius: var(--r-1); color: var(--primary-deep); border: 1px solid var(--border); }

/* ============================ Privacy / feature list ============================ */
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); }
.checklist li { display: grid; grid-template-columns: 28px 1fr; gap: var(--s-3); align-items: start; color: var(--text-2); }
.checklist li .ph { color: var(--success); font-size: 1.4rem; }
.xlist li .ph { color: var(--text-3); }

/* ============================ Pricing ============================ */
.price-card { max-width: 460px; margin: 0 auto; text-align: center; border: 2px solid var(--primary-tint); }
.price { font-family: var(--font-display); font-weight: 800; font-size: 3rem; color: var(--text-1); letter-spacing: -.03em; }
.price small { font-size: 1rem; font-weight: 600; color: var(--text-3); display: block; margin-top: var(--s-2); }

/* ============================ FAQ ============================ */
.faq { max-width: 760px; margin: 0 auto; display: grid; gap: var(--s-3); }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-3); padding: 0 var(--s-5); box-shadow: var(--shadow-sm); }
.faq summary { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; padding: var(--s-4) 0; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); color: var(--text-1); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "\002B"; font-family: var(--font-mono); color: var(--primary); font-size: 1.4rem; transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding-bottom: var(--s-4); margin: 0; }

/* ============================ Banded sections ============================ */
.band-soft { background: var(--surface-2); }
.band-cyan { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%); color: #fff; }
.band-cyan h2, .band-cyan p { color: #fff; }
.band-cyan .eyebrow { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.25); }

/* ============================ Footer ============================ */
.site-footer { background: var(--ink); color: var(--ink-text-2); padding: var(--s-8) 0 var(--s-6); }
.site-footer h4 { color: #fff; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; font-family: var(--font-mono); font-weight: 600; margin-bottom: var(--s-4); }
.site-footer a { color: var(--ink-text-2); display: block; padding: 5px 0; font-size: .95rem; }
.site-footer a:hover { color: var(--primary-tint); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--s-6); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s-6); } }
.footer-brand { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-3); }
/* wordmark.png ships with DARK "ShiftHawk" text; the footer band is dark in
   BOTH themes, so render the logo clean white unconditionally. */
.site-footer .footer-brand img { height: 28px; filter: brightness(0) invert(1); }
.footer-bottom { border-top: 1px solid var(--ink-border); margin-top: var(--s-7); padding-top: var(--s-5); display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s-3); font-size: .85rem; color: var(--text-3); }

/* ============================ Prose (legal pages) ============================ */
.prose { max-width: 760px; margin: 0 auto; }
.prose h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: var(--s-3); }
.prose h2 { font-size: 1.5rem; margin-top: var(--s-7); margin-bottom: var(--s-3); }
.prose h3 { margin-top: var(--s-5); }
.prose p, .prose li { color: var(--text-2); font-size: 1.02rem; }
.prose ul, .prose ol { padding-left: var(--s-5); margin-bottom: var(--s-4); }
.prose li { margin-bottom: var(--s-2); }
.prose .updated { font-family: var(--font-mono); font-size: .85rem; color: var(--text-3); margin-bottom: var(--s-6); }
.prose a { text-decoration: underline; }

/* ============================ Store badges ============================ */
.store-badges { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.center .store-badges { justify-content: center; }
.store-badge {
  display: inline-flex; align-items: center; gap: 11px;
  background: #0B1220; color: #fff; border: 1.5px solid rgba(255,255,255,.18);
  border-radius: var(--r-2); padding: 9px 18px; min-height: 56px;
  position: relative; transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.store-badge:hover { color: #fff; background: #131f33; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.store-badge .ph, .store-badge i { font-size: 1.95rem; line-height: 1; }
.store-badge__logo { width: 27px; height: 27px; flex: none; display: block; }
.store-badge__txt { display: flex; flex-direction: column; line-height: 1.08; text-align: left; }
.store-badge__txt small { font-size: .66rem; letter-spacing: .02em; opacity: .82; font-family: var(--font-body); text-transform: none; }
.store-badge__txt strong { font-size: 1.16rem; font-weight: 700; font-family: var(--font-display); letter-spacing: -.01em; color: #fff; }
/* pre-launch "Soon" ribbon — removed by JS once a real store URL is configured */
.store-badge.is-soon::after {
  content: "Soon"; position: absolute; top: -9px; right: -9px;
  font-family: var(--font-mono); font-size: .6rem; font-weight: 700; letter-spacing: .04em;
  background: var(--banana); color: #0B1220; padding: 2px 8px; border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
}
/* duotone logos render white on the dark pill */
.store-badge .ph-duotone { color: #fff; }
/* on the dark hero, lift the pill off the near-black background so it reads */
.hero .store-badge { background: #18243a; border-color: rgba(255,255,255,.22); box-shadow: var(--shadow-lg); }
.hero .store-badge:hover { background: #20304c; }
/* on the cyan band, give the dark pills a touch more separation */
.band-cyan .store-badge { border-color: rgba(255,255,255,.3); }

/* ============================ Dark-mode component overrides ============================
   Sections that hardcode light hex, or that need a tweak beyond the token flip.
   ========================================================================== */
html[data-theme="dark"] {
  /* .band-soft is light grey in light mode — give it a slightly different dark
     surface so alternating bands still read as a subtle alternation. */
}
html[data-theme="dark"] .band-soft { background: #0E1626; }

/* SVG diagram <img>s are light-background art (flowchart, work-vs-life,
   ForeSIGHT, ACGME). On the dark page they'd float; sit them on a soft light
   panel so they stay legible and intentional. */
html[data-theme="dark"] .diagram {
  background: #F4F8FC;
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  padding: var(--s-4);
}

/* Named-chain chips hardcode light pastel fills — flip to translucent tints. */
html[data-theme="dark"] .chip-triple { background: rgba(249,115,22,.16); color: #FDBA74; border-color: rgba(249,115,22,.4); }
html[data-theme="dark"] .chip-mega   { background: rgba(244,63,94,.16);  color: #FDA4AF; border-color: rgba(244,63,94,.4); }
html[data-theme="dark"] .chip-karma  { background: rgba(236,72,153,.16); color: #F9A8D4; border-color: rgba(236,72,153,.4); }
html[data-theme="dark"] .chip-quad   { background: rgba(99,102,241,.18); color: #A5B4FC; border-color: rgba(99,102,241,.42); }

/* FAQ marker + summary already use tokens; nothing extra needed. */

/* ============================ Reveal animation ============================ */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
