/* =========================================================
   LabDecode — Design System v2 (PayNext-inspired)
   Deep teal/green + soft mint · Inter · soft elevated cards
   ========================================================= */
:root {
  /* Backgrounds */
  --bg: #f4f8f6;            /* soft mint-tinted off-white */
  --bg-2: #eaf2ee;          /* slightly deeper mint */
  --surface: #ffffff;       /* cards */
  --dark: #0e2a25;          /* deep forest-teal (footer / hero accents) */
  --dark-2: #16382f;

  /* Brand */
  --teal: #15564a;          /* primary deep teal-green */
  --teal-600: #1c6b5b;
  --teal-400: #2f8f78;
  --accent: #6fe3b0;        /* soft mint accent (bright, friendly) */
  --accent-soft: #d6f5e6;   /* pale mint fill */
  --accent-deep: #0c9d6e;   /* mint used on light bg for text contrast */

  /* Text */
  --ink: #102a24;           /* near-black teal for headings */
  --ink-2: #3d564f;         /* body text */
  --muted: #6c8077;         /* secondary */
  --on-dark: #eaf4ef;
  --on-dark-muted: rgba(234,244,239,0.66);

  /* Lines */
  --line: rgba(16,42,36,0.09);
  --line-strong: rgba(16,42,36,0.16);

  /* Medical flags (muted, on-theme) */
  --flag-high: #c4604a;     /* muted terracotta-red = HIGH */
  --flag-high-soft: #f6e2dc;
  --flag-low: #b58234;      /* soft ochre = LOW */
  --flag-low-soft: #f3e8d2;
  --flag-ok: #0c9d6e;       /* mint-green = NORMAL */
  --flag-ok-soft: #d6f5e6;

  /* Radii — large & rounded like PayNext */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 34px;
  --r-pill: 100px;

  /* Shadows — soft, diffuse */
  --shadow-sm: 0 1px 2px rgba(16,42,36,.05), 0 2px 6px rgba(16,42,36,.04);
  --shadow-md: 0 12px 30px -12px rgba(16,42,36,.16);
  --shadow-lg: 0 30px 60px -24px rgba(16,42,36,.22);
  --shadow-mint: 0 14px 34px -12px rgba(12,157,110,.4);

  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --container: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-2);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  letter-spacing: -0.011em;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 26px; }
.narrow { max-width: 800px; margin: 0 auto; padding: 0 26px; }

/* Typography — Inter, tight tracking, bold weights */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
h1 { font-size: clamp(2.3rem, 5.2vw, 3.9rem); font-weight: 800; letter-spacing: -0.04em; }
h2 { font-size: clamp(1.7rem, 3.8vw, 2.7rem); font-weight: 800; letter-spacing: -0.035em; }
h3 { font-size: clamp(1.15rem, 2vw, 1.45rem); }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em;
  padding: 8px 16px; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--teal);
  font-weight: 500;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-deep);
  box-shadow: 0 0 0 4px rgba(12,157,110,.18);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 4px rgba(12,157,110,.18);} 50% { box-shadow: 0 0 0 7px rgba(12,157,110,0);} }
.muted { color: var(--muted); }
em.serif { font-style: normal; color: var(--accent-deep); font-weight: 800; }

/* Buttons — pill, mint primary */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 26px; border-radius: var(--r-pill);
  font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), background .25s ease, box-shadow .25s ease, color .25s ease;
  white-space: nowrap; letter-spacing: -0.01em;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-600); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-accent { background: var(--accent); color: var(--dark); font-weight: 700; }
