/* unlikely.place — Jurisdiction Matrices
   Built on the Unlikely Professionals brand system (unlikely.style) */

:root {
  --ink: #1a1a1a;
  --ink-light: #4a4a4a;
  --ink-lighter: #7a7a7a;
  --ink-faint: #b0b0b0;
  --bg: #fffff8;
  --bg-warm: #fafaf2;
  --bg-card: #f7f6f0;
  --bg-panel: #f5f4ee;
  --accent: #8b0000;
  --accent-muted: #b85450;
  --rule: #e0ddd4;
  --rule-strong: #c8c4b8;
  --gold: #c9a227;
  --green: #5a8a5a;
  --teal: #4a9a7a;
  --purple: #7a6a9a;
  --blue: #5a7a9a;
  --sienna: #9a7a6a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 18.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ===== STICKY NAV ===== */
.sticky-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(26, 26, 26, 0.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,248,0.08);
  padding: 0 32px;
  height: 48px;
  display: flex;
  align-items: center;
}
.nav-brand {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #fffff8;
  margin-right: 40px;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}
.nav-links {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.nav-links a {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 12.5px;
  font-weight: 400;
  color: rgba(255,255,248,0.5);
  text-decoration: none;
  padding: 14px 14px;
  white-space: nowrap;
  transition: color 0.2s;
  letter-spacing: 0.3px;
}
.nav-links a:hover { color: #fffff8; }
.nav-links a.active { color: #fffff8; border-bottom: 2px solid var(--accent-muted); }
.nav-links a .nav-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  opacity: 0.5;
  margin-right: 4px;
}

/* ===== BANDS & CONTAINERS ===== */
.band { width: 100%; position: relative; }
.band--cream { background: var(--bg); }
.band--warm { background: var(--bg-warm); }
.band--dark { background: var(--ink); color: #fffff8; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 100px 48px;
}
.container--narrow { max-width: 980px; }
.container--hero { padding: 140px 48px 80px; }

/* ===== HERO ===== */
.hero-kicker {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: rgba(255,255,248,0.4);
  margin-bottom: 16px;
}
.hero-title {
  font-family: 'Crimson Pro', Georgia, serif;
  font-weight: 300;
  font-size: clamp(39px, 4.5vw, 64.5px);
  letter-spacing: -1px;
  line-height: 1.08;
  max-width: 900px;
  color: #fffff8;
}
.hero-title--xl {
  font-size: clamp(40px, 6vw, 80px);
  letter-spacing: -2px;
  line-height: 1.05;
}
.hero-italic {
  font-family: 'Crimson Pro', Georgia, serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(20.5px, 2vw, 27.5px);
  color: rgba(255,255,248,0.5);
  margin-top: 10px;
}
.hero-sub {
  font-size: clamp(17px, 1.3vw, 20.5px);
  color: rgba(255,255,248,0.55);
  margin-top: 24px;
  max-width: 600px;
  line-height: 1.7;
}
.hero-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: rgba(255,255,248,0.35);
  margin-top: 28px;
  letter-spacing: 0.5px;
}

/* waveform logo (brand rule: never below 120px wide) */
.hero-logo {
  display: block;
  filter: brightness(0) invert(1);
  opacity: 0.95;
  height: auto;
}
.hero-logo--index {
  width: min(420px, 70vw);
  margin-top: 48px;
}
.hero-logo--branch {
  width: 180px;
  margin-bottom: 28px;
}
.hero--full {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.scroll-arrow {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ===== SECTION HEADERS ===== */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 8px;
  margin-bottom: 28px;
  position: relative;
}
.section-head::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  border-bottom: 0.5px solid var(--ink-lighter);
}
.band--dark .section-head { border-bottom-color: rgba(255,255,248,0.3); }
.band--dark .section-head::after { border-bottom-color: rgba(255,255,248,0.1); }
.section-num {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  font-size: clamp(15px, 1.2vw, 17px);
  color: var(--ink-faint);
}
.band--dark .section-num { color: rgba(255,255,248,0.35); }
.section-title {
  font-family: 'Crimson Pro', Georgia, serif;
  font-weight: 300;
  font-size: clamp(32px, 3vw, 43.5px);
  letter-spacing: -0.3px;
}
.section-note {
  font-size: clamp(18.5px, 1.4vw, 20.5px);
  color: var(--ink-light);
  margin-bottom: 36px;
  max-width: 720px;
  line-height: 1.7;
}
.band--dark .section-note { color: rgba(255,255,248,0.6); }

.sub-label {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-lighter);
  margin: 40px 0 14px;
}
.band--dark .sub-label { color: rgba(255,255,248,0.45); }

