:root {
  --primary: #16584c;
  --primary-d: #0e3f37;
  --primary-soft: #e4ede8;
  --bg: #f4f1e9;
  --paper: #ffffff;
  --paper-2: #fbf9f3;
  --ink: #1b2b26;
  --ink-2: #3f524b;
  --ink-3: #6b7b73;
  --line: #e4decf;
  --line-2: #efeadf;
  --sand: #c9772f;
  --sand-soft: #f3e6d4;
  --risk-vlow: #4e7c5b;
  --risk-low: #7ba05b;
  --risk-mod: #c79a1e;
  --risk-high: #c8742f;
  --risk-vhigh: #b23a2e;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(27, 43, 38, 0.08);
  --max: 1120px;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Public Sans", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--primary-d);
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  line-height: 1.2;
  margin: 0 0 0.75rem;
  font-weight: 500;
}

p {
  margin: 0 0 1rem;
}

.container {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .header-inner,
.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--ink);
}

.brand strong {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
}

.brand span {
  color: var(--ink-3);
  font-size: 0.95rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  align-items: center;
}

.nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.95rem;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.65rem 1.1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

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

.btn-primary:hover {
  background: var(--primary-d);
  color: #fff;
}

.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sand {
  background: var(--sand);
  color: #fff;
}

.btn-sand:hover {
  background: #b56828;
  color: #fff;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.9rem;
}

.hero {
  padding: 3rem 0 2.5rem;
}

.hero-layout {
  display: grid;
  gap: 2rem;
  align-items: start;
}

.hero-main {
  display: grid;
  gap: 1.25rem;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.75rem);
  max-width: 12ch;
  line-height: 1.05;
  margin: 0;
}

.hero-title em {
  font-style: italic;
  color: var(--primary);
}

.lede {
  font-size: 1.08rem;
  color: var(--ink-2);
  max-width: 52ch;
  margin: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--primary);
  flex-shrink: 0;
}

.searchbar {
  display: grid;
  gap: 0.65rem;
}

.searchbar-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.35rem 0.35rem 0.85rem;
  box-shadow: var(--shadow);
}

.search-pin {
  color: var(--ink-3);
  display: inline-flex;
}

.searchbar-input-wrap input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0.7rem 0.35rem;
  font: inherit;
}

.searchbar-input-wrap input:focus {
  outline: none;
}

.search-btn {
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 0.7rem 1.1rem;
  cursor: pointer;
  white-space: nowrap;
}

.search-btn:hover {
  background: var(--primary-d);
}

.search-alt {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-weight: 600;
  text-align: left;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.search-alt:hover {
  color: var(--primary);
}

.trust {
  margin-top: 0.25rem;
}

.trust-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  margin: 0 0 0.25rem;
}

.trust-copy {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.98rem;
}

.trust-copy strong {
  font-family: var(--serif);
  color: var(--ink);
}

.hero-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 40px 90px -50px rgba(16, 63, 55, 0.55);
  width: 100%;
  max-width: 402px;
  justify-self: end;
}

.hc-map {
  position: relative;
  height: 178px;
  overflow: hidden;
  background: #e7efe8;
}

.hc-map-art {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.heat {
  position: absolute;
  width: 150px;
  height: 150px;
  right: 8%;
  bottom: -18px;
  background: radial-gradient(circle, rgba(200, 116, 47, 0.45), rgba(0, 0, 0, 0) 68%);
  pointer-events: none;
}

.radius-ring {
  position: absolute;
  width: 130px;
  height: 130px;
  border: 1px solid rgba(22, 88, 76, 0.22);
  border-radius: 999px;
  left: 58%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(22, 88, 76, 0.06);
  pointer-events: none;
}

.pin-marker {
  position: absolute;
  left: var(--pin-left, 68%);
  top: var(--pin-top, 42%);
  width: 2px;
  height: 30px;
  background: #c8742f;
  border-radius: 999px;
  box-shadow: 0 6px 14px -4px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -100%);
  pointer-events: none;
}

.pin-marker::after {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 10px;
  height: 10px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #c8742f;
  border: 2px solid #fff;
}

.me-pin {
  position: absolute;
  left: 56%;
  bottom: 46px;
  transform: translateX(-50%);
  pointer-events: none;
}

.me-dot {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #2f6bff;
  border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgba(47, 107, 255, 0.18);
}

.hc-body {
  padding: 1rem 1.15rem 0.85rem;
}

.hc-loc {
  margin: 0 0 0.85rem;
  color: var(--ink-3);
  font-size: 0.92rem;
}

