:root {
  /* Dark Glassmorphism Color Palette */
  --bg-dark: #07090f;
  --bg-panel: rgba(20, 24, 36, 0.6);
  --bg-panel-hover: rgba(30, 36, 52, 0.8);
  --border-glass: rgba(255, 255, 255, 0.1);
  --border-highlight: rgba(255, 255, 255, 0.25);
  
  --text-main: #f8f9fa;
  --text-muted: #a0a5b5;
  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-gradient: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
  --error-color: #ff4b4b;
  
  /* Spacing Scale */
  --sp-4: 4px;
  --sp-8: 8px;
  --sp-12: 12px;
  --sp-16: 16px;
  --sp-24: 24px;
  --sp-40: 40px;
  --sp-64: 64px;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html {
  lang: en;
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden; /* Global overflow safety, not used for masking layout elements */
}

/* Base Elements */
h1, h2, h3, h4, .brand-name {
  overflow-wrap: anywhere;
  color: var(--text-main);
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: var(--sp-24); }
h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); margin-bottom: var(--sp-24); }
h3 { font-size: clamp(1.25rem, 2vw, 1.75rem); margin-bottom: var(--sp-16); }

p {
  margin-bottom: var(--sp-16);
  color: var(--text-muted);
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

a:hover {
  color: var(--accent-blue);
  text-shadow: 0 0 8px rgba(79, 172, 254, 0.4);
}

ul, ol {
  margin-bottom: var(--sp-24);
  padding-left: var(--sp-24);
  color: var(--text-muted);
}

li {
  margin-bottom: var(--sp-8);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Accessibility */
:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 4px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sp-24);
  min-width: 0;
}

.section {
  padding: var(--sp-64) 0;
}

/* Header */
.site-header {
  background: rgba(7, 9, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  height: 64px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 100;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-main);
  text-decoration: none;
}

.brand svg {
  width: 24px;
  height: 24px;
  fill: url(#brand-gradient);
}

.main-nav {
  display: flex;
  align-items: center;
}

.main-nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--sp-24);
}

.main-nav a {
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.95rem;
}

.main-nav a:hover {
  color: var(--accent-cyan);
}

.header-cta {
  display: flex;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-panel);
  color: var(--text-main);
  border: 1px solid var(--border-glass);
  padding: var(--sp-12) var(--sp-24);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.btn-compact {
  padding: var(--sp-8) var(--sp-16);
  font-size: 0.9rem;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #000;
  border: none;
  text-shadow: none;
}

.btn-primary:hover {
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.4);
  color: #000;
}

.btn:hover:not(.btn-primary) {
  background: var(--bg-panel-hover);
  border-color: var(--border-highlight);
  color: var(--text-main);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: var(--sp-8);
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Hero Section */
.hero {
  position: relative;
  padding: 120px 0 var(--sp-64);
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle at center, rgba(0, 242, 254, 0.1) 0%, rgba(7, 9, 15, 0) 50%);
  z-index: -1;
}

.hero p {
  font-size: 1.25rem;
  max-width: 600px;
  margin: 0 auto var(--sp-40);
}

/* Glass Overlay Cards */
.routes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-40);
  min-width: 0;
}

.card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  height: 400px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid var(--border-glass);
  background-color: #1a1e29;
  min-width: 0;
}

.card:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 8px 32px rgba(0, 242, 254, 0.15);
}

.card-bg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s ease;
  z-index: 1;
}

.card:hover .card-bg {
  transform: scale(1.05);
}

.card-overlay {
  position: relative;
  z-index: 2;
  background: linear-gradient(to top, rgba(7, 9, 15, 0.95) 0%, rgba(7, 9, 15, 0.6) 60%, transparent 100%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: var(--sp-40) var(--sp-24) var(--sp-24);
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  min-width: 0;
}

.card-overlay h3 {
  margin-bottom: var(--sp-8);
  color: var(--text-main);
}

.card-overlay p {
  margin-bottom: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.card-tags {
  display: flex;
  gap: var(--sp-8);
  margin-bottom: var(--sp-16);
  flex-wrap: wrap;
}

.tag {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px var(--sp-8);
  border-radius: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
}

/* Supporting Content Layout */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-64);
  align-items: center;
  min-width: 0;
}