/* ===== BRANCH CARDS (index) ===== */
.branch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 20px 0;
}
.branch-card {
  display: block;
  background: var(--bg-warm);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--card-accent, var(--ink));
  padding: 24px 26px 22px;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.branch-card:hover {
  background: var(--bg-card);
  border-color: var(--rule-strong);
  transform: translateY(-2px);
}
.branch-card .b-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  letter-spacing: 1.5px;
  color: var(--ink-faint);
  margin-bottom: 8px;
}
.branch-card .b-name {
  font-family: 'Crimson Pro', Georgia, serif;
  font-weight: 500;
  font-size: 27.5px;
  letter-spacing: -0.2px;
  margin-bottom: 2px;
}
.branch-card .b-region {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.branch-card .b-desc {
  font-size: 16.5px;
  color: var(--ink-light);
  line-height: 1.55;
}
.branch-card .b-url {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink-lighter);
  margin-top: 14px;
  padding-top: 10px;
  border-top: 0.5px solid var(--rule);
}

/* ===== MATRIX CONTENT (converted markdown) ===== */
.matrix-content { max-width: none; }
.matrix-content > p:first-child { font-size: 17px; color: var(--ink-light); }

.matrix-content h1 { display: none; } /* replaced by hero */

.matrix-content { counter-reset: sec; }
.matrix-content h2 {
  font-family: 'Crimson Pro', Georgia, serif;
  font-weight: 300;
  font-size: clamp(30px, 2.6vw, 39px);
  letter-spacing: -0.3px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 8px;
  margin: 64px 0 20px;
  position: relative;
  scroll-margin-top: 64px;
}
.matrix-content h2::before {
  counter-increment: sec;
  content: counter(sec, decimal-leading-zero);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  font-size: clamp(15px, 1.2vw, 17px);
  color: var(--ink-faint);
  margin-right: 12px;
}
.matrix-content h2::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  border-bottom: 0.5px solid var(--ink-lighter);
}

.matrix-content h3 {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-lighter);
  margin: 44px 0 14px;
  scroll-margin-top: 64px;
}

.matrix-content h4 {
  font-family: 'Crimson Pro', Georgia, serif;
  font-weight: 600;
  font-size: 22px;
  margin: 32px 0 10px;
  scroll-margin-top: 64px;
}

.matrix-content p { margin: 0 0 16px; max-width: 900px; }
.matrix-content ul, .matrix-content ol { margin: 0 0 18px; padding-left: 26px; max-width: 900px; }
.matrix-content li { margin-bottom: 8px; }
.matrix-content li > ul, .matrix-content li > ol { margin-top: 8px; margin-bottom: 0; }

.matrix-content a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(139,0,0,0.25); }
.matrix-content a:hover { border-bottom-color: var(--accent); }

.matrix-content strong { font-weight: 600; }

.matrix-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82em;
  background: var(--bg-panel);
  border: 1px solid var(--rule);
  padding: 1px 5px;
  border-radius: 2px;
}

.matrix-content blockquote {
  border-left: 3px solid var(--rule-strong);
  padding: 4px 0 4px 20px;
  margin: 0 0 18px;
  color: var(--ink-light);
}

.matrix-content hr {
  border: none;
  border-top: 0.5px solid var(--rule-strong);
  margin: 56px 0;
}

/* ===== TABLES ===== */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0 28px;
  border-bottom: 2px solid var(--ink);
}
.matrix-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16.5px;
  min-width: 680px;
}
.matrix-content thead tr {
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.matrix-content th {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink-light);
  padding: 8px 12px;
  text-align: left;
  white-space: nowrap;
}
.matrix-content td {
  padding: 8px 12px;
  vertical-align: top;
  min-width: 34px;
}
.matrix-content tbody tr { border-bottom: 0.5px solid var(--rule); }
.matrix-content tbody tr:last-child { border-bottom: none; }
.matrix-content tbody tr:hover { background: var(--bg-warm); }
.matrix-content td:first-child { white-space: nowrap; }

/* footnote superscripts inside matrix cells */
.matrix-content sup { font-size: 0.7em; color: var(--accent); }

