:root {
  /* Dark glassmorphism palette */
  --bg-base: #07090e;
  --bg-surface: #111520;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #0f172a;
  
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-bg-hover: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-bright: rgba(255, 255, 255, 0.25);
  
  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-gradient: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Spacing Scale */
  --sp-4: 4px;
  --sp-8: 8px;
  --sp-12: 12px;
  --sp-16: 16px;
  --sp-24: 24px;
  --sp-40: 40px;
  --sp-64: 64px;
  
  /* Header heights */
  --header-desktop: 64px;
  --header-mobile: 52px;
}

/* Base Reset & Accessibility */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  color: var(--text-main);
  background-color: var(--bg-base);
  line-height: 1.6;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Ambient glow effect */
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(0, 242, 254, 0.05), transparent 30%),
    radial-gradient(circle at 85% 80%, rgba(79, 172, 254, 0.05), transparent 30%);
  background-attachment: fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

a, button, input, textarea, select {
  font-family: inherit;
}

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
  border-radius: 4px;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

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

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

.text-accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent-cyan);
}

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

h1 { font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
p { margin-bottom: var(--sp-16); }
p:last-child { margin-bottom: 0; }

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

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

.grid {
  display: grid;
  gap: var(--sp-24);
}

.flex {
  display: flex;
  gap: var(--sp-24);
}

.grid > *, .flex > * {
  min-width: 0;
}

/* Glassmorphism Utilities */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: var(--sp-24);
}

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

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

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  z-index: 101;
  overflow-wrap: anywhere;
}

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

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

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
  overflow-wrap: anywhere;
}

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

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.875rem;
  padding: var(--sp-8) var(--sp-16);
  border-radius: 8px;
  transition: opacity 0.2s ease, transform 0.2s ease;
  text-decoration: none;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.875rem;
  padding: var(--sp-8) var(--sp-16);
  border-radius: 8px;
  transition: background 0.2s ease;
}

.btn-ghost:hover {
  background: var(--glass-bg-hover);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  z-index: 101;
}

/* Card Style: Glass Overlay */
.card-glass {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 4/5;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-decoration: none;
  border: 1px solid var(--glass-border);
}

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

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

.card-glass-content {
  position: relative;
  z-index: 2;
  padding: var(--sp-24);
  background: linear-gradient(to top, rgba(7, 9, 14, 0.95) 0%, rgba(7, 9, 14, 0.7) 60%, rgba(7, 9, 14, 0) 100%);
  border-top: 1px solid var(--glass-border);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transform: translateY(0);
  transition: background 0.3s ease;
}

.card-glass:hover .card-glass-content {
  background: linear-gradient(to top, rgba(7, 9, 14, 0.98) 0%, rgba(7, 9, 14, 0.8) 70%, rgba(7, 9, 14, 0) 100%);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--sp-8);
  color: var(--text-main);
}

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

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-4);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Page Layouts */
.hero {
  position: relative;
  padding: var(--sp-64) 0;
  min-height: 60vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 600px;
}

.hero-subtitle {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--sp-16);
  display: block;
}

/* Grid Layouts */
.guides-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Supporting Stats Block */
.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-top: var(--sp-40);
}

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

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent-cyan);
  margin-bottom: var(--sp-12);
}

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

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

.featured-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 16px;
  margin-top: var(--sp-40);
  border: 1px solid var(--glass-border);
}

.article-body {
  max-width: 800px;
  margin: 0 auto var(--sp-64);
}

.article-body h2 {
  margin-top: var(--sp-40);
  padding-bottom: var(--sp-8);
  border-bottom: 1px solid var(--glass-border);
}

.article-body h3 {
  margin-top: var(--sp-24);
  font-size: 1.25rem;
}

.article-body ul, .article-body ol {
  margin-bottom: var(--sp-16);
  padding-left: var(--sp-24);
}

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

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

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: var(--sp-8);
  color: var(--text-main);
}

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

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

.form-control.is-invalid {
  border-color: #ef4444;
}

.error-msg {
  display: none;
  color: #ef4444;
  font-size: 0.75rem;
  margin-top: var(--sp-4);
}

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

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

.static-map::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
}

.map-marker {
  position: relative;
  width: 16px;
  height: 16px;
  background: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 20px var(--accent-cyan);
}

/* Table */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: var(--sp-24);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
}

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

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

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

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--glass-border);
  padding: var(--sp-64) 0 var(--sp-40);
  background: rgba(7, 9, 14, 0.5);
}

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

.footer-col h4 {
  font-size: 1rem;
  color: var(--text-main);
  margin-bottom: var(--sp-16);
}

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

.footer-links li {
  margin-bottom: var(--sp-8);
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

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

.footer-bottom {
  padding-top: var(--sp-24);
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-16);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: var(--sp-24);
  left: var(--sp-24);
  right: var(--sp-24);
  z-index: 1000;
  display: none;
  max-width: 800px;
  margin: 0 auto;
}

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

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

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

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

/* Responsive Rules */
@media (max-width: 767px) {
  .site-header {
    height: var(--header-mobile);
  }
  
  .nav-toggle {
    display: flex;
  }
  
  .nav-desktop {
    position: fixed;
    top: var(--header-mobile);
    left: 0;
    right: 0;
    background: rgba(7, 9, 14, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    flex-direction: column;
    padding: var(--sp-24);
    gap: var(--sp-16);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
  }
  
  .nav-desktop.is-visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .header-cta {
    display: none;
  }
  
  .nav-desktop .header-cta {
    display: inline-flex;
    width: 100%;
  }

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

@media (max-width: 399px) {
  :root {
    --sp-64: 40px;
    --sp-40: 24px;
    --sp-24: 16px;
  }
  .cookie-actions {
    flex-direction: column;
    width: 100%;
  }
  .cookie-actions button {
    width: 100%;
  }
}

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