/* ═══════════════════════════════════════════════
   HOME PAGE STYLES — Main Oniscomorpha page
   ═══════════════════════════════════════════════ */

/* ─── HERO OVERRIDES ─── */
.hero {
  padding: 7rem 2rem 5rem;
}
.hero-rings {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.hero-rings svg {
  width: min(900px, 110vw); height: min(900px, 110vw);
  animation: slowSpin 80s linear infinite; opacity: 0.25;
}
@keyframes slowSpin { to { transform: rotate(360deg); } }

.hero-eyebrow {
  color: var(--sage); opacity: 0.85;
}
.millipede-wrap {
  cursor: pointer; margin: 0 auto 1.5rem; display: inline-flex;
  align-items: center; justify-content: center; user-select: none;
}
.hero h1 {
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  line-height: 1.05; margin-bottom: 0.8rem;
}
.hero h1 em { color: var(--sage); }
.hero-subtitle {
  color: var(--text2); font-size: 0.9rem; letter-spacing: 0.18em;
  text-transform: uppercase; margin-bottom: 3rem;
  font-family: 'Jost', sans-serif; font-style: normal;
}
.hero-stats { display: flex; gap: 3rem; justify-content: center; flex-wrap: wrap; }
.hero-stat { text-align: center; }
.hero-stat-num {
  display: block; font-family: 'Cormorant Garamond', serif;
  font-size: 2.8rem; color: var(--gold); font-weight: 300;
  line-height: 1; margin-bottom: 0.3rem;
}
.hero-stat-label { font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.scroll-hint {
  font-size: 0.68rem; opacity: 0.55;
}
.scroll-line {
  height: 40px;
  animation: scrollPulse 2.2s ease-in-out infinite;
}
@keyframes scrollPulse { 0%,100%{opacity:0.3;transform:scaleY(0.8);}50%{opacity:1;transform:scaleY(1);} }

/* ─── DIVIDER OVERRIDE ─── */
.divider {
  background: linear-gradient(to right, transparent, var(--sage3, var(--border)), transparent);
  opacity: 0.4;
}

/* ─── SECTION OVERRIDES ─── */
.section-label {
  font-size: 0.68rem; letter-spacing: 0.38em; opacity: 0.75;
}
.section-title {
  font-size: clamp(2rem, 5vw, 3.6rem); font-weight: 300;
  line-height: 1.1; margin-bottom: 2rem;
}
.section-title em { color: var(--sage); }
.section-body {
  color: var(--text); font-size: 1rem; line-height: 1.8; margin-bottom: 2.5rem;
}
.section-body p + p { margin-top: 0.9rem; }

/* ─── REVEAL DELAYS ─── */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* ─── SECTION 01: SYSTEMATICS ─── */
.phylo-wrap { margin-top: 3rem; overflow-x: auto; }
.phylo-wrap svg { max-width: 100%; display: block; margin: 0 auto; }

.orders-trio { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.5rem; margin-top: 3rem; }
@media (max-width: 768px) { .orders-trio { grid-template-columns: 1fr; } }
.order-card {
  border: 1px solid var(--border); border-radius: 8px; padding: 2rem;
  background: rgba(255,255,255,0.015); transition: transform 0.3s, border-color 0.3s;
  display: flex; flex-direction: column;
}
[data-theme="light"] .order-card { background: rgba(0,0,0,0.02); }
.order-card:hover { transform: translateY(-5px); border-color: var(--border2); }
.order-card.extinct { border-color: rgba(201,149,43,0.2); }
.order-badge {
  font-size: 0.66rem; letter-spacing: 0.25em; text-transform: uppercase;
  padding: 0.22rem 0.7rem; border-radius: 2px; display: inline-block; margin-bottom: 1.2rem;
  align-self: flex-start;
}
.badge-extinct { background: rgba(201,149,43,0.12); color: var(--gold); }
.badge-north { background: rgba(111,170,133,0.12); color: var(--sage); }
.badge-south { background: rgba(167,139,250,0.12); color: var(--purple); }
.order-card h3 {
  font-family: 'Cormorant Garamond', serif; font-size: 1.6rem; font-weight: 400;
  color: var(--cream2); font-style: italic; margin-bottom: 0.3rem;
}
.order-era { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; }
.order-card p { font-size: 0.88rem; color: var(--text); line-height: 1.7; flex: 1; }
.order-stats { display: flex; gap: 1.5rem; margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px solid var(--border); }
.os { text-align: center; }
.os-val { display: block; font-family: 'Cormorant Garamond', serif; font-size: 1.8rem; color: var(--gold); font-weight: 300; line-height: 1; }
.os-lbl { font-size: 0.68rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); }

.synap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; margin-top: 2.5rem; }
.synap-item {
  background: rgba(255,255,255,0.015); border: 1px solid var(--border);
  border-radius: 6px; padding: 1.1rem;
}
[data-theme="light"] .synap-item { background: rgba(0,0,0,0.02); }
.synap-icon { font-size: 1.2rem; margin-bottom: 0.5rem; }
.synap-title {
  font-family: 'Cormorant Garamond', serif; font-size: 1rem; color: var(--cream2);
  margin-bottom: 0.3rem; font-weight: 400;
}
.synap-item p { font-size: 0.82rem; color: var(--text); line-height: 1.6; }

