/* =========================================================================
   Phlebotomy Toolkit microsite — styles.css
   One stylesheet, dark theme, no external dependencies.
   Source of truth: strategy/06-design-system.md (tokens/components LOCKED;
   class names/selectors are executor discretion).
   ========================================================================= */

/* ---------- Design tokens (06 "Design tokens [LOCKED]") ---------- */
:root {
  --bg:           #0A0E17;
  --surface:      #121A28;
  --surface-2:    #1A2436;
  --line:         #24304A;
  --line-strong:  #33415C;
  --ink:          #F1F5F9;
  --body:         #CBD5E1;
  --muted:        #94A3B8;
  --brand:        #2DD4BF;
  --brand-strong: #14B8A6;
  --brand-ink:    #04211D;
  --focus:        #2DD4BF;

  --tube-blue:  #60A5FA;
  --tube-red:   #F87171;
  --tube-gold:  #FBBF24;
  --tube-green: #34D399;
  --tube-lav:   #A78BFA;
  --tube-gray:  #94A3B8;

  --alert:      #F87171;
  --alert-tint: #241318;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", sans-serif;

  --fs-hero:  clamp(2.25rem, 5.5vw, 3.5rem);
  --fs-h1:    clamp(2rem, 4.5vw, 2.75rem);
  --fs-h2:    clamp(1.5rem, 3.2vw, 2rem);
  --fs-h3:    1.25rem;
  --fs-lead:  clamp(1.05rem, 1.6vw, 1.25rem);
  --fs-body:  1.0625rem;
  --fs-small: 0.9375rem;

  --measure:     68ch;
  --content-max: 1120px;

  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;

  --radius-sm:   8px;
  --radius:      14px;
  --radius-lg:   22px;
  --radius-pill: 999px;

  --shadow-sm:   0 1px 2px rgba(0,0,0,.5);
  --shadow:      0 16px 40px -18px rgba(0,0,0,.7);
  --glow-brand:  0 0 60px -12px rgba(45,212,191,.25);

  --section-pad: var(--s8);
  --header-h: 64px;

  color-scheme: dark;
}

@media (min-width: 1024px) {
  :root { --section-pad: var(--s9); }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 76px;
}
body, h1, h2, h3, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { display: block; }

body {
  background: var(--bg);
  color: var(--body);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main { display: block; }

h1, h2, h3 {
  color: var(--ink);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); margin-bottom: var(--s5); }
h3 { font-size: var(--fs-h3); font-weight: 700; margin-bottom: var(--s3); }

p { max-width: var(--measure); }
p + p { margin-top: var(--s4); }

.lead {
  font-size: var(--fs-lead);
  color: var(--body);
  max-width: var(--measure);
}

/* Prose helper: paragraphs/lists inside long-form guide content */
.prose p, .prose ul, .prose ol { max-width: var(--measure); }
.prose p + p, .prose ul + p, .prose p + ul { margin-top: var(--s4); }
.prose ul { display: grid; gap: var(--s3); }
.prose li { padding-left: var(--s5); position: relative; }
.prose li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.7em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand);
}
.prose strong { color: var(--ink); }
.prose a { color: var(--brand); text-underline-offset: 2px; text-decoration: underline; }
.prose a:hover { color: #5EEAD4; }

/* Links (prose) */
a.link {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a.link:hover { color: #5EEAD4; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Layout helpers ---------- */
.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--s4);
}
@media (min-width: 600px) {
  .container { padding-inline: var(--s6); }
}

.section { padding-block: var(--section-pad); }
.section-2 { background: var(--surface-2); }
.section-head { max-width: var(--measure); margin-bottom: var(--s6); }
.section-lead { color: var(--body); font-size: var(--fs-lead); margin-top: var(--s3); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---------- C1 Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(10, 14, 23, .8);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header { background: var(--bg); }
}
.site-header.is-scrolled { border-bottom-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.header-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s5);
}
.logo {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  flex: 0 0 auto;
  min-width: 0;
}
.logo img {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  flex: 0 0 auto;
}
.logo span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-primary {
  display: none;
  gap: var(--s6);
  flex: 1 1 auto;
  min-width: 0;
}
.nav-primary a {
  color: var(--body);
  font-weight: 600;
  font-size: var(--fs-small);
  white-space: nowrap;
}
.nav-primary a:hover { color: var(--brand); }

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--s4);
  flex: 0 0 auto;
}