/* ===== FOOTER (matches unlikely.style closing band) ===== */
.site-footer {
  background: var(--ink);
  padding: 60px 48px;
}
.site-footer .foot-inner { max-width: 1200px; margin: 0 auto; }
.site-footer .foot-rule {
  border-top: 1px solid rgba(255,255,248,0.15);
  padding-top: 24px;
}
.site-footer .foot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.site-footer .foot-brand {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,248,0.6);
}
.site-footer .foot-line {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 14px;
  color: rgba(255,255,248,0.3);
  margin-top: 4px;
  letter-spacing: 0.3px;
}
.site-footer .foot-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: rgba(255,255,248,0.25);
  margin-top: 4px;
}
.site-footer .foot-right { text-align: right; }
@media (max-width: 640px) {
  .site-footer { padding: 40px 20px; }
  .site-footer .foot-grid { grid-template-columns: 1fr; }
  .site-footer .foot-right { text-align: left; }
}

/* ===== LEGEND CHIPS (index) ===== */
.legend-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0 6px;
}
.legend-chip {
  display: flex;
  align-items: baseline;
  gap: 10px;
  background: var(--bg-warm);
  border: 1px solid var(--rule);
  padding: 12px 16px;
  flex: 1 1 220px;
}
.legend-chip .glyph {
  font-size: 18.5px;
  color: var(--accent);
  flex-shrink: 0;
}
.legend-chip .l-body { font-size: 15.5px; color: var(--ink-light); line-height: 1.5; }
.legend-chip .l-body strong { color: var(--ink); font-weight: 600; }

