:root {
  --ink: #102d3c;
  --muted: #5d7482;
  --soft: #edf5f7;
  --paper: #ffffff;
  --line: rgba(16, 45, 60, .13);
  --blue: #1f6fb2;
  --green: #147e68;
  --gold: #c99624;
  --violet: #7b4db3;
  --coral: #ca604e;
  --sky: #dbeef6;
  --shadow: 0 22px 60px rgba(16, 45, 60, .11);
  --shadow-soft: 0 10px 28px rgba(16, 45, 60, .08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  background:
    linear-gradient(180deg, #ffffff 0%, #f5fafb 42%, #eef6f3 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .55;
  background-image:
    linear-gradient(rgba(16, 45, 60, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 45, 60, .045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, #000, transparent 78%);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 1000;
  padding: 10px 12px;
  border-radius: 10px;
  color: #fff;
  background: var(--ink);
  text-decoration: none;
  font-weight: 800;
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  width: min(1280px, calc(100% - 24px));
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  padding: 12px 0 30px;
}

.hero {
  order: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: clamp(14px, 2vw, 22px);
  padding: clamp(16px, 2.5vw, 28px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(255, 255, 255, .9)),
    linear-gradient(110deg, rgba(20, 126, 104, .09), transparent 38%),
    linear-gradient(290deg, rgba(31, 111, 178, .11), transparent 34%),
    #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  box-shadow: 0 12px 22px rgba(20, 126, 104, .22);
}

.brand span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--ink);
  background: #fff;
  font-size: 14px;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  text-align: center;
  white-space: normal;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.btn:focus-visible,
input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(33, 102, 173, .32);
  outline-offset: 2px;
}

.btn.primary {
  color: #fff;
  background: var(--green);
  box-shadow: 0 12px 24px rgba(20, 126, 104, .18);
}

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

.btn.ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, .72);
}

.btn.icon-only {
  width: 42px;
  padding: 0;
}

.sr-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(260px, .58fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: stretch;
}

.hero-grid > *,
.manifesto > *,
.content-grid > *,
.full-card > *,
.map-shell,
.signal-panel,
.feature-card,
.tag-explorer {
  min-width: 0;
}

h1 {
  max-width: 780px;
  margin: 0 0 10px;
  font-size: clamp(32px, 4.15vw, 54px);
  line-height: 1.02;
  letter-spacing: 0;
}

.lead {
  max-width: 850px;
  margin: 0;
  color: #35576a;
  font-size: clamp(16px, 1.4vw, 18px);
  font-weight: 620;
}

.hero-note {
  max-width: 820px;
  margin: 10px 0 0;
  color: #516d7c;
  font-size: 14px;
  font-weight: 720;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.signal-panel {
  align-self: stretch;
  display: grid;
  align-content: space-between;
  gap: 14px;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 18px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(9, 35, 62, .96), rgba(13, 58, 76, .92)),
    #0b2540;
  box-shadow: var(--shadow-soft);
}

.signal-art {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: 50% 43%;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16), 0 18px 34px rgba(0,0,0,.22);
}

.signal-copy h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(19px, 1.85vw, 25px);
  line-height: 1.12;
}

.signal-copy ul {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.signal-copy li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px;
  color: rgba(255, 255, 255, .76);
  font-size: 13px;
  font-weight: 720;
}

.signal-copy li::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: .62em;
  border-radius: 50%;
  background: #f3cc5e;
}

.signal-copy strong {
  color: #ffffff;
}

.metric-strip {
  order: 3;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow-soft);
}

.metric b {
  display: block;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1;
}

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

.section {
  margin-top: 18px;
}

.manifesto {
  order: 4;
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
  gap: 22px;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow);
}

.section-kicker {
  display: block;
  margin-bottom: 12px;
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.manifesto h2,
.map-title h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.05;
  letter-spacing: 0;
}

.manifesto-copy p {
  margin: 0 0 14px;
  color: #496676;
  font-size: 16px;
}

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.pillar {
  display: flex;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  color: #335466;
  background: #f7fbfc;
  font-size: 14px;
  font-weight: 820;
}