@media (min-width: 720px) {
  .nav-primary { display: flex; }
}

/* ---------- Buttons & App Store CTA ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: var(--fs-small);
  white-space: nowrap;
  transition: background-color 160ms ease, color 160ms ease, filter 160ms ease;
}
.btn-primary {
  background: var(--brand-strong);
  color: var(--brand-ink);
  padding: 10px 18px;
}
.btn-primary:hover { background: var(--brand); }
.btn-primary:active { filter: brightness(0.92); }

.btn-secondary {
  background: transparent;
  color: var(--brand);
  border: 1.5px solid var(--brand);
  padding: 10px 18px;
}
.btn-secondary:hover { background: var(--surface-2); }

/* Official Apple badge wrapper — never restyle the artwork itself */
.badge-link {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm);
}
.badge-link img {
  height: 48px;
  width: auto;
  display: block;
}
.badge-link.badge-lg img { height: 52px; }
.badge-link.badge-sm img { height: 40px; }

.cta-price {
  color: var(--muted);
  font-size: var(--fs-small);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s4);
}
.cta-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s3);
}
.cta-stack.centered { align-items: center; text-align: center; }

/* In-flow section CTA (features / how) */
.section-cta {
  margin-top: var(--s7);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s3);
  text-align: center;
}

/* ---------- C2 Hero ---------- */
.hero {
  padding-top: var(--s8);
  padding-bottom: var(--s8);
}
.hero-grid {
  display: grid;
  gap: var(--s7);
  align-items: center;
}
.hero-copy { order: 1; }
.hero-media { order: 2; }
.hero-title {
  font-size: var(--fs-hero);
  margin-bottom: var(--s5);
}
.hero-lead {
  margin-bottom: var(--s6);
}
.hero-cta {
  margin-bottom: var(--s5);
}
.hero-secondary {
  margin-bottom: var(--s6);
}
.trust-line {
  color: var(--muted);
  font-size: var(--fs-small);
  margin-bottom: var(--s6);
}

.hero-device-wrap {
  position: relative;
  display: flex;
  justify-content: center;
}
.hero-device-wrap::before {
  content: "";
  position: absolute;
  inset: 10% 15%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(45,212,191,.28), transparent 70%);
  box-shadow: var(--glow-brand);
  z-index: 0;
}
.hero-device-wrap .device-frame { position: relative; z-index: 1; }

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1.1fr 1fr;
  }
  .hero-media { order: 2; }
}

/* ---------- Device frame (screenshot treatment) ---------- */
.device-frame {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 6px;
  box-shadow: var(--shadow);
  display: inline-block;
  max-width: 100%;
}
.device-frame img {
  border-radius: var(--radius);
  display: block;
  width: 100%;
  height: auto;
}
.device-frame.size-hero { width: min(340px, 78vw); }
.device-frame.size-gallery { width: min(320px, 70vw); }
.device-frame.size-ipad { width: min(440px, 86vw); }

/* ---------- Tube-chip system (signature element) ---------- */
.tube-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  list-style: none;
  padding: 0;
  margin: 0;
}
.tube-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  background: var(--surface);
  border: 1px solid var(--chip-color, var(--line-strong));
  border-radius: var(--radius-pill);
  padding: 6px 14px 6px 10px;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--ink);
}
.tube-chip .dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--chip-color, var(--muted));
  flex: 0 0 auto;
}
.tube-chip.chip-cultures { --chip-color: rgba(45,212,191,.4); }
.tube-chip.chip-cultures .dot { background: var(--brand); }
.tube-chip.chip-blue { --chip-color: rgba(96,165,250,.4); }
.tube-chip.chip-blue .dot { background: var(--tube-blue); }
.tube-chip.chip-redgold { --chip-color: rgba(251,191,36,.4); }
.tube-chip.chip-redgold .dot { background: linear-gradient(135deg, var(--tube-red) 50%, var(--tube-gold) 50%); }
.tube-chip.chip-green { --chip-color: rgba(52,211,153,.4); }
.tube-chip.chip-green .dot { background: var(--tube-green); }
.tube-chip.chip-lavender { --chip-color: rgba(167,139,250,.4); }
.tube-chip.chip-lavender .dot { background: var(--tube-lav); }
.tube-chip.chip-gray { --chip-color: rgba(148,163,184,.4); }
.tube-chip.chip-gray .dot { background: var(--tube-gray); }

