/* ============================================================
   PHARMACONOMICS — app.css
   Mina's house design system (light DEFAULT + dark toggle) with a
   biotech accent and catalyst-specific components. Fully self-contained,
   zero external CDNs. Per-product accent overridden in one place (:root below).
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* PRODUCT ACCENT (one-line change): clinical cyan-blue */
  --accentH: 202; --accentS: 85%; --accentL: 42%;
  --accent: hsl(var(--accentH) var(--accentS) var(--accentL));
  --accent-hover: hsl(var(--accentH) var(--accentS) calc(var(--accentL) - 6%));
  --accent-soft: hsl(var(--accentH) var(--accentS) var(--accentL) / .12);
  --on-accent: #fff;

  /* neutrals — light (DEFAULT) */
  --bg: #f7f7f8; --surface: #ffffff; --surface-2: #f0f0f3;
  --text: #1a1a1f; --text-2: #55555f; --text-3: #8e8e99;
  --border: #e3e3e9; --border-strong: #cfcfd8;

  /* status */
  --ok: #15803d; --warn: #b45309; --bad: #b91c1c;
  --ok-soft: rgb(21 128 61 / .12);
  --warn-soft: rgb(180 83 9 / .12);
  --bad-soft: rgb(185 28 28 / .12);

  /* shape + depth */
  --radius: 10px; --radius-sm: 6px; --radius-full: 999px;
  --shadow-1: 0 1px 2px rgb(16 16 20 / .06);
  --shadow-2: 0 6px 20px rgb(16 16 20 / .10);

  --container: 1080px;
  color-scheme: light;
}

[data-theme="dark"] {
  --accentL: 48%;
  --bg: #131316; --surface: #1c1c21; --surface-2: #26262d;
  --text: #f2f2f4; --text-2: #a3a3ae; --text-3: #71717c;
  --border: #2c2c34; --border-strong: #3d3d47;
  --ok: #4ade80; --warn: #fbbf24; --bad: #f87171;
  --ok-soft: rgb(74 222 128 / .14);
  --warn-soft: rgb(251 191 36 / .14);
  --bad-soft: rgb(248 113 113 / .14);
  --shadow-1: none;
  --shadow-2: 0 6px 20px rgb(0 0 0 / .45);
  color-scheme: dark;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 400 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* house rule: body never scrolls horizontally */
}
img, svg, video { display: block; max-width: 100%; }
input, button, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- Type ---------- */
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; }
h2 { font-size: clamp(1.35rem, 3vw, 1.6rem); font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 600; }
p { text-wrap: pretty; }
.lead { font-size: 1.125rem; color: var(--text-2); }
.muted { color: var(--text-2); }
.small, small { font-size: .875rem; }
.label {
  font-size: .75rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-3);
}
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "SFMono-Regular", "Cascadia Code",
        Menlo, Consolas, monospace; }
.prose { max-width: 65ch; }

