/* ============================================
   Demand Signal - Design System
   servicedemand.io
   ============================================ */

/* --- CSS Variables --- */
:root {
  /* Backgrounds */
  --bg-base: #0a0a0f;
  --bg-surface: #12121a;
  --bg-elevated: #1a1a2e;
  --border: #2a2a3e;

  /* Accent */
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.15);

  /* Demand colors */
  --demand-low: #3b82f6;
  --demand-medium: #f59e0b;
  --demand-high: #ef4444;
  --demand-rising: #10b981;

  /* Text */
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --container-max: 1200px;
  --section-gap: 5rem;
  --card-radius: 12px;
  --card-padding: 1.5rem;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

/* --- Reset --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}
a {
  color: var(--accent);
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
h1, h2, h3, h4 {
  line-height: 1.2;
  color: var(--text-primary);
}
h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 1.75rem; font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }
section {
  padding: var(--section-gap) 0;
}

/* --- Header --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}
.site-header .container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
}
.logo-icon {
  color: var(--accent);
  font-size: 1.5rem;
}
.logo-accent {
  color: var(--accent);
}
.main-nav {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
}
.main-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}
.main-nav a:hover {
  color: var(--text-primary);
}
.header-cta {
  background: var(--accent);
  color: white;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background var(--transition-fast);
}
.header-cta:hover {
  background: var(--accent-hover);
}
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.mobile-menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  margin: 5px 0;
  transition: var(--transition-fast);
}

/* --- Footer --- */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 3rem 0 1.5rem;
  margin-top: var(--section-gap);
}
.site-footer .container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.6;
  margin-top: 0.75rem;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-links h4 {
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color var(--transition-fast);
}
.footer-links a:hover {
  color: var(--accent);
}
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  text-align: center;
}
.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* --- Demand Score Badge --- */
.demand-score {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
}
.demand-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.demand-label--low { background: rgba(59, 130, 246, 0.15); color: var(--demand-low); }
.demand-label--rising { background: rgba(16, 185, 129, 0.15); color: var(--demand-rising); }
.demand-label--high { background: rgba(245, 158, 11, 0.15); color: var(--demand-medium); }
.demand-label--surging {
  background: rgba(239, 68, 68, 0.15);
  color: var(--demand-high);
  animation: pulse-surge 2s ease-in-out infinite;
}
@keyframes pulse-surge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

/* --- Demand Meter Bar --- */
.demand-meter {
  width: 100%;
  height: 8px;
  background: var(--bg-base);
  border-radius: 4px;
  overflow: hidden;
}
.demand-meter-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
  background: linear-gradient(90deg, var(--demand-low) 0%, var(--demand-medium) 60%, var(--demand-high) 100%);
}

/* --- Card --- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}
.card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}
.card--high-demand {
  border-color: var(--demand-high);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.1);
}

/* --- Email Capture --- */
.email-capture {
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: var(--card-radius);
  padding: 2rem;
  text-align: center;
}
.email-capture h3 {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.email-capture p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.email-form {
  display: flex;
  gap: 0.5rem;
  max-width: 480px;
  margin: 0 auto;
}
.email-form input[type="email"] {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 0.9rem;
}
.email-form input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
}
.email-form button {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
  white-space: nowrap;
}
.email-form button:hover {
  background: var(--accent-hover);
}

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--accent);
}
.breadcrumb span.sep {
  color: var(--text-muted);
}

/* --- Signal Card --- */
.signal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.signal-card .signal-icon {
  font-size: 1.5rem;
}
.signal-card .signal-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.signal-card .signal-value {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}
.signal-card .signal-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- Grid Utilities --- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

/* --- Demand Display (city hero) --- */
.demand-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  margin-top: 1.5rem;
}
.demand-updated {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- Signal Grid --- */
.signal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: var(--section-gap) 0;
}

/* --- City Hero --- */
.city-hero {
  padding: 3rem 0 1rem;
  text-align: center;
}
.city-hero h1 {
  margin-bottom: 0.5rem;
}

/* --- Nearby Cities --- */
.nearby-cities {
  padding: var(--section-gap) 0;
}
.nearby-cities h2 {
  margin-bottom: 1.5rem;
}
.nearby-card {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.nearby-card h3 {
  color: var(--text-primary);
}
.nearby-card .demand-score {
  font-size: 1.5rem;
}

/* --- Demand Context --- */
.demand-context {
  padding: var(--section-gap) 0;
}
.demand-context h2 {
  margin-bottom: 1rem;
}
.demand-context p {
  color: var(--text-secondary);
  line-height: 1.8;
}

/* --- FAQ --- */
.faq-section {
  padding: var(--section-gap) 0;
}
.faq-section h2 {
  margin-bottom: 1.5rem;
}
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
}
.faq-item h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}
.faq-item p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* --- Nav Links --- */
.nav-links {
  display: flex;
  gap: 1.5rem;
  padding: 2rem 0;
  flex-wrap: wrap;
}
.nav-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.nav-links a:hover {
  color: var(--accent-hover);
}