.tube-chips-wrap { margin-top: var(--s6); }
.tube-chips-wrap .tube-chips { margin-top: var(--s3); }
.tube-chips-label {
  font-size: var(--fs-small);
  color: var(--muted);
  font-weight: 600;
}

/* ---------- C3 Trust strip ---------- */
.trust-strip {
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
/* Self-sizing flex-wrap (not a fixed-column grid): each item is exactly as
   wide as its label needs, so a label is never squeezed narrower than its
   content. Items wrap as whole units onto new rows at narrow widths —
   individual labels never wrap or truncate at any viewport width. */
.trust-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s5) var(--s6);
  padding-block: var(--s6);
}
.trust-item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  color: var(--ink);
  font-weight: 600;
  font-size: var(--fs-small);
  white-space: nowrap;
  flex: 0 0 auto;
}
.trust-item svg { flex: 0 0 auto; color: var(--brand); }

/* ---------- Generic two-column media section (Problem/What-it-is) ---------- */
.split {
  display: grid;
  gap: var(--s7);
  align-items: center;
}
.split .split-media { display: flex; justify-content: center; }
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split.media-right .split-media { order: 2; }
  .split.media-right .split-copy { order: 1; }
}

/* ---------- C4 Feature grid ---------- */
.feature-group { margin-top: var(--s7); }
.feature-group:first-of-type { margin-top: 0; }
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s5);
}
/* Feature-card titles are long phrases (e.g. "Patient communication
   scripts", "Scenario quizzes & checklists") and must never wrap (QA R2).
   A 2-up tier squeezes cards too narrow for that at common widths, so this
   grid intentionally skips straight from 1-col to 3-col (permitted — 06
   says cards "may" go 2-col, not must) and gives the title its own full-
   width row above the icon+description row (see .feature-card below). */
@media (min-width: 1024px) {
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--s5);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}
.feature-card .icon {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
}
.feature-card-title {
  color: var(--ink);
  font-weight: 700;
  display: block;
  white-space: nowrap;
}
.feature-card-text { color: var(--body); font-size: var(--fs-small); }

/* ---------- C5 Gallery ---------- */
.gallery-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(70vw, 320px);
  gap: var(--s5);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--s3);
  scrollbar-width: thin;
}
.gallery-scroll figure {
  scroll-snap-align: start;
}
.gallery-scroll .device-frame { width: 100%; }
figure { display: flex; flex-direction: column; align-items: center; gap: var(--s3); }
figcaption {
  color: var(--muted);
  font-size: var(--fs-small);
  text-align: center;
  max-width: 34ch;
}
@media (min-width: 720px) {
  .gallery-scroll {
    grid-auto-flow: unset;
    grid-template-columns: repeat(2, 1fr);
    overflow: visible;
  }
}
@media (min-width: 1024px) {
  .gallery-scroll { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- C6 How it works ---------- */
.how-grid {
  display: grid;
  gap: var(--s7);
  align-items: center;
}
.how-list { display: grid; gap: var(--s4); }
.how-item {
  padding: var(--s4) var(--s5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.how-item strong { color: var(--ink); }
.platform-line {
  margin-top: var(--s4);
  color: var(--muted);
  font-size: var(--fs-small);
  text-align: center;
}
@media (min-width: 900px) {
  .how-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- C7 Who it's for ---------- */
.who-copy { max-width: var(--measure); }

/* ---------- C8 Guides hub ---------- */
.guides-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s5);
}
@media (min-width: 600px) {
  .guides-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .guides-grid { grid-template-columns: repeat(3, 1fr); }
}
.guide-card {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--s5) var(--s6);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.guide-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
  box-shadow: var(--shadow);
}
.guide-card-title { color: var(--ink); font-weight: 700; font-size: 1.0625rem; }
.guide-card-teaser { color: var(--body); font-size: var(--fs-small); }
.guide-card-link { color: var(--brand); font-weight: 600; font-size: var(--fs-small); margin-top: auto; }

/* ---------- C9 FAQ ---------- */
.faq-list { display: grid; gap: var(--s4); max-width: var(--measure); }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s4) var(--s5);
}
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .chevron {
  flex: 0 0 auto;
  transition: transform 160ms ease;
  color: var(--brand);
}
.faq-item[open] summary .chevron { transform: rotate(180deg); }
.faq-item .faq-answer {
  margin-top: var(--s4);
  color: var(--body);
  max-width: var(--measure);
}

