body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  margin: 0;
  background: #0f172a;
  color: #e2e8f0;
}

a {
  color: #7DB3FF;
}

a:hover {
  color: #A9CCFF;
}

header {
  background: #020617;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #1e293b;
}

header h1 {
  margin: 0;
  font-size: 1.8rem;
}

nav {
  margin-top: 0.5rem;
}

nav a {
  color: #38bdf8;
  text-decoration: none;
  margin-right: 1.2rem;
}

main {
  max-width: 900px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

.hero h2 {
  font-size: 2rem;
}

.button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.7rem 1.2rem;
  background: #38bdf8;
  color: #0f172a;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
}

/* =========================================================
   Phase badges (3-badge system)
   ========================================================= */

.phase-badges{
  display:flex;
  flex-wrap:wrap;
  gap:.6rem;
  margin-top:.9rem;
}

.phase-badge{
  display:inline-flex;
  align-items:center;
  gap:.5rem;
  padding:.45rem .75rem;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.03);
  color:rgba(255,255,255,.88);
  text-decoration:none;
  font-size:.92rem;
  line-height:1;
}

.phase-badge:hover{
  background:rgba(255,255,255,.06);
}

.phase-badge .dot{
  width:.55rem;
  height:.55rem;
  border-radius:50%;
  background:rgba(120,170,255,.35);
  box-shadow:0 0 0 3px rgba(120,170,255,.10);
  flex:0 0 auto;
}

.phase-badge.active{
  border-color:rgba(120,170,255,.55);
  background:rgba(120,170,255,.10);
}

.phase-badge.active .dot{
  background:rgba(120,170,255,.95);
  box-shadow:0 0 0 3px rgba(120,170,255,.18);
}

footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.9rem;
  color: #94a3b8;
  border-top: 1px solid #1e293b;
}

/* ===============================
   Buttons / Calls to Action
================================= */

.btn {
  display: inline-block;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,0.05);
  color: #E6EDF7;
  text-decoration: none;
  font-weight: 500;
  transition: all .15s ease;
}

.btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,.35);
}

.btn.primary {
  background: linear-gradient(135deg, #2F6BFF, #1F4ED8);
  color: #FFFFFF;
  border: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset,
              0 4px 14px rgba(0,0,0,.35);
}

.btn.primary:hover {
  filter: brightness(1.1);
}

/* --- Biochemistry panels / grids (used by evolution pages) --- */
.section {
  margin: 2rem 0;
}


/* Make the closed select readable on the dark UI */
select {
  background-color: #101a2e; /* match your dark theme */
  color: #e9eefc;            /* readable in the closed control */
}

/* Force dropdown list items to be readable (browser support varies) */
select option {
  color: #111;               /* readable text in the dropdown */
  background-color: #fff;    /* readable background in the dropdown */
}

/* Keep your “checked” and hover styling */
select option:checked {
  background-color: #cfd6ff;
  color: #000;
}

select option:hover {
  background-color: #dde3ff;
}

.grid {
  display: grid;
  gap: 1rem;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 980px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .grid-3 { grid-template-columns: 1fr; }
}

.panel {
  padding: 1.1rem 1.1rem 1rem;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
}

.panel h2 {
  margin: 0 0 .5rem;
  font-size: 1.1rem;
  line-height: 1.25;
}

.muted {
  opacity: .82;
  margin: 0 0 .75rem;
}

.hr {
  height: 1px;
  background: rgba(255,255,255,.12);
  margin: .85rem 0 .9rem;
}

.pill-link {
  display: inline-block;
  padding: .35rem .7rem;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  text-decoration: none;
  font-size: .95rem;
}


/* Phase badges (global) */
.phase-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .85rem 0 0;
}

.phase-badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .30rem .65rem;
  border-radius: 999px;
  font-size: .82rem;
  letter-spacing: .02em;
  text-decoration: none;
  color: rgba(235,245,255,.95);
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.04);
}

.phase-badge:hover {
  background: rgba(120,170,255,0.14);
  border-color: rgba(120,170,255,0.42);
}

.phase-dot {
  width: .55rem;
  height: .55rem;
  border-radius: 999px;
  background: rgba(120,170,255,0.85);
  box-shadow: 0 0 0 2px rgba(120,170,255,0.14);
}

/* Optional: emphasize which phase this page belongs to */
.phase-badge.current {
  background: rgba(120,170,255,0.18);
  border-color: rgba(120,170,255,0.55);
}

.pill-link {
  display: inline-block;
  margin-top: .75rem;
  padding: .4rem .8rem;
  border: 1px solid rgba(120,170,255,.5);
  border-radius: 999px;
  text-decoration: none;
  color: #cfe2ff;
  font-size: .85rem;
}
.pill-link:hover { background: rgba(120,170,255,.15); }

/* Canonical scientific diagram styling */
.diagram {
  display: block;
  width: 100%;
  max-width: 960px;
  height: auto;

  margin: 2.5rem auto;   /* vertical rhythm + centered */
  padding: 0;

  background: white;   /* protects diagrams on dark backgrounds */
  border-radius: 6px;

  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.diagram figcaption {
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #6b7280; /* soft neutral gray */
  margin-top: 0.75rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* Canonical diagram sizing */
.diagram {
  max-width: 980px;           /* <- your locked-in width */
  margin: 1.25rem auto;       /* center in the page */
}

.diagram img {
  display: block;
  width: 100%;                /* scale down to the figure width */
  height: auto;               /* keep aspect ratio */
  max-width: 100%;
  border-radius: 12px;        /* optional, matches your card aesthetic */
}

.diagram.compact {
  max-width: 820px;
}

aside.toc {
  background: rgba(15, 23, 42, 0.75); /* dark navy glass */
  color: #e2e8f0; /* soft light text */
  border: 1px solid rgba(148, 163, 184, 0.25);
  backdrop-filter: blur(6px);
}

aside.toc a {
  color: #93c5fd; /* soft blue links */
}

aside.toc a:hover {
  color: #bfdbfe;
}


