:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --paper: #ffffff;
  --paper-soft: #eef2eb;
  --ink: #18211d;
  --muted: #5b665f;
  --line: #d8ded5;
  --green: #173d2c;
  --green-2: #2f684d;
  --ochre: #b87932;
  --blue: #245b68;
  --forest-fill: rgba(36, 95, 66, .34);
  --crop-fill: rgba(184, 121, 50, .34);
  --shadow: 0 18px 55px rgba(24, 33, 29, .12);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

a { color: inherit; text-decoration: none; }

button,
input,
select,
textarea {
  font: inherit;
}

.site-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid rgba(216, 222, 213, .9);
  background: rgba(247, 248, 245, .92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 760;
  letter-spacing: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: var(--green);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}

.brand-mark svg { width: 22px; height: 22px; }

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 580;
}

.nav a:hover,
.nav a[aria-current="page"] { color: var(--green); }

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang {
  display: inline-flex;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 7px;
  overflow: hidden;
}

.lang a {
  min-width: 38px;
  padding: 8px 10px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 780;
}

.lang a.active {
  background: var(--green);
  color: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 720;
}

.btn.primary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.btn.ghost:hover,
.btn.primary:hover { transform: translateY(-1px); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(500px, 1.14fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  min-height: calc(100vh - 69px);
  padding: clamp(34px, 6vw, 78px) clamp(18px, 4vw, 48px) 34px;
}

.hero-copy {
  max-width: 660px;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(44px, 6vw, 82px);
  line-height: .96;
  letter-spacing: 0;
}

.lead {
  margin: 24px 0 0;
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.source-pill {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.72);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: .02em;
}

.map-preview {
  position: relative;
  min-height: 610px;
  overflow: hidden;
  border: 1px solid #cfd7ce;
  border-radius: var(--radius);
  background:
    linear-gradient(105deg, rgba(23,61,44,.08), transparent 44%),
    #e8eee5;
  box-shadow: var(--shadow);
}

.preview-map {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(26deg, transparent 0 13%, rgba(23,61,44,.13) 13% 15%, transparent 15% 33%, rgba(184,121,50,.14) 33% 36%, transparent 36%),
    radial-gradient(circle at 73% 34%, rgba(36,91,104,.18), transparent 17%),
    radial-gradient(circle at 33% 62%, rgba(184,121,50,.2), transparent 18%),
    radial-gradient(circle at 52% 44%, rgba(23,61,44,.22), transparent 15%),
    linear-gradient(135deg, #e6ece3, #f9faf7 62%, #dfe9dc);
}

.contour {
  position: absolute;
  border: 1px solid rgba(23,61,44,.18);
  border-radius: 43% 57% 64% 36% / 50% 44% 56% 50%;
}

.contour.one { width: 420px; height: 250px; left: 32%; top: 12%; transform: rotate(-18deg); }
.contour.two { width: 360px; height: 310px; left: 48%; top: 46%; transform: rotate(22deg); }
.contour.three { width: 310px; height: 220px; left: 6%; top: 52%; transform: rotate(-8deg); }

.preview-sidebar {
  position: absolute;
  top: 18px;
  left: 18px;
  width: min(340px, calc(100% - 36px));
  padding: 16px;
  border: 1px solid rgba(216,222,213,.95);
  border-radius: var(--radius);
  background: rgba(255,255,255,.9);
  box-shadow: 0 12px 34px rgba(24,33,29,.13);
  backdrop-filter: blur(16px);
}

.field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.panel-title {
  margin: 16px 0 10px;
  font-size: 12px;
  font-weight: 830;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.layer-row {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 0;
  border-top: 1px solid #edf0eb;
  font-size: 14px;
}

.swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.swatch.crop { background: var(--ochre); }
.swatch.forest { background: var(--green-2); }
.swatch.water { background: var(--blue); }

.toggle {
  width: 36px;
  height: 20px;
  border-radius: 99px;
  background: #d9dfd6;
  position: relative;
}

.toggle::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

.toggle.on { background: var(--green); }
.toggle.on::after { left: 19px; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.metric {
  padding: 14px 12px;
  background: #fff;
}

.metric strong {
  display: block;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}

.metric span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 740;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.section {
  padding: clamp(56px, 8vw, 104px) clamp(18px, 4vw, 48px);
  border-top: 1px solid var(--line);
}

.section-inner {
  max-width: 1180px;
  margin: 0 auto;
}

.section h2,
.content h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1.05;
  letter-spacing: 0;
}

.section p,
.content p,
.content li {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.split {
  display: grid;
  grid-template-columns: .92fr 1.08fr;
  gap: clamp(28px, 5vw, 70px);
  align-items: start;
}

.feature-list {
  display: grid;
  gap: 14px;
}

.feature {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.feature-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--paper-soft);
  color: var(--green);
}

.feature h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.feature p { margin: 0; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 30px;
}

.card {
  min-height: 220px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.card h3 {
  margin: 0 0 12px;
  font-size: 22px;
}

.card p { margin: 0; }

.content {
  max-width: 900px;
  margin: 0 auto;
  padding: 70px clamp(18px, 4vw, 48px) 96px;
}

.content .box {
  margin-top: 26px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.content-action {
  margin-top: 22px;
}

.content-cards {
  margin-top: 34px;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 32px clamp(18px, 4vw, 48px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.footer-links {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.footer a:hover {
  color: var(--green);
}

.viewer-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: 61px 1fr;
  background: #dfe7dc;
  overflow: hidden;
}

.viewer-topbar {
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 16px;
  border-bottom: 1px solid #ccd5cb;
  background: rgba(247,248,245,.96);
}

.viewer-title {
  min-width: 0;
  display: grid;
  gap: 2px;
  text-align: center;
}

.viewer-title strong {
  font-size: 14px;
  line-height: 1.1;
}

.viewer-title span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.viewer-main {
  position: relative;
  min-height: 0;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.real-viewer {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 0;
  background: #eef2eb;
}

.viewer-panel {
  position: absolute;
  z-index: 400;
  top: 18px;
  left: 18px;
  width: min(360px, calc(100vw - 36px));
  max-height: calc(100% - 36px);
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(205,213,203,.95);
  border-radius: var(--radius);
  background: rgba(255,255,255,.94);
  box-shadow: 0 16px 46px rgba(24,33,29,.16);
  backdrop-filter: blur(16px);
}

.viewer-panel h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.viewer-panel p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.search {
  width: 100%;
  min-height: 42px;
  margin-top: 14px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f2f5f0;
}

.mode-tabs button {
  min-height: 34px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.mode-tabs button.active {
  background: #fff;
  color: var(--green);
  box-shadow: 0 2px 8px rgba(24,33,29,.08);
}

.legend {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.legend label {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}

.legend input { accent-color: var(--green); }

.details {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfa;
}

.details h2 {
  margin: 0;
  font-size: 16px;
}

.details dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  margin: 12px 0 0;
  font-size: 13px;
}

.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 760; }

.map-note {
  position: absolute;
  z-index: 400;
  right: 18px;
  bottom: 18px;
  max-width: 390px;
  padding: 12px 14px;
  border: 1px solid rgba(205,213,203,.95);
  border-radius: var(--radius);
  background: rgba(255,255,255,.94);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 10px 30px rgba(24,33,29,.12);
}

@media (max-width: 980px) {
  .hero,
  .split {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .map-preview {
    min-height: 520px;
  }

  .nav {
    display: none;
  }

  .cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .topbar,
  .viewer-topbar,
  .footer {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar .actions,
  .viewer-topbar .actions {
    justify-content: space-between;
  }

  .hero {
    padding-top: 28px;
  }

  h1 {
    font-size: 42px;
  }

  .map-preview {
    min-height: 430px;
  }

  .preview-sidebar {
    left: 12px;
    top: 12px;
    width: calc(100% - 24px);
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .viewer-shell {
    grid-template-rows: auto 1fr;
  }

  .viewer-panel {
    top: auto;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    max-height: 54vh;
  }

  .map-note {
    display: none;
  }
}
