/* ============================================================
   technology.css — R2 Technology page, page-specific styles only.
   Builds the GPS-for-Health schematic, Coordinate Anatomy,
   Threshold-vs-Trajectory, and FAIR Architecture visualizations.
   Every color/font/spacing value below is a var(--...) token
   already defined in styles.css / site-extend.css. Those files
   are frozen; nothing here overrides them, only adds to them.
   ============================================================ */

/* ---- shared: toggle chip button, used by all four visualizations ---- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip-toggle {
  font-family: var(--f-body); font-size: 13px; font-weight: 500;
  padding: 9px 15px; border-radius: 999px; border: 1px solid var(--hair);
  background: var(--surface); color: var(--ink-2); cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.chip-toggle:hover { border-color: rgba(110,91,209,0.32); transform: translateY(-1px); }
.chip-toggle[aria-pressed="true"] { background: var(--violet); border-color: var(--violet); color: #fff; }
.chip-toggle:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.dark .chip-toggle { background: rgba(255,255,255,0.05); border-color: rgba(180,166,232,0.22); color: var(--on-night-2); }
.dark .chip-toggle[aria-pressed="true"] { background: var(--violet); color: #fff; }

.viz-definition {
  margin-top: 14px; padding: 14px 16px; background: var(--bg-soft); border: 1px solid var(--hair);
  border-radius: 12px; font-size: 14px; color: var(--ink-2); line-height: 1.55; min-height: 1.5em;
}
.viz-definition strong { color: var(--ink); font-weight: 600; }

.viz-figure-note { margin-top: 18px; font-size: 12.5px; color: var(--faint); line-height: 1.6; max-width: 74ch; }

/* generic svg text labels used across all four diagrams */
.gps-label, .ca-label, .ca-axis-label, .th-label, .fair-svg-label {
  font-family: var(--f-body); font-size: 11.5px; fill: var(--ink-2);
}
.ca-axis-label { font-size: 10.5px; fill: var(--faint); }

@media (prefers-reduced-motion: reduce) {
  .chip-toggle, .gps-layer, .ca-group, .fair-pillar-btn, .fair-pillar-rect, .th-view { transition: none !important; }
}

/* ---------------------------------------------------------------
   1. GPS for Health schematic (#platform feature-row)
   --------------------------------------------------------------- */
.gps-figure svg { background: var(--bg-soft); border-radius: 12px; display: block; width: 100%; height: auto; }
.gps-layer { transition: opacity var(--dur-base) var(--ease); }
.gps-layer.gps-dim { opacity: 0.16; }
.gps-pulse { animation: gpsPulse 2.4s var(--ease) infinite; transform-origin: center; transform-box: fill-box; }
@keyframes gpsPulse {
  0% { opacity: 0.55; transform: scale(0.9); }
  70% { opacity: 0; transform: scale(2); }
  100% { opacity: 0; transform: scale(2); }
}
@media (prefers-reduced-motion: reduce) {
  .gps-pulse { animation: none; opacity: 0.3; }
}

/* ---------------------------------------------------------------
   2a. Coordinate anatomy (inside Cytoverse platform-part)
   --------------------------------------------------------------- */
.ca-figure svg { background: var(--bg-soft); border-radius: 12px; display: block; width: 100%; height: auto; }
.ca-group { transition: opacity var(--dur-base) var(--ease); }
.ca-group.ca-dim { opacity: 0.14; }
.ca-point-btn { cursor: pointer; }
.ca-point-btn:focus-visible { outline: 2px solid var(--violet); outline-offset: 5px; border-radius: 50%; }
.ca-evidence-panel { margin-top: 14px; padding: 16px 18px; background: var(--bg-soft); border: 1px solid var(--hair);
  border-radius: 12px; display: none; }
.ca-evidence-panel.is-open { display: block; }
.ca-evidence-panel h4 { font-family: var(--f-display); font-size: 14px; font-weight: 600; color: var(--ink); margin: 0 0 10px; }
.ca-evidence-list { display: flex; flex-direction: column; gap: 8px; margin: 0 0 8px; }
.ca-evidence-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.ca-evidence-name { width: 148px; flex-shrink: 0; }
.ca-evidence-bar { flex: 1; height: 6px; border-radius: 4px; background: var(--hair); overflow: hidden; }
.ca-evidence-fill { display: block; height: 100%; background: var(--violet); border-radius: 4px; }
.ca-evidence-pct { font-family: var(--f-mono); font-size: 12px; color: var(--muted); width: 36px; text-align: right; flex-shrink: 0; }
.ca-evidence-note { font-size: 12px; color: var(--faint); margin: 4px 0 0; }

