/* ===================================================================
   Grounded — Apple-style light design system (per DESIGN.md)
   Photography-first, light-dominant, single Action Blue accent.
   Same class + CSS-variable names as the prior dark theme, so every
   page (hubs, scenarios, MCP shells, intake) re-skins with no HTML edit.
   =================================================================== */
:root {
  /* Apple tokens */
  --blue: #0066cc;
  --blue-focus: #0071e3;
  --blue-on-dark: #2997ff;
  --ink: #1d1d1f;
  --ink-80: #333333;
  --ink-48: #7a7a7a;
  --canvas: #ffffff;
  --parchment: #f5f5f7;
  --pearl: #fafafc;
  --hairline: #e0e0e0;
  --divider: #f0f0f0;
  --tile-dark: #272729;
  --on-dark: #ffffff;
  --prod-shadow: rgba(0, 0, 0, 0.22) 3px 5px 30px 0;

  /* Back-compat variable names (referenced by inline page styles) */
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --panel: #ffffff;
  --panel-2: #f5f5f7;
  --border: rgba(0, 0, 0, 0.10);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --muted-2: #86868b;
  --accent: #0066cc;
  --accent-2: #0066cc;
  --accent-3: #bf6a00;
  --shadow: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: -apple-system, system-ui, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; }

.page { width: min(1260px, calc(100vw - 48px)); margin: 0 auto; padding: 28px 0 64px; }
.page--detail { padding-top: 24px; }

/* Surfaces — flat, hairline-bordered cards. No gradients, no shadows. */
.hero, .detail-hero, .panel, .scenario-card, .product-card, .evidence-card {
  border: 1px solid var(--hairline);
  background: var(--canvas);
  box-shadow: none;
  border-radius: 18px;
}
.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 24px;
  padding: 48px 40px;
  background: var(--parchment);
  border-color: transparent;
}
/* kill all decorative gradient overlays from the old theme */
.hero::after, .detail-hero::after, .panel::after,
.product-card::after, .scenario-card::after, .evidence-card::after { content: none; }

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  letter-spacing: 0.04em; text-transform: uppercase;
  font-size: 12px; color: var(--ink); font-weight: 600;
}
h1, h2, h3 { margin: 0; line-height: 1.07; letter-spacing: -0.02em; color: var(--ink); }
h1 { font-size: clamp(40px, 5vw, 56px); font-weight: 600; max-width: 16ch; }
h2 { font-size: clamp(28px, 2.4vw, 40px); font-weight: 600; line-height: 1.1; }
h3 { font-size: 21px; font-weight: 600; line-height: 1.19; }