/* ─── SECTION 02: FOSSIL ─── */
.fossil-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; margin-top: 3rem; }
@media (max-width: 768px) { .fossil-layout { grid-template-columns: 1fr; } }
.fossil-card {
  background: rgba(255,255,255,0.015); border: 1px solid rgba(201,149,43,0.15);
  border-radius: 8px; padding: 1.5rem; margin-bottom: 1rem;
}
[data-theme="light"] .fossil-card { background: rgba(0,0,0,0.02); }
.fossil-card h4 {
  font-family: 'Cormorant Garamond', serif; font-size: 1.2rem; color: var(--gold);
  margin-bottom: 0.6rem; font-weight: 400;
}
.fossil-card p { font-size: 0.88rem; color: var(--text); line-height: 1.7; }

.geo-timeline { margin-top: 0; }
.geo-era { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.6rem; }
.geo-bar {
  height: 28px; border-radius: 3px; display: flex; align-items: center;
  padding: 0 0.7rem; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 400; white-space: nowrap;
}
.geo-mya { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.geo-event { font-size: 0.82rem; color: var(--sage); font-style: italic; }
.geo-line { width: 1px; height: 12px; background: var(--border); margin-left: 2rem; }

/* ─── SECTION 03: LIVING ORDERS ─── */
.tab-nav {
  display: flex; border-bottom: 1px solid var(--border); margin-bottom: 2.5rem;
}
.tab-btn {
  background: none; border: none; color: var(--muted); font-family: 'Jost', sans-serif;
  font-size: 0.8rem; letter-spacing: 0.22em; text-transform: uppercase;
  padding: 0.9rem 1.8rem; cursor: pointer; transition: color 0.3s;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-btn.active { color: var(--cream2); border-bottom-color: var(--sage); }
.tab-panel { display: none; }
.tab-panel.active { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
@media (max-width: 768px) { .tab-panel.active { grid-template-columns: 1fr; } }
.tab-panel-info h3 {
  font-family: 'Cormorant Garamond', serif; font-size: 1.85rem; color: var(--cream2);
  margin-bottom: 0.3rem; font-weight: 300;
}
.tab-panel-info .tab-sub {
  font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.5rem;
}
.tab-panel-info p { font-size: 0.92rem; color: var(--text); line-height: 1.75; margin-bottom: 1rem; }
.feature-list { list-style: none; margin-top: 0.5rem; }
.feature-list li {
  font-size: 0.88rem; color: var(--text); padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  display: flex; gap: 0.7rem; align-items: baseline;
}
.feature-list li::before { content: '—'; color: var(--sage); flex-shrink: 0; }
.feature-list em { color: var(--cream); font-style: normal; }
.morph-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.morph-card {
  border: 1px solid var(--border); border-left: 3px solid var(--clr, var(--sage));
  border-radius: 5px; padding: 1.2rem; background: rgba(255,255,255,0.015); transition: transform 0.3s;
}
[data-theme="light"] .morph-card { background: rgba(0,0,0,0.02); }
.morph-card:hover { transform: translateX(3px); }
.morph-icon { font-size: 1.3rem; margin-bottom: 0.5rem; }
.morph-title {
  font-family: 'Cormorant Garamond', serif; font-size: 1.05rem; color: var(--cream2);
  margin-bottom: 0.4rem; font-weight: 400;
}
.morph-text { font-size: 0.82rem; color: var(--text); line-height: 1.65; }
.morph-tag {
  display: inline-block; margin-top: 0.6rem; font-size: 0.65rem;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--clr, var(--sage)); opacity: 0.8;
}

/* ─── SECTION 04: DEFENSE ─── */
.defense-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 3rem; }
@media (max-width: 768px) { .defense-grid { grid-template-columns: 1fr; } }
.defense-panel {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 2rem; background: rgba(255,255,255,0.015);
}
[data-theme="light"] .defense-panel { background: rgba(0,0,0,0.02); }
.defense-panel.chemical { border-color: rgba(158,207,178,0.22); }
.defense-panel.mechanical { border-color: rgba(167,139,250,0.22); }
.defense-panel h3 {
  font-family: 'Cormorant Garamond', serif; font-size: 1.65rem; color: var(--cream2);
  margin-bottom: 0.25rem; font-weight: 300;
}
.defense-sub { font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.5rem; }
.defense-panel p { font-size: 0.9rem; color: var(--text); line-height: 1.75; margin-bottom: 0.9rem; }
.dtag {
  display: inline-block; padding: 0.18rem 0.6rem; border-radius: 3px;
  font-size: 0.68rem; letter-spacing: 0.15em; text-transform: uppercase;
  margin: 0.2rem;
}
.dtag-g { background: rgba(111,170,133,0.12); color: var(--sage); }
.dtag-p { background: rgba(167,139,250,0.12); color: var(--purple); }
.dtag-a { background: rgba(201,149,43,0.12); color: var(--gold); }

.glomerin-viz {
  margin-top: 1.5rem; background: rgba(255,255,255,0.02); border-radius: 8px;
  padding: 1.2rem; text-align: center; border: 1px solid var(--border);
}
[data-theme="light"] .glomerin-viz { background: rgba(0,0,0,0.03); }
.glomerin-viz canvas { display: block; margin: 0 auto; }
.glomerin-viz p { font-size: 0.72rem; text-align: center; margin-top: 0.4rem; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }

.armor-viz {
  margin-top: 1.5rem; background: rgba(255,255,255,0.02); border-radius: 8px;
  padding: 1.2rem; border: 1px solid rgba(167,139,250,0.1);
}
[data-theme="light"] .armor-viz { background: rgba(0,0,0,0.03); }
.armor-viz p { font-size: 0.72rem; text-align: center; margin-top: 0.4rem; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }

/* ─── SECTION 05: VOLVATION ─── */
.vol-section { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; margin-top: 3rem; }
@media (max-width: 768px) { .vol-section { grid-template-columns: 1fr; } }
.vol-steps { counter-reset: step; }
.vol-step {
  position: relative; padding: 1rem 1rem 1rem 3rem; margin-bottom: 0.8rem;
  border-radius: 6px; border: 1px solid var(--border); background: rgba(255,255,255,0.01);
  cursor: pointer; transition: all 0.3s;
  counter-increment: step;
}
[data-theme="light"] .vol-step { background: rgba(0,0,0,0.02); }
.vol-step::before {
  content: counter(step, '0'); position: absolute; left: 0.9rem; top: 50%;
  transform: translateY(-50%); font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem; color: var(--sage2); font-weight: 300;
}
.vol-step.active {
  border-color: var(--sage); background: rgba(111,170,133,0.05);
}
.vol-step.active::before { color: var(--gold); }
.vol-step h4 { font-family: 'Cormorant Garamond', serif; font-size: 1.05rem; color: var(--cream2); margin-bottom: 0.2rem; font-weight: 400; }
.vol-step p { font-size: 0.82rem; color: var(--text); line-height: 1.6; }
.vol-visual { display: flex; flex-direction: column; align-items: center; gap: 1.2rem; }
.vol-progress { display: flex; gap: 0.5rem; }
.vol-pip { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); transition: background 0.3s; }
.vol-pip.active { background: var(--sage); }
.vol-btn-row { display: flex; gap: 0.8rem; }
.vol-btn {
  background: none; border: 1px solid var(--border); color: var(--sage);
  font-family: 'Jost', sans-serif; font-size: 0.78rem; letter-spacing: 0.15em;
  padding: 0.5rem 1.1rem; cursor: pointer; border-radius: 3px; transition: all 0.3s;
}
.vol-btn:hover { background: rgba(111,170,133,0.08); border-color: var(--sage); }

