/* The Cell: cinematic biological artwork and a complete midnight palette. */
:root {
  --surface: #f9fcfd;
  --surface-raised: #fff;
  --surface-soft: #e8eff8;
  --accent-soft: #e7e9fa;
  --text-soft: #727c96;
  --text-label: #67779b;
  --accent-ink: #7363ac;
  --theme-ring: #ccd7e7;
}
.brand .logo-dark { display: none; }
.theme-toggle {
  display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px;
  padding: 0; border: 1px solid var(--theme-ring); border-radius: 50%;
  background: transparent; color: var(--ink); transition: background .2s, border-color .2s;
}
.theme-toggle:hover { background: var(--accent-soft); border-color: var(--accent-ink); }
.theme-toggle svg { width: 17px; height: 17px; stroke-width: 1.5; }
.theme-toggle .sun { display: none; }
.navright { gap: 13px; }
.guide-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-bottom: 45px; }
.guide-toolbar .guide-link { margin: 0; }

.hero-inner { grid-template-columns: 1.02fr 1.05fr; gap: 0; }
.hero-card { position: relative; z-index: 2; }
.biotech-art { position: relative; width: 115%; margin: -20px -9% 0 -4%; isolation: isolate; }
.biotech-art::before {
  content: ''; position: absolute; z-index: -1; inset: 15% 6% 8%; border-radius: 50%;
  background: radial-gradient(ellipse, #c5b9f17a, #b9e4f23d 48%, transparent 70%);
  filter: blur(35px);
}
.biotech-art img {
  display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain;
  filter: drop-shadow(0 30px 32px #29257616);
  animation: cell-breathe 18s ease-in-out infinite;
}
.biotech-art figcaption {
  margin: 16px auto 0; width: 78%; display: flex; justify-content: space-between; gap: 20px;
  border-top: 1px solid var(--line); padding-top: 17px; color: var(--text-label);
  font: 8px 'IBM Plex Mono', monospace; letter-spacing: .08em; line-height: 1.8;
}
.biotech-art figcaption span:first-child { color: var(--accent-ink); }
.biotech-art figcaption span:last-child { text-align: right; }
@keyframes cell-breathe {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
}

:root[data-theme="dark"] {
  --bg: #0b0c1c; --panel: #14172c; --ink: #efedf9; --muted: #a6aec9;
  --line: #2a2d48; --purple: #a99afb; --cyan: #75d6e5;
  --surface: #121629; --surface-raised: #191d34; --surface-soft: #101427;
  --accent-soft: #252344; --text-soft: #a5aec7; --text-label: #949fbd;
  --accent-ink: #bbb0f5; --theme-ring: #393d5b;
}
[data-theme="dark"] ::selection { background: #54428e; color: #fff; }
[data-theme="dark"] .brand .logo-light { display: none; }
[data-theme="dark"] .brand .logo-dark { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] nav { background: #101326e8; border-color: #2c304b; box-shadow: 0 8px 40px #0002; }
[data-theme="dark"] .navlinks a:hover { color: #c2b4ff; }
[data-theme="dark"] .hero {
  background: radial-gradient(ellipse at 79% 48%, #26214d 0, #14223985 32%, transparent 60%),
    linear-gradient(140deg, #0c0e20, #0a1020);
}
[data-theme="dark"] h1 em { color: #aba7e8; }
[data-theme="dark"] h2 .dim { color: #9a9fca; }
[data-theme="dark"] .biotech-art::before { background: radial-gradient(ellipse, #6d42e436, #168bb320 48%, transparent 72%); }
[data-theme="dark"] .biotech-art img { filter: drop-shadow(0 20px 45px #4674d928); }
[data-theme="dark"] .btn { border-color: #454765; }
[data-theme="dark"] .btn:hover { background: #282641; }
[data-theme="dark"] .btn.primary,
[data-theme="dark"] .navright .btn,
[data-theme="dark"] .run-btn { background: #b4a4fa; color: #17102e; border-color: #b4a4fa; }
[data-theme="dark"] .btn.primary:hover,
[data-theme="dark"] .navright .btn:hover,
[data-theme="dark"] .run-btn:hover { background: #c8bcff; border-color: #c8bcff; }
[data-theme="dark"] :is(.hero .micro, .statusbar, .eyebrow, .agent-top, .note, .network-node p,
  .network-note, .lab-kicker, .simulation, .fixture-note, .reset-btn, .result-top, .result-summary span,
  .workflow-label, .flow-node span, .feedback-loop span, .lab-bottom p, .console-head, .console-body,
  .step>span, .ownership, footer, .close, .submitrow span, .demo-loading) { color: var(--text-label); }
[data-theme="dark"] :is(.agent p, .checks label, .output-empty, .result-card p, .output-intro,
  .question-context, .input-claim p, .flow-node b, .method p, .step p, .application p,
  .engage p, details p, .contact p, dialog p) { color: var(--text-soft); }
[data-theme="dark"] :is(.agent-icon, .enzyme-role, .arrow, .network-output>span, #demo-status,
  .result-tag, .result-summary strong, .input-claim span, .feedback-loop, .export-btn, .guide-link,
  .console-body strong, .application .mono, .engage a, .ownership>span, summary:after) { color: var(--accent-ink); }
[data-theme="dark"] :is(.network-output, .output-empty h4, .ownership strong) { color: #c6c8e7; }
[data-theme="dark"] .agent { background: var(--surface); border-color: var(--line); }
[data-theme="dark"] .agent:hover { background: #1c2039; border-color: #656080; }
[data-theme="dark"] .agent.active { background: #282343; border-color: #8474b4; }
[data-theme="dark"] .lab { background: #111427; border-color: #353a58; }
[data-theme="dark"] .tool-network { background: linear-gradient(120deg, #1c1b38, #121e30); }
[data-theme="dark"] .network-node { background: #171c31; border-color: #343a58; }
[data-theme="dark"] .node-type { color: #9bb1d2; }
[data-theme="dark"] .network-node i { color: #9393c3; }
[data-theme="dark"] .llm { background: #29213f; border-color: #504066; }
[data-theme="dark"] .llm .node-type { color: #ccb3f7; }
[data-theme="dark"] .human { background: #142c38; border-color: #305763; }
[data-theme="dark"] .human .node-type { color: #84ced7; }
[data-theme="dark"] .lab-controls { background: #101326; }
[data-theme="dark"] :is(.lab-controls select, .lab-controls textarea, dialog input, dialog textarea, dialog select) {
  background: #1b2038; border-color: #3b4262; color: #e0e4f5;
}
[data-theme="dark"] .empty-glyph { color: #a493d2; }
[data-theme="dark"] .result-card { background: #171c31; border-color: #323a56; }
[data-theme="dark"] .input-claim { border-color: #9173c1; }
[data-theme="dark"] .workflow { background: #12162b; }
[data-theme="dark"] .flow-node { border-color: #343a57; }
[data-theme="dark"] .flow-node.active { background: #30264d; border-color: #a18dd1; }
[data-theme="dark"] .flow-node.done { background: #192b38; }
[data-theme="dark"] .flow-node i { color: #929abc; }
[data-theme="dark"] .guide-link,
[data-theme="dark"] .engage a { border-color: #625477; }
[data-theme="dark"] .method { background: #101529; border-color: var(--line); }
[data-theme="dark"] .console { background: #171c31; border-color: #3a4260; }
[data-theme="dark"] :is(.console-head, .steps, .step) { border-color: #343d58; }
[data-theme="dark"] .console-body .warn { color: #d5afcc; }
[data-theme="dark"] .science-image { background: #13182e; }
[data-theme="dark"] .bridge { background: #211e4c; border: 1px solid #363267; }
[data-theme="dark"] .engage article { background: var(--surface); }
[data-theme="dark"] .contact { border-color: #333b59; background: radial-gradient(ellipse at top, #262644, #101526 75%); }
[data-theme="dark"] dialog { background: #161b30; border-color: #48516e; }
[data-theme="dark"] dialog::backdrop { background: #050715b3; }
[data-theme="dark"] .skip-link { background: #24233e; }
[data-theme="dark"] .spinner { border-color: #4a3e63; border-top-color: #c3aaf0; }
[data-theme="dark"] .menu-open .navlinks { background: #161b30; border-color: #353c59; }

@media (min-width: 1500px) { .biotech-art { width: 119%; margin-left: -3%; } }
@media (max-width: 1050px) {
  nav { gap: 15px; }
  .navright { gap: 10px; }
  .navlinks { gap: 16px; }
  .biotech-art { width: 117%; margin-left: -6%; }
}
@media (max-width: 760px) {
  .hero-inner { grid-template-columns: 1fr; gap: 10px; }
  .hero { padding-bottom: 45px; }
  .biotech-art { width: 112%; max-width: 620px; margin: 8px -6% 0; justify-self: center; }
  .biotech-art figcaption { margin-top: 10px; width: 82%; font-size: 7px; }
  .navright { gap: 8px; }
  .theme-toggle { width: 34px; height: 34px; flex-basis: 34px; }
}
@media (max-width: 370px) {
  nav { padding-inline: 17px 12px; gap: 6px; }
  .brand img { width: 112px; }
  .navright { gap: 6px; }
  #lang { font-size: 11px; padding-inline: 2px; }
  .menu-toggle { padding: 6px; }
  .biotech-art figcaption { gap: 10px; font-size: 6px; }
}
@media (prefers-reduced-motion: reduce) { .biotech-art img { animation: none; transform: none; } }
