@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700;800&family=Outfit:wght@500;600;700;800;900&display=swap');

:root {
  /* Dark Mode Default - Heavy Haul Hazard & Highway Telemetry */
  --bg-primary: #0b0f19;
  --bg-surface: #111827;
  --bg-card: #172033;
  --bg-elevated: #1e293b;
  --border-subtle: #2d3748;
  --border-strong: #475569;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Brand Accent Tokens */
  --accent-hazard: #f97316;
  --accent-hazard-glow: rgba(249, 115, 22, 0.2);
  --accent-yellow: #eab308;
  --accent-cyan: #06b6d4;
  --accent-lime: #22c55e;
  --accent-red: #ef4444;
  
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.5);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #f1f5f9;
  --bg-elevated: #e2e8f0;
  --border-subtle: #cbd5e1;
  --border-strong: #94a3b8;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --accent-hazard: #ea580c;
  --accent-hazard-glow: rgba(234, 88, 12, 0.15);
  --accent-yellow: #ca8a04;
  --accent-cyan: #0284c7;
  --accent-lime: #16a34a;
  --accent-red: #dc2626;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header & Nav */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
}

.header-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-hazard), #c2410c);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 17px;
  box-shadow: 0 4px 12px var(--accent-hazard-glow);
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.brand-text p {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 8px;
  margin-left: 8px;
  border-left: 2px solid var(--border-strong);
}

.theme-toggle:hover {
  background: var(--bg-elevated);
  border-color: var(--accent-hazard);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* Main Container */
.main-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  flex: 1;
  width: 100%;
}

/* UI Elements & Buttons */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-hazard), #ea580c);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--accent-hazard-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #fb923c, #f97316);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--accent-hazard);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.card:hover {
  border-color: var(--accent-hazard);
  box-shadow: var(--shadow-md);
}

/* Heavy Haul Evaluator Rig */
.evaluator-rig {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 36px;
  margin-bottom: 48px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.evaluator-rig::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: repeating-linear-gradient(45deg, var(--accent-hazard), var(--accent-hazard) 15px, #000 15px, #000 30px);
}

.rig-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 36px;
  margin-top: 24px;
}

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

.control-group {
  margin-bottom: 20px;
}

.control-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.control-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  color: var(--accent-hazard);
}

.range-input {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--bg-elevated);
  outline: none;
  accent-color: var(--accent-hazard);
  cursor: pointer;
}

.select-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
}

.select-input:focus {
  border-color: var(--accent-hazard);
}

.results-telemetry {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

/* Guide & Article Styles */
.guide-article {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.guide-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.guide-section h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
}

.guide-table th, .guide-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13.5px;
}

.guide-table th {
  background: var(--bg-elevated);
  font-weight: 700;
  color: var(--text-primary);
}

/* Footer */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 48px 24px 24px;
  margin-top: auto;
}

.footer-grid {
  max-width: 1240px;
  margin: 0 auto 36px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}

@media (max-width: 880px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .nav-links {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 4px;
  }
}

.footer-col h4 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 13.5px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent-hazard);
}

.footer-bottom {
  max-width: 1240px;
  margin: 0 auto;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 12px;
}

/* Featured Direct Answer Snippet Box (AEO) */
.direct-answer-box {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.08), rgba(234, 179, 8, 0.04));
  border: 1.5px solid rgba(249, 115, 22, 0.4);
  border-left: 6px solid var(--accent-hazard);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 20px 0 28px;
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.08);
}

.direct-answer-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-hazard);
  margin-bottom: 10px;
}

.direct-answer-text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  font-weight: 500;
}

.direct-answer-text strong {
  color: #fff;
  background: rgba(249, 115, 22, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
}

[data-theme="light"] .direct-answer-text strong {
  color: #c2410c;
  background: rgba(249, 115, 22, 0.15);
}

/* E-E-A-T Verification Bar */
.eeat-badge-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.eeat-badge-bar a {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 600;
}

.eeat-badge-bar a:hover {
  text-decoration: underline;
}

/* Bordering States Corridor Navigation */
.bordering-states-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.bordering-state-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 13.5px;
  transition: all 0.2s ease;
}

.bordering-state-card:hover {
  border-color: var(--accent-hazard);
  transform: translateY(-2px);
  background: var(--bg-elevated);
}

/* Print Stylesheet for Truck Driver Cab Sheet */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
  }
  .header, .footer, .theme-toggle, .btn-primary, .breadcrumb, button {
    display: none !important;
  }
  .main-container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .hero-card, .guide-section, .telemetry-card {
    border: 1px solid #999 !important;
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
  .guide-table th {
    background: #eee !important;
    color: #000 !important;
  }
  .direct-answer-box {
    border: 2px solid #000 !important;
    background: #f4f4f4 !important;
    color: #000 !important;
  }
}

