:root {
  --bg: #0e1420;
  --panel: #141c2b;
  --text: #e8ecf3;
  --muted: #c3ccdc;
  --germ: #4fa3e3;
  --terrain: #6bbf8a;
  --accent: #e3c34f;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.6;
}

/* Tabs / nav */
.tabs {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  margin: 0;
  padding: 0.65rem 1.5rem;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
  border-bottom: 1px solid var(--panel);
}
.logo {
  flex: 0 0 auto;
  display: flex;
  line-height: 0;
}
.logo svg { display: block; }
.logo:hover .iceberg-tip { fill: var(--accent); }
.tab-scroll {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
}
.tab {
  display: inline-block;
  background: var(--panel);
  border: 1px solid transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  flex: 0 0 auto;
  transition: border-color 0.2s, color 0.2s;
}
.tab:hover { border-color: var(--accent); }
.tab.active {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: bold;
}

/* Page content wrapper */
.panel { max-width: 900px; margin: 0 auto; padding: 1rem 1.5rem 4rem; }

/* Landing */
.landing {
  text-align: center;
  padding: 0 0 1rem;
}
.landing h1 {
  font-size: 2.4rem;
  margin: 0 0 0.75rem;
  letter-spacing: 0.02em;
}
.landing p {
  max-width: 720px;
  margin: 0 auto;
  color: var(--accent);
  font-weight: bold;
  font-size: 1.15rem;
}

.section-title {
  text-align: center;
  font-size: 1.7rem;
  margin: 0 0 0.5rem;
}
.section-sub {
  text-align: center;
  color: var(--muted);
  max-width: 700px;
  margin: 0 auto 2.5rem;
  font-size: 1.02rem;
}

.theories {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 2rem auto 0;
}
.card {
  flex: 1 1 320px;
  background: var(--panel);
  border-radius: 10px;
  padding: 2rem;
  border-top: 3px solid var(--muted);
}
.card.germ { border-top-color: var(--germ); }
.card.terrain { border-top-color: var(--terrain); }
.card h2 {
  margin-top: 0;
  font-size: 1.4rem;
}

/* Any block a speak-btn can read aloud (theory cards, background-block sub-sections, etc.) */
.speak-scope { position: relative; }
.speak-scope h2, .speak-scope h3 { padding-right: 2.2rem; }
.speak-btn {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--muted);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}
.speak-btn:hover { border-color: var(--accent); color: var(--accent); }
.speak-btn.speaking { border-color: var(--accent); color: var(--accent); background: var(--panel); }
.speak-btn svg { width: 18px; height: 18px; display: block; }
.card .origin {
  color: var(--muted);
  font-size: 1.15rem;
  font-style: italic;
  margin-bottom: 1rem;
}
.card.germ .origin {
  color: var(--germ);
  font-weight: bold;
}
.card.terrain .origin {
  color: var(--terrain);
  font-weight: bold;
}
.card p {
  color: #ffffff;
  font-size: 1rem;
}

/* Background block (cultural / political / financial context) */
.background-block {
  background: var(--panel);
  border-radius: 10px;
  padding: 2rem;
  margin-top: 1.5rem;
}
.background-block h3 {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 1.15rem;
}
.background-block > .speak-scope:not(:first-child) { margin-top: 2rem; }
.background-block p { color: #ffffff; margin: 0.5rem 0; }
.background-block .caveat {
  font-size: 0.92rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 0.6rem;
}
.inline-link {
  color: var(--accent);
  text-decoration: underline;
}

/* Timelines */
.timeline {
  position: relative;
  margin: 2rem 0 0;
  padding-left: 1.6rem;
  border-left: 3px solid var(--muted);
}
.timeline.germ-line { border-left-color: var(--germ); }
.timeline.terrain-line { border-left-color: var(--terrain); }
.timeline-item { position: relative; margin-bottom: 2.2rem; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.05rem;
  top: 0.35rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
}
.germ-line .timeline-item::before { background: var(--germ); }
.terrain-line .timeline-item::before { background: var(--terrain); }
.timeline-year { font-weight: bold; font-size: 1.05rem; }
.germ-line .timeline-year { color: var(--germ); }
.terrain-line .timeline-year { color: var(--terrain); }
.timeline-item p { color: #ffffff; margin: 0.4rem 0 0; }

.pointer { text-align: center; margin-top: 2.8rem; }
.pointer p { color: var(--muted); font-style: italic; margin-bottom: 1rem; }
.pointer a, .pointer-btn {
  display: inline-block;
  background: var(--accent);
  color: var(--bg);
  font-family: inherit;
  font-weight: bold;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 1rem;
}

/* Flexner hinge */
.hinge-block {
  background: var(--panel);
  border: 2px solid var(--accent);
  border-radius: 10px;
  padding: 2rem;
  margin-top: 1.5rem;
}
.hinge-block h3 { color: var(--accent); margin: 0 0 0.5rem; }
.hinge-block > .speak-scope:not(:first-child) { margin-top: 1.75rem; }
.hinge-block p { color: #ffffff; margin: 0.5rem 0; }
.hinge-block .caveat {
  font-size: 0.92rem;
  color: var(--muted);
  font-style: italic;
}

/* Today's Duality */
.duality-columns { display: flex; flex-wrap: wrap; gap: 2rem; margin-top: 1rem; }
.duality-col { flex: 1 1 320px; }
.duality-col h3 { text-align: center; font-size: 1.2rem; }
.duality-col.germ-col h3 { color: var(--germ); }
.duality-col.terrain-col h3 { color: var(--terrain); }
.duality-col.speak-scope h3 { padding-left: 2.2rem; }
.duality-close {
  text-align: center;
  max-width: 700px;
  margin: 3rem auto 0;
  color: var(--muted);
  font-style: italic;
  font-size: 1.05rem;
}

footer {
  text-align: center;
  padding: 2rem 1.5rem 3rem;
  color: var(--muted);
  font-size: 0.85rem;
}
