@import 'df-styles.css';

/* ── Page-specific tokens ── */
:root {
  --line: rgba(137, 180, 215, .18);
  --surface-map: #0b1729;
  --surface-2: #101f35;
  --gsm: #fbbf24;
  --umts: #a78bfa;
  --lte: #22d3ee;
  --nr: #f472b6;
}

/* ── Body: cellgermany-specific background ── */
body {
  background:
    radial-gradient(circle at 76% 4%, rgba(34, 211, 238, .08), transparent 27rem),
    linear-gradient(180deg, #071221 0%, var(--bg) 50rem);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(96, 165, 250, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, .025) 1px, transparent 1px);
  background-size: 48px 48px;
  content: "";
  pointer-events: none;
}

main,
footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 40px;
  align-items: center;
  min-height: 570px;
  padding: 54px 0 38px;
}

.eyebrow {
  margin: 0 0 15px;
  color: var(--cyan);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 680px;
  margin-bottom: 22px;
  font-size: clamp(2.7rem, 6.5vw, 5.6rem);
  font-weight: 600;
  letter-spacing: -.065em;
  line-height: .98;
}

.hero-lead {
  max-width: 650px;
  margin-bottom: 30px;
  color: var(--text-soft);
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  line-height: 1.75;
}

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

.primary-action,
.secondary-action {
  padding: 11px 17px;
  border-radius: 8px;
  font-size: .83rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform .2s, border-color .2s, background .2s;
}

.primary-action {
  background: var(--cyan);
  color: #04111e;
}

.secondary-action {
  border: 1px solid var(--line);
  color: var(--text-soft);
}

.primary-action:hover,
.secondary-action:hover { transform: translateY(-2px); }
.secondary-action:hover { border-color: #3c5d88; background: rgba(96, 165, 250, .06); }

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

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(12, 27, 47, .82);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .22);
}

.stats article { padding: 24px 28px; }
.stats article + article { border-left: 1px solid var(--line); }

.stat-value {
  display: block;
  margin-bottom: 7px;
  color: #fff;
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -.04em;
}

.stat-label {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.map-section,
.explanations { padding-top: 110px; }

.section-heading {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
  align-items: end;
  margin-bottom: 32px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 4vw, 3.1rem);
  letter-spacing: -.045em;
  line-height: 1.08;
}

.section-heading > p {
  margin-bottom: 3px;
  color: var(--muted);
  line-height: 1.7;
}

.section-heading.compact { grid-template-columns: 1fr; }

.map-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-map);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .28);
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 62px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #0c192c;
}

.technology-filter { display: flex; gap: 7px; flex-wrap: wrap; }

.technology-filter button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid #294463;
  border-radius: 7px;
  background: #10223a;
  color: #c9d7e9;
  cursor: pointer;
  font: 600 .71rem/1 Inter, sans-serif;
}

.technology-filter button[aria-pressed="false"] {
  border-color: #1a2a3e;
  background: transparent;
  color: var(--muted);
}

.dot { width: 7px; height: 7px; border-radius: 50%; }
.dot.gsm { background: var(--gsm); }
.dot.umts { background: var(--umts); }
.dot.lte { background: var(--lte); }
.dot.nr { background: var(--nr); }

.map-status { color: var(--muted); font-size: .72rem; text-align: right; }

.map-toolbar-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.station-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #c4d4e8;
  cursor: pointer;
  font-size: .7rem;
  font-weight: 600;
  white-space: nowrap;
}

.station-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  width: 31px;
  height: 17px;
  border: 1px solid #36516f;
  border-radius: 3px;
  background: #14263c;
  transition: border-color .2s, background .2s;
}

.switch-track span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: #7890ad;
  transition: transform .2s, background .2s;
}

.station-switch input:checked + .switch-track { border-color: var(--cyan); background: rgba(34, 211, 238, .2); }
.station-switch input:checked + .switch-track span { background: #67e8f9; transform: translateX(14px); }
.station-switch:has(input:disabled) { cursor: not-allowed; opacity: .38; }
.station-switch input:focus-visible + .switch-track { outline: 2px solid var(--blue); outline-offset: 2px; }

#cellMap {
  width: 100%;
  height: min(68vh, 720px);
  min-height: 520px;
  background: #081321;
}