.btn-accent:hover { transform: translateY(-2px); box-shadow: var(--shadow-mint); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn .arrow { transition: transform .3s ease; }
.btn:hover .arrow { transform: translateX(4px); }

/* Navbar */
.nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: rgba(244,248,246,0.82);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 15px 0; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; letter-spacing: -0.04em; color: var(--ink); }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--teal); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-size: 1rem; font-weight: 800; box-shadow: var(--shadow-sm); }
.nav-links { display: flex; gap: 28px; font-size: 0.92rem; color: var(--ink-2); align-items: center; font-weight: 500; }
.nav-links a { position: relative; padding: 4px 0; transition: color .2s ease; }
.nav-links a:hover { color: var(--teal); }
.nav-links a::after { content: ""; position: absolute; left: 0; bottom: -3px; height: 2px; width: 0; background: var(--accent); border-radius: 2px; transition: width .25s ease; }
.nav-links a:hover::after { width: 100%; }
.nav-cta { display: flex; align-items: center; gap: 12px; }
.menu-toggle { display: none; background: none; border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px; cursor: pointer; color: var(--ink); }
@media (max-width: 940px) {
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 12px 26px; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 13px 0; width: 100%; border-bottom: 1px solid var(--line); }
  .menu-toggle { display: block; }
  .nav-cta .btn-text-hide { display: none; }
}

/* Breadcrumbs */
.breadcrumb { font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); padding: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.breadcrumb a:hover { color: var(--teal); }
.breadcrumb span.sep { opacity: 0.4; }

/* Sections */
.section { padding: 104px 0; }
.section-sm { padding: 68px 0; }
.section-head { text-align: center; max-width: 700px; margin: 0 auto 56px; }
.section-head .eyebrow { margin-bottom: 22px; }
.section-head h2 { margin-bottom: 16px; }
.section-head p { font-size: 1.06rem; color: var(--ink-2); }

/* Grids */
.grid { display: grid; gap: 22px; }
.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: 880px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Cards — big radius, soft shadow, mint hover */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s ease, border-color .35s ease;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--accent); }

.cat-card { display: flex; flex-direction: column; gap: 14px; min-height: 210px; }
.cat-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); color: var(--teal); display: grid; place-items: center; transition: background .3s ease, color .3s ease; }
.card:hover .cat-icon { background: var(--teal); color: var(--accent); }
.cat-card h3 { margin: 0; }
.cat-card .cat-meta { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; margin-top: auto; }
.cat-card .cat-link { font-family: var(--font-body); font-size: 0.86rem; font-weight: 600; color: var(--teal); display: inline-flex; align-items: center; gap: 6px; }

/* Tables */
.lab-table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 0.92rem; background: var(--surface); border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.lab-table th { background: var(--bg-2); text-align: left; padding: 15px 18px; font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--teal); font-weight: 600; border-bottom: 1px solid var(--line); }
.lab-table td { padding: 15px 18px; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.lab-table tr:last-child td { border-bottom: 0; }
.lab-table td.val { font-family: var(--font-mono); font-weight: 600; color: var(--ink); }
.lab-table tr:hover td { background: var(--accent-soft); }

/* Flags */
.flag { display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 0.66rem; font-family: var(--font-mono); font-weight: 700; letter-spacing: 0.05em; }
.flag.high { background: var(--flag-high-soft); color: var(--flag-high); }
.flag.low { background: var(--flag-low-soft); color: var(--flag-low); }
.flag.ok { background: var(--flag-ok-soft); color: var(--flag-ok); }

/* Callouts */
.callout { border-radius: var(--r-md); padding: 22px 26px; margin: 24px 0; font-size: 0.95rem; border: 1px solid var(--line); }
.callout-title { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 8px; font-weight: 700; }
.callout.usa { background: var(--accent-soft); border-color: transparent; }
.callout.usa .callout-title { color: var(--teal); }
.callout.warn { background: var(--flag-high-soft); border-color: transparent; }
.callout.warn .callout-title { color: var(--flag-high); }
.callout.tip { background: var(--flag-ok-soft); border-color: transparent; }
.callout.tip .callout-title { color: var(--flag-ok); }

/* Article body */
.article-body { font-size: 1.05rem; line-height: 1.78; color: var(--ink-2); }
.article-body h2 { margin: 50px 0 18px; font-size: clamp(1.5rem, 3vw, 2.1rem); }
.article-body h3 { margin: 36px 0 14px; }
.article-body ul, .article-body ol { padding-left: 22px; margin: 0 0 1.2em; }
.article-body li { margin-bottom: 9px; }
.article-body strong { color: var(--ink); font-weight: 600; }
.article-body a { color: var(--teal); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--accent); }
.article-body a:hover { color: var(--accent-deep); }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q { width: 100%; text-align: left; background: none; border: none; padding: 24px 0; font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--ink); cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; letter-spacing: -0.02em; }
.faq-q .icon { flex-shrink: 0; transition: transform .3s ease; color: var(--accent-deep); font-weight: 400; }
.faq-q[aria-expanded="true"] .icon { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.faq-a-inner { padding: 0 0 24px; color: var(--ink-2); }

/* Review badge */
.review-badge { display: flex; align-items: center; gap: 14px; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); margin: 28px 0; box-shadow: var(--shadow-sm); }
.review-avatar { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, var(--teal-400), var(--teal)); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 0.8rem; flex-shrink: 0; }
.review-text { font-size: 0.86rem; line-height: 1.45; }
.review-text strong { color: var(--ink); }
.review-text .review-meta { color: var(--muted); font-size: 0.8rem; }

