:root {
  --color-bg-base: #0a0614;
  --color-bg-glass: rgba(20, 15, 35, 0.6);
  --color-border-glass: rgba(255, 255, 255, 0.1);
  --color-text-main: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-accent-start: #a855f7;
  --color-accent-end: #3b82f6;
  --color-accent-solid: #8b5cf6;
  --color-error: #ef4444;

  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-24: 24px;
  --space-40: 40px;
  --space-64: 64px;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

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

html {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--color-bg-base);
  color: var(--color-text-main);
  line-height: 1.6;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden; /* Only allowed on body to prevent horizontal scrollbar from layout, NOT for layout masking */
}

/* Typography & General */
h1, h2, h3, h4, .brand-name, nav, .wrap-anywhere {
  overflow-wrap: anywhere;
  line-height: 1.2;
}

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

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

a:hover {
  color: var(--color-accent-solid);
}

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

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

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

.flex-min {
  min-width: 0;
}

/* Glassmorphism Utilities */
.glass-panel {
  background: var(--color-bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--color-border-glass);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.text-gradient {
  background: linear-gradient(135deg, var(--color-accent-start), var(--color-accent-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--color-accent-solid); /* Fallback */
}

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

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

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

.logo svg {
  width: 24px;
  height: 24px;
}

.nav-desktop {
  display: flex;
  gap: var(--space-24);
}

.nav-desktop a {
  font-size: 0.9rem;
  font-weight: 500;
}

.header-cta {
  background: linear-gradient(135deg, var(--color-accent-start), var(--color-accent-end));
  color: #fff;
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
}

.header-cta:hover {
  opacity: 0.9;
  color: #fff;
}

.mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--color-text-main);
  cursor: pointer;
  z-index: 101;
  padding: var(--space-8);
}

/* Mobile Nav Overlay */
.nav-mobile {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--color-bg-base);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--space-24);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.nav-mobile.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.nav-mobile a {
  font-size: 1.5rem;
  font-weight: 600;
}

/* Hero Section */
.hero {
  padding: var(--space-64) 0;
  text-align: center;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(168,85,247,0.15) 0%, rgba(10,6,20,0) 70%);
  z-index: -1;
  pointer-events: none;
}

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

/* Card Style: Glass overlay (full-bleed image with translucent panel) */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-40);
  margin-bottom: var(--space-64);
}

.glass-card {
  position: relative;
  height: 400px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  text-decoration: none;
  color: var(--color-text-main);
  transition: transform 0.3s ease;
}

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

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

.glass-card-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: var(--space-24);
  background: linear-gradient(to top, rgba(10, 6, 20, 0.95) 0%, rgba(20, 15, 35, 0.7) 60%, transparent 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--color-border-glass);
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.glass-card-tag {
  align-self: flex-start;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--color-accent-solid);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-sm);
  font-weight: 700;
}

.glass-card-title {
  font-size: 1.25rem;
  margin-bottom: 0;
}

.glass-card-meta {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Content Pages */
.page-header {
  padding: var(--space-64) 0 var(--space-40);
  text-align: center;
  border-bottom: 1px solid var(--color-border-glass);
  margin-bottom: var(--space-40);
}

.page-content {
  max-width: 800px;
  margin: 0 auto var(--space-64);
}

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

.page-content ul {
  margin-bottom: var(--space-16);
  padding-left: var(--space-24);
  color: var(--color-text-muted);
}

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

.page-content p {
  color: var(--color-text-muted);
}

.stat-block {
  display: flex;
  align-items: baseline;
  gap: var(--space-12);
  margin-bottom: var(--space-24);
  padding: var(--space-16);
  background: var(--color-bg-glass);
  border: 1px solid var(--color-border-glass);
  border-radius: var(--radius-sm);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent-solid);
}

.stat-label {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.table-wrapper {
  overflow-x: auto;
  margin-bottom: var(--space-24);
  border: 1px solid var(--color-border-glass);
  border-radius: var(--radius-md);
}

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

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

th {
  background: rgba(255, 255, 255, 0.02);
  font-weight: 600;
}

/* 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-12) var(--space-16);
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--color-border-glass);
  border-radius: var(--radius-sm);
  color: var(--color-text-main);
  font-family: inherit;
  transition: border-color 0.2s ease;
}

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

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

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

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

.btn-submit {
  background: linear-gradient(135deg, var(--color-accent-start), var(--color-accent-end));
  color: #fff;
  border: none;
  padding: var(--space-16) var(--space-24);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.2s ease;
}

.btn-submit:hover {
  opacity: 0.9;
}

.map-block {
  height: 300px;
  background: linear-gradient(135deg, rgba(255,255,255,0.02), rgba(255,255,255,0.05));
  border: 1px solid var(--color-border-glass);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: var(--space-40);
  flex-direction: column;
  gap: var(--space-8);
}

.map-block svg {
  width: 40px;
  height: 40px;
  fill: var(--color-accent-solid);
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--color-border-glass);
  padding: var(--space-64) 0 var(--space-24);
  background: rgba(10, 6, 20, 0.5);
}

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

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

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

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

.footer-col a, .footer-col p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

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

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: var(--space-24);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - var(--space-40));
  max-width: 600px;
  z-index: 1000;
  padding: var(--space-24);
  display: none;
  flex-direction: column;
  gap: var(--space-16);
}

.cookie-banner.is-visible {
  display: flex;
}

.cookie-text {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

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

.cookie-btn {
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-glass);
  background: transparent;
  color: var(--color-text-main);
  cursor: pointer;
  font-size: 0.85rem;
  flex: 1;
  min-width: 120px;
}

.cookie-btn:hover {
  background: rgba(255,255,255,0.05);
}

.cookie-btn.primary {
  background: var(--color-accent-solid);
  border-color: var(--color-accent-solid);
  color: #fff;
}

.cookie-btn.primary:hover {
  background: var(--color-accent-start);
}

/* Responsive */
@media (max-width: 767px) {
  .site-header {
    height: 52px;
  }
  .nav-desktop {
    display: none;
  }
  .mobile-toggle {
    display: block;
  }
  .header-cta {
    display: none;
  }
}

@media (max-width: 399px) {
  :root {
    --space-64: 40px;
    --space-40: 24px;
    --space-24: 16px;
  }
  
  .glass-card {
    height: 320px;
  }
  
  .glass-card-overlay {
    padding: var(--space-16);
  }
}

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