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

  --color-bg: #0B0F19;
  --color-surface: rgba(20, 25, 40, 0.65);
  --color-surface-hover: rgba(30, 38, 56, 0.85);
  --color-border: rgba(0, 229, 255, 0.15);
  --color-border-glow: rgba(0, 229, 255, 0.4);
  
  --color-text-main: #F8FAFC;
  --color-text-muted: #94A3B8;
  
  --color-accent: #00E5FF;
  --color-accent-text: #000000;
  
  --color-error: #FF5252;
  --font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
}

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

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--color-bg);
  color: var(--color-text-main);
  font-family: var(--font-family);
  line-height: 1.6;
}

body::before, body::after {
  content: '';
  position: fixed;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,229,255,0.05) 0%, rgba(0,0,0,0) 70%);
  z-index: -1;
  pointer-events: none;
}

body::before {
  top: -20vw;
  left: -20vw;
}

body::after {
  bottom: -20vw;
  right: -20vw;
  background: radial-gradient(circle, rgba(179,136,255,0.05) 0%, rgba(0,0,0,0) 70%);
}

h1, h2, h3, h4, h5, h6, .brand-name, .nav-links a {
  overflow-wrap: anywhere;
  margin-top: 0;
  margin-bottom: var(--space-16);
  font-weight: 600;
  color: var(--color-text-main);
}

h1 { font-size: 2.5rem; line-height: 1.2; }
h2 { font-size: 2rem; line-height: 1.3; }
h3 { font-size: 1.5rem; line-height: 1.4; }

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

a:hover, a:focus {
  text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

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

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

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

.flex-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-24);
}

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

.col {
  flex: 1 1 300px;
}

/* Glassmorphism Classes */
.glass-panel {
  background: var(--color-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.glass-panel-glow:hover {
  border-color: var(--color-border-glow);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 0 20px rgba(0, 229, 255, 0.05);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-accent);
  color: var(--color-accent-text);
  padding: var(--space-12) var(--space-24);
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
  font-family: var(--font-family);
}

.btn:hover, .btn:focus {
  background-color: #00B8D4;
  color: var(--color-accent-text);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.5);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text-main);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover, .btn-secondary:focus {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--color-text-main);
  box-shadow: none;
}

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

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

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

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

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

.nav-links a {
  color: var(--color-text-main);
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
}

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

.header-cta {
  display: flex;
  align-items: center;
}

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

.menu-toggle-icon {
  width: 24px;
  height: 24px;
  fill: var(--color-text-main);
}

/* Card Style 3: Glass Overlay */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-40);
  margin-top: var(--space-40);
}

.card {
  position: relative;
  border-radius: 16px;
  overflow: hidden; /* Only masking image */
  min-height: 400px;
  display: flex;
  align-items: flex-end;
  text-decoration: none;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: border-color 0.3s;
}

.card:hover, .card:focus-within {
  border-color: var(--color-accent);
}

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

.card-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: var(--space-24);
  background: rgba(11, 15, 25, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  transform: translateY(0);
  transition: transform 0.3s ease, background 0.3s ease;
}

.card:hover .card-overlay {
  background: rgba(11, 15, 25, 0.85);
  transform: translateY(-4px);
}

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

.card-meta {
  display: flex;
  gap: var(--space-12);
  flex-wrap: wrap;
}

.card-tag {
  background: rgba(0, 229, 255, 0.1);
  color: var(--color-accent);
  padding: var(--space-4) var(--space-8);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid rgba(0, 229, 255, 0.2);
}

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

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--color-accent);
  font-weight: 600;
  font-size: 0.9rem;
  margin-top: var(--space-8);
}

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

.hero {
  padding: calc(var(--space-64) * 2) 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-subtitle {
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-bottom: var(--space-16);
}

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

/* Article Content */
.article-header {
  margin-bottom: var(--space-64);
}

.article-meta {
  display: flex;
  gap: var(--space-16);
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--space-24);
}

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

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

.article-content p, .article-content ul, .article-content ol {
  margin-bottom: var(--space-24);
  font-size: 1.1rem;
}

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

.article-content blockquote {
  border-left: 4px solid var(--color-accent);
  margin: var(--space-40) 0;
  padding: var(--space-16) var(--space-24);
  background: var(--color-surface);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  font-size: 1.2rem;
}

.featured-img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: var(--space-40);
  border: 1px solid var(--color-border);
}

.stat-block {
  display: flex;
  align-items: baseline;
  gap: var(--space-12);
  margin-bottom: var(--space-24);
}

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

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

/* 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.3);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text-main);
  font-family: var(--font-family);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

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

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

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

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

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

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

.map-block {
  width: 100%;
  height: 300px;
  background: repeating-linear-gradient(45deg, var(--color-surface), var(--color-surface) 10px, rgba(0,0,0,0) 10px, rgba(0,0,0,0) 20px);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: var(--space-24);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
}

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

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

th {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
  color: var(--color-text-main);
}

/* Footer */
.site-footer {
  margin-top: var(--space-64);
  padding: var(--space-64) 0 var(--space-40);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.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 {
  color: var(--color-text-main);
  margin-bottom: var(--space-16);
}

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

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

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

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

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

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(11, 15, 25, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--color-border);
  padding: var(--space-24);
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.4s ease;
  visibility: hidden;
}

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

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

.cookie-text {
  flex: 1 1 300px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0;
}

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

/* Responsive */
@media (max-width: 768px) {
  .site-header {
    height: 52px;
  }
  
  .nav-links {
    position: fixed;
    top: 52px;
    left: 0;
    width: 100%;
    height: calc(100vh - 52px);
    background: var(--color-bg);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-24);
    gap: var(--space-24);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
  }

  .nav-links.is-visible {
    transform: translateX(0);
  }

  .nav-links a {
    font-size: 1.25rem;
  }

  .header-cta {
    display: none;
  }

  .menu-toggle {
    display: block;
  }
  
  .hero {
    padding: var(--space-64) 0;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
}

@media (max-width: 399px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
  .cookie-actions {
    flex-direction: column;
    width: 100%;
  }
  .cookie-actions .btn {
    width: 100%;
  }
  .stat-block {
    flex-direction: column;
    gap: 0;
  }
}

@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;
  }
}