:root {
  --bg: #0a0c0f;
  --bg-alt: #0f1217;
  --surface: #14181f;
  --surface-hi: #1a2029;
  --line: #222730;
  --line-hi: #343c49;
  --text: #eef1f5;
  --text-2: #a5afbc;
  --muted: #6c7684;
  --accent: #2dd4a0;
  --accent-dim: rgba(45, 212, 160, 0.10);
  --accent-line: rgba(45, 212, 160, 0.36);
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --max-w: 1240px;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.6;
  overflow-x: clip;
  width: 100%;
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--text);
}

pre code, .cmd-bar code {
  background: transparent;
  border: none;
  padding: 0;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted);
}

.hi-text {
  color: var(--accent);
}

.inline-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent-line);
}
.inline-link:hover {
  text-decoration-color: var(--accent);
}

.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
}

/* Header */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15.5px;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--accent);
  position: relative;
  display: inline-block;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: var(--accent);
}

.brand-ver {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--bg-alt);
  padding: 2px 7px;
  border-radius: 3px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
}
.nav a:hover {
  color: var(--text);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 3px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn-primary {
  background: var(--accent);
  color: #06130e;
}
.btn-primary:hover {
  background: #42e0ae;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
}

.copy-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  padding: 4px 9px;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
}
.copy-btn:hover {
  color: var(--text);
  border-color: var(--line-hi);
}
.copy-btn.copied {
  color: var(--accent);
  border-color: var(--accent-line);
}

/* HERO: ARCHITECTURAL SPLIT + LIVE MAP ALIGNED TO GRID */
.hero {
  border-bottom: 1px solid var(--line);
}

.hero-wrap {
  padding-top: 0;
  padding-bottom: 0;
}

.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 520px) minmax(0, 1fr);
  min-height: 610px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  max-width: 100%;
}

.hero-left {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--bg);
  min-width: 0;
  max-width: 100%;
}

.hero-intro {
  padding: 36px 28px 26px;
  border-bottom: 1px solid var(--line);
}

.hero-intro h1 {
  font-size: clamp(28px, 2.8vw, 36px);
  line-height: 1.14;
  letter-spacing: -0.03em;
  font-weight: 600;
  margin-bottom: 14px;
}

.lead {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 20px;
}

.cmd-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 8px 10px;
  font-size: 12.5px;
  min-width: 0;
}
.cmd-bar code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  color: var(--text);
}
.prompt {
  color: var(--accent);
  user-select: none;
}

/* Workbench */
.workbench {
  display: flex;
  flex-direction: column;
  flex: 1;
  background: var(--bg-alt);
  min-width: 0;
}

.wb-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.wb-tab {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  border-right: 1px solid var(--line);
  border-bottom: 2px solid transparent;
  padding: 10px 8px;
  cursor: pointer;
  white-space: nowrap;
}
.wb-tab:last-child {
  border-right: none;
}
.wb-tab:hover {
  color: var(--text);
}
.wb-tab.active {
  color: var(--accent);
  background: var(--bg-alt);
  border-bottom-color: var(--accent);
}

.wb-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px 8px;
}

.wb-input {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 7px 10px;
  font-size: 12.5px;
  outline: none;
}
.wb-input:focus {
  border-color: var(--accent);
}

.wb-samples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 10px;
}

.wb-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 3px 8px;
  cursor: pointer;
}
.wb-chip:hover {
  color: var(--text);
  border-color: var(--line-hi);
}
.wb-chip.active {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-dim);
}

.wb-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  font-size: 11px;
  color: var(--muted);
}

.wb-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wb-status {
  color: var(--accent);
  white-space: nowrap;
}

.wb-output {
  margin: 0;
  padding: 14px 16px;
  font-size: 11.5px;
  line-height: 1.52;
  flex: 1;
  min-height: 225px;
  max-height: 280px;
  overflow: auto;
  color: #d6dde7;
}

.jk { color: #93c5fd; }
.js { color: #86efac; }
.jn { color: #fbbf24; }
.jb { color: #c4b5fd; }

/* Live Map Pane */
.hero-map-pane {
  position: relative;
  min-height: 560px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    #0d1117;
  background-size: 48px 48px;
  overflow: hidden;
}

.hero-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-overlay-top,
.map-overlay-bottom {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(10, 12, 15, 0.88);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-2);
  backdrop-filter: blur(8px);
}

.map-overlay-top {
  top: 14px;
  left: 14px;
  right: 14px;
  justify-content: space-between;
}
.map-overlay-top a {
  color: var(--accent);
  white-space: nowrap;
}
.map-overlay-top a:hover {
  text-decoration: underline;
}

.map-overlay-bottom {
  bottom: 14px;
  left: 14px;
  color: var(--text);
}
.map-overlay-bottom .sep {
  color: var(--muted);
}

.tex-pin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #0a0c0f;
  box-shadow: 0 0 0 4px rgba(45, 212, 160, 0.25);
}

.hero-map .maplibregl-ctrl-group {
  background: rgba(15, 18, 23, 0.92);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: none;
}
.hero-map .maplibregl-ctrl-group button {
  background: transparent;
  border-color: var(--line);
}
.hero-map .maplibregl-ctrl-group button .maplibregl-ctrl-icon {
  filter: invert(0.85);
}
.hero-map .maplibregl-ctrl-attrib {
  background: rgba(10, 12, 15, 0.85);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 10px;
}
.hero-map .maplibregl-ctrl-attrib a {
  color: var(--text-2);
}

/* Sections */
.section {
  padding: 68px 0;
  border-bottom: 1px solid var(--line);
}

.sec-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 740px);
  gap: 14px;
  align-items: baseline;
  margin-bottom: 28px;
}

