/* PermitParser — a working set of blueprints, not another SaaS dashboard.
   Committed to one identity: deep cyanotype blue, linen linework, a
   permit-stamp accent. No light/dark toggle — a blueprint doesn't have one. */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --blue-0: #081b33;
  --blue-1: #0d2b4e;
  --blue-2: #123a63;
  --blue-3: #1a4c7c;
  --line: rgba(230, 238, 250, 0.16);
  --line-strong: rgba(230, 238, 250, 0.34);
  --paper: #f4f0e4;
  --paper-dim: #c9d6e8;
  --paper-faint: #8fa3c2;
  --stamp: #ff5a36;
  --stamp-ink: #3a0f04;
  --amber: #ffb238;
  --teal: #5fd9c8;
  --display: 'Space Grotesk', 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --body: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --radius: 3px;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--blue-0);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: -1px -1px;
  color: var(--paper);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--stamp); color: var(--paper); }

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
  color: #ffffff;
}

.mono { font-family: var(--mono); }

.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  display: flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: '';
  width: 16px;
  height: 1px;
  background: var(--teal);
}

/* ---- Shell ---- */

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
}

header.site {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--blue-0) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
header.site .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  max-width: 1180px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  color: #fff;
}
.brand .mark {
  width: 26px; height: 26px;
  border: 1.5px solid var(--paper);
  border-radius: 2px;
  position: relative;
  flex: none;
}
.brand .mark::before, .brand .mark::after {
  content: '';
  position: absolute;
  background: var(--stamp);
}
.brand .mark::before { top: 6px; left: 4px; right: 4px; height: 2px; }
.brand .mark::after { top: 12px; left: 4px; width: 10px; height: 2px; }
nav.site-nav { display: flex; align-items: center; gap: 28px; }
nav.site-nav a {
  color: var(--paper-dim);
  font-size: 14px;
  font-weight: 500;
}
nav.site-nav a:hover { color: #fff; text-decoration: none; }
nav.site-nav a.current { color: var(--stamp); }
.btn {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--blue-0);
  background: var(--paper);
  border: none;
  border-radius: var(--radius);
  padding: 9px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:hover { background: #fff; text-decoration: none; }
.btn.ghost {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--line-strong);
}
.btn.ghost:hover { border-color: var(--paper); background: rgba(255,255,255,0.04); }

/* ---- Hero ---- */

.hero {
  padding: 88px 0 64px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.hero .grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: start;
}
.hero h1 {
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.04;
  margin: 18px 0 22px;
}
.hero h1 em {
  font-style: normal;
  color: var(--stamp);
}
.hero p.lede {
  font-size: 17.5px;
  color: var(--paper-dim);
  max-width: 52ch;
  margin: 0 0 30px;
}
.hero .ctas { display: flex; gap: 12px; flex-wrap: wrap; }

.stamp-badge {
  position: absolute;
  top: 84px; right: 28px;
  width: 108px; height: 108px;
  border: 2.5px solid var(--stamp);
  border-radius: 50%;
  color: var(--stamp);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transform: rotate(-9deg);
  opacity: 0.85;
  pointer-events: none;
}
@media (max-width: 900px) { .stamp-badge { display: none; } }

/* Live panel (right side of hero) */
.live-panel {
  background: var(--blue-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}
.live-panel .lp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--paper-faint);
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--teal);
  display: inline-block;
  margin-right: 6px;
  box-shadow: 0 0 0 0 rgba(95,217,200,0.6);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(95,217,200,0.5); }
  70% { box-shadow: 0 0 0 7px rgba(95,217,200,0); }
  100% { box-shadow: 0 0 0 0 rgba(95,217,200,0); }
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.stat-row .stat {
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat-row .stat:last-child { border-right: none; }
.stat .n {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 600;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.stat .l {
  font-size: 11.5px;
  color: var(--paper-faint);
  margin-top: 4px;
}
.feed { max-height: 320px; overflow-y: auto; }
.feed-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.feed-row:last-child { border-bottom: none; }
.feed-row .addr { color: #fff; font-weight: 500; }
.feed-row .meta { color: var(--paper-faint); font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.feed-empty { padding: 28px 16px; color: var(--paper-faint); font-size: 13.5px; text-align: center; }

/* ---- Sections ---- */

section.block { padding: 72px 0; border-bottom: 1px solid var(--line); }
section.block.tight { padding: 56px 0; }
.block-head { max-width: 640px; margin-bottom: 40px; }
.block-head h2 { font-size: 32px; margin-top: 14px; }
.block-head p { color: var(--paper-dim); font-size: 15.5px; margin-top: 12px; }

.pipeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}
.pipeline .stage {
  padding: 24px 20px;
  border-right: 1px solid var(--line);
  position: relative;
}
.pipeline .stage:last-child { border-right: none; }
.pipeline .stage::after {
  content: '\2192';
  position: absolute;
  right: -11px; top: 24px;
  color: var(--paper-faint);
  background: var(--blue-0);
  width: 20px; text-align: center;
  z-index: 1;
}
.pipeline .stage:last-child::after { content: ''; }
.pipeline .num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--stamp);
  margin-bottom: 10px;
}
.pipeline h3 { font-size: 16.5px; margin-bottom: 8px; }
.pipeline p { font-size: 13.5px; color: var(--paper-dim); margin: 0; }
@media (max-width: 860px) {
  .pipeline { grid-template-columns: 1fr; }
  .pipeline .stage { border-right: none; border-bottom: 1px solid var(--line); }
  .pipeline .stage::after { content: ''; }
}

.coverage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
}
.town-card {
  background: var(--blue-1);
  padding: 22px 20px;
}
.town-card.active { background: var(--blue-2); }
.town-card .status {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.town-card .status.live { color: var(--teal); }
.town-card .status.soon { color: var(--paper-faint); }
.town-card .status .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.town-card h4 { font-size: 17px; color: #fff; margin-bottom: 4px; font-family: var(--display); font-weight: 600; }
.town-card p { font-size: 12.5px; color: var(--paper-faint); margin: 0; }

.stack-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.stack-table th {
  text-align: left;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-faint);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-strong);
}
.stack-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--paper-dim);
  vertical-align: top;
}
.stack-table td.layer { color: #fff; font-weight: 500; white-space: nowrap; }
.stack-table td.why { font-size: 13.5px; }

/* API block */
.api-block {
  background: var(--blue-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 24px;
}
.api-block pre {
  margin: 12px 0 0;
  padding: 16px;
  background: var(--blue-0);
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--paper-dim);
}
.api-block pre .k { color: var(--teal); }
.api-block pre .s { color: var(--amber); }
.endpoint {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 13.5px;
  margin-bottom: 4px;
}
.endpoint .verb {
  color: var(--blue-0);
  background: var(--teal);
  border-radius: 2px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
}

/* Footer / CTA */
.cta-block { padding: 76px 0; text-align: center; }
.cta-block h2 { font-size: 30px; margin: 0 auto 14px; max-width: 30ch; }
.cta-block p { color: var(--paper-dim); max-width: 46ch; margin: 0 auto 28px; }
.cta-block .ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

footer.site {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
}
footer.site .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
footer.site p { color: var(--paper-faint); font-size: 13px; margin: 0; font-family: var(--mono); }
footer.site .flinks { display: flex; gap: 20px; }
footer.site .flinks a { color: var(--paper-dim); font-size: 13px; }

/* About page specifics */
.about-hero { padding: 72px 0 40px; border-bottom: 1px solid var(--line); }
.about-hero h1 { font-size: clamp(32px, 4.5vw, 46px); margin: 16px 0 20px; }
.about-hero p.lede { color: var(--paper-dim); font-size: 17px; max-width: 66ch; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }
.two-col h3 { font-size: 19px; margin-bottom: 12px; color: var(--stamp); }
.two-col p { color: var(--paper-dim); font-size: 14.5px; }

.caveat-box {
  border-left: 3px solid var(--amber);
  background: color-mix(in srgb, var(--amber) 8%, var(--blue-1));
  padding: 18px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px;
  color: var(--paper-dim);
}
.caveat-box strong { color: var(--amber); }

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