/* Shared redesign shell for student-authored interactive lesson pages. */
:root {
  --bg: #f7f8f4;
  --bg2: #ffffff;
  --bg3: #f1f5f4;
  --text: #111821;
  --text2: #667184;
  --accent: #2f86a8;
  --gray2: #dce3ea;
}

body {
  background:
    radial-gradient(900px 520px at 8% 0%, rgba(92, 178, 198, 0.16), transparent 62%),
    radial-gradient(780px 520px at 96% 8%, rgba(195, 119, 90, 0.13), transparent 60%),
    radial-gradient(860px 560px at 70% 100%, rgba(95, 150, 116, 0.12), transparent 64%),
    var(--bg);
  color: var(--text);
}

nav {
  background: rgba(249, 251, 248, 0.88);
  border-bottom: 1px solid rgba(122, 135, 148, 0.22);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72);
}

nav .logo {
  color: #1e6d8a;
}

nav .links a:hover,
nav .links a.active {
  color: #125a75;
  background: rgba(47, 134, 168, 0.12);
}

nav .links {
  scrollbar-width: none;
}

nav .links::-webkit-scrollbar {
  display: none;
}

.home-view,
.reset-view {
  flex: 0 0 auto;
  border: 1px solid rgba(47, 134, 168, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #1e6d8a;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 9px 14px;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(19, 30, 42, 0.05);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.home-view {
  text-decoration: none;
}

.reset-view {
  margin-left: 14px;
}

.home-view:hover,
.reset-view:hover {
  border-color: rgba(47, 134, 168, 0.46);
  background: rgba(47, 134, 168, 0.12);
  color: #125a75;
}

.container {
  max-width: 1240px;
  padding: 94px 28px 72px;
}

.hero {
  text-align: left;
  padding: 58px 0 34px;
}

.hero h1 {
  max-width: 900px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: 0;
  color: #101821;
  margin-bottom: 18px;
}

.hero p {
  max-width: 880px;
  margin: 0;
  color: #4f5d6d;
  font-size: 17px;
  line-height: 1.75;
}

.author-line {
  color: #7b8492;
}

.hero .stats-row {
  justify-content: flex-start;
  gap: 14px;
  margin-top: 28px;
}

.hero .stat-box {
  min-width: 145px;
  padding: 16px 18px 14px;
  border: 1px solid rgba(125, 139, 153, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 1px 2px rgba(19, 30, 42, 0.04), 0 10px 24px rgba(19, 30, 42, 0.05);
}

.hero .stat-box .num {
  color: #1f7fa7;
  font-size: 31px;
  line-height: 1.05;
}

.hero .stat-box .lbl {
  color: #677384;
  margin-top: 6px;
}

.lesson-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 30px;
}

.map-card {
  min-height: 150px;
  padding: 20px;
  border: 1px solid rgba(125, 139, 153, 0.24);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1px 2px rgba(19, 30, 42, 0.04), 0 14px 32px rgba(19, 30, 42, 0.06);
}

.map-kicker {
  display: block;
  margin-bottom: 10px;
  color: #2f86a8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-card strong {
  display: block;
  color: #111821;
  font-size: 17px;
  line-height: 1.35;
  margin-bottom: 8px;
}

.map-card p {
  color: #5e6978;
  font-size: 13.5px;
  line-height: 1.65;
  margin: 0;
}

section {
  min-height: 0;
  margin: 28px 0;
  padding: 30px;
  border: 1px solid rgba(125, 139, 153, 0.22);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 1px 2px rgba(19, 30, 42, 0.04), 0 20px 52px rgba(19, 30, 42, 0.06);
}

section:last-child {
  border-bottom: 1px solid rgba(125, 139, 153, 0.22);
}

h2 {
  color: #111821;
  font-size: clamp(24px, 2.5vw, 34px);
  letter-spacing: 0;
}

.subtitle {
  max-width: 900px;
  color: #5e6978;
  font-size: 15px;
  line-height: 1.75;
}

.legend {
  justify-content: flex-start;
  margin: 14px 0 20px;
}

.legend-item {
  color: #687487;
}

.chart-wrap {
  padding: 18px;
  border-radius: 20px;
  background:
    radial-gradient(680px 360px at 82% 0%, rgba(47, 134, 168, 0.14), transparent 60%),
    #101421;
  border: 1px solid rgba(18, 24, 36, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.chart-wrap > div {
  border-radius: 14px;
}

.detail-panel {
  background: #f8faf9;
  border: 1px solid rgba(125, 139, 153, 0.22);
  color: #1a2430;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.detail-panel h3 {
  color: #1e7798;
}

.detail-panel .meta,
.detail-panel .stat .label,
.source-ref {
  color: #697586;
}

.detail-panel .tag {
  color: #1f7796;
  background: rgba(47, 134, 168, 0.12);
}

.detail-panel .stat {
  background: #eef4f5;
}

.detail-panel .stat .val {
  color: #101821;
}

.gene-table th,
.gene-table td {
  border-color: rgba(125, 139, 153, 0.22);
}

.gene-table th {
  color: #677384;
}

.card,
.conv-card,
.ch-card {
  background: #f8faf9;
  border-color: rgba(125, 139, 153, 0.22);
}

.card h4,
.ch-card h4 {
  color: #a55a2c;
}

.convergence-diagram,
.paradigm-diagram,
.xi-diagram {
  background:
    radial-gradient(620px 320px at 78% 0%, rgba(47, 134, 168, 0.16), transparent 60%),
    #101421;
  color: #e6ebf0;
  border-radius: 20px;
  border: 1px solid rgba(18, 24, 36, 0.88);
}

footer {
  color: #6a7482 !important;
  border-top-color: rgba(125, 139, 153, 0.24) !important;
}

footer a {
  color: #1e7798 !important;
}

@media (max-width: 820px) {
  .container {
    padding: 76px 18px 54px;
  }

  .hero {
    padding-top: 36px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .hero p,
  .subtitle {
    font-size: 15px;
  }

  .lesson-map {
    grid-template-columns: 1fr;
  }

  .hero .stats-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero .stat-box {
    min-width: 0;
  }

  .reset-view {
    margin-left: 8px;
    padding: 8px 11px;
    font-size: 12px;
  }

  section {
    padding: 22px 16px;
    border-radius: 18px;
  }

  .chart-wrap {
    margin-left: -4px;
    margin-right: -4px;
    padding: 12px;
  }
}

@media (max-width: 640px) {
  .hero h1 {
    font-size: 30px;
    line-height: 1.18;
    max-width: 100%;
  }

  .hero .stat-box {
    padding: 14px 12px 12px;
  }

  .hero .stat-box .num {
    font-size: 29px;
  }
}
