/* ═══════════════════════════════════════════
   PERMITBEAM — BOROUGH LANDING PAGE STYLES
   Shared across all 5 borough pages + index
   Design System: "Data Intelligence Noir"
═══════════════════════════════════════════ */
:root {
  --bg-deep: #080d1a;
  --bg-surface: #0c1222;
  --bg-elevated: #111827;
  --bg-card: #151d2e;
  --bg-card-hover: #1a2438;
  --border: rgba(232, 163, 23, 0.12);
  --border-strong: rgba(232, 163, 23, 0.25);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --amber: #E8A317;
  --amber-bright: #F5B731;
  --amber-dim: #C78B0A;
  --amber-glow: rgba(232, 163, 23, 0.15);
  --amber-surface: rgba(232, 163, 23, 0.06);
  --emerald: #10B981;
  --emerald-dim: rgba(16, 185, 129, 0.15);
  --emerald-surface: rgba(16, 185, 129, 0.08);
  --blue: #3B82F6;
  --blue-dim: rgba(59, 130, 246, 0.15);
  --red-alert: #EF4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --text-primary: #F5F0E8;
  --text-secondary: #C9C1B4;
  --text-tertiary: #8B8478;
  --text-muted: #6E6860;
  --text-faint: #3D3930;
  --display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --body: 'Newsreader', Georgia, serif;
  --mono: 'JetBrains Mono', 'Courier New', monospace;
  --max-w: 1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg-deep);
  color: var(--text-secondary);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: rgba(232, 163, 23, 0.35); color: var(--text-primary); }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 9999; opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

.grid-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.3;
  background-image:
    linear-gradient(rgba(232, 163, 23, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 163, 23, 0.015) 1px, transparent 1px);
  background-size: 60px 60px;
}

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 clamp(20px, 4vw, 40px); }
section { position: relative; z-index: 1; }

.section-eyebrow {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--amber);
  margin-bottom: 16px; display: flex; align-items: center; gap: 12px;
}
.section-eyebrow::before { content: ''; width: 24px; height: 1px; background: var(--amber); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 32px; font-family: var(--mono); font-size: 13px; font-weight: 600;
  letter-spacing: 0.04em; cursor: pointer; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent; position: relative; overflow: hidden;
}
.btn-primary { background: var(--amber); color: var(--bg-deep); border-color: var(--amber); }
.btn-primary:hover {
  background: var(--amber-bright); border-color: var(--amber-bright);
  box-shadow: 0 0 40px rgba(232, 163, 23, 0.3), 0 0 80px rgba(232, 163, 23, 0.1);
  transform: translateY(-2px);
}
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--amber); color: var(--text-primary); background: var(--amber-surface); }

.tag {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono);
  font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 10px; border: 1px solid;
}
.tag-amber { color: var(--amber); border-color: rgba(232, 163, 23, 0.3); background: var(--amber-surface); }
.tag-emerald { color: var(--emerald); border-color: rgba(16, 185, 129, 0.3); background: var(--emerald-surface); }

/* NAV */
nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
nav.scrolled { background: rgba(8, 13, 26, 0.92); backdrop-filter: blur(20px) saturate(1.2); -webkit-backdrop-filter: blur(20px) saturate(1.2); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon { width: 34px; height: 34px; position: relative; }
.logo-text { font-family: var(--display); font-size: 20px; color: var(--text-primary); letter-spacing: -0.01em; }
.logo-text span { color: var(--amber); }
.nav-links { display: flex; align-items: center; gap: 32px; list-style: none; }
.nav-links a { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-tertiary); transition: color 0.2s; }
.nav-links a:hover { color: var(--amber); }
.nav-cta { padding: 9px 20px; font-size: 11px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--border-strong); width: 40px; height: 40px; cursor: pointer; position: relative; flex-shrink: 0; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { display: block; width: 18px; height: 1.5px; background: var(--text-secondary); position: absolute; left: 50%; transform: translateX(-50%); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.nav-toggle span { top: 50%; transform: translate(-50%, -50%); }
.nav-toggle span::before { content: ''; top: -6px; left: 0; transform: none; }
.nav-toggle span::after { content: ''; top: 6px; left: 0; transform: none; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); background: var(--amber); }
.nav-toggle[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); background: var(--amber); }

