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

  /* Dark Glassmorphism Palette */
  --bg-dark: #0a0c10;
  --bg-darker: #050608;
  --surface-glass: rgba(18, 22, 29, 0.45);
  --surface-glass-solid: #12161d;
  --surface-overlay: rgba(10, 12, 16, 0.85);
  --border-glass: rgba(255, 255, 255, 0.1);
  --border-glass-light: rgba(255, 255, 255, 0.2);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --neon-cyan: #00f3ff;
  --neon-magenta: #ff0055;
  --neon-gradient: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
  
  /* Typography */
  --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

html {
  font-family: var(--font-stack);
  background-color: var(--bg-darker);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(0, 243, 255, 0.03), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(255, 0, 85, 0.03), transparent 25%);
  background-attachment: fixed;
}

/* Global Typography & Rules */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.word-wrap {
  overflow-wrap: anywhere;
}

a {
  color: var(--neon-cyan);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--text-main);
}

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

img, svg {
  display: block;
  max-width: 100%;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-24);
}

.main-content {
  flex: 1;
  padding: var(--space-64) 0;
}

/* Utilities */
.text-center { text-align: center; }
.text-gradient {
  background: var(--neon-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--neon-cyan);
}
.mb-24 { margin-bottom: var(--space-24); }
.mb-40 { margin-bottom: var(--space-40); }
.mb-64 { margin-bottom: var(--space-64); }
.mt-40 { margin-top: var(--space-40); }
[hidden] { display: none !important; }

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

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 16px rgba(0, 243, 255, 0.2);
  color: var(--text-main);
}

.btn-primary {
  background: var(--neon-gradient);
  color: var(--bg-darker);
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #33f5ff, #ff3377);
  box-shadow: 0 0 24px rgba(255, 0, 85, 0.4);
  color: var(--bg-darker);
}

/* Header */
.site-header {
  position: relative;
  height: 64px;
  background: var(--surface-overlay);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  z-index: 100;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  z-index: 101;
}

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

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

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

.nav-link:hover {
  color: var(--neon-cyan);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  z-index: 101;
}

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

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

/* Glass Panels & Neon Borders */
.glass-panel {
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: var(--space-40);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.neon-border {
  position: relative;
}

.neon-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: var(--neon-gradient);
  z-index: -1;
  filter: blur(4px);
  opacity: 0.4;
  transition: opacity 0.3s ease;
}

.neon-border:hover::before {
  opacity: 0.8;
}

/* Card Style: Glass overlay */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-24);
  min-width: 0;
}

.card-glass {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-decoration: none;
  color: var(--text-main);
  border: 1px solid var(--border-glass);
  background: var(--bg-dark);
}

.card-glass img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.card-overlay {
  position: relative;
  z-index: 2;
  background: linear-gradient(to top, rgba(5, 6, 8, 1) 0%, rgba(10, 12, 16, 0.8) 60%, transparent 100%);
  padding: var(--space-40) var(--space-24) var(--space-24);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.3s ease;
}

.card-glass:hover .card-overlay {
  border-top-color: var(--neon-cyan);
}

.card-tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--neon-magenta);
  margin-bottom: var(--space-8);
  display: block;
}

.card-title {
  font-size: 1.5rem;
  margin-bottom: var(--space-8);
  color: var(--text-main);
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Article Layout */
.article-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto var(--space-64);
}

.article-hero {
  width: 100%;
  height: 50vh;
  min-height: 400px;
  border-radius: 24px;
  object-fit: cover;
  margin-bottom: var(--space-64);
  border: 1px solid var(--border-glass);
}

.article-body {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.125rem;
}

.article-body h2 {
  margin: var(--space-64) 0 var(--space-24);
  color: var(--neon-cyan);
  font-size: 2rem;
}

.article-body h3 {
  margin: var(--space-40) 0 var(--space-16);
  font-size: 1.5rem;
}

.article-body p {
  margin-bottom: var(--space-24);
}

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

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

/* Data Grid (Stats) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-24);
  margin: var(--space-40) 0;
  padding: var(--space-24);
  background: var(--surface-glass);
  border-radius: 12px;
  border: 1px solid var(--border-glass);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--neon-cyan);
  margin-bottom: var(--space-12);
}

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

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

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

.footer-col h4 {
  margin-bottom: var(--space-24);
  color: var(--text-main);
}

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

.footer-col li {
  margin-bottom: var(--space-12);
}

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

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

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

/* Tables (Legal pages & Specs) */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: var(--space-24);
  border-radius: 8px;
  border: 1px solid var(--border-glass);
}

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

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

th {
  background: var(--surface-glass);
  font-weight: 600;
  color: var(--neon-cyan);
}

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

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

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

.form-control:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 2px rgba(0, 243, 255, 0.2);
}

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

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

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

.map-block {
  width: 100%;
  height: 300px;
  background: var(--bg-dark);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-direction: column;
  gap: var(--space-8);
}

.map-icon {
  width: 48px;
  height: 48px;
  fill: var(--neon-magenta);
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: var(--space-24);
  left: var(--space-24);
  right: var(--space-24);
  max-width: 800px;
  margin: 0 auto;
  background: var(--surface-glass-solid);
  border: 1px solid var(--border-glass);
  padding: var(--space-24);
  border-radius: 16px;
  z-index: 1000;
  box-shadow: 0 12px 48px rgba(0,0,0,0.8);
}

.cookie-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: var(--neon-gradient);
  border-radius: 16px 16px 0 0;
}

.cookie-content {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-24);
  align-items: center;
  justify-content: space-between;
}

.cookie-text {
  flex: 1;
  min-width: 260px;
  font-size: 0.9rem;
}

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

/* Responsive */
@media (max-width: 768px) {
  .site-header { height: 52px; }
  
  .menu-toggle { display: block; }
  
  .nav-links {
    display: none;
    position: absolute;
    top: 52px;
    left: 0;
    width: 100%;
    background: var(--bg-darker);
    flex-direction: column;
    padding: var(--space-24);
    border-bottom: 1px solid var(--border-glass);
    gap: var(--space-16);
  }

  .nav-links.is-visible {
    display: flex;
  }
  
  .header-actions .btn {
    display: none;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .glass-panel {
    padding: var(--space-24);
  }

  .neon-border::before {
    inset: 0; /* reduce offset below 768px */
    border-radius: 16px;
  }
  
  .article-body h2 { font-size: 1.5rem; }
  .article-hero { height: 30vh; min-height: 250px; }
}

@media (max-width: 400px) {
  :root {
    --space-40: 24px;
    --space-64: 40px;
  }
  .cookie-actions {
    flex-direction: column;
    width: 100%;
  }
  .cookie-actions .btn {
    width: 100%;
  }
  .stat-value {
    font-size: 1.5rem;
  }
}

/* Accessibility: 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;
  }
}