/* ─────────────────────────────────────────────────────────────
   main.css — Netprobe / Connection Intelligence
   Layout: split-screen hero. Left=text, Right=map+card.
───────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist+Mono:wght@300;400;500;600&family=Geist:wght@300;400;500&display=swap');

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --w0: #faf7f2;
  --w1: #f4efe6;
  --w2: #ede6d9;
  --w3: #e2d9c8;
  --w4: #cfc4b0;

  --moss:   #4a5e42;
  --moss-2: #3a4c34;
  --moss-3: #627558;
  --moss-4: #8aaa7a;
  --bark:   #2a1f14;
  --bark-2: #3c2e1e;

  --ink:   #1a1208;
  --ink-2: #3d3020;
  --ink-3: #6e6050;
  --ink-4: #a09080;

  --ok:       #2d5e38;
  --ok-dim:   rgba(45,94,56,.12);
  --warn:     #7a5200;
  --warn-dim: rgba(122,82,0,.10);
  --err:      #7a1e1e;
  --err-dim:  rgba(122,30,30,.10);

  --serif: 'Instrument Serif', Georgia, serif;
  --mono:  'Geist Mono', 'Fira Code', monospace;
  --sans:  'Geist', system-ui, sans-serif;

  --r:  8px;
  --r2: 4px;
  --r3: 2px;
  --nav-h: 52px;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--w1);
  color: var(--ink-2);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Nav ────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 40px;
  background: var(--bark);
  border-bottom: 1px solid var(--bark-2);
  gap: 24px;
}

.nav-brand {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-brand-mark {
  width: 28px; height: 28px;
  background: var(--moss);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-brand-name {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--w0);
  letter-spacing: .01em;
}

.nav-brand-tag {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--moss-4);
  padding: 2px 6px;
  border: 1px solid rgba(98,117,88,.4);
  border-radius: var(--r3);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #9a8e7e;
  text-decoration: none;
  padding: 6px 13px;
  border-radius: var(--r2);
  border: 1px solid transparent;
  transition: color .15s, border-color .15s, background .15s;
}
.nav-link:hover {
  color: var(--w0);
  border-color: rgba(255,255,255,.1);
  background: rgba(255,255,255,.05);
}

/* ── SPLIT HERO ─────────────────────────────────────────── */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - var(--nav-h));
}

/* LEFT PANEL */
.split-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 56px 60px 48px;
  border-right: 1px solid var(--w3);
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow: hidden;
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--moss-3);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--moss-3);
  opacity: .6;
}

.hero-label {
  font-family: var(--serif);
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 400;
  color: var(--ink-3);
  line-height: 1.3;
  margin-bottom: 10px;
}

.hero-ip {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(38px, 4.5vw, 60px);
  color: var(--moss);
  line-height: 1.05;
  letter-spacing: -.01em;
  margin-bottom: 28px;
  word-break: break-all;
  min-height: 1.1em;
}

.hero-sub {
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 300;
  color: var(--ink-4);
  line-height: 1.7;
  max-width: 380px;
  margin-bottom: 36px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--ink-3);
  background: var(--w0);
  border: 1px solid var(--w3);
  border-radius: 99px;
  padding: 7px 16px 7px 12px;
  width: fit-content;
  box-shadow: 0 1px 3px rgba(30,20,8,.06);
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ink-4);
  flex-shrink: 0;
  transition: background .3s, box-shadow .3s;
}
.status-dot.ok   { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-dim); }
.status-dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-dim); }
.status-dot.err  { background: var(--err); box-shadow: 0 0 0 3px var(--err-dim); }

/* Hero quick-facts strip */
.hero-facts {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--w3);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
}
.hero-fact-label {
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 4px;
}
.hero-fact-val {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.hero-fact-val.green { color: var(--ok); }
.hero-fact-val.moss  { color: var(--moss); }

/* RIGHT PANEL */
.split-right {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--w2);
}

/* Map — upper half of right */
.map-wrap {
  position: relative;
  height: 55%;
  flex-shrink: 0;
  border-bottom: 1px solid var(--w3);
}

#map { position: absolute; inset: 0; }

