:root {
  /* Soft Modern Aesthetic Scale & Colors */
  --color-bg: #f8fbff;
  --color-surface: #ffffff;
  --color-text-main: #1e293b;
  --color-text-muted: #475569;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-accent: #38bdf8;
  --color-border: #e2e8f0;
  
  /* 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;
  
  /* Radii & Shadows for Soft Modern */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-micro: 0 4px 20px rgba(15, 23, 42, 0.05);
  --shadow-hover: 0 12px 32px rgba(15, 23, 42, 0.08);
  
  /* Typography */
  --font-stack: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  min-width: 0; /* Ensures flex/grid children can shrink below content width */
}

body {
  font-family: var(--font-stack);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

a:hover {
  color: var(--color-primary-hover);
}

:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

button, .button {
  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;
}

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

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

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

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

.header-inner {
  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;
}

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

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

.nav-desktop a:hover {
  color: var(--color-primary);
}

.header-cta {
  display: flex;
  align-items: center;
  gap: var(--space-16);
}

.nav-mobile-toggle {
  display: none;
  background: transparent;
  color: var(--color-text-main);
  padding: var(--space-4);
}

/* Mobile Nav Overlay */
.nav-mobile-overlay {
  display: none;
  position: absolute;
  top: 52px;
  left: 0;
  width: 100%;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-micro);
  padding: var(--space-24);
  flex-direction: column;
  gap: var(--space-16);
  z-index: 100;
}

.nav-mobile-overlay.is-open {
  display: flex;
}

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

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: var(--space-24);
  color: var(--color-text-main);
}

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

/* Cards (Horizontal Split style) */
.card-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-40);
  margin-bottom: var(--space-64);
}

.card {
  display: flex;
  flex-direction: row;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-micro);
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  border: 1px solid rgba(226, 232, 240, 0.5);
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card-media {
  width: 40%;
  flex-shrink: 0;
  position: relative;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-content {
  padding: var(--space-40);
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-grow: 1;
}

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

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

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

.card-desc {
  color: var(--color-text-muted);
  margin-bottom: var(--space-24);
}

.card-cta {
  align-self: flex-start;
  font-weight: 600;
  text-decoration: none;
}

.card-cta::after {
  content: " →";
}

/* Content Pages */
.page-header {
  padding: var(--space-64) 0 var(--space-40);
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.page-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: var(--space-24);
}

.content-wrapper {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-micro);
  padding: var(--space-64);
  max-width: 800px;
  margin: 0 auto var(--space-64);
}

.content-wrapper h2 {
  margin: var(--space-40) 0 var(--space-16);
  font-size: 1.75rem;
}

.content-wrapper h3 {
  margin: var(--space-24) 0 var(--space-16);
  font-size: 1.25rem;
}

.content-wrapper p, .content-wrapper ul {
  margin-bottom: var(--space-24);
  color: var(--color-text-muted);
  font-size: 1.05rem;
}

.content-wrapper ul {
  padding-left: var(--space-24);
}

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

.stat-block {
  display: flex;
  align-items: baseline;
  gap: 12px; /* strict rule */
  margin-bottom: var(--space-16);
  background: var(--color-bg);
  padding: var(--space-16);
  border-radius: var(--radius-sm);
}

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

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

/* Table */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-bottom: var(--space-24);
}

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

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

th {
  background-color: var(--color-bg);
  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-16);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  background-color: var(--color-bg);
  color: var(--color-text-main);
  transition: border-color 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

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

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

.map-block {
  width: 100%;
  height: 300px;
  background-color: var(--color-bg);
  background-image: linear-gradient(var(--color-border) 1px, transparent 1px),
                    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: 20px 20px;
  border-radius: var(--radius-md);
  margin-top: var(--space-40);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  position: relative;
}

.map-pin {
  width: 32px;
  height: 32px;
  fill: var(--color-primary);
}

/* Footer */
.site-footer {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  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);
}

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

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

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

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

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

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

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-24);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  transform: translateY(0);
  transition: transform 0.3s ease;
}

.cookie-banner.is-hidden {
  transform: translateY(100%);
  visibility: hidden;
}

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

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

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

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

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

/* Breakpoints */
@media (max-width: 768px) {
  .site-header {
    height: 52px;
  }
  
  .nav-desktop {
    display: none;
  }
  
  .nav-mobile-toggle {
    display: block;
  }
  
  .card {
    flex-direction: column;
  }
  
  .card-media {
    width: 100%;
    height: 250px;
  }
  
  .card-content {
    padding: var(--space-24);
  }
  
  .content-wrapper {
    padding: var(--space-24);
  }
}

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