.zoom-hint {
  position: absolute;
  z-index: 700;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 28px);
  padding: 8px 11px;
  border: 1px solid rgba(96, 165, 250, .25);
  border-radius: 7px;
  background: rgba(7, 18, 33, .86);
  color: #a9bad0;
  font-size: .68rem;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.zoom-hint svg { width: 16px; fill: none; stroke: var(--cyan); stroke-width: 1.8; }

.leaflet-control-zoom a { border-color: #2a405d !important; background: #0d1d31 !important; color: #cfe2fa !important; }
.leaflet-control-attribution { background: rgba(7, 16, 29, .82) !important; color: #7186a2 !important; }
.leaflet-control-attribution a { color: #9bb9d9 !important; }

.leaflet-control-geocoder {
  width: min(320px, calc(100vw - 92px));
  border: 1px solid #2a4668 !important;
  border-radius: 7px !important;
  background: rgba(9, 25, 43, .96) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3) !important;
}
.leaflet-control-geocoder-expanded { width: min(320px, calc(100vw - 92px)); }
.leaflet-control-geocoder-icon { background-color: transparent !important; filter: invert(82%) sepia(67%) saturate(1199%) hue-rotate(144deg) brightness(96%); }
.leaflet-control-geocoder-form input { width: calc(100% - 42px) !important; height: 36px; padding: 0 8px !important; border: 0 !important; outline: 0; background: transparent !important; color: #e5eef9; font: 600 .76rem/1 Inter, sans-serif; }
.leaflet-control-geocoder-form input::placeholder { color: #7690ad; }
.leaflet-control-geocoder-alternatives { border-top-color: #284360 !important; }
.leaflet-control-geocoder-alternatives li { border-bottom-color: #203752 !important; }
.leaflet-control-geocoder-alternatives a { color: #c6d6e9 !important; font: 500 .72rem/1.4 Inter, sans-serif !important; }
.leaflet-control-geocoder-alternatives li:hover,
.leaflet-control-geocoder-selected { background: #153451 !important; }

.cell-density-cell { stroke: rgba(219, 234, 254, .2); stroke-width: .7; vector-effect: non-scaling-stroke; transition: fill-opacity .15s; }
.cell-density-cell:hover { fill-opacity: .94; stroke: rgba(255, 255, 255, .72); }
.cell-density-cell.is-selected { fill-opacity: 1; stroke: #fff; stroke-width: 2; }

.search-neighborhood-cell { fill: none; stroke: rgba(103, 232, 249, .75); stroke-width: 1.2; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; pointer-events: none; }
.search-neighborhood-cell.is-center { stroke: #fff; stroke-width: 2.5; stroke-dasharray: none; }

.cluster-search-popup .leaflet-popup-content { min-width: 190px; }
.cluster-search-button { width: 100%; margin-top: 12px; padding: 9px 11px; border: 1px solid var(--cyan); border-radius: 6px; background: rgba(34, 211, 238, .14); color: #a5f3fc; cursor: pointer; font: 700 .72rem/1 Inter, sans-serif; }
.cluster-search-button:hover, .cluster-search-button:focus-visible { background: rgba(34, 211, 238, .25); outline: 0; }

.city-search-marker { display: block; width: 13px; height: 13px; border: 2px solid #fff; border-radius: 2px; background: var(--cyan); box-shadow: 0 0 0 5px rgba(34, 211, 238, .2), 0 4px 14px rgba(0, 0, 0, .5); }

.cell-point-icon { background: transparent; border: 0; }
.cell-point-marker { display: block; width: var(--point-size); height: var(--point-size); border: 1px solid rgba(7, 18, 33, .9); border-radius: 1px; background: var(--point-color); box-shadow: 0 0 5px color-mix(in srgb, var(--point-color), transparent 35%); }

.all-stations-canvas { position: absolute; pointer-events: none; }

.jenks-legend { position: absolute; z-index: 700; left: 14px; bottom: 14px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid rgba(96, 165, 250, .22); border-radius: 6px; background: rgba(7, 18, 33, .86); color: #91a7c1; font-size: .62rem; backdrop-filter: blur(8px); pointer-events: none; }
.jenks-swatches { display: grid; grid-template-columns: repeat(5, 14px); gap: 2px; }
.jenks-swatches i { width: 14px; height: 9px; border: 1px solid rgba(255, 255, 255, .18); }
.jenks-swatches i:nth-child(1) { background: #2563eb; }
.jenks-swatches i:nth-child(2) { background: #168aad; }
.jenks-swatches i:nth-child(3) { background: #34a853; }
.jenks-swatches i:nth-child(4) { background: #167a3e; }
.jenks-swatches i:nth-child(5) { background: #064e3b; }

.station-switch-note { color: #7287a1; }

.cell-popup .leaflet-popup-content-wrapper,
.cell-popup .leaflet-popup-tip { background: #0d1d31; color: #dce9f8; }
.cell-popup .leaflet-popup-content-wrapper { border: 1px solid #294463; border-radius: 10px; }
.cell-popup .leaflet-popup-content { margin: 14px 16px; }

.popup-kicker { color: var(--cyan); font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.popup-title { margin: 5px 0 9px; font-size: 1rem; }
.popup-grid { display: grid; grid-template-columns: auto auto; gap: 4px 16px; font-size: .76rem; }
.popup-grid span:nth-child(odd) { color: #8095af; }
.popup-grid span:nth-child(even) { text-align: right; }

.explanation-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.explanation-grid article { min-height: 265px; padding: 28px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(145deg, rgba(16, 31, 53, .9), rgba(8, 21, 38, .9)); }
.explanation-grid svg { width: 45px; margin-bottom: 25px; fill: none; stroke: var(--cyan); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.explanation-grid h3 { margin-bottom: 13px; font-size: 1.02rem; }
.explanation-grid p { margin-bottom: 0; color: var(--muted); font-size: .86rem; line-height: 1.75; }

.source-note { display: grid; grid-template-columns: .7fr 1.6fr auto; gap: 32px; align-items: center; margin: 90px 0; padding: 25px 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.source-note span { display: block; margin-bottom: 5px; color: var(--muted); font-size: .65rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.source-note strong { font-size: .9rem; }
.source-note p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.65; }
.source-note > a { color: var(--cyan); font-size: .75rem; font-weight: 700; white-space: nowrap; }

footer { display: flex; justify-content: space-between; padding: 25px 0 35px; border-top: 1px solid rgba(138, 160, 189, .12); color: #617791; font-size: .7rem; }
footer a { text-decoration: none; }
footer a:hover { color: var(--cyan); }

@media (max-width: 850px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 75px; }
  .hero-visual { max-width: 560px; margin: -30px auto 0; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats article:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .stats article:nth-child(4) { border-top: 1px solid var(--line); }
  .section-heading { grid-template-columns: 1fr; gap: 16px; }
  .explanation-grid { grid-template-columns: 1fr; }
  .explanation-grid article { min-height: 0; }
  .source-note { grid-template-columns: 1fr; gap: 14px; }
}

@media (max-width: 620px) {
  main, footer { width: min(100% - 24px, 1180px); }
  .hero { padding-top: 55px; }
  .hero-visual { margin-top: -10px; }
  .stats article { padding: 19px; }
  .map-section, .explanations { padding-top: 78px; }
  .map-toolbar { align-items: flex-start; flex-direction: column; }
  .map-toolbar-meta { width: 100%; justify-content: space-between; }
  .map-status { text-align: left; }
  #cellMap { min-height: 540px; height: 70vh; }
  .leaflet-control-geocoder,
  .leaflet-control-geocoder-expanded { width: min(250px, calc(100vw - 84px)); }
  .zoom-hint { display: none; }
  .jenks-legend { bottom: 8px; left: 8px; }
  footer { gap: 12px; flex-direction: column; }
}
