:root {
  /* Spacing Scale */
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-24: 24px;
  --space-40: 40px;
  --space-64: 64px;

  /* Colors - Dark Glassmorphism */
  --bg-color: #050508;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  --glass-bg: rgba(20, 20, 28, 0.4);
  --glass-border: rgba(255, 255, 255, 0.1);
  --neon-1: #ff00cc;
  --neon-2: #3333ff;
  
  /* Layout */
  --header-height-desk: 64px;
  --header-height-mob: 52px;
  --container-max: 1200px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  min-width: 0; /* Prevents flex/grid blowout */
}

html {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-color);
  line-height: 1.6;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: var(--space-24);
  overflow-wrap: anywhere;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p {
  margin-bottom: var(--space-16);
  color: var(--text-secondary);
}

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

a:hover, a:focus {
  color: var(--neon-1);
}

:focus-visible {
  outline: 2px solid var(--neon-1);
  outline-offset: 4px;
}

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

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

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-24);
}

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

th {
  color: var(--text-primary);
  font-weight: 600;
}

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

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

.grid {
  display: grid;
  gap: var(--space-40);
}

.grid-cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* Glassmorphism Components */
.glass-panel {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: var(--space-40);
  z-index: 1;
}

.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(135deg, var(--neon-1), var(--neon-2));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: -1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-24);
  background: linear-gradient(90deg, var(--neon-1), var(--neon-2));
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
  text-align: center;
}

.btn:hover {
  opacity: 0.9;
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-secondary);
}

/* Header */
.site-header {
  height: var(--header-height-desk);
  display: flex;
  align-items: center;
  background: rgba(5, 5, 8, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  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(--space-12);
  font-weight: 700;
  font-size: 1.2rem;
  overflow-wrap: anywhere;
  flex-shrink: 1;
}

.brand svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.nav-menu {
  display: flex;
  gap: var(--space-24);
  align-items: center;
}

.nav-link {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.nav-link:hover {
  color: var(--text-primary);
}

.header-cta {
  padding: var(--space-8) var(--space-16);
  font-size: 0.9rem;
}

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

.nav-toggle svg {
  width: 24px;
  height: 24px;
}

/* Hero */
.hero {
  padding: 120px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--neon-2) 0%, transparent 60%);
  transform: translate(-50%, -50%);
  opacity: 0.15;
  filter: blur(60px);
  z-index: -1;
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  max-width: 800px;
  margin: 0 auto var(--space-24);
}

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

/* Card Style: Glass overlay */
.card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-decoration: none;
  transition: transform 0.3s ease;
  background-color: #1a1a24;
}

.card:hover {
  transform: translateY(-4px);
}

.card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.card-overlay {
  position: relative;
  z-index: 2;
  padding: var(--space-24);
  background: rgba(5, 5, 8, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.card-tags {
  display: flex;
  gap: var(--space-8);
  flex-wrap: wrap;
}

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

.card-title {
  font-size: 1.25rem;
  margin-bottom: 0;
  color: var(--text-primary);
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Article Content */
.article-header {
  padding: var(--space-64) 0 var(--space-40);
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: var(--space-64);
}

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

.article-content h2 {
  margin-top: var(--space-64);
}

.article-content img {
  width: 100%;
  border-radius: 16px;
  margin: var(--space-40) 0;
  height: auto;
}

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

.form-label {
  display: block;
  margin-bottom: var(--space-8);
  font-weight: 600;
}

.form-control {
  width: 100%;
  padding: var(--space-16);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--neon-1);
  background: rgba(255, 255, 255, 0.08);
}

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

.form-error {
  color: #ff4444;
  font-size: 0.875rem;
  margin-top: var(--space-8);
  display: none;
}

.is-invalid {
  border-color: #ff4444;
}
.is-invalid + .form-error {
  display: block;
}

.form-success {
  display: none;
  padding: var(--space-24);
  background: rgba(0, 255, 100, 0.1);
  border: 1px solid rgba(0, 255, 100, 0.3);
  border-radius: 8px;
  margin-bottom: var(--space-24);
}

.form-success.is-visible {
  display: block;
}

/* Map Block */
.map-block {
  width: 100%;
  height: 300px;
  background: #111;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-border);
  margin-top: var(--space-40);
  position: relative;
  overflow: hidden;
}

.map-block::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.3;
}

.map-pin {
  width: 24px;
  height: 24px;
  background: var(--neon-1);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  position: relative;
  z-index: 2;
  box-shadow: 0 0 20px var(--neon-1);
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--glass-border);
  padding: var(--space-64) 0 var(--space-24);
  background: rgba(5, 5, 8, 0.9);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-40);
  margin-bottom: var(--space-64);
}

.footer-brand {
  margin-bottom: var(--space-16);
}

.footer-info p {
  font-size: 0.875rem;
  margin-bottom: var(--space-4);
}

.footer-nav h4 {
  font-size: 1rem;
  margin-bottom: var(--space-16);
}

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

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

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: var(--space-24);
  left: var(--space-24);
  right: var(--space-24);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  max-width: 600px;
  margin: 0 auto;
  transform: translateY(150%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

/* Stats (Data context) */
.stat-block {
  display: flex;
  flex-direction: column;
}
.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--neon-1);
  margin-bottom: var(--space-12);
  line-height: 1;
}
.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Media Queries */
@media (max-width: 767px) {
  .site-header {
    height: var(--header-height-mob);
  }
  
  .nav-toggle {
    display: block;
  }
  
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(5, 5, 8, 0.95);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    flex-direction: column;
    padding: var(--space-24);
    gap: var(--space-16);
    display: none;
  }
  
  .nav-menu.is-active {
    display: flex;
  }
  
  .header-cta {
    display: none; /* Hide on mobile if space is tight, rely on nav menu */
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .glass-panel::before {
    /* Offset frames must not use negative insets, reduced offset to 0 */
    inset: 0;
    padding: 1px;
  }
}

@media (max-width: 399px) {
  h1 { font-size: 2rem; }
  .cookie-actions { flex-direction: column; }
  .btn { 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;
  }
}