/* ─── SECTION 06: ECOLOGY ─── */
.eco-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; margin-top: 3rem; }
.eco-card {
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden; background: rgba(255,255,255,0.015); transition: transform 0.3s;
}
[data-theme="light"] .eco-card { background: rgba(0,0,0,0.02); }
.eco-card:hover { transform: translateY(-3px); }
.eco-card-inner { padding: 1.8rem; }
.eco-card h3 {
  font-family: 'Cormorant Garamond', serif; font-size: 1.25rem; color: var(--cream2);
  margin-bottom: 0.8rem; font-weight: 400; display: flex; align-items: center; gap: 0.5rem;
}
.eco-card h3 span { font-size: 1.3rem; }
.eco-card p { font-size: 0.88rem; color: var(--text); line-height: 1.75; }
.eco-stat-row {
  display: flex; gap: 1.5rem; margin-top: 1.2rem; padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}
.eco-stat-item { text-align: center; }
.eco-stat-val {
  display: block; font-family: 'Cormorant Garamond', serif; font-size: 1.9rem;
  color: var(--gold); font-weight: 300; line-height: 1; margin-bottom: 0.2rem;
}
.eco-stat-lbl { font-size: 0.68rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); }

/* ─── SECTION 07: REPRODUCTION ─── */
.repro-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; margin-top: 3rem; }
@media (max-width: 768px) { .repro-layout { grid-template-columns: 1fr; } }
.section-body-inline { font-size: 0.95rem; color: var(--text); line-height: 1.8; margin-bottom: 1.5rem; }
.strid-box {
  background: rgba(255,255,255,0.02); border: 1px solid rgba(201,149,43,0.18);
  border-radius: 8px; padding: 1.5rem; margin-top: 1.5rem;
}
[data-theme="light"] .strid-box { background: rgba(0,0,0,0.03); }
.strid-box h4 {
  font-family: 'Cormorant Garamond', serif; font-size: 1.15rem; color: var(--gold);
  margin-bottom: 0.8rem; font-weight: 400;
}
.strid-box p { font-size: 0.85rem; color: var(--text); line-height: 1.7; margin-bottom: 0.7rem; }
.repro-timeline { position: relative; padding-left: 1.5rem; }
.repro-timeline::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(to bottom, var(--sage2), transparent);
}
.rt-step { position: relative; margin-bottom: 1.8rem; padding-left: 0.5rem; }
.rt-step::before {
  content: ''; position: absolute; left: -1.56rem; top: 0.42rem;
  width: 7px; height: 7px; border-radius: 50%; background: var(--sage2);
  border: 1px solid var(--sage);
}
.rt-step h4 {
  font-family: 'Cormorant Garamond', serif; font-size: 1.05rem; color: var(--cream2);
  margin-bottom: 0.25rem; font-weight: 400;
}
.rt-step p { font-size: 0.85rem; color: var(--text); line-height: 1.65; }