/* ---------------------------------------------------------------
   2b. Threshold vs trajectory (lead-in above #crossScaleViz)
   --------------------------------------------------------------- */
.th-figure svg { background: var(--bg-soft); border-radius: 12px; display: block; width: 100%; height: auto; }
.th-view { transition: opacity var(--dur-base) var(--ease); }
.th-view[hidden] { display: none; }
.th-toggle-row { display: inline-flex; border: 1px solid var(--hair); border-radius: 999px; padding: 3px; gap: 2px; margin-top: 4px; }
.th-toggle-row .chip-toggle { border: none; padding: 8px 16px; }
.th-toggle-row .chip-toggle[aria-pressed="true"] { box-shadow: 0 4px 12px -4px rgba(81,69,168,0.45); }
.th-lead-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 18px; margin-bottom: 4px; }

/* ---------------------------------------------------------------
   2c. FAIR architecture (new section after Capabilities)
   --------------------------------------------------------------- */
.fair-figure svg { background: var(--bg-soft); border-radius: 12px; display: block; width: 100%; height: auto; }
.fair-pillar-rect { transition: opacity var(--dur-base) var(--ease); }
.fair-pillar-rect.dim { opacity: 0.32; }
.fair-pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.fair-pillar-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px;
  border-radius: 14px; border: 1px solid var(--hair); background: var(--surface); cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.fair-pillar-btn:hover { border-color: rgba(110,91,209,0.32); }
.fair-pillar-btn[aria-expanded="true"] { background: rgba(110,91,209,0.08); border-color: var(--violet); }
.fair-pillar-btn:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.fp-letter { font-family: var(--f-display); font-size: 22px; font-weight: 600; color: var(--violet); }
.fp-label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.fair-definition {
  margin-top: 14px; padding: 16px 18px; background: var(--bg-soft); border: 1px solid var(--hair);
  border-radius: 12px; font-size: 14px; color: var(--ink-2); line-height: 1.6; min-height: 3em;
}
.fair-definition strong { color: var(--ink); }

@media (max-width: 640px) {
  .fair-pillars { grid-template-columns: repeat(2, 1fr); }
}

/* ---------------------------------------------------------------
   Hero: two-column layout (headline + Ali "hero-portrait" visual)
   --------------------------------------------------------------- */
.tech-hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
.tech-hero-grid .page-hero-inner { max-width: none; }
.tech-hero-portrait { margin: 0; background: var(--bg-soft); border: 1px solid var(--hair); border-radius: 18px; padding: 14px; box-shadow: 0 24px 60px -32px rgba(81,69,168,0.3); }
.tech-hero-portrait img { display: block; width: 100%; height: auto; border-radius: 12px; }
.tech-hero-portrait .figure-caption { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--hair-soft); font-size: 12.5px; color: var(--muted); line-height: 1.55; }
@media (max-width: 980px) {
  .tech-hero-grid { grid-template-columns: 1fr; }
  .tech-hero-portrait { order: -1; max-width: 420px; width: 100%; margin: 0 auto; }
}

/* ---------------------------------------------------------------
   Biotype explainer: cough-analogy diagram (#biotype, before #platform)
   --------------------------------------------------------------- */
.biotype-viz-wrap { margin-top: 28px; }
.biotype-figure svg { background: var(--bg-soft); border-radius: 12px; display: block; width: 100%; height: auto; }
.biotype-group { transition: opacity var(--dur-base) var(--ease); }
.biotype-root-label { font-family: var(--f-display); font-size: 15px; font-weight: 600; fill: var(--ink); }
.biotype-branch-label { font-family: var(--f-display); font-size: 12.5px; font-weight: 600; }
.biotype-sub-label { font-family: var(--f-body); font-size: 11px; fill: var(--muted); }
.biotype-response-label { font-family: var(--f-body); font-size: 11.5px; fill: var(--ink-2); }
@media (prefers-reduced-motion: reduce) {
  .biotype-group { transition: none !important; }
}