@media (max-width: 768px) {
  .nav-links {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    background: rgba(8, 13, 26, 0.97); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    flex-direction: column; padding: 20px clamp(20px, 4vw, 40px) 24px; gap: 0;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 14px 0; font-size: 13px; border-bottom: 1px solid var(--border-subtle); }
  .nav-links li:last-child a { border-bottom: none; }
  .nav-cta { display: none; }
  .nav-toggle { display: block; }
}

/* BOROUGH HERO */
.borough-hero { padding: 120px 0 60px; position: relative; overflow: hidden; }
.borough-hero::after {
  content: ''; position: absolute; top: -20%; right: -15%; width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(232, 163, 23, 0.06) 0%, transparent 60%); pointer-events: none;
}
.borough-hero .wrap { position: relative; z-index: 1; }
.breadcrumb { font-family: var(--mono); font-size: 11px; color: var(--text-muted); margin-bottom: 24px; letter-spacing: 0.04em; }
.breadcrumb a { color: var(--text-tertiary); transition: color 0.2s; }
.breadcrumb a:hover { color: var(--amber); }
.breadcrumb span { margin: 0 8px; opacity: 0.4; }
.borough-hero h1 { font-family: var(--display); font-size: clamp(32px, 5vw, 52px); font-weight: 400; line-height: 1.12; color: var(--text-primary); margin-bottom: 16px; letter-spacing: -0.02em; }
.borough-hero h1 em { font-style: italic; color: var(--amber); }
.borough-tagline { font-family: var(--body); font-size: 18px; color: var(--text-tertiary); max-width: 640px; margin-bottom: 12px; font-style: italic; }
.borough-meta { font-family: var(--mono); font-size: 11px; color: var(--text-muted); letter-spacing: 0.06em; }

/* STATS BAR */
.stats-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); margin-bottom: 48px; }
.stat-cell { background: var(--bg-card); padding: 24px 20px; text-align: center; }
.stat-value { font-family: var(--mono); font-size: clamp(24px, 3vw, 36px); font-weight: 700; color: var(--text-primary); line-height: 1.1; }
.stat-value.amber { color: var(--amber); }
.stat-label { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-muted); margin-top: 8px; }
@media (max-width: 640px) { .stats-bar { grid-template-columns: repeat(2, 1fr); } }