.eyebrow {
  display: inline-flex;
  margin: 14px 0 12px;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.lead { color: var(--ink-80); font-size: 21px; font-weight: 400; line-height: 1.45; max-width: 60ch; }

.hero__copy { position: relative; z-index: 1; display: grid; gap: 8px; }
.hero__actions, .hero__stats, .stats-inline, .tag-row { display: flex; gap: 12px; flex-wrap: wrap; }

.nav-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.nav-chip {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 14px; border-radius: 9999px;
  border: 1px solid var(--hairline); background: var(--canvas);
  color: var(--ink); font-size: 13px; font-weight: 600;
}
.nav-chip:hover { border-color: #c7c7cc; }

/* Buttons — pill grammar, single blue accent, scale(0.95) on press */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9999px; padding: 11px 22px; font-weight: 600; font-size: 17px;
  letter-spacing: -0.01em;
  border: 1px solid transparent; cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 120ms ease;
}
.button:active { transform: scale(0.96); }
.button--primary { background: var(--blue); color: #fff; }
.button--primary:hover { background: #0058b0; }
.button--ghost { border-color: var(--blue); color: var(--blue); background: transparent; }
.button--ghost:hover { background: rgba(0, 102, 204, 0.06); }

.hero__stats { flex-direction: column; align-self: stretch; }
.stat {
  display: grid; gap: 4px;
  padding: 20px 22px;
  border-radius: 18px;
  background: var(--canvas);
  border: 1px solid var(--hairline);
}
.stat strong { font-size: 36px; letter-spacing: -0.03em; color: var(--ink); font-weight: 600; }
.stat span, .mini-meta, .fineprint, .section__header p, .evidence-card__meta,
.product-card__footer, .product-card__meta, .query-chip, .label-box span, .note-box p {
  color: var(--muted);
}

.section { margin-top: 64px; }
.section__header { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 18px; }
.section__header p { max-width: 56ch; line-height: 1.5; }

.scenario-grid, .product-grid, .evidence-stack { display: grid; gap: 20px; }
.scenario-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.scenario-card {
  padding: 24px;
  transition: border-color 160ms ease, transform 160ms ease;
  background: var(--canvas);
}
.scenario-card:hover { transform: translateY(-2px); border-color: #c7c7cc; }
.scenario-card__top, .scenario-card__footer, .product-card__meta,
.product-card__footer, .mini-meta, .evidence-card__meta {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
.scenario-card__score { color: var(--blue); font-weight: 600; }
.scenario-card p { color: var(--muted); line-height: 1.5; }

.section--split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; }
.panel { padding: 24px; background: var(--canvas); }
.panel--accent { background: var(--parchment); border-color: transparent; }
.checklist { margin: 0; padding-left: 18px; color: var(--ink-80); line-height: 1.6; }
.checklist li + li { margin-top: 6px; }

.back-link { display: inline-flex; color: var(--blue); margin-bottom: 18px; font-size: 15px; }
.back-link:hover { text-decoration: underline; }

.detail-hero { padding: 32px; background: var(--parchment); border-color: transparent; }
.detail-hero__grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 24px; align-items: start; }
.detail-hero__note {
  padding: 20px; border-radius: 18px; background: var(--canvas); border: 1px solid var(--hairline);
}
.query-chip {
  display: inline-flex; margin-top: 16px; padding: 10px 16px;
  border: 1px solid var(--hairline); background: var(--canvas);
  border-radius: 9999px; font-weight: 600; color: var(--ink-80);
}

.evidence-stack { margin-top: 8px; }
.evidence-card { padding: 20px; background: var(--canvas); border-radius: 18px; }
.evidence-card h3 { margin-top: 10px; font-size: 18px; line-height: 1.3; }
.evidence-card p { color: var(--muted); line-height: 1.5; }

.pill {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 12px; border-radius: 9999px;
  background: rgba(0, 102, 204, 0.10); color: var(--blue); font-weight: 600;
  font-size: 12px;
}
.pill--soft, .pill-soft { background: var(--parchment); color: var(--ink-80); }

.product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.product-card { overflow: hidden; background: var(--canvas); }
.product-card__image { position: relative; aspect-ratio: 4 / 3; background: var(--parchment); }
.product-card__image img { width: 100%; height: 100%; object-fit: cover; }
.product-card__image::after { content: none; }
.rank {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  padding: 8px 12px; border-radius: 9999px;
  background: rgba(255, 255, 255, 0.85); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--hairline); font-weight: 700; color: var(--ink);
}
.product-card__body { padding: 20px; display: grid; gap: 12px; }
.product-card__body h3 { font-size: 18px; line-height: 1.3; }
.ingredients { color: var(--muted); line-height: 1.5; margin: 0; }
.mini-meta { font-size: 13px; }
.match-box {
  padding: 14px 16px; border-radius: 14px;
  background: rgba(0, 102, 204, 0.06); border: 1px solid rgba(0, 102, 204, 0.18);
}
.match-box strong { display: block; margin-bottom: 4px; color: var(--blue); }
.match-box span { color: var(--ink-80); line-height: 1.45; }

.label-box, .note-box {
  padding: 14px 16px; border-radius: 14px; background: var(--parchment); border: 1px solid var(--hairline);
}
.label-box strong, .note-box strong { display: block; margin-bottom: 4px; color: var(--ink-80); }
.label-box--fda { background: rgba(191, 106, 0, 0.08); border-color: rgba(191, 106, 0, 0.28); }
.label-box--fda strong { color: #9a5600; }
.label-box--warn { background: rgba(209, 46, 46, 0.07); border-color: rgba(209, 46, 46, 0.24); }
.label-box--warn strong { color: #c4302b; }
.product-card__footer a { color: var(--blue); font-weight: 600; }
.fineprint { font-size: 13px; line-height: 1.5; color: var(--muted); }
.case-section { scroll-margin-top: 72px; }

/* ===================================================================
   Global site shell — Apple global-nav (black) + parchment footer
   =================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.80);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.site-header__inner {
  width: min(1260px, calc(100vw - 48px)); margin: 0 auto;
  display: flex; align-items: center; gap: 16px; padding: 0; min-height: 48px;
}
.site-brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  font-size: 14px; color: #f5f5f7; text-decoration: none; white-space: nowrap;
}
.site-brand__dot { width: 20px; height: 20px; border-radius: 5px; background: url("../../assets/favicon.svg") center / contain no-repeat; box-shadow: none; }
.site-nav { display: flex; align-items: center; gap: 2px; margin: 0 4px 0 12px; flex: 1; flex-wrap: wrap; }
.site-nav a {
  padding: 6px 12px; border-radius: 9999px;
  font-size: 14px; font-weight: 400; color: #d2d2d7; text-decoration: none;
  transition: color .15s ease, background .15s ease;
}
.site-nav a:hover { color: #fff; }
.site-nav a.is-active { color: #fff; background: rgba(255, 255, 255, 0.12); }
.site-cta {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 16px; border-radius: 9999px; font-weight: 600; font-size: 14px;
  color: #fff; text-decoration: none; white-space: nowrap; background: var(--blue);
  transition: background .15s ease, transform .12s ease;
}
.site-cta:hover { background: #0058b0; }
.site-cta:active { transform: scale(0.96); }

.site-footer { margin-top: 80px; border-top: 1px solid var(--hairline); background: var(--parchment); }
.site-footer__inner {
  width: min(1260px, calc(100vw - 48px)); margin: 0 auto; padding: 48px 0 24px;
  display: grid; grid-template-columns: 1.7fr 1fr 1fr; gap: 28px;
}
.site-footer .site-brand { color: var(--ink); }
/* footer brand mark inherits the logomark from .site-brand__dot */
.site-footer__brand p { margin: 14px 0 0; max-width: 46ch; color: var(--ink-80); line-height: 1.55; font-size: 14px; }
.site-footer__col { display: flex; flex-direction: column; gap: 10px; }
.site-footer__head { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-48); font-weight: 600; margin-bottom: 2px; }
.site-footer__col a { color: var(--ink-80); text-decoration: none; font-size: 14px; }
.site-footer__col a:hover { color: var(--blue); }
.site-footer__base {
  width: min(1260px, calc(100vw - 48px)); margin: 0 auto; padding: 18px 0 40px;
  border-top: 1px solid var(--divider);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--ink-48); font-size: 12px; line-height: 1.5;
}
.site-footer__disclaimer { max-width: 60ch; }

@media (max-width: 980px) {
  .hero, .detail-hero__grid, .section--split, .scenario-grid, .product-grid { grid-template-columns: 1fr; }
  .page { width: min(100vw - 24px, 1240px); }
}
@media (max-width: 860px) {
  .site-header__inner { flex-wrap: wrap; gap: 10px; padding: 8px 0; }
  .site-nav { order: 3; flex: 1 1 100%; width: 100%; margin: 6px 0 0; justify-content: flex-start; }
  .site-cta { margin-left: auto; }
  .site-footer__inner { grid-template-columns: 1fr; gap: 22px; }
}