/* ===== SEMANTIC GLYPH COLORS (data-ink: color encodes tier) ===== */
.gy-named   { color: #5a8a5a; }  /* published product-specific rule */
.gy-allowed { color: #c9a227; }  /* published general mechanism */
.gy-unpub   { color: #a09c90; }  /* nothing published — discretion */
.gy-enf     { color: #5a8a5a; }  /* WV: code enforced */
.gy-permit  { color: #c9a227; }  /* WV: permit-only */
.gy-none    { color: #b85450; }  /* WV: no regime */
.gy-flood   { color: #5a7a9a; }  /* flood overlay */

/* glyph-only matrix cells: centered, enlarged — scannable at a glance */
.matrix-content td.gcell {
  text-align: center;
  font-size: 19.5px;
  line-height: 1.2;
  white-space: nowrap;
}
.matrix-content td.gcell sup,
.matrix-content td.gcell { font-variant-position: normal; }

/* ===== ON THIS PAGE (wayfinding) ===== */
.toc-band { border-bottom: 1px solid var(--rule); }
.toc-band .toc-container { padding: 44px 48px 40px; }
.toc-sections {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 15.5px;
  line-height: 2;
}
.toc-sections a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule-strong); }
.toc-sections a:hover { border-bottom-color: var(--accent); color: var(--accent); }
.toc-sep { color: var(--ink-faint); margin: 0 4px; }
.toc-juris { margin-top: 2px; }
.toc-chip {
  display: inline-block;
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 14px;
  color: var(--ink-light);
  background: var(--bg-warm);
  border: 1px solid var(--rule);
  padding: 3px 10px;
  margin: 0 6px 6px 0;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.toc-chip:hover { border-color: var(--accent-muted); color: var(--accent); }

/* ===== STATEWIDE-FRAME BLOCKS (h2 + ul: hanging blocks, not bullet walls) ===== */
.matrix-content h2 + ul {
  list-style: none;
  padding-left: 0;
  max-width: 900px;
}
.matrix-content h2 + ul > li {
  border-left: 2px solid var(--rule-strong);
  padding-left: 18px;
  margin-bottom: 16px;
}
.matrix-content h2 + ul > li > ul {
  list-style: disc;
  padding-left: 22px;
  margin-top: 8px;
}

/* ===== DOSSIER HEADINGS (real anchors, not whisper-labels) ===== */
.matrix-content h3.dossier {
  font-family: 'Crimson Pro', Georgia, serif;
  font-weight: 500;
  font-size: 25.5px;
  letter-spacing: -0.2px;
  text-transform: none;
  color: var(--ink);
  border-bottom: 0.5px solid var(--rule-strong);
  padding-bottom: 6px;
  margin: 52px 0 14px;
}

/* ===== FOOTNOTES (reference-size, out of the reading line) ===== */
.matrix-content .footnotes {
  font-size: 15.5px;
  color: var(--ink-light);
  margin: -8px 0 32px;
  max-width: 900px;
}
.matrix-content .footnotes p { margin-bottom: 6px; font-size: 14px; }
.matrix-content .footnotes p strong {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-lighter);
}
.matrix-content .footnotes ol { padding-left: 22px; margin-bottom: 0; }
.matrix-content .footnotes li { margin-bottom: 5px; line-height: 1.5; }

/* ===== WIDE TABLES: sticky jurisdiction column + prose-cell typography ===== */
.matrix-content table.wide th:first-child,
.matrix-content table.wide td:first-child {
  position: sticky;
  left: 0;
  background: var(--bg);
  z-index: 1;
  border-right: 1px solid var(--rule);
}
.matrix-content table.wide thead th:first-child { background: var(--bg); }
.matrix-content table.wide tbody tr:hover td:first-child { background: var(--bg-warm); }
/* with a leading UP column, the jurisdiction column (2nd) stays sticky too */
.matrix-content table.wide.has-up th:nth-child(2),
.matrix-content table.wide.has-up td:nth-child(2) {
  position: sticky;
  left: 44px;
  background: var(--bg);
  z-index: 1;
  border-right: 1px solid var(--rule);
}
.matrix-content table.wide.has-up tbody tr:hover td:nth-child(2) { background: var(--bg-warm); }
.matrix-content table.wide.has-up td:first-child,
.matrix-content table.wide.has-up th:first-child {
  border-right: 2px solid var(--rule-strong);
}
.matrix-content table.wide td:last-child {
  font-size: 15.5px;
  line-height: 1.55;
  min-width: 340px;
  white-space: normal;
}
/* two-column prose tables (Tier 2/3): reading typography in the wide cell */
.matrix-content table:not(.wide) td:last-child {
  font-size: 16px;
  line-height: 1.6;
}
.matrix-content table:not(.wide) td:first-child:not(.up-cell) { min-width: 150px; }
.matrix-content table:not(.wide).has-up td:nth-child(2) { min-width: 150px; }

/* ===== UP STATUS COLUMN (leading, visually fenced off) ===== */
.up-yes { color: #5a8a5a; }
.up-no  { color: #b85450; }
.matrix-content table td.up-cell {
  text-align: center;
  font-size: 18.5px;
  font-weight: 600;
  white-space: nowrap;
  width: 44px;
  min-width: 44px;
  border-right: 2px solid var(--rule-strong);
}
.matrix-content table th.up-head {
  text-align: center;
  border-right: 2px solid var(--rule-strong);
}
.matrix-content td.up-cell:first-child { white-space: nowrap; }

/* ===== FLOATING LEGEND ===== */
.legend-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.legend-fab {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #fffff8;
  background: rgba(26, 26, 26, 0.95);
  border: 1px solid rgba(255,255,248,0.15);
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 12px rgba(26,26,26,0.25);
  transition: background 0.2s;
}
.legend-fab:hover { background: rgba(26, 26, 26, 1); }
.fab-glyphs { font-size: 14px; letter-spacing: 2px; }
.legend-panel {
  width: min(440px, calc(100vw - 48px));
  max-height: min(70vh, 640px);
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--rule-strong);
  box-shadow: 0 6px 32px rgba(26,26,26,0.22);
  padding: 20px 24px 18px;
}
.legend-panel .glyph-row { grid-template-columns: 30px 112px 1fr; padding: 4px 0; }
.legend-panel .g-glyph { font-size: 17px; }
.legend-panel .g-name { font-size: 13px; }
.legend-panel .g-desc { font-size: 15px; line-height: 1.5; }
.legend-panel .glyph-group { padding: 10px 0 12px; }
.legend-panel .glyph-matrix { margin-bottom: 14px; }
.legend-panel .g-products { font-size: 14.5px; }
.legend-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.legend-close {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 25.5px;
  line-height: 1;
  color: var(--ink-lighter);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
}
.legend-close:hover { color: var(--accent); }

@media (max-width: 640px) {
  .legend-float { right: 12px; bottom: 12px; }
  .legend-panel { max-height: 60vh; }
  .legend-panel .glyph-row { grid-template-columns: 24px 1fr; }
  .legend-panel .g-desc { grid-column: 2; }
}

@media print {
  .legend-float { display: none; }
}

/* ===== GLYPH LEGEND (canonical, all branches) ===== */
.glyph-band .glyph-container { padding: 56px 48px; }
.g-heading {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-lighter);
  margin-bottom: 20px;
}
.glyph-matrix {
  border-top: 2px solid var(--ink);
  margin-bottom: 22px;
}
.glyph-group {
  border-bottom: 0.5px solid var(--rule-strong);
  padding: 14px 0 16px;
}
.glyph-group:last-child { border-bottom: 2px solid var(--ink); }
.g-label {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.glyph-row {
  display: grid;
  grid-template-columns: 38px 126px 1fr;
  gap: 0 14px;
  align-items: baseline;
  padding: 5px 0;
}
.g-glyph {
  font-size: 19.5px;
  color: var(--ink);
  text-align: center;
  line-height: 1;
}
.g-name {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--ink);
}
.g-desc {
  font-size: 16.5px;
  color: var(--ink-light);
  line-height: 1.55;
}
.g-products {
  font-size: 15.5px;
  color: var(--ink-light);
  line-height: 1.6;
}
.g-products .g-label { display: inline; }

@media (max-width: 640px) {
  .glyph-band .glyph-container { padding: 40px 20px; }
  .glyph-row { grid-template-columns: 28px 1fr; }
  .g-desc { grid-column: 2; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .container { padding: 80px 28px; }
  .container--hero { padding: 110px 28px 64px; }
  .branch-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-brand { display: none; }
}
@media (max-width: 640px) {
  .container { padding: 60px 20px; }
  .container--hero { padding: 96px 20px 56px; }
  .branch-grid { grid-template-columns: 1fr; }
  .sticky-nav { padding: 0 12px; }
  .nav-links a { padding: 14px 8px; font-size: 11.5px; }
  .site-footer { padding: 32px 20px; }
}

/* ===== PRODUCT-COLUMN HOVER CALLOUTS ===== */
.matrix-content th.tip {
  position: relative;
  cursor: help;
  text-decoration: underline dotted var(--ink-faint);
  text-underline-offset: 3px;
}
.matrix-content th.tip::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  width: max-content;
  max-width: 280px;
  background: rgba(26, 26, 26, 0.97);
  color: #fffff8;
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.3px;
  text-transform: none;
  line-height: 1.5;
  padding: 8px 12px;
  white-space: normal;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s;
  pointer-events: none;
}
.matrix-content th.tip:hover::after {
  opacity: 1;
  visibility: visible;
}

/* ===== LEGEND COLOR OVERRIDES (glyph colors must win over .g-glyph ink) ===== */
.glyph-matrix .g-glyph.gy-named,   .fab-glyphs .gy-named   { color: #5a8a5a; }
.glyph-matrix .g-glyph.gy-allowed, .fab-glyphs .gy-allowed { color: #c9a227; }
.glyph-matrix .g-glyph.gy-unpub,   .fab-glyphs .gy-unpub   { color: #a09c90; }
.glyph-matrix .g-glyph.gy-enf     { color: #5a8a5a; }
.glyph-matrix .g-glyph.gy-permit  { color: #c9a227; }
.glyph-matrix .g-glyph.gy-none    { color: #b85450; }
.glyph-matrix .g-glyph.gy-flood   { color: #5a7a9a; }
.glyph-matrix .g-glyph.up-yes     { color: #5a8a5a; }
.glyph-matrix .g-glyph.up-no      { color: #b85450; }

@media print {
  .sticky-nav { display: none; }
  .band--dark { background: #fff; color: var(--ink); }
  .hero-sub, .hero-meta, .hero-kicker, .hero-italic, .hero-title { color: var(--ink); }
  .hero-logo { filter: none; }
  .hero--full { min-height: 0; }
  .scroll-arrow { display: none; }
}

/* footer contact links */
.site-footer .foot-mono a {
  color: rgba(255,255,248,0.35);
  text-decoration: none;
}
.site-footer .foot-mono a:hover { color: #fffff8; }

/* second hero-meta line sits tight under the first */
.hero-meta--labels { margin-top: 8px; }

/* ===== LICENSE GRID (mirrors unlikely.engineer, brand-styled) ===== */
.lic-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  border: 1px solid var(--rule-strong);
  background: var(--bg);
}
.lic {
  padding: 16px 18px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.lic-grid .lic:nth-child(5n) { border-right: none; }
.lic-grid .lic:nth-last-child(-n+5) { border-bottom: none; }
.lic-state {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-lighter);
  margin-bottom: 6px;
}
.lic-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  letter-spacing: -0.3px;
  margin-bottom: 3px;
}
.lic-type {
  font-size: 13.5px;
  color: var(--ink-light);
  margin-bottom: 6px;
}
.lic-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 2px 8px;
  border: 1px solid;
  border-radius: 2px;
  margin-bottom: 5px;
}
.lic-status.active  { color: #3f6b3f; border-color: #a8c5a8; background: #eef4ea; }
.lic-status.inactive { color: #8a6d00; border-color: #e0c85a; background: #fdf6e3; }
.lic-status.pending { color: var(--ink-lighter); border-color: var(--rule-strong); background: var(--bg-panel); }
.lic-pip { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.lic-expiry {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 11.5px;
  color: var(--ink-faint);
}
.lic-verify-note {
  font-size: 14px;
  color: var(--ink-lighter);
  margin-top: 16px;
}
.lic-verify-note a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(139,0,0,0.25); }

/* ===== SEAL HOVER (internal edition only — markup absent on public) ===== */
.lic--seal { position: relative; cursor: help; }
.lic--seal .lic-state {
  color: var(--ink-light);
  border-bottom: 1px dotted var(--rule-strong);
  display: inline-block;
  padding-bottom: 1px;
}
.lic-seal-pop {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 6px);
  transform: translateX(-50%) translateY(4px);
  width: 232px;
  padding: 14px 14px 10px;
  background: var(--bg);
  border: 1px solid var(--rule-strong);
  box-shadow: 0 6px 24px rgba(20, 16, 10, 0.18);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
  z-index: 40;
}
.lic--seal:hover .lic-seal-pop,
.lic--seal:focus .lic-seal-pop,
.lic--seal:focus-within .lic-seal-pop {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.lic-seal-pop img { width: 100%; height: auto; display: block; }
/* public edition ships draggable="false" specimens; block save/drag vectors */
.lic-seal-pop img[draggable="false"] {
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.lic-seal-cap {
  display: block;
  margin-top: 8px;
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--ink-lighter);
}
.lic-seal-cap.inactive { color: #8a6d00; }
/* first grid row: drop the popup below the card instead of above the fold */
.lic-grid .lic--seal:nth-child(-n+5) .lic-seal-pop {
  bottom: auto;
  top: calc(100% - 6px);
}

/* ===== FIRM BAND (mirrors unlikely.engineer firm grid) ===== */
.firm-band .container { padding: 64px 48px; }
.firm-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px 24px;
}
.firm-label {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-lighter);
  margin-bottom: 3px;
}
.firm-value { font-size: 16.5px; color: var(--ink); line-height: 1.5; }
.firm-value a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule-strong); }
.firm-value a:hover { border-bottom-color: var(--accent); color: var(--accent); }
.firm-sub { color: var(--ink-faint); font-size: 14px; }

@media (max-width: 1024px) {
  .lic-grid { grid-template-columns: repeat(3, 1fr); }
  .lic-grid .lic:nth-child(5n) { border-right: 1px solid var(--rule); }
  .lic-grid .lic:nth-child(3n) { border-right: none; }
  .lic-grid .lic:nth-last-child(-n+5) { border-bottom: 1px solid var(--rule); }
  .lic-grid .lic:nth-last-child(-n+3) { border-bottom: none; }
  .firm-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .lic-grid { grid-template-columns: repeat(2, 1fr); }
  .lic-grid .lic:nth-child(3n) { border-right: 1px solid var(--rule); }
  .lic-grid .lic:nth-child(2n) { border-right: none; }
  .firm-grid { grid-template-columns: 1fr; }
}

/* ===== REGION GROUPING (index section 02) ===== */
.region-label {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--ink-light);
  margin: 28px 0 4px;
}
.region-rule {
  border: none;
  border-top: 0.5px solid var(--rule-strong);
  margin: 36px 0 8px;
}
.branch-card--pending {
  border-style: dashed;
  cursor: default;
  opacity: 0.85;
}
.branch-card--pending:hover { transform: none; background: var(--bg-warm); border-color: var(--rule); }
.branch-card--pending .b-url { color: var(--ink-faint); font-style: italic; }
