:root {
  --bg: #f4f7f5;
  --panel: #ffffff;
  --ink: #10211a;
  --muted: #607066;
  --primary: #176b4d;
  --primary-2: #0f4f3a;
  --accent: #f0a735;
  --line: #dce6df;
  --low: #2f9e44;
  --moderate: #f59f00;
  --high: #e8590c;
  --very-high: #c92a2a;
  --shadow: 0 18px 50px rgba(16, 33, 26, 0.10);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #e6f3ec 0, transparent 32rem), var(--bg);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.site-header {
  position: sticky; top: 0; z-index: 999;
  backdrop-filter: blur(14px);
  background: rgba(244,247,245,0.88);
  border-bottom: 1px solid var(--line);
}
.nav-wrap {
  max-width: 1180px; margin: auto; padding: 0.85rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .8rem; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), #62b987);
  color: white; display: grid; place-items: center; font-weight: 900;
  box-shadow: 0 10px 25px rgba(23,107,77,.25);
}
.brand small { display: block; color: var(--muted); font-size: .78rem; margin-top: -2px; }
.nav-links { display: flex; align-items: center; gap: .35rem; }
.nav-links a { padding: .65rem .8rem; border-radius: 999px; color: #263c31; font-weight: 650; font-size: .92rem; }
.nav-links a:hover { background: #e8f2ec; }
.nav-cta { background: var(--primary); color: white !important; }
.nav-toggle { display: none; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; font-size: 1.35rem; padding: .35rem .6rem; }
.section-pad { max-width: 1180px; margin: auto; padding: 5.5rem 1rem; }
.section-pad-small { max-width: 1180px; margin: auto; padding: 1rem 1rem 4rem; }
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
.eyebrow { color: var(--primary); text-transform: uppercase; letter-spacing: .12em; font-weight: 800; font-size: .78rem; margin: 0 0 .6rem; }
h1 { font-size: clamp(2.45rem, 6vw, 5.2rem); line-height: .96; margin: 0 0 1.2rem; letter-spacing: -.055em; }
h2 { font-size: clamp(1.9rem, 4vw, 3.2rem); line-height: 1.05; margin: 0 0 1rem; letter-spacing: -.035em; }
h3 { margin-top: 0; }
.hero-text { font-size: 1.12rem; color: var(--muted); max-width: 650px; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1.6rem 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .85rem 1.05rem; border-radius: 14px; border: 1px solid transparent; font-weight: 800; cursor: pointer; }
.btn.primary { background: var(--primary); color: white; box-shadow: 0 12px 30px rgba(23,107,77,.25); }
.btn.primary:hover { background: var(--primary-2); }
.btn.ghost { background: white; border-color: var(--line); color: var(--ink); }
.btn.full { width: 100%; }
.hero-note { background: rgba(255,255,255,.78); border: 1px solid var(--line); border-radius: 16px; padding: 1rem; color: var(--muted); }
.hero-panel { position: relative; border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); background: white; }
.hero-panel img { width: 100%; min-height: 420px; object-fit: cover; }
.floating-card { position: absolute; left: 1rem; right: 1rem; display: flex; align-items: center; gap: .7rem; background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 18px; padding: .75rem .9rem; box-shadow: 0 10px 30px rgba(0,0,0,.08); }
.floating-card.top { top: 1rem; max-width: 230px; }
.floating-card.bottom { bottom: 1rem; max-width: 310px; }
.stat-number { font-size: 1.8rem; font-weight: 900; color: var(--primary); }
.risk-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.risk-high { background: var(--high); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stat-card, .image-card, .map-side-panel, .prediction-panel, .calc-form, .upload-card, .formula-box, figure {
  background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow);
}
.stat-card { padding: 1.25rem; }
.stat-card span { color: var(--primary); font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.stat-card strong { display: block; font-size: 1.2rem; margin: .35rem 0; }
.stat-card p { color: var(--muted); margin-bottom: 0; }
.split-section { display: grid; grid-template-columns: .95fr 1.05fr; gap: 2rem; align-items: center; }
.formula-box { padding: 1.2rem; margin: 1.4rem 0; }
.formula-box code { display: block; white-space: normal; background: #eef7f1; border: 1px dashed #9acbae; color: #0d4b34; padding: 1rem; border-radius: 14px; font-weight: 800; }
.method-list { display: grid; gap: .7rem; }
.method-list div { padding: .8rem 1rem; background: #eef4f0; border-radius: 14px; color: var(--muted); }
.image-card { padding: .65rem; overflow: hidden; }
.image-card img { border-radius: 18px; width: 100%; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.section-head p { color: var(--muted); max-width: 760px; }
.map-controls { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.chip { border: 1px solid var(--line); background: white; color: var(--ink); padding: .65rem .85rem; border-radius: 999px; font-weight: 800; cursor: pointer; }
.chip.active, .chip:hover { background: var(--primary); color: white; }
.map-layout { display: grid; grid-template-columns: 1fr 310px; gap: 1rem; }
.map { min-height: 590px; border-radius: 24px; border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; z-index: 1; }
.map-side-panel { padding: 1.2rem; }
.summary-card { display: flex; justify-content: space-between; align-items: center; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.summary-card span { color: var(--muted); }
.summary-card strong { font-size: 1.35rem; }
.legend { margin-top: 1rem; }
.legend div { display: flex; align-items: center; gap: .6rem; margin: .55rem 0; color: var(--muted); }
.legend-dot { width: 14px; height: 14px; display: inline-block; border-radius: 50%; }
.legend-dot.low { background: var(--low); }
.legend-dot.moderate { background: var(--moderate); }
.legend-dot.high { background: var(--high); }
.legend-dot.very-high { background: var(--very-high); }
.calculator-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 1rem; align-items: stretch; }
.calc-form { padding: 1rem; display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; }
.calc-form label { display: grid; gap: .35rem; color: var(--muted); font-weight: 800; }
.calc-form input[type="number"], .calc-form input[type="file"] { width: 100%; padding: .8rem; border: 1px solid var(--line); border-radius: 12px; font: inherit; }
.calc-form input[type="range"] { width: 100%; accent-color: var(--primary); }
.calc-form output { color: var(--primary); font-weight: 900; }
.prediction-panel { padding: 1.4rem; display: grid; align-content: start; }
.score-ring { width: 180px; height: 180px; border-radius: 50%; margin: 1rem auto; display: grid; place-items: center; background: conic-gradient(var(--primary) 0%, #e6eee9 0%); }
.score-ring span { width: 130px; height: 130px; border-radius: 50%; background: white; display: grid; place-items: center; font-size: 2rem; font-weight: 950; color: var(--primary); }
.result-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: .8rem; }
.result-grid div { background: #eef4f0; border-radius: 16px; padding: 1rem; }
.result-grid span { color: var(--muted); display: block; font-size: .86rem; }
.result-grid strong { font-size: 1.2rem; }
.recommendation { background: #fff8e7; border: 1px solid #ffe1a3; color: #6d4a00; padding: 1rem; border-radius: 16px; margin-top: 1rem; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
figure { margin: 0; padding: .65rem; overflow: hidden; }
figure img { border-radius: 18px; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
figcaption { padding: .8rem .4rem .2rem; color: var(--muted); font-weight: 850; }
.upload-card { padding: 1.4rem; display: grid; grid-template-columns: 1fr 340px; gap: 1.2rem; align-items: center; }
.upload-card p { color: var(--muted); }
.upload-box { display: grid; gap: .8rem; }
.upload-box input { background: white; border: 1px dashed var(--primary); border-radius: 14px; padding: 1rem; }
.footer { text-align: center; padding: 2.5rem 1rem; color: var(--muted); border-top: 1px solid var(--line); }
.leaflet-popup-content { min-width: 230px; }
.popup-title { font-weight: 900; font-size: 1.05rem; margin-bottom: .4rem; color: var(--ink); }
.popup-row { display: flex; justify-content: space-between; gap: 1rem; padding: .25rem 0; border-bottom: 1px solid #edf1ee; }
.popup-risk { font-weight: 900; padding: .25rem .5rem; border-radius: 999px; color: white; display: inline-block; margin-top: .5rem; }
@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 72px; left: 1rem; right: 1rem; background: white; border: 1px solid var(--line); border-radius: 18px; padding: .7rem; box-shadow: var(--shadow); }
  .nav-links.open { display: grid; }
  .hero, .split-section, .map-layout, .calculator-grid, .upload-card { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .section-head { align-items: flex-start; flex-direction: column; }
  .map-controls { justify-content: flex-start; }
}
@media (max-width: 620px) {
  .section-pad { padding: 3.5rem 1rem; }
  .stats-grid, .gallery-grid, .calc-form { grid-template-columns: 1fr; }
  .hero-panel img { min-height: 300px; }
  .map { min-height: 470px; }
  .result-grid { grid-template-columns: 1fr; }
  .brand small { display: none; }
}