/* ─── CONSERVATION ─── */
.threat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.2rem; margin-top: 3rem; }
.threat-card {
  border-radius: 8px; padding: 1.5rem; background: rgba(255,255,255,0.015);
  border: 1px solid var(--border);
}
[data-theme="light"] .threat-card { background: rgba(0,0,0,0.02); }
.threat-card.red { border-left: 3px solid var(--red); }
.threat-card.amber { border-left: 3px solid var(--gold); }
.threat-card.green { border-left: 3px solid var(--sage); }
.threat-icon { font-size: 1.4rem; margin-bottom: 0.7rem; }
.threat-title { font-family: 'Cormorant Garamond', serif; font-size: 1.1rem; color: var(--cream2); margin-bottom: 0.4rem; font-weight: 400; }
.threat-text { font-size: 0.85rem; color: var(--text); line-height: 1.7; }
.conserve-callout {
  margin-top: 3rem; border: 1px solid var(--border); border-radius: 8px;
  padding: 2.2rem; text-align: center; background: rgba(255,255,255,0.015);
}
[data-theme="light"] .conserve-callout { background: rgba(0,0,0,0.02); }
.conserve-callout p {
  font-family: 'Cormorant Garamond', serif; font-size: 1.2rem;
  font-style: italic; color: var(--text2); line-height: 1.75;
}

