:root {
  --bg: #f6f3ea;
  --panel: rgba(255, 255, 255, 0.88);
  --ink: #1f2430;
  --muted: #5a6272;
  --line: rgba(31, 36, 48, 0.1);
  --brand: #0f766e;
  --shadow: 0 24px 60px rgba(31, 36, 48, 0.12);
  --radius: 24px;
  --font-scale: 1;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Avenir Next", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.14), transparent 28%),
    linear-gradient(180deg, #f8f5ee 0%, var(--bg) 100%);
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 82px 0 48px;
}

.hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  box-shadow: var(--shadow);
}

.hero-top {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-actions { display: inline-flex; gap: 10px; }

.pill {
  appearance: none;
  border: 1px solid rgba(31, 36, 48, 0.16);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 900;
  cursor: pointer;
}
.pill:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.35); outline-offset: 2px; }

.hero-title {
  margin: 14px 0 8px;
  font-size: clamp(1.9rem, 3.2vw, 3rem);
  line-height: 1.02;
}

.hero-subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: calc(1.02rem * var(--font-scale));
  max-width: 70ch;
}

.panel {
  margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.search-row {
  display: grid;
  grid-template-columns: 90px 1fr 190px;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(31, 36, 48, 0.08);
}

.search-label {
  font-weight: 900;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.search-input,
.search-select {
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(31, 36, 48, 0.14);
  background: white;
  font-weight: 800;
  font-size: calc(1rem * var(--font-scale));
}
.search-input:focus-visible,
.search-select:focus-visible { outline: 3px solid rgba(15, 118, 110, 0.22); outline-offset: 2px; }

.topic-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.topic-card {
  text-align: left;
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(31, 36, 48, 0.10);
  background: rgba(255, 255, 255, 0.9);
  padding: 14px 14px 12px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.topic-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(31, 36, 48, 0.12); }
.topic-card:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.35); outline-offset: 2px; }

.topic-tag {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: rgba(37, 99, 235, 0.92);
  font-weight: 950;
  letter-spacing: 0.04em;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.topic-title {
  margin: 10px 0 6px;
  font-size: calc(1.2rem * var(--font-scale));
  font-weight: 950;
  line-height: 1.08;
}

.topic-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: calc(0.98rem * var(--font-scale));
}

.empty {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(249, 115, 22, 0.10);
  border: 1px solid rgba(249, 115, 22, 0.24);
  font-weight: 900;
}

.hidden { display: none !important; }

.topic-article {
  padding: 4px 8px 6px;
}

.topic-crumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.back {
  border: 1px solid rgba(31, 36, 48, 0.14);
  background: white;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 950;
  cursor: pointer;
}

.topic-h1 {
  margin: 14px 0 6px;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.05;
}

.topic-lede {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: calc(1.05rem * var(--font-scale));
  line-height: 1.7;
  max-width: 75ch;
}

.section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(31, 36, 48, 0.08);
}
.section h2 {
  margin: 0 0 8px;
  font-size: calc(1.25rem * var(--font-scale));
  font-weight: 950;
}
.section p, .section li {
  font-size: calc(1.02rem * var(--font-scale));
  line-height: 1.7;
}

.factbox {
  margin-top: 12px;
  border-radius: 18px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: rgba(15, 118, 110, 0.08);
  padding: 12px 14px;
}
.factbox h3 {
  margin: 0 0 8px;
  font-weight: 950;
}
.factbox ul { margin: 0; padding-left: 18px; }

.quiz {
  margin-top: 12px;
  border-radius: 18px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.07);
  padding: 12px 14px;
}
.quiz h3 { margin: 0 0 8px; font-weight: 950; }
.quiz .q { margin: 10px 0 6px; font-weight: 950; }
.quiz .choices { display: grid; gap: 8px; }
.choice {
  text-align: left;
  border: 1px solid rgba(31, 36, 48, 0.14);
  background: white;
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 850;
}
.choice.correct { border-color: rgba(16, 185, 129, 0.5); background: rgba(16, 185, 129, 0.10); }
.choice.wrong { border-color: rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.08); }
.feedback { margin-top: 8px; font-weight: 900; }

@keyframes wc-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

@keyframes wc-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes wc-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes wc-rise {
  0% { opacity: 0; transform: translateY(0); }
  50% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-60px); }
}

@keyframes wc-fall {
  0% { opacity: 0; transform: translateY(0); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translateY(25px); }
}

@keyframes wc-wave {
  0% { transform: translateX(0); }
  50% { transform: translateX(-10px); }
  100% { transform: translateX(0); }
}

.water-cycle-diagram {
  margin: 16px 0;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid rgba(79, 195, 247, 0.25);
  background: linear-gradient(180deg, #e1f5fe, #b3e5fc);
  box-shadow: 0 8px 24px rgba(2, 136, 209, 0.12);
}

.wc-svg {
  width: 100%;
  height: auto;
  display: block;
}

.wc-sun {
  animation: wc-pulse 3s ease-in-out infinite;
  transform-origin: center;
}

.wc-sun-rays {
  animation: wc-rotate 12s linear infinite;
  transform-origin: 100px 75px;
}

.wc-evap {
  animation: wc-float 2.5s ease-in-out infinite;
}

.wc-particle {
  animation: wc-rise 2.5s ease-out infinite;
}
.wc-particle:nth-child(2) { animation-delay: 0.8s; }
.wc-particle:nth-child(3) { animation-delay: 1.6s; }

.wc-cloud {
  animation: wc-float 4s ease-in-out infinite;
}
.wc-cloud:nth-child(2) { animation-delay: 0.5s; }
.wc-cloud:nth-child(3) { animation-delay: 1s; }
.wc-cloud:nth-child(4) { animation-delay: 0.3s; }

.wc-rain {
  animation: wc-fall 0.8s ease-in infinite;
}
.wc-rain:nth-child(2) { animation-delay: 0.2s; }
.wc-rain:nth-child(3) { animation-delay: 0.4s; }
.wc-rain:nth-child(4) { animation-delay: 0.6s; }

.wc-ocean {
  animation: wc-wave 3s ease-in-out infinite;
}

.wc-runoff {
  animation: wc-float 2s ease-in-out infinite;
}

.wc-label {
  font-family: "Trebuchet MS", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 900;
  fill: #01579b;
  pointer-events: none;
}

.wc-stage {
  cursor: pointer;
  transition: opacity 0.2s;
}
.wc-stage:hover { opacity: 0.85; }
.wc-stage:focus-visible {
  outline: 3px solid rgba(2, 136, 209, 0.5);
  outline-offset: 2px;
  border-radius: 8px;
}

.wc-active {
  filter: drop-shadow(0 0 8px rgba(255, 193, 7, 0.6));
}

@media (max-width: 720px) {
  .search-row { grid-template-columns: 1fr; }
  .search-label { display: none; }
}

