:root {
  --color-bg: #090a0f;
  --color-surface: rgba(20, 22, 30, 0.5);
  --color-surface-hover: rgba(30, 32, 45, 0.7);
  --color-border: rgba(0, 243, 255, 0.15);
  --color-accent: #00f3ff;
  --color-accent-alt: #bd00ff;
  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  --color-error: #ff4757;
  
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 40px;
  --space-6: 64px;
  
  --font-base: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

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

body {
  margin: 0;
  padding: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-base);
  line-height: 1.6;
  font-size: 16px;
  min-width: 320px;
}

/* Typography & Wrapping */
h1, h2, h3, h4, h5, h6, .brand, nav a {
  overflow-wrap: anywhere;
  color: #ffffff;
  margin-top: 0;
  margin-bottom: var(--space-4);
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
p { margin-top: 0; margin-bottom: var(--space-4); }

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

a:hover, a:focus {
  color: #ffffff;
  text-shadow: 0 0 8px var(--color-accent);
}

/* Accessibility Focus */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 0;
}

/* Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.text-center { text-align: center; }
.mt-6 { margin-top: var(--space-6); }
.mb-6 { margin-bottom: var(--space-6); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: var(--space-2) var(--space-4);
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn:hover {
  background: var(--color-surface-hover);
  color: #ffffff;
  border-color: var(--color-accent);
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}

.btn-primary {
  background: linear-gradient(90deg, rgba(0, 243, 255, 0.1), rgba(189, 0, 255, 0.1));
  color: #ffffff;
  border: 1px solid var(--color-accent);
}

.btn-primary:hover {
  background: linear-gradient(90deg, rgba(0, 243, 255, 0.2), rgba(189, 0, 255, 0.2));
  color: #ffffff;
  box-shadow: 0 0 20px rgba(189, 0, 255, 0.3);
}

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

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

.brand-area {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.brand {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.brand-icon {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 2;
}

/* Navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--space-4);
}

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

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

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  padding: var(--space-1);
  cursor: pointer;
}

.mobile-toggle svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
}

/* Hero Section */
.hero {
  padding: var(--space-6) 0;
  text-align: center;
  position: relative;
  background: radial-gradient(circle at top center, rgba(189,0,255,0.1) 0%, rgba(9,10,15,0) 60%);
}

.hero p {
  max-width: 600px;
  margin: 0 auto var(--space-5);
  font-size: 1.125rem;
  color: var(--color-text-muted);
}

/* Section Spacing */
.section {
  padding: var(--space-6) 0;
}

/* Glass Overlay Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-5);
}

.card {
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  min-width: 0; /* Flex/Grid shrink rule */
}

.card:hover, .card:focus-within {
  transform: translateY(-4px);
  border-color: var(--color-accent-alt);
  box-shadow: 0 10px 30px rgba(189, 0, 255, 0.15);
}

.card-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: var(--space-4);
  background: rgba(9, 10, 15, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0, 243, 255, 0.3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.card-title {
  margin: 0;
  font-size: 1.25rem;
  color: #ffffff;
}

.card-desc {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.card-stat {
  display: flex;
  align-items: center;
  gap: 12px; /* Strict 12px rule between stat and label */
  font-size: 0.875rem;
  color: var(--color-accent);
  margin-top: var(--space-2);
}

/* Layout Content (Articles) */
.article-header {
  margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-4);
}

.article-content h2, .article-content h3 {
  margin-top: var(--space-5);
}

.article-content p {
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

.article-content ul {
  margin-bottom: var(--space-4);
  padding-left: var(--space-4);
}

.article-content li {
  margin-bottom: var(--space-2);
}

.stat-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: var(--space-4);
  border-radius: 8px;
  margin: var(--space-5) 0;
  border-left: 4px solid var(--color-accent);
}

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

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 500;
  color: #ffffff;
}

.form-control {
  width: 100%;
  padding: var(--space-3);
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--color-border);
  color: #ffffff;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  border-color: var(--color-accent);
}

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

.error-msg {
  display: none;
  color: var(--color-error);
  font-size: 0.875rem;
  margin-top: var(--space-1);
}

.error-msg.is-visible {
  display: block;
}

/* Table */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-bottom: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

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

th, td {
  padding: var(--space-3);
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  background: var(--color-surface);
  color: #ffffff;
  font-weight: 600;
}

/* Static Map Block */
.static-map {
  width: 100%;
  height: 300px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-bg {
  position: absolute;
  inset: 0;
  opacity: 0.3;
  background-image: 
    linear-gradient(rgba(0,243,255,0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,243,255,0.2) 1px, transparent 1px);
  background-size: 20px 20px;
}

.map-marker {
  position: relative;
  z-index: 2;
  width: 20px;
  height: 20px;
  background: var(--color-error);
  border-radius: 50%;
  box-shadow: 0 0 15px var(--color-error);
}

/* Footer */
.site-footer {
  margin-top: var(--space-6);
  padding: var(--space-6) 0 var(--space-4);
  background: rgba(5, 6, 10, 0.9);
  border-top: 1px solid var(--color-border);
  font-size: 0.875rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.footer-col h4 {
  color: #ffffff;
  margin-bottom: var(--space-3);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: var(--space-2);
}

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

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

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: var(--space-4);
  text-align: center;
  color: var(--color-text-muted);
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(9, 10, 15, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--color-accent-alt);
  padding: var(--space-4);
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}

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

.cookie-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  justify-content: space-between;
}

.cookie-text {
  flex: 1 1 300px;
  margin: 0;
  font-size: 0.875rem;
}

.cookie-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* Responsive Rules */
@media (max-width: 768px) {
  .site-header {
    height: 52px;
  }
  
  .main-nav {
    display: none;
    position: absolute;
    top: 52px;
    left: 0;
    width: 100%;
    background: rgba(9, 10, 15, 0.98);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-4);
    flex-direction: column;
    align-items: flex-start;
  }
  
  .main-nav.is-visible {
    display: flex;
  }
  
  .nav-links {
    flex-direction: column;
    width: 100%;
  }
  
  .nav-links li {
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: var(--space-2) 0;
  }
  
  .mobile-toggle {
    display: block;
  }
  
  .header-cta {
    display: none;
  }
}

@media (max-width: 399px) {
  :root {
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 40px;
  }
  
  .card-grid {
    grid-template-columns: 1fr;
  }
  
  .cookie-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .cookie-actions .btn {
    width: 100%;
  }
}

/* Reduced Motion */
@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;
  }
}