/* ─── FAMILY ACCORDION ─── */
.family-list { list-style: none; margin-top: 1.5rem; }
.family-item {
  border: 1px solid var(--border); border-radius: 6px; margin-bottom: 0.5rem;
  overflow: hidden; cursor: pointer; transition: border-color 0.3s;
}
.family-item.open { border-color: var(--border2); }
.family-header {
  display: flex; align-items: center; gap: 0.8rem; padding: 0.85rem 1rem;
  background: rgba(255,255,255,0.015);
}
[data-theme="light"] .family-header { background: rgba(0,0,0,0.02); }
.family-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.family-name { font-family: 'Cormorant Garamond', serif; font-size: 1.05rem; color: var(--cream2); font-style: italic; }
.family-region { margin-left: auto; font-size: 0.72rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); }
.family-chevron { color: var(--muted); font-size: 0.9rem; transition: transform 0.3s; margin-left: 0.5rem; }
.family-item.open .family-chevron { transform: rotate(90deg); }
.family-body {
  display: none; padding: 1rem; font-size: 0.85rem; color: var(--text); line-height: 1.7;
  background: rgba(255,255,255,0.01); border-top: 1px solid var(--border);
}
[data-theme="light"] .family-body { background: rgba(0,0,0,0.01); }
.family-item.open .family-body { display: block; }

/* ─── QUOTE BLOCK ─── */
.quote-block {
  border-left: 2px solid var(--sage); padding: 1rem 1.5rem; margin: 2rem 0;
  background: rgba(111,170,133,0.04); border-radius: 0 6px 6px 0;
}
.quote-block p {
  font-family: 'Cormorant Garamond', serif; font-size: 1.1rem;
  font-style: italic; color: var(--text2); line-height: 1.7;
}

/* ─── MAP SECTION ─── */
.map-section { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start; margin-top: 3rem; }
@media (max-width: 768px) { .map-section { grid-template-columns: 1fr; } }
.world-map-wrap { position: sticky; top: 6rem; }
.world-map-label { font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.8rem; text-align: center; }
#world-map { width: 100%; aspect-ratio: 2/1; border-radius: 8px; border: 1px solid var(--border); overflow: hidden; }
.map-legend { display: flex; flex-wrap: wrap; gap: 0.6rem 1.2rem; margin-top: 1rem; justify-content: center; }
.legend-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; color: var(--muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.family-item.map-active { border-color: var(--gold); background: rgba(201,149,43,0.08); }
