:root {
  /* Soft Modern Palette */
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-hover: #f1f5f9;
  --color-primary: #3182ce;
  --color-primary-hover: #2b6cb0;
  --color-text-main: #2d3748;
  --color-text-muted: #4a5568;
  --color-border: #e2e8f0;
  --color-error: #e53e3e;
  --color-error-bg: #fff5f5;
  
  /* Spacing Scale (4, 8, 16, 24, 40, 64px) */
  --space-4: 4px;
  --space-8: 8px;
  --space-16: 16px;
  --space-24: 24px;
  --space-40: 40px;
  --space-64: 64px;
  
  /* Typography */
  --font-sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  line-height: 1.6;
  min-width: 320px;
  overflow-x: hidden; /* Prevent body scrollbar, but layout uses reflow */
}

/* Ensure no elements cause horizontal scroll natively, without masking content */
.page-wrapper {
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6, .brand-name, .nav-link {
  overflow-wrap: anywhere;
  color: var(--color-text-main);
  line-height: 1.3;
}

h1 { font-size: 2.5rem; margin-bottom: var(--space-24); font-weight: 700; }
h2 { font-size: 2rem; margin-bottom: var(--space-24); font-weight: 600; }
h3 { font-size: 1.5rem; margin-bottom: var(--space-16); font-weight: 600; }
p { margin-bottom: var(--space-16); color: var(--color-text-muted); }
a { color: var(--color-primary); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--color-primary-hover); }

/* Accessibility Focus */
*:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}
input:focus-visible, textarea:focus-visible {
  outline-offset: 0;
}

/* Layout */
.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 var(--space-24);
  min-width: 0;
}

main {
  flex: 1;
}

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

.section-light {
  background-color: var(--color-surface);
}

/* Header */
.header {
  height: 64px;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  position: relative; /* Not sticky per instructions */
  z-index: 100;
}

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

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

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

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

.nav-link {
  color: var(--color-text-muted);
  font-weight: 500;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-24);
  background-color: var(--color-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn:hover {
  background-color: var(--color-primary-hover);
  color: #ffffff;
}

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

.btn-secondary:hover {
  background-color: var(--color-surface-hover);
  color: var(--color-text-main);
}

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

/* Mobile Nav Overlay */
.mobile-nav-overlay {
  position: fixed;
  top: 52px; /* Below mobile header */
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-surface);
  z-index: 90;
  padding: var(--space-24);
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-nav-overlay.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-overlay .nav-link {
  font-size: 1.25rem;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: var(--space-64) 0;
  background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
  border-radius: var(--radius-md);
  margin-top: var(--space-24);
  margin-bottom: var(--space-64);
}

.hero h1 {
  max-width: 800px;
  margin: 0 auto var(--space-24) auto;
}

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

/* Sub-page Hero */
.subpage-hero {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: var(--space-24);
  margin-bottom: var(--space-40);
  background-color: var(--color-border);
}

.subpage-hero img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  display: block;
}

.subpage-hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: var(--space-40) var(--space-24) var(--space-24);
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
  color: #ffffff;
}

.subpage-hero-content h1 {
  color: #ffffff;
  margin-bottom: var(--space-8);
}

.subpage-hero-content p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0;
}

/* Horizontal Split Card */
.card-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-40);
}

.card {
  display: flex;
  flex-direction: row;
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 0;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.card-media {
  flex: 0 0 45%;
  min-width: 0;
  position: relative;
}

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

.card-body {
  flex: 1;
  padding: var(--space-40) var(--space-24);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

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

.tag {
  background-color: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-sm);
  font-weight: 500;
}

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

.card-title a {
  color: var(--color-text-main);
}
.card-title a:hover {
  color: var(--color-primary);
}

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

.card-footer {
  margin-top: auto;
}

/* Content Article */
.article-content {
  max-width: 800px;
  margin: 0 auto var(--space-64);
}

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

.article-content h3 {
  margin-top: var(--space-24);
}

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

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

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-24);
  background-color: var(--color-surface);
  padding: var(--space-24);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-40);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 12px; /* 12px between stat and label per constraints */
}

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

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

/* Contact Form */
.form-wrapper {
  max-width: 600px;
  background-color: var(--color-surface);
  padding: var(--space-40) var(--space-24);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-64);
}

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

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

.form-control {
  width: 100%;
  padding: 12px var(--space-16);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-text-main);
  background-color: var(--color-bg);
  transition: border-color 0.2s ease;
}

.form-control:focus {
  border-color: var(--color-primary);
}

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

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

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

/* Static Map Block */
.static-map {
  width: 100%;
  height: 300px;
  background-color: #e2e8f0;
  background-image: 
    linear-gradient(rgba(255,255,255,0.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.4) 1px, transparent 1px);
  background-size: 20px 20px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin-bottom: var(--space-24);
}

.static-map-pin {
  width: 40px;
  height: 40px;
  fill: var(--color-primary);
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
  transform: translateY(-10px);
}

/* Footer */
.footer {
  background-color: #1a202c;
  color: #a0aec0;
  padding: var(--space-64) 0 var(--space-40);
  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);
}

.footer-col h4 {
  color: #ffffff;
  margin-bottom: var(--space-16);
  font-size: 1.125rem;
}

.footer-col p {
  color: #a0aec0;
  margin-bottom: var(--space-8);
}

.footer-col a {
  color: #a0aec0;
  display: block;
  margin-bottom: var(--space-8);
}

.footer-col a:hover {
  color: #ffffff;
}

.footer-bottom {
  border-top: 1px solid #2d3748;
  padding-top: var(--space-24);
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  align-items: center;
  text-align: center;
  font-size: 0.875rem;
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--color-border);
  padding: var(--space-24);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.05);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  align-items: center;
}

/* [hidden] is used for state per constraints */
.cookie-banner[hidden] {
  display: none !important;
}

.cookie-content {
  text-align: center;
  max-width: 800px;
}

.cookie-content p {
  margin-bottom: 0;
  font-size: 0.875rem;
}

.cookie-actions {
  display: flex;
  gap: var(--space-16);
  flex-wrap: wrap;
  justify-content: center;
}

/* Info Blocks */
.info-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-40);
}

.info-block {
  background-color: var(--color-surface);
  padding: var(--space-40) var(--space-24);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.info-block h3 {
  margin-bottom: var(--space-16);
}

/* Legal Pages */
.legal-content {
  background-color: var(--color-surface);
  padding: var(--space-40);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-64);
}

.legal-content h2 {
  margin-top: var(--space-40);
  margin-bottom: var(--space-16);
}

.table-wrapper {
  overflow-x: auto;
  margin-bottom: var(--space-24);
}

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

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

th {
  background-color: var(--color-bg);
  font-weight: 600;
}

/* Media Queries */
@media (max-width: 767px) {
  .header {
    height: 52px;
  }
  
  .nav-desktop, .btn-desktop {
    display: none;
  }
  
  .hamburger {
    display: block;
  }

  .card {
    flex-direction: column;
  }

  .card-media {
    flex: 0 0 auto;
    height: 250px;
  }
  
  .card-media img {
    position: relative;
    height: 250px;
  }

  .cookie-banner {
    padding: var(--space-16);
  }
  
  .cookie-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .cookie-actions button {
    width: 100%;
  }
  
  .legal-content {
    padding: var(--space-24) var(--space-16);
  }
}

@media (max-width: 399px) {
  .hero h1 {
    font-size: 1.75rem;
  }
  
  .card-body {
    padding: var(--space-24) var(--space-16);
  }
  
  .section {
    padding: var(--space-40) 0;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Motion Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}