/* ---------- C10 Final CTA band ---------- */
.final-cta {
  background: var(--surface-2);
  text-align: center;
}
.final-cta .container { display: flex; flex-direction: column; align-items: center; }
.final-cta h2 { margin-bottom: var(--s3); }
.final-cta .lead { margin-bottom: var(--s6); }

/* ---------- C11 Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: var(--s8);
  background: var(--bg);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s7);
}
@media (min-width: 720px) {
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}
.footer-col-title {
  color: var(--ink);
  font-weight: 700;
  font-size: var(--fs-small);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--s4);
}
.footer-app-identity {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s3);
}
.footer-app-identity img {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
}
.footer-app-identity span {
  color: var(--ink);
  font-weight: 700;
}
.footer-col p { color: var(--muted); font-size: var(--fs-small); margin-bottom: var(--s5); }
.footer-links { display: grid; gap: var(--s3); }
.footer-links a { color: var(--body); font-size: var(--fs-small); }
.footer-links a:hover { color: var(--brand); }
.footer-disclaimer {
  margin-top: var(--s8);
  padding-top: var(--s6);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.6;
  max-width: var(--content-max);
}
.footer-disclaimer strong { color: var(--body); }
.footer-copyright {
  margin-top: var(--s5);
  color: var(--muted);
  font-size: 0.8125rem;
}

/* ---------- C12 Sticky mobile CTA ---------- */
.sticky-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 70;
  background: var(--surface);
  border-top: 1px solid var(--line-strong);
  padding: var(--s3) var(--s4);
  padding-bottom: calc(var(--s3) + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  box-shadow: 0 -8px 24px rgba(0,0,0,.4);
}
.sticky-cta .sticky-label {
  color: var(--ink);
  font-weight: 700;
  font-size: var(--fs-small);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body { padding-bottom: 76px; }

@media (min-width: 720px) {
  .sticky-cta { display: none; }
  body { padding-bottom: 0; }
}
@media print {
  .sticky-cta { display: none; }
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  padding-top: var(--s6);
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  font-size: var(--fs-small);
  color: var(--muted);
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb li[aria-current="page"] { color: var(--ink); }
.breadcrumb .sep { color: var(--line-strong); }

/* ---------- Guide article (C13) ---------- */
.guide-hero-head { padding-top: var(--s5); padding-bottom: var(--s7); }
.guide-hero-head h1 { margin-bottom: var(--s5); }
.guide-hero-image { margin-top: var(--s7); display: flex; justify-content: center; }
.guide-top-cta { margin-top: var(--s6); }

.guide-body { padding-bottom: var(--s8); }
.guide-body section { margin-top: var(--s8); }
.guide-body section:first-child { margin-top: 0; }
.guide-body h2 { margin-bottom: var(--s5); }
.guide-body h3 { margin-top: var(--s5); }

.safety-callout {
  background: var(--alert-tint);
  border-left: 4px solid var(--alert);
  border-radius: var(--radius-sm);
  padding: var(--s5) var(--s5);
  color: var(--ink);
  max-width: var(--measure);
  margin-top: var(--s6);
}
.safety-callout p { max-width: none; }
.safety-callout strong { color: var(--ink); }

.related-guides {
  margin-top: var(--s8);
}

/* Guide bottom CTA (end of final H2 section) and FAQ head spacing */
.guide-bottom-cta { margin-top: var(--s6); }
.faq-head { margin-top: 0; }
.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s4);
}
@media (min-width: 600px) {
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Misc ---------- */
.eyebrow {
  color: var(--brand);
  font-weight: 700;
  font-size: var(--fs-small);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--s3);
  display: block;
}

/* ---------- Responsive: large screens ---------- */
@media (min-width: 1280px) {
  .container { padding-inline: var(--s7); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .guide-card:hover { transform: none; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .sticky-cta, .badge-link, .btn { display: none !important; }
  body { padding-bottom: 0; background: #fff; color: #000; }
}