.map-overlay {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 500;
  background: rgba(42,31,20,.88);
  border-radius: var(--r2);
  padding: 9px 14px;
  font-family: var(--mono);
  font-size: 10px;
  color: #c8bfb0;
  line-height: 1.9;
  pointer-events: none;
  backdrop-filter: blur(4px);
}
.map-overlay strong {
  font-size: 11.5px;
  color: var(--w0);
  font-weight: 600;
  display: block;
  margin-bottom: 1px;
}
.map-overlay .edge-tag {
  color: var(--moss-4);
  font-weight: 600;
}

/* Key info card — lower half of right */
.right-card {
  flex: 1;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--w0);
}

.right-card-title {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 16px;
}

.kv-list { display: flex; flex-direction: column; }
.kv-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--w2);
  gap: 16px;
}
.kv-row:last-child { border-bottom: none; }
.kv-key {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-4);
  flex-shrink: 0;
}
.kv-val {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  text-align: right;
  word-break: break-all;
}
.kv-val.green { color: var(--ok); }
.kv-val.moss  { color: var(--moss); }
.kv-val.dim   { color: var(--ink-3); font-weight: 400; }

/* ── SCROLL SECTION (below fold) ────────────────────────── */
.below-fold {
  background: var(--w1);
  border-top: 1px solid var(--w3);
  padding: 56px 48px 80px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.section-title {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--w3);
}

/* Full info grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--w3);
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--w3);
  box-shadow: 0 1px 4px rgba(30,20,8,.06);
}

.info-cell {
  background: var(--w0);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background .15s;
}
.info-cell:hover { background: var(--w1); }

.info-label {
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.info-val {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  word-break: break-all;
}
.info-val.green { color: var(--ok); }
.info-val.moss  { color: var(--moss); }
.info-val.dim   { color: var(--ink-3); font-weight: 400; }

/* ── Skeleton ────────────────────────────────────────────── */
.skeleton {
  display: inline-block;
  background: linear-gradient(90deg, var(--w2) 25%, var(--w3) 50%, var(--w2) 75%);
  background-size: 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r3);
  color: transparent !important;
  user-select: none;
  min-width: 60px;
}
@keyframes shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ── Footer ─────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--w3);
  padding: 22px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: .04em;
  background: var(--w0);
}
.footer a { color: var(--ink-4); text-decoration: none; transition: color .15s; }
.footer a:hover { color: var(--moss); }

/* ── Leaflet overrides ──────────────────────────────────── */
.leaflet-control-zoom a {
  background: var(--w0) !important;
  color: var(--ink-2) !important;
  border-color: var(--w3) !important;
}
.leaflet-control-zoom a:hover { background: var(--w2) !important; }
.leaflet-control-attribution {
  font-family: var(--mono) !important;
  font-size: 9px !important;
  background: rgba(250,247,242,.8) !important;
}
.leaflet-tooltip.map-tip {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.leaflet-tooltip-top.map-tip::before { display: none !important; }

.map-popup {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--w0);
  background: var(--bark);
  border-radius: 5px;
  padding: 5px 10px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  display: block;
}

/* ── Animations ─────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up   { animation: fadeUp .4s ease both; }
.fade-up-1 { animation: fadeUp .4s .1s  ease both; }
.fade-up-2 { animation: fadeUp .4s .2s  ease both; }
.fade-up-3 { animation: fadeUp .4s .3s  ease both; }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--w2); }
::-webkit-scrollbar-thumb { background: var(--w4); border-radius: 3px; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; min-height: unset; }
  .split-left {
    position: static;
    height: auto;
    padding: 48px 28px 40px;
    border-right: none;
    border-bottom: 1px solid var(--w3);
  }
  .split-right { min-height: 520px; }
  .map-wrap    { height: 280px; }
  .below-fold  { padding: 40px 24px 60px; }
  .info-grid   { grid-template-columns: 1fr 1fr; }
  .nav         { padding: 0 20px; }
  .footer      { padding: 20px 24px; flex-direction: column; gap: 8px; }
}
@media (max-width: 480px) {
  .info-grid { grid-template-columns: 1fr; }
  .nav-brand-tag { display: none; }
  .hero-facts { grid-template-columns: 1fr; }
}