:root {
  --bg-1: #f2f5ff;
  --bg-2: #e9eefc;
  --glass: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.35);
  --shadow: 0 18px 50px rgba(17, 24, 39, 0.14);
  --text: #0f172a;
  --muted: #4b5563;
  --accent: #007aff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg-1), var(--bg-2));
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

.background {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(500px 500px at 15% 20%, rgba(0, 122, 255, 0.16), transparent 50%),
    radial-gradient(600px 600px at 85% 10%, rgba(45, 209, 172, 0.18), transparent 55%),
    radial-gradient(500px 500px at 40% 70%, rgba(249, 192, 12, 0.14), transparent 55%);
  filter: blur(0px);
  z-index: 0;
}

.content {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 22px 60px;
}

.panel {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px 30px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  margin-bottom: 26px;
}

.glass {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.68));
}

.hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: center;
  padding: 32px 34px;
}

.hero-text h1 {
  margin: 0 0 8px 0;
  font-size: 56px;
  letter-spacing: -0.5px;
}

.subtitle {
  color: #6b7280;
  font-size: 38px;
  margin-top: -12px;
  font-weight: 500;
}

.lede {
  margin: 0;
  color: #1f2937;
  font-size: 14px;
  max-width: 640px;
}

.chip {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  font-size: 13px;
  margin: 4px 6px 4px 0;
  color: #0f172a;
}

h2 {
  font-size: 32px;
  margin: 0 0 10px;
  letter-spacing: -0.2px;
}

#view-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 18px 0 12px;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.9);
}

.seg-btn {
  border: none;
  background: transparent;
  padding: 12px 22px;
  font-size: 14px;
  color: #0f172a;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.seg-btn + .seg-btn {
  border-left: 1px solid var(--glass-border);
}

.seg-btn.active {
  background: #0f172a;
  color: #fff;
}

.seg-btn:hover:not(.active) {
  background: rgba(15, 23, 42, 0.05);
}

.view-description {
  max-width: 900px;
  margin: 0 auto 18px;
  font-size: 18px;
  color: #555;
  line-height: 1.6;
  opacity: 0.95;
  transition: opacity 0.2s ease;
}

.section-title {
  font-size: 56px;
  margin-bottom: 6px;
}

.section-subtitle {
  font-weight: 700;
  color: #374151;
  margin-top: -4px;
  margin-bottom: 6px;
  font-size: 18px;
}

p {
  margin: 12px 0 0;
  font-size: 14px;
  color: #1f2937;
}

.team {
  list-style: none;
  padding: 0;
  margin: 12px 0 0 0;
  color: #1f2937;
  font-size: 16px;
  line-height: 1.5;
}

.team li + li {
  margin-top: 4px;
}

#viz-container {
  padding: 26px 26px 18px;
}

#view-trends,
#view-map {
  width: 100%;
}

#map-hub {
  padding: 22px 24px 24px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

#view-map {
  display: none;
}

.legend-hint {
  font-size: 13px;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--glass-border);
}

#linechart {
  width: 100%;
  height: 520px;
  border-radius: 14px;
}

#baseline-ndvi {
  padding: 26px 26px 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.68));
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 26px;
}

#baseline-ndvi h2 {
  font-size: 32px;
  margin: 0 0 8px;
}

#baseline-ndvi .subtitle {
  font-size: 16px;
  margin-top: -2px;
  margin-bottom: 8px;
}

#baselineChart {
  width: 100%;
  height: 360px;
  display: block;
  border-radius: 14px;
}

#mapChart {
  width: 100%;
  height: 520px;
  display: block;
  border-radius: 14px;
}

.caption {
  text-align: left;
  font-size: 14px;
  color: var(--muted);
  margin-top: 10px;
}

.view-shell {
  padding: 8px 0 0;
}

.writeup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 10px;
}

.writeup-card {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.writeup-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  color: #0f172a;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--muted);
}

.footer-meta {
  color: #6b7280;
}

.tooltip {
  position: fixed;
  padding: 10px 12px;
  background: #000;
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  pointer-events: none;
  opacity: 0;
  transition: 0.15s ease-out;
  z-index: 20;
}

.context-note {
  max-width: 640px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #4b5563;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}


@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .content {
    padding: 32px 18px 48px;
  }
  .panel {
    padding: 24px 22px;
  }
  #linechart {
    height: 460px;
  }
  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}