.glass-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: var(--sp-40);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  min-width: 0;
}

/* Article Styling (Sub-pages & Legal) */
.article-header {
  text-align: center;
  margin-bottom: var(--sp-64);
}

.article-content {
  max-width: 800px;
  margin: 0 auto;
}

.article-content h2 {
  margin-top: var(--sp-40);
  padding-bottom: var(--sp-8);
  border-bottom: 1px solid var(--border-glass);
}

.article-content h3 {
  margin-top: var(--sp-24);
}

/* Stats Block */
.stats-block {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-24);
  margin: var(--sp-40) 0;
  min-width: 0;
}

.stat-item {
  background: var(--bg-panel);
  border: 1px solid var(--border-glass);
  padding: var(--sp-16);
  border-radius: 8px;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: var(--sp-12);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Forms */
.form-group {
  margin-bottom: var(--sp-24);
}

.form-label {
  display: block;
  margin-bottom: var(--sp-8);
  font-weight: 500;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: var(--sp-12) var(--sp-16);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 242, 254, 0.15);
}

.form-control.is-invalid {
  border-color: var(--error-color);
}

.error-message {
  display: none;
  color: var(--error-color);
  font-size: 0.875rem;
  margin-top: var(--sp-4);
}

.form-control.is-invalid + .error-message {
  display: block;
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* Map Block */
.map-block {
  width: 100%;
  height: 300px;
  background: var(--bg-panel);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-40);
  overflow: hidden;
}

.map-block svg {
  width: 100%;
  height: 100%;
  opacity: 0.5;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin: var(--sp-24) 0;
  border: 1px solid var(--border-glass);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 600px;
}

th, td {
  padding: var(--sp-16);
  border-bottom: 1px solid var(--border-glass);
}

th {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
  color: var(--text-main);
}

tr:last-child td {
  border-bottom: none;
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-glass);
  background: rgba(7, 9, 15, 0.95);
  padding: var(--sp-64) 0 var(--sp-24);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--sp-40);
  margin-bottom: var(--sp-40);
  min-width: 0;
}

.footer-col h4 {
  margin-bottom: var(--sp-16);
  font-size: 1.125rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
}

.footer-col a {
  color: var(--text-muted);
}

.footer-col a:hover {
  color: var(--accent-cyan);
}

.footer-bottom {
  text-align: center;
  padding-top: var(--sp-24);
  border-top: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: var(--sp-24);
  left: var(--sp-24);
  right: var(--sp-24);
  background: rgba(20, 24, 36, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-highlight);
  border-radius: 12px;
  padding: var(--sp-24);
  display: flex;
  flex-direction: column;
  gap: var(--sp-16);
  z-index: 9999;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(150%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner.is-visible {
  transform: translateY(0);
}

.cookie-content p {
  margin: 0;
  font-size: 0.9rem;
}

.cookie-actions {
  display: flex;
  gap: var(--sp-12);
  flex-wrap: wrap;
}

/* Media Queries */
@media (max-width: 768px) {
  .site-header {
    height: 52px;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .main-nav {
    display: none;
    position: absolute;
    top: 52px;
    left: 0;
    width: 100%;
    background: rgba(7, 9, 15, 0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
    padding: var(--sp-24);
  }
  
  .main-nav.is-visible {
    display: block;
  }
  
  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-16);
  }
  
  .main-nav a {
    display: block;
    padding: var(--sp-8) 0;
  }
  
  .header-cta {
    display: none;
  }
  
  .content-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-40);
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-24);
  }
  
  .glass-panel {
    padding: var(--sp-24);
  }
}

@media (max-width: 400px) {
  .site-header {
    height: 48px;
  }
  
  .hero {
    padding-top: 80px;
  }
  
  .stats-block {
    grid-template-columns: 1fr;
  }
}