/* PERMITS TABLE */
.permits-section { padding: 0 0 80px; }
.permits-section h2 { font-family: var(--display); font-size: clamp(24px, 3vw, 32px); font-weight: 400; color: var(--text-primary); margin-bottom: 24px; }
.permits-table-wrap { overflow-x: auto; border: 1px solid var(--border); -webkit-overflow-scrolling: touch; }
.permits-table { width: 100%; border-collapse: collapse; min-width: 800px; }
.permits-table thead { background: var(--bg-elevated); }
.permits-table th { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
.permits-table td { padding: 14px 16px; border-bottom: 1px solid var(--border-subtle); font-size: 14px; vertical-align: top; }
.permits-table tbody tr { background: var(--bg-card); transition: background 0.15s; }
.permits-table tbody tr:hover { background: var(--bg-card-hover); }
.permits-table .addr { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.permits-table .cost { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--amber); white-space: nowrap; }
.permits-table .work-type { color: var(--text-secondary); font-size: 13px; }
.permits-table .owner { color: var(--text-tertiary); font-size: 13px; }
.permits-table .desc { font-size: 12px; color: var(--text-muted); max-width: 260px; line-height: 1.5; }
.insurance-tag { display: inline-block; font-family: var(--mono); font-size: 9px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 7px; border: 1px solid; white-space: nowrap; margin-top: 4px; }
.insurance-tag.high { color: var(--amber); border-color: rgba(232, 163, 23, 0.3); background: var(--amber-surface); }
.insurance-tag.medium { color: var(--blue); border-color: rgba(59, 130, 246, 0.3); background: var(--blue-dim); }
.insurance-tag.low { color: var(--text-muted); border-color: var(--border-subtle); background: transparent; }

/* ZIP CODES */
.zip-section { padding: 60px 0 80px; background: var(--bg-surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.zip-section h2 { font-family: var(--display); font-size: clamp(24px, 3vw, 32px); font-weight: 400; color: var(--text-primary); margin-bottom: 32px; }
.zip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.zip-card { background: var(--bg-card); border: 1px solid var(--border); padding: 20px; transition: border-color 0.2s, background 0.2s; }
.zip-card:hover { border-color: var(--border-strong); background: var(--bg-card-hover); }
.zip-code { font-family: var(--mono); font-size: 20px; font-weight: 700; color: var(--text-primary); }
.zip-count { font-family: var(--mono); font-size: 12px; color: var(--amber); margin-top: 4px; }
.zip-area { font-family: var(--body); font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* CTA */
.cta-section { padding: 80px 0; text-align: center; }
.cta-section h2 { font-family: var(--display); font-size: clamp(28px, 4vw, 42px); font-weight: 400; color: var(--text-primary); margin-bottom: 16px; line-height: 1.15; }
.cta-section p { font-size: 17px; color: var(--text-tertiary); max-width: 520px; margin: 0 auto 32px; }
.cta-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* BOROUGH NAV */
.borough-nav { padding: 20px 0; border-bottom: 1px solid var(--border); background: var(--bg-surface); }
.borough-nav-inner { display: flex; gap: 24px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.borough-nav a { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; padding: 6px 0; border-bottom: 2px solid transparent; transition: all 0.2s; }
.borough-nav a:hover { color: var(--text-secondary); }
.borough-nav a.active { color: var(--amber); border-bottom-color: var(--amber); }

/* FAQ */
.faq-section { padding: 60px 0 80px; }
.faq-section h2 { font-family: var(--display); font-size: clamp(24px, 3vw, 32px); font-weight: 400; color: var(--text-primary); margin-bottom: 32px; }
.faq-item { border-bottom: 1px solid var(--border); padding: 24px 0; }
.faq-item:first-child { border-top: 1px solid var(--border); }
.faq-q { font-family: var(--body); font-size: 17px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.faq-a { font-size: 15px; color: var(--text-tertiary); line-height: 1.7; max-width: 720px; }

/* FOOTER */
footer { border-top: 1px solid var(--border); padding: 44px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-left p { font-family: var(--body); font-size: 13px; color: var(--text-muted); margin-top: 8px; }
.footer-right { text-align: right; }
.footer-email { font-family: var(--mono); font-size: 13px; color: var(--amber); transition: color 0.2s; }
.footer-email:hover { color: var(--amber-bright); }
.footer-copy { font-family: var(--mono); font-size: 11px; color: var(--text-faint); margin-top: 4px; }

/* INDEX PAGE — BOROUGH CARDS */
.borough-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.borough-card { background: var(--bg-card); border: 1px solid var(--border); padding: 32px; transition: all 0.25s; display: block; }
.borough-card:hover { border-color: var(--border-strong); background: var(--bg-card-hover); transform: translateY(-2px); }
.borough-card h3 { font-family: var(--display); font-size: 28px; font-weight: 400; color: var(--text-primary); margin-bottom: 8px; }
.borough-card .bc-tagline { font-family: var(--body); font-size: 14px; color: var(--text-muted); font-style: italic; margin-bottom: 16px; }
.borough-card .bc-stat { font-family: var(--mono); font-size: 32px; font-weight: 700; color: var(--amber); margin-bottom: 4px; }
.borough-card .bc-label { font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 16px; }
.borough-card .bc-top { font-family: var(--mono); font-size: 12px; color: var(--text-tertiary); line-height: 1.6; }
.borough-card .bc-arrow { font-family: var(--mono); font-size: 12px; color: var(--amber); margin-top: 16px; display: block; }

/* TOTAL STATS */
.total-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); margin-bottom: 48px; }
@media (max-width: 640px) { .total-stats { grid-template-columns: 1fr; } }

/* ANIMATIONS */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 768px) {
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-right { text-align: center; }
  .borough-cards { grid-template-columns: 1fr; }
}