/* Sources */
.sources { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); }
.sources h3 { font-size: 1.1rem; margin-bottom: 14px; }
.sources ol { font-size: 0.86rem; color: var(--muted); padding-left: 20px; }
.sources li { margin-bottom: 8px; }
.sources a { color: var(--teal); }

/* Page hero */
.page-hero { padding: 48px 0 54px; }
.page-hero h1 { margin: 18px 0 18px; max-width: 900px; }
.page-hero .lead { font-size: 1.16rem; max-width: 680px; color: var(--ink-2); }
.page-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 26px; font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); }
.page-meta span { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); padding: 8px 14px; border-radius: var(--r-pill); border: 1px solid var(--line); }

/* Tools */
.tool-shell { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 40px; box-shadow: var(--shadow-md); }
.tool-field { margin-bottom: 22px; }
.tool-field label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--ink); margin-bottom: 9px; }
.tool-field .hint { font-size: 0.78rem; color: var(--muted); margin-top: 6px; }
.tool-input, .tool-select { width: 100%; padding: 15px 17px; border: 1px solid var(--line-strong); border-radius: var(--r-md); font-family: var(--font-mono); font-size: 1rem; background: var(--bg); color: var(--ink); transition: border-color .2s ease, box-shadow .2s ease; }
.tool-input:focus, .tool-select:focus { outline: none; border-color: var(--accent-deep); box-shadow: 0 0 0 4px var(--accent-soft); }
.tool-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .tool-row { grid-template-columns: 1fr; } }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button { flex: 1; min-width: 80px; padding: 13px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--bg); font-family: var(--font-body); font-size: 0.9rem; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: all .2s ease; }
.seg button.active { background: var(--teal); color: #fff; border-color: var(--teal); }
.tool-result { margin-top: 28px; padding: 30px; border-radius: var(--r-lg); background: var(--bg-2); border: 1px solid var(--line); display: none; }
.tool-result.show { display: block; animation: fadeUp .4s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px);} to { opacity: 1; transform: translateY(0);} }
.result-big { font-family: var(--font-display); font-size: clamp(2.4rem, 6vw, 3.4rem); font-weight: 800; line-height: 1; margin-bottom: 10px; color: var(--ink); letter-spacing: -0.04em; }
.result-label { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.result-status { display: inline-block; padding: 7px 16px; border-radius: var(--r-pill); font-size: 0.82rem; font-weight: 700; margin: 12px 0; }
.result-status.ok { background: var(--flag-ok-soft); color: var(--flag-ok); }
.result-status.warn { background: var(--flag-low-soft); color: var(--flag-low); }
.result-status.high { background: var(--flag-high-soft); color: var(--flag-high); }

/* Range bar */
.range-track { position: relative; height: 12px; border-radius: 8px; margin: 24px 0 8px; background: linear-gradient(to right, var(--flag-low-soft), var(--flag-ok-soft) 25%, var(--flag-ok-soft) 75%, var(--flag-high-soft)); }
.range-marker { position: absolute; top: -4px; width: 4px; height: 20px; background: var(--ink); border-radius: 2px; transition: left .5s ease; }
.range-scale { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); }