/* --- Homepage Hero --- */
.hero {
  padding: 5rem 0 3rem;
  text-align: center;
}
.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}
.hero p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: white;
  padding: 0.875rem 2rem;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: background var(--transition-fast);
}
.hero-cta:hover {
  background: var(--accent-hover);
  color: white;
}

/* --- Demand Ticker --- */
.demand-ticker {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}
.ticker-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
}
.ticker-item .ticker-city {
  color: var(--text-primary);
  font-weight: 600;
}
.ticker-item .ticker-score {
  font-family: var(--font-mono);
  font-weight: 700;
}

/* --- How It Works --- */
.how-it-works {
  padding: var(--section-gap) 0;
}
.how-it-works h2 {
  text-align: center;
  margin-bottom: 2.5rem;
}
.how-it-works .step-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}
.how-it-works .card {
  text-align: center;
}
.how-it-works .card h3 {
  margin-bottom: 0.5rem;
}
.how-it-works .card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* --- Surging Table --- */
.surging-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
}
.surging-table th,
.surging-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.surging-table th {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.surging-table td {
  font-size: 0.9rem;
}
.surging-table tbody tr:hover {
  background: var(--bg-surface);
}
.surging-table .score-cell {
  font-family: var(--font-mono);
  font-weight: 700;
}

/* --- Lead Magnet Strip --- */
.lead-strip {
  padding: var(--section-gap) 0;
}
.lead-strip h2 {
  text-align: center;
  margin-bottom: 2rem;
}
.lead-card {
  text-decoration: none;
  text-align: center;
}
.lead-card .lead-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}
.lead-card h3 {
  margin-bottom: 0.5rem;
}
.lead-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* --- Services Grid --- */
.services-section {
  padding: var(--section-gap) 0;
}
.services-section h2 {
  text-align: center;
  margin-bottom: 2rem;
}
.service-card {
  text-decoration: none;
}
.service-card h3 {
  margin-bottom: 0.5rem;
}
.service-card .trigger-tag {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-base);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}
.service-card .view-cta {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
}

/* --- Demand Map Container --- */
.map-section {
  padding: var(--section-gap) 0;
}
.map-section h2 {
  text-align: center;
  margin-bottom: 1rem;
}
.map-container {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 1.5rem;
  min-height: 400px;
  position: relative;
}
.map-filter {
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
}
.map-filter select {
  background: var(--bg-base);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
}

/* --- Alert Pages --- */
.alert-hero {
  padding: 4rem 0 2rem;
  text-align: center;
}
.alert-hero h1 {
  margin-bottom: 1rem;
}
.alert-hero p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}
.alert-preview {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 1.5rem;
  margin: 2rem auto;
  max-width: 600px;
}
.alert-preview h4 {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.social-proof {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 1.5rem;
  text-align: center;
}

/* --- Hotspots Page --- */
.hotspots-header {
  padding: 3rem 0 1rem;
}
.hotspots-header h1 {
  margin-bottom: 0.5rem;
}
.update-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* --- Blog --- */
.blog-hero {
  padding: 4rem 0 2rem;
  text-align: center;
}
.blog-hero h1 {
  margin-bottom: 0.5rem;
}
.blog-hero p {
  color: var(--text-secondary);
  font-size: 1rem;
}
.coming-soon {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* --- State Page --- */
.state-hero {
  padding: 3rem 0 1rem;
  text-align: center;
}
.state-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 2rem 0;
}
.city-grid {
  padding: var(--section-gap) 0;
}
.city-grid h2 {
  margin-bottom: 1.5rem;
}
.city-card {
  text-decoration: none;
}
.city-card h3 {
  margin-bottom: 0.5rem;
}
.city-card .demand-score {
  font-size: 1.5rem;
}

/* --- Service Landing --- */
.service-hero {
  padding: 3rem 0 1rem;
  text-align: center;
}
.service-hero h1 {
  margin-bottom: 0.5rem;
}
.service-hero p {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 600px;
  margin: 0.5rem auto 0;
}
.states-list {
  padding: var(--section-gap) 0;
}
.states-list h2 {
  margin-bottom: 1.5rem;
}
.state-link-card {
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.state-link-card h3 {
  font-size: 1rem;
}
.state-link-card .arrow {
  color: var(--accent);
}

/* --- FOMO Banner --- */
.fomo-banner {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--demand-high);
  border-radius: var(--card-radius);
  padding: 1rem 1.5rem;
  text-align: center;
  display: none;
}
.fomo-banner.visible {
  display: block;
}
.fomo-banner p {
  color: var(--demand-high);
  font-weight: 600;
}

/* --- Embed Widget Section --- */
.embed-section {
  padding: 2rem 0;
}
.embed-section h3 {
  margin-bottom: 0.75rem;
}
.embed-code {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: pre;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .header-cta { display: none; }
  .mobile-menu-btn { display: block; }
  .main-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    gap: 1rem;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .signal-grid { grid-template-columns: 1fr; }
  .state-stats { grid-template-columns: 1fr; }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.35rem; }
  .hero h1 { font-size: 2rem; }
  .demand-score { font-size: 2.5rem; }
}
@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .email-form {
    flex-direction: column;
  }
  .demand-ticker {
    flex-direction: column;
    align-items: center;
  }
}