/* ---------- Layout ---------- */
.container { max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.section { padding-block: 40px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: 60px;
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
}
.brand {
  font-weight: 700; font-size: 1.05rem; color: var(--text);
  letter-spacing: -0.01em; display: inline-flex; align-items: center; gap: 8px;
}
.brand:hover { text-decoration: none; }
.brand .mark { font-size: 1.15rem; }
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a { color: var(--text-2); font-size: .925rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
@media (max-width: 560px) { .nav-links { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border: 1px solid transparent;
  border-radius: var(--radius); background: var(--accent); color: var(--on-accent);
  font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn:hover {
  background: var(--accent-hover); text-decoration: none;
  transform: translateY(-1px); box-shadow: var(--shadow-1);
}
.btn:active { transform: none; }
.btn:disabled, .btn[aria-busy="true"] { opacity: .6; cursor: not-allowed; transform: none; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { min-height: 34px; padding: 0 12px; border-radius: var(--radius-sm); font-size: .875rem; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .9rem; }
.input,
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="url"], input[type="search"],
select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field .hint { font-size: .8rem; color: var(--text-3); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 24px;
}
.card h3 { margin-bottom: 8px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border-radius: var(--radius-full); font-size: .8rem; font-weight: 600;
  background: var(--surface-2); color: var(--text-2); white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

/* ---------- Progress bars ---------- */
.pbar { height: 8px; background: var(--surface-2); border-radius: var(--radius-full); overflow: hidden; }
.pbar > span {
  display: block; height: 100%; width: 0; background: var(--accent);
  border-radius: inherit; transition: width .4s ease;
}
.pbar.indet > span { width: 40%; animation: pbar-slide 1.1s ease-in-out infinite; }
@keyframes pbar-slide { from { margin-left: -40%; } to { margin-left: 100%; } }
.pbar.ok > span { background: var(--ok); }
.pbar.warn > span { background: var(--warn); }
.pbar.bad > span { background: var(--bad); }
.metric { display: grid; gap: 6px; }
.metric .metric-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.metric .metric-head b { font-variant-numeric: tabular-nums; }

/* ---------- Skeleton & empty states ---------- */
.skeleton {
  border-radius: var(--radius-sm); color: transparent !important;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 48px 20px; color: var(--text-2);
  background: var(--surface); border: 1px dashed var(--border-strong);
  border-radius: var(--radius); }
.empty .empty-icon { font-size: 2rem; margin-bottom: 8px; }

/* ---------- Theme toggle ---------- */
.theme-toggle {
  width: 42px; height: 42px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border-strong);
  border-radius: var(--radius-full); cursor: pointer; font-size: 1rem;
  transition: background .15s ease;
}
.theme-toggle:hover { background: var(--surface-2); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border); margin-top: 56px;
  padding: 32px 0; color: var(--text-3); font-size: .875rem;
}
.footer-grid { display: grid; gap: 18px; }
.footer-disclaimer { max-width: 68ch; color: var(--text-2); line-height: 1.6; }
.footer-disclaimer strong { color: var(--text); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer-links a { color: var(--text-2); font-weight: 600; }
.footer-links a:hover { color: var(--text); text-decoration: none; }
.footer-meta { display: flex; justify-content: space-between; gap: 12px 24px;
  flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--border);
  color: var(--text-3); }

/* ---------- Motion & mobile base ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ============================================================
   PHARMACONOMICS — catalyst components
   ============================================================ */

/* ---------- Hero ---------- */
.hero { padding-block: 40px 8px; }
.hero h1 { max-width: 18ch; }
.hero .lead { max-width: 52ch; margin-top: 10px; }

/* Hero as a balanced 2-column band on wide screens: copy left, proof/action
   right — kills the dead space that opened up beside a left-aligned hero. */
.hero-grid { display: grid; gap: 22px; padding-top: 8px; }
.hero-grid > .trust-strip { margin-top: 0; }
@media (min-width: 940px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.06fr) minmax(360px, 0.94fr);
    gap: 48px; align-items: center;
  }
  .hero-grid .hero { padding-block: 20px 8px; }
  .hero-grid > .trust-strip,
  .hero-grid .trust-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Freshness / trust strip ---------- */
.trust-strip {
  display: grid; gap: 14px; margin-top: 24px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.trust-tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 16px 18px;
}
.trust-tile .trust-value {
  font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.trust-tile .trust-value.placeholder { color: var(--text-3); font-size: 1.05rem;
  font-weight: 600; }
.trust-tile .trust-label { margin-top: 2px; }
.trust-tile .trust-sub { color: var(--text-3); font-size: .8rem; margin-top: 6px; }

/* ---------- Toolbar: filter chips + search ---------- */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin: 28px 0 20px;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px;
  border-radius: var(--radius-full); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-2); font-size: .875rem;
  font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.chip:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.chip.active {
  background: var(--accent); color: var(--on-accent); border-color: var(--accent);
}
.chip.active:hover { background: var(--accent-hover); color: var(--on-accent); }
.searchbox { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.searchbox input { padding-left: 38px; }
.searchbox .search-ico {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none;
}
.result-count { color: var(--text-3); font-size: .875rem; margin-bottom: 14px; }

/* ---------- Catalyst grid + card ---------- */
.catalyst-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.catalyst {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-1);
  padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 14px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.catalyst:hover { transform: translateY(-2px); box-shadow: var(--shadow-2);
  border-color: var(--border-strong); }
.catalyst.is-imminent { border-left: 3px solid var(--warn); }

.cat-top { display: flex; align-items: flex-start;
  justify-content: space-between; gap: 10px; }
.ticker {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; color: var(--text);
}
.company { color: var(--text-3); font-size: .8rem; margin-top: 1px; }
.cat-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.cat-drug { }
.cat-drug .drug { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
.cat-drug .indication { color: var(--text-2); font-size: .9rem; margin-top: 2px; }

/* countdown */
.countdown { display: grid; gap: 6px; }
.countdown-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.countdown-head .tminus { font-weight: 700; font-size: .95rem;
  font-variant-numeric: tabular-nums; }
.countdown-head .date { color: var(--text-2); font-size: .85rem;
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.pbar.imminent > span { background: var(--warn); }
.pbar.soon > span { background: var(--accent); }
.pbar.scheduled > span { background: color-mix(in srgb, var(--accent) 55%, var(--surface-2)); }

/* trust receipt — the differentiator. Styled as a distinct "proof" panel so it
   reads as a receipt/badge, not a buried footnote. */
.receipt {
  margin-top: auto;                       /* pin to card bottom → even rows */
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px 10px; flex-wrap: wrap;
}
.receipt .src-link {
  display: inline-flex; align-items: center; gap: 7px; font-size: .85rem;
  font-weight: 700; max-width: 100%; color: var(--accent);
}
.receipt .src-link:hover { text-decoration: none; color: var(--accent-hover); }
.receipt .src-link .src-ico { flex: none; opacity: .9; }
.receipt .src-type { color: var(--text-2); font-weight: 500; }
.verified {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .76rem; font-weight: 600; white-space: nowrap;
  color: var(--ok); background: var(--ok-soft);
  padding: 3px 9px; border-radius: var(--radius-full);
}
.verified .live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 var(--ok-soft); animation: live-pulse 2s ease-out infinite;
}
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 var(--ok-soft); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.receipt .no-src { color: var(--text-3); font-size: .82rem; font-style: italic; }

/* recent changes ("we caught it") strip */
.changes-list { display: grid; gap: 10px; }
.change-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .9rem;
}
.change-row .chg-field { color: var(--text-2); }
.change-row .arrow { color: var(--text-3); }
.change-row .chg-time { margin-left: auto; color: var(--text-3);
  font-size: .8rem; white-space: nowrap; }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .section { padding-block: 28px; }
  .catalyst-grid { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .toolbar { gap: 12px; }
  .searchbox { max-width: none; }
}