.hc-postcode {
  font-weight: 600;
  color: var(--ink-2);
}

.hc-risk-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.hc-risk-label {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--ink);
}

.badge.high {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #f6e2cf;
  color: #8a4818;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
}

.badge.high .bd {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #c8742f;
  flex-shrink: 0;
}

.hc-meter {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

.hc-meter-item strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--ink);
}

.hc-meter-item span {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-3);
  line-height: 1.3;
}

.hc-foot {
  height: 12px;
  border-top: 1px solid var(--line-2);
  background: linear-gradient(180deg, rgba(251, 249, 243, 0.4), transparent);
}

.sec-eyebrow {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 0.5rem;
}

.sec-title {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  max-width: 22ch;
  margin: 0 0 1rem;
}

.sec-sub {
  color: var(--ink-2);
  max-width: 68ch;
  margin: 0 0 1.5rem;
}

.legend {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.legend-cell {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem;
}

.legend-bar {
  height: 6px;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

.legend-bar.vlow { background: var(--risk-vlow); }
.legend-bar.low { background: var(--risk-low); }
.legend-bar.mod { background: var(--risk-mod); }
.legend-bar.high { background: var(--risk-high); }
.legend-bar.vhigh { background: var(--risk-vhigh); }

.legend-cell h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.legend-cell p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-2);
}

.edu {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.edu-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.edu-card h3 {
  font-size: 1.2rem;
}

.edu-card ul {
  margin: 0.75rem 0 1rem;
  padding-left: 1.1rem;
  color: var(--ink-2);
}

.edu-more {
  font-weight: 600;
  text-decoration: none;
}

.edu-more:hover {
  text-decoration: underline;
}

.search-hint {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--ink-3);
}

.autocomplete-wrap {
  position: relative;
}

.suggestions {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 260px;
  overflow-y: auto;
}

.suggestions li {
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--ink-2);
}

.suggestions li:hover,
.suggestions li.active {
  background: var(--primary-soft);
  color: var(--ink);
}

.preview-card {
  display: none;
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.stat-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.stat-card strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.5rem;
}

.stat-card span {
  color: var(--ink-3);
  font-size: 0.9rem;
}

.section {
  padding: 2.5rem 0;
}

.section.alt {
  background: var(--paper);
  border-block: 1px solid var(--line);
}

.section h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.section-intro {
  color: var(--ink-2);
  max-width: 60ch;
  margin-bottom: 1.5rem;
}

.cards-3 {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card h3 {
  font-size: 1.2rem;
}

.card ul {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--ink-2);
}

.steps {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.step {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.step h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.step p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.95rem;
}

.step-num {
  display: inline-flex;
  width: 1.8rem;
  height: 1.8rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.risk-grid,
.risk-item,
.risk-label {
  /* legacy - replaced by .legend on homepage */
}

@media (min-width: 900px) {
  .hero-layout {
    grid-template-columns: minmax(0, 1fr) 402px;
    gap: 2.5rem;
    align-items: start;
  }
}

@media (min-width: 768px) {
  .legend {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 899px) {
  .hero-card {
    max-width: none;
    justify-self: stretch;
  }
}

@media (max-width: 768px) {
  .steps {
    grid-template-columns: 1fr;
  }

  .searchbar-row {
    grid-template-columns: auto 1fr;
    border-radius: var(--radius);
    padding: 0.5rem 0.65rem;
  }

  .search-btn {
    grid-column: 1 / -1;
    width: 100%;
  }
}

.site-footer {
  background: var(--primary-d);
  color: #dce7e3;
  padding: 2rem 0;
  margin-top: 2rem;
}

.site-footer a {
  color: #f4f1e9;
}

.footer-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.footer-grid h4 {
  color: #fff;
  font-size: 1rem;
}

.footer-bottom {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.9rem;
  color: #a8c0b8;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.95rem;
}

input, select, textarea {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
  background: var(--paper);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.notice {
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.notice-success {
  background: #e8f3ec;
  border: 1px solid #b9d8c3;
  color: #1f4d36;
}

.notice-error {
  background: #fdeeed;
  border: 1px solid #efc5c0;
  color: #7a2b24;
}

.consent-banner {
  position: fixed;
  inset: auto 1rem 1rem 1rem;
  max-width: 520px;
  margin-inline: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  z-index: 200;
  display: none;
}

.consent-banner.show {
  display: block;
}

.consent-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}


@media (max-width: 640px) {
  .nav {
    display: none;
  }
}