.pillar:nth-child(-n+8) {
  border-color: rgba(23,132,99,.22);
  background: #fff;
}

.map-shell {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

#atlas {
  order: 2;
  display: flex;
  flex-direction: column;
}

.map-shell {
  order: 1;
}

.content-grid {
  order: 2;
}

.map-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--line);
}

.map-title p {
  margin: 7px 0 0;
  color: var(--muted);
  font-weight: 650;
}

.toolbox {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) repeat(3, minmax(150px, .8fr)) auto;
  gap: 8px;
  grid-column: 1 / -1;
  margin-top: 4px;
}

.field {
  position: relative;
}

.field svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 18px;
  height: 18px;
  color: #7790a0;
  transform: translateY(-50%);
  pointer-events: none;
}

input,
select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  font-size: 14px;
  font-weight: 700;
}

select {
  appearance: none;
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, #607987 50%),
    linear-gradient(135deg, #607987 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 19px,
    calc(100% - 13px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.field input {
  padding-left: 40px;
}

.map-canvas {
  height: min(72vh, 740px);
  min-height: 610px;
  background: var(--sky);
}

.map-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.map-hint {
  color: #526c7b;
  font-size: 12px;
  font-weight: 850;
}

.map-footer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.legend span,
.active-summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: #526c7b;
  background: #fff;
  font-size: 12px;
  font-weight: 850;
}

.active-summary {
  color: var(--ink);
  background: #f5f9fb;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.dot.cil { background: var(--blue); }
.dot.near { background: var(--gold); }
.dot.network { background: var(--violet); }

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  margin-top: 16px;
}

.feature-card,
.tag-explorer {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.90);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.feature-head,
.tag-head {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.feature-head h3,
.tag-head h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

.feature-head p,
.tag-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.feature-body {
  padding: 16px;
}

.full-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 16px;
  align-items: start;
}

.badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.badge.cil { color: var(--blue); background: #e8f2ff; }
.badge.near { color: #83610a; background: #fff5d8; }
.badge.network { color: var(--violet); background: #f3ecfb; }

.full-card h3 {
  margin: 10px 0 5px;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.05;
  letter-spacing: 0;
}

.meta {
  color: var(--muted);
  font-weight: 850;
}

.note {
  margin: 14px 0 0;
  color: #405f70;
  font-size: 15px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 16px;
}

.info-grid div,
.action-box {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #f7fbfc;
}

.info-grid strong,
.action-box strong {
  display: block;
  margin-bottom: 5px;
  color: #708898;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.info-grid span {
  color: #294d61;
  font-size: 13px;
  font-weight: 850;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.tag-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 8px;
  color: #526c7b;
  background: #fff;
  font-size: 11px;
  font-weight: 850;
}

.full-card-side {
  display: grid;
  gap: 10px;
}

.empty-state {
  padding: 18px;
  border: 1px dashed rgba(18,48,67,.24);
  border-radius: 18px;
  color: #526c7b;
  background: #f7fbfc;
  font-weight: 720;
}

.tag-explorer,
.insight-card,
.side-stack {
  display: grid;
  gap: 12px;
}

.side-stack .tag-explorer,
.side-stack .insight-card {
  position: static;
}

.insight-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.90);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tag-body,
.insight-body {
  max-height: 620px;
  overflow: auto;
  padding: 10px 14px 16px;
}

.insight-body {
  display: grid;
  gap: 12px;
}

.insight-block {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #f7fbfc;
}

.insight-block > strong {
  display: block;
  margin-bottom: 8px;
  color: #708898;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.mix-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  position: relative;
  padding: 7px 0 11px;
  color: #35576a;
  font-size: 12px;
  font-weight: 850;
}

.mix-row i {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 5px;
  border-radius: 999px;
  background: #e5eef2;
  overflow: hidden;
}

.mix-row i::after {
  content: "";
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.rank-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rank-list span {
  display: inline-flex;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  color: #3d5d70;
  background: #fff;
  font-size: 12px;
  font-weight: 850;
}

.rank-list b {
  color: var(--green);
}

.tag-group {
  padding-top: 10px;
}

.tag-group-title {
  margin: 0 0 7px;
  color: #708898;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 3px 3px 3px 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: #385a6b;
  background: #fff;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.tag-chip.active {
  color: #fff;
  border-color: var(--ink);
  background: var(--ink);
}

.map-marker {
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 10px 18px rgba(18, 48, 67, .28);
}

.map-marker.cil {
  width: 34px;
  height: 34px;
  border-width: 4px;
  background: var(--blue);
  box-shadow: 0 0 0 6px rgba(33,102,173,.16), 0 12px 24px rgba(18,48,67,.32);
}

.map-marker.near { background: var(--gold); }
.map-marker.network { background: var(--violet); }
.map-marker.approx {
  opacity: .58;
  filter: saturate(.75);
}

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background: rgba(18,48,67,.16);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  color: #fff;
  border: 3px solid #fff;
  background: var(--ink);
  font-weight: 950;
}

.rich-popup {
  min-width: 250px;
  max-width: 320px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.rp-title {
  margin: 7px 0 3px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.15;
  font-weight: 950;
}

.rp-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.rp-note {
  margin-top: 8px;
  color: #405f70;
  font-size: 13px;
  line-height: 1.42;
}

.rp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.rp-actions a,
.rp-actions button,
.rp-actions span {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 8px 10px;
  color: #fff;
  background: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.rp-actions button {
  color: var(--ink);
  background: #fff;
}

.rp-actions span {
  color: #6b7f8e;
  background: #f3f6f8;
}

.footer-note {
  order: 5;
  margin: 18px auto 0;
  padding: 16px;
  color: #526c7b;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

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

  .signal-panel {
    min-height: 230px;
  }

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

  .toolbox .field:first-child {
    grid-column: 1 / -1;
  }

  .tag-explorer {
    position: static;
  }

  .journey-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .wrap {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    padding-top: 7px;
  }

  .hero,
  .manifesto,
  .map-shell,
  .feature-card,
  .tag-explorer {
    border-radius: 20px;
    max-width: 100%;
  }

  .hero,
  .manifesto {
    padding: 16px;
  }

  .hero {
    gap: 14px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .brand span:last-child {
    font-size: 14px;
  }

  h1 {
    font-size: clamp(30px, 9vw, 39px);
    margin-bottom: 10px;
  }

  .lead {
    font-size: 15px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .hero-note {
    display: none;
  }

  .signal-panel {
    display: grid;
    min-height: 0;
    padding: 12px;
    border-radius: 18px;
  }

  .signal-art {
    aspect-ratio: 16 / 9;
    min-height: 132px;
    border-radius: 14px;
    object-position: 50% 42%;
  }

  .signal-copy h2 {
    font-size: 20px;
  }

  .signal-copy li {
    font-size: 12px;
  }

  .hero-actions .btn.ghost {
    display: none;
  }

  .signal-panel .btn {
    display: none;
  }

  .map-head {
    padding: 14px;
    gap: 10px;
  }

  .map-title h2 {
    font-size: 26px;
  }

  .map-title p,
  .active-summary {
    font-size: 12px;
  }

  .toolbox {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }

  .toolbox .field:first-child,
  .toolbox button {
    grid-column: auto;
  }

  input,
  select {
    min-height: 42px;
  }

  .lead,
  .hero-note,
  .signal-panel p {
    overflow-wrap: anywhere;
  }

  .topbar,
  .map-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .nav-actions,
  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .nav-actions .btn,
  .hero-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .metric-strip {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 12px;
  }

  .pillar-grid,
  .full-card,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .map-canvas {
    height: 58vh;
    min-height: 390px;
  }

  .tag-body {
    max-height: none;
  }

  .map-footer-actions,
  .map-footer-actions .btn {
    width: 100%;
  }
}
