:root {
  --bg-dark: #07090e;
  --surface: #121824;
  --surface-glass: rgba(18, 24, 36, 0.65);
  --accent-cyan: #00F0FF;
  --accent-purple: #B200FF;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border-glow: rgba(0, 240, 255, 0.3);
  --danger: #ef4444;
  
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-24: 24px;
  --space-40: 40px;
  --space-64: 64px;
  
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html {
  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;
}

/* Typography & Wrapping Rules */
h1, h2, h3, h4, h5, h6, .brand-name, .nav-link {
  overflow-wrap: anywhere;
  color: #ffffff;
}

h1 { font-size: 2.5rem; line-height: 1.2; margin-bottom: var(--space-24); }
h2 { font-size: 2rem; margin-bottom: var(--space-16); margin-top: var(--space-40); }
h3 { font-size: 1.5rem; margin-bottom: var(--space-12); }
p { margin-bottom: var(--space-16); }
a { color: var(--accent-cyan); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: #fff; }

/* Focus and Accessibility */
*:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 4px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-24);
}
main { flex-grow: 1; padding: var(--space-64) 0; }
.grid { display: grid; gap: var(--space-24); }
.flex { display: flex; gap: var(--space-24); }
.grid > *, .flex > * { min-width: 0; } /* Crucial for responsive text wrapping */

/* Header */
.site-header {
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-glow);
  height: 64px;
  display: flex;
  align-items: center;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.logo-area {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
}
.main-nav { display: flex; align-items: center; }
.nav-list {
  display: flex;
  list-style: none;
  gap: var(--space-24);
}
.nav-link { color: var(--text-main); font-weight: 500; }
.nav-link:hover { color: var(--accent-cyan); }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
}
.menu-toggle svg { width: 24px; height: 24px; fill: currentColor; }

.header-cta {
  background-image: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  color: var(--bg-dark);
  padding: var(--space-8) var(--space-16);
  border-radius: 4px;
  font-weight: bold;
}
.header-cta:hover { color: var(--bg-dark); opacity: 0.9; }

/* Neon Glass Components */
.glass-panel {
  background: var(--surface-glass);
  backdrop-filter: blur(16px);
  border: 1px solid transparent;
  border-radius: 12px;
  background-image: linear-gradient(var(--surface-glass), var(--surface-glass)), linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-purple) 100%);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  padding: var(--space-24);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

/* Cards: Glass overlay */
.card-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  height: 380px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}
.card-img {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover;
  z-index: 1;
}
.card-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 2;
  padding: var(--space-24);
  background: rgba(7, 9, 14, 0.8);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border-glow);
  transform: translateY(0);
  transition: transform 0.3s ease;
}
.card:hover .card-overlay {
  background: rgba(7, 9, 14, 0.95);
}
.card-title { color: #fff; margin-bottom: var(--space-8); font-size: 1.25rem; }
.card-desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: var(--space-16); }
.card-link {
  display: inline-block;
  color: var(--accent-cyan);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

/* Article Styling */
.article-header {
  margin-bottom: var(--space-64);
  text-align: center;
}
.article-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--space-24);
  display: block;
}
.article-hero-img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: var(--space-40);
  border: 1px solid var(--border-glow);
}
.article-content {
  max-width: 800px;
  margin: 0 auto;
}
.article-content h2 { color: var(--accent-cyan); }
.article-content ul, .article-content ol { margin-bottom: var(--space-16); padding-left: var(--space-24); }
.article-content li { margin-bottom: var(--space-8); }
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-24);
  display: block;
  overflow-x: auto;
}
.article-content th, .article-content td {
  border: 1px solid var(--border-glow);
  padding: var(--space-12);
  text-align: left;
}
.article-content th { background: rgba(0, 240, 255, 0.1); color: var(--accent-cyan); }

/* Forms */
.form-group { margin-bottom: var(--space-24); }
.form-label { display: block; margin-bottom: var(--space-8); color: var(--text-main); font-weight: 500; }
.form-control {
  width: 100%;
  padding: var(--space-12);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #fff;
  font-family: var(--font-sans);
}
.form-control:focus { outline: none; border-color: var(--accent-cyan); box-shadow: 0 0 8px rgba(0, 240, 255, 0.3); }
.form-error {
  display: none;
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: var(--space-4);
}
.is-invalid + .form-error { display: block; }
.is-invalid { border-color: var(--danger); }
.btn {
  display: inline-block;
  background-image: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  color: var(--bg-dark);
  padding: var(--space-12) var(--space-24);
  border: none;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.btn:hover { opacity: 0.9; color: var(--bg-dark); }

/* Map Block */
.static-map {
  width: 100%;
  height: 300px;
  background-color: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background-image: radial-gradient(circle at center, rgba(0, 240, 255, 0.1) 0%, transparent 70%);
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-glow);
  background: var(--surface);
  padding: var(--space-64) 0 var(--space-24);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-40);
  margin-bottom: var(--space-40);
}
.footer-col h3 { color: var(--accent-cyan); font-size: 1.2rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: var(--space-8); }
.footer-col a { color: var(--text-muted); }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  text-align: center;
  padding-top: var(--space-24);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-glow);
  padding: var(--space-16);
  z-index: 1000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  transform: translateY(100%);
  transition: transform 0.4s ease-out;
}
.cookie-banner.is-visible { transform: translateY(0); }
.cookie-text { flex: 1 1 300px; font-size: 0.9rem; }
.cookie-actions { display: flex; gap: var(--space-8); flex-wrap: wrap; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
}
.btn-outline:hover { background: rgba(0, 240, 255, 0.1); }

/* Stats block in content */
.stat-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: var(--space-12);
}
.stat-label { color: var(--text-muted); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* Responsive Adjustments */
@media (max-width: 767px) {
  .site-header { height: 52px; }
  .header-cta { display: none; }
  .menu-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 52px;
    left: 0; right: 0;
    background: var(--bg-dark);
    padding: var(--space-24);
    border-bottom: 1px solid var(--border-glow);
    z-index: 50;
  }
  .main-nav.is-visible { display: block; }
  .nav-list { flex-direction: column; }
  .glass-panel { padding: var(--space-16); border: none; box-shadow: none; background: rgba(18,24,36,0.9); }
  main { padding: var(--space-40) 0; }
  h1 { font-size: 2rem; }
  .article-hero-img { height: 250px; }
}

@media (max-width: 399px) {
  .card-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .card { height: 320px; }
  .cookie-actions { flex-direction: column; width: 100%; }
  .cookie-actions button { width: 100%; }
}

@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;
  }
}