/* Privacy note */
.privacy-note { display: flex; gap: 12px; align-items: flex-start; padding: 18px 22px; background: var(--accent-soft); border-radius: var(--r-md); margin-top: 24px; font-size: 0.84rem; color: var(--teal); }
.privacy-note svg { flex-shrink: 0; margin-top: 2px; }

/* Footer */
.footer { background: var(--dark); color: var(--on-dark); padding: 84px 0 36px; position: relative; overflow: hidden; }
.footer::before { content:""; position:absolute; top:-40%; right:-10%; width:520px; height:520px; border-radius:50%; background: radial-gradient(circle, rgba(111,227,176,0.14), transparent 70%); pointer-events:none; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 44px; margin-bottom: 56px; position: relative; }
@media (max-width: 880px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
.footer .logo { color: #fff; }
.footer .logo-mark { background: var(--accent); color: var(--dark); }
.footer-about p { color: var(--on-dark-muted); font-size: 0.94rem; margin-top: 18px; max-width: 360px; }
.footer-col h4 { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent); margin-bottom: 16px; font-weight: 500; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 11px; }
.footer-col a { color: var(--on-dark-muted); font-size: 0.9rem; transition: color .2s ease; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(234,244,239,0.12); padding-top: 26px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; font-family: var(--font-mono); font-size: 0.74rem; color: var(--on-dark-muted); position: relative; }
.footer-disclaimer { background: rgba(234,244,239,0.05); border: 1px solid rgba(234,244,239,0.12); border-radius: var(--r-md); padding: 20px 24px; margin-bottom: 38px; font-size: 0.82rem; color: var(--on-dark-muted); line-height: 1.65; position: relative; }
.footer-disclaimer strong { color: #fff; }

/* Store buttons */
.store-buttons { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.store-btn { display: inline-flex; align-items: center; gap: 11px; padding: 12px 18px; background: rgba(234,244,239,0.08); color: #fff; border: 1px solid rgba(234,244,239,0.16); border-radius: 14px; font-weight: 600; transition: transform .25s ease, background .25s ease; }
.store-btn:hover { transform: translateY(-3px); background: rgba(234,244,239,0.14); }
.store-btn .store-icon { width: 24px; height: 24px; flex-shrink: 0; }
.store-btn-text { line-height: 1.1; display: flex; flex-direction: column; }
.store-btn-text small { font-size: 0.62rem; color: var(--on-dark-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.store-btn-text strong { font-size: 0.95rem; font-weight: 600; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal.d-1 { transition-delay: .08s; }
.reveal.d-2 { transition-delay: .16s; }
.reveal.d-3 { transition-delay: .24s; }

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.tag { padding: 8px 15px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); font-family: var(--font-body); font-size: 0.8rem; font-weight: 500; color: var(--teal); background: var(--surface); transition: all .2s ease; }
.tag:hover { background: var(--accent-soft); border-color: var(--accent); }

/* Hero gradient panel (PayNext-style) */
.hero-panel { background: linear-gradient(155deg, var(--dark) 0%, var(--teal) 100%); border-radius: var(--r-xl); color: var(--on-dark); position: relative; overflow: hidden; }
.hero-panel::after { content:""; position:absolute; bottom:-30%; left:-10%; width:440px; height:440px; border-radius:50%; background: radial-gradient(circle, rgba(111,227,176,0.18), transparent 70%); }

/* Stat band */
.stat-band { background: var(--dark); color: var(--on-dark); border-radius: var(--r-xl); padding: 52px 40px; }
.stat-num { font-family: var(--font-display); font-size: clamp(2.2rem,5vw,3.2rem); font-weight: 800; color: #fff; letter-spacing: -0.04em; line-height: 1; }
.stat-num .suffix { color: var(--accent); }
.stat-label { color: var(--on-dark-muted); font-size: 0.9rem; margin-top: 8px; }