.sec-idx {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

.sec-head h2 {
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin-bottom: 8px;
}

.sec-head p {
  color: var(--text-2);
  font-size: 14.5px;
}

/* Architecture */
.pipeline-box {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 18px 20px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text);
  overflow-x: auto;
  margin-bottom: 0;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.spec-cell {
  padding: 22px 20px;
  border-right: 1px solid var(--line);
}
.spec-cell:last-child {
  border-right: none;
}

.spec-num {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}

.spec-cell h3 {
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.spec-cell p {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.58;
}

/* Tables */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg-alt);
  overflow: hidden;
}

.table-bar {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-2);
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.data-table thead th {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table th.num,
.data-table td.num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
}

.data-table tr.row-hi td {
  background: var(--accent-dim);
}

.bar-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.bar {
  width: 56px;
  height: 5px;
  background: #1d232c;
  border-radius: 2px;
  overflow: hidden;
  display: inline-block;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--accent);
}
.bar.dim i {
  background: #556173;
}

.table-foot {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}
.table-foot strong {
  color: var(--text-2);
}

/* Atlas */
.atlas-shell {
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg-alt);
}

.atlas-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.preset-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-pill {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-2);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 5px 10px;
  cursor: pointer;
}
.preset-pill:hover {
  color: var(--text);
  border-color: var(--line-hi);
}
.preset-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #06130e;
  font-weight: 600;
}

.atlas-proj {
  font-size: 11px;
  color: var(--muted);
}

.atlas-canvas-wrap {
  position: relative;
  width: 100%;
  background: #080a0d;
}

#atlas-canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
}

.atlas-tooltip {
  display: none;
  position: absolute;
  pointer-events: none;
  background: rgba(10, 12, 15, 0.96);
  border: 1px solid var(--line-hi);
  border-radius: 3px;
  padding: 8px 10px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text);
  z-index: 5;
  max-width: 250px;
}

.atlas-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.atlas-cmd-wrap {
  min-width: 0;
  flex: 1;
}

.atlas-cmd {
  font-size: 12.5px;
  color: var(--text);
  overflow-x: auto;
  white-space: nowrap;
}

.atlas-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

/* Mobile Row */
.sec-head > *,
.spec-cell,
.hero-split > *,
.mobile-row > *,
.table-wrap,
.atlas-shell,
.code-shell {
  min-width: 0;
  max-width: 100%;
}

.mobile-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding: 24px 20px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.mobile-row h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.mobile-row p {
  font-size: 13.5px;
  color: var(--text-2);
}

.mobile-links {
  margin-top: 10px;
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Code Tabs */
.code-shell {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
}

.code-tabs {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.code-tab {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  background: transparent;
  border: none;
  border-right: 1px solid var(--line);
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  cursor: pointer;
  white-space: nowrap;
}
.code-tab:hover {
  color: var(--text);
}
.code-tab.active {
  color: var(--accent);
  background: var(--bg-alt);
  border-bottom-color: var(--accent);
}

.code-pane {
  display: none;
  position: relative;
  padding: 18px 20px;
}
.code-pane.active {
  display: block;
}

.code-pane .copy-btn {
  position: absolute;
  top: 12px;
  right: 14px;
}

.code-pane pre {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text);
  overflow-x: auto;
  padding-right: 64px;
}

.tok-c { color: #6c7684; }
.tok-s { color: #86efac; }
.tok-k { color: #93c5fd; }
.tok-f { color: #fbbf24; }

/* Footer */
.site-footer {
  padding: 32px 0 42px;
  font-size: 12.5px;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-meta strong {
  color: var(--text);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
}
.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-split {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-left {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .hero-map-pane {
    min-height: 380px;
  }
  .spec-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .spec-cell {
    border-bottom: 1px solid var(--line);
  }
  .spec-cell:nth-child(2n) {
    border-right: none;
  }
  .mobile-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .nav,
  .brand-ver {
    display: none;
  }
  .wrap {
    padding: 0 14px;
  }
  .hero-wrap {
    padding: 0;
  }
  .hero-split {
    border-left: none;
    border-right: none;
  }
  .hero-intro {
    padding: 22px 14px 18px;
  }
  .wb-input-row,
  .wb-samples,
  .wb-meta,
  .wb-output {
    padding-left: 14px;
    padding-right: 14px;
  }
  .spec-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .spec-cell {
    border-right: none;
  }
  .sec-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  .section {
    padding: 40px 0;
  }
  .map-overlay-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .atlas-bottom {
    flex-direction: column;
    align-items: stretch;
  }
}
