:root {
  /* Soft Modern Aesthetic */
  --bg: #f8fafc;
  --surface: #ffffff;
  --text-main: #0f172a;
  --text-muted: #475569;
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #e0e7ff;
  --border: #e2e8f0;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 32px rgba(99, 102, 241, 0.08);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Layout Spacing (4, 8, 16, 24, 40, 64px) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 40px;
  --space-6: 64px;
}

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

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); font-weight: 600; }

p, li {
  color: var(--text-muted);
}

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

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

/* Focus Accessibility */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: var(--space-1);
}

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

main {
  flex: 1;
  padding: var(--space-6) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  min-width: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
}

/* 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(--border);
  height: 64px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 100;
}

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

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

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

.nav-menu {
  display: flex;
  gap: var(--space-4);
  list-style: none;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}

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

.nav-cta {
  background-color: var(--primary);
  color: #ffffff;
  padding: var(--space-2) var(--space-3);
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

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

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  color: var(--text-main);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: var(--space-6) 0;
  background: linear-gradient(135deg, var(--surface) 0%, var(--primary-light) 100%);
  border-radius: var(--radius-lg);
  margin-top: var(--space-4);
  box-shadow: var(--shadow-md);
}

.hero h1 {
  margin-bottom: var(--space-4);
  color: var(--text-main);
}

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

/* Card Style: Horizontal Split */
.card-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-width: 0;
}

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

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

.card-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 0;
}

.card-content {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-4);
  flex: 1;
  min-width: 0;
}

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

.tag {
  background-color: var(--primary-light);
  color: var(--primary-hover);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-title {
  margin-bottom: var(--space-2);
}

.card-excerpt {
  margin-bottom: var(--space-4);
}

/* Standard Content Pages */
.page-header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.article-content {
  background-color: var(--surface);
  padding: var(--space-6);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  max-width: 800px;
  margin: 0 auto;
}

.article-content h2 {
  margin: var(--space-5) 0 var(--space-4);
}

.article-content h3 {
  margin: var(--space-4) 0 var(--space-3);
}

.article-content p {
  margin-bottom: var(--space-4);
  font-size: 1.0625rem;
}

.article-content ul {
  margin-bottom: var(--space-4);
  padding-left: var(--space-4);
}

.article-content li {
  margin-bottom: var(--space-2);
  font-size: 1.0625rem;
}

/* Data Table */
.table-wrapper {
  overflow-x: auto;
  margin: var(--space-5) 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

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

th, td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}

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

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

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--text-main);
}

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

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.btn {
  display: inline-block;
  background-color: var(--primary);
  color: #ffffff;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.2s ease;
}

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

.form-message {
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  margin-top: var(--space-4);
  display: none;
}

.form-message.is-visible {
  display: block;
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #34d399;
}

.is-invalid {
  border-color: #ef4444 !important;
}

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

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

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

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

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

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: var(--space-4);
  left: var(--space-4);
  right: var(--space-4);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-md);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 800px;
  margin: 0 auto;
}

.cookie-banner[hidden] {
  display: none;
}

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

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

.btn-outline:hover {
  background-color: var(--bg);
  color: var(--text-main);
}

/* Map Block (Static Styled) */
.map-block {
  width: 100%;
  height: 300px;
  background: var(--bg) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="%23f8fafc"/><path d="M10 10 h80 v80 h-80 z" fill="none" stroke="%23e2e8f0" stroke-width="2"/><circle cx="50" cy="50" r="4" fill="%236366f1"/></svg>') center/cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-5);
}

/* Media Queries */
@media (min-width: 768px) {
  .site-header {
    height: 64px;
  }
  
  .card {
    flex-direction: row;
  }
  
  .card-media {
    width: 40%;
    aspect-ratio: auto;
    min-height: 100%;
  }
  
  .card-content {
    width: 60%;
  }

  .cookie-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (max-width: 767px) {
  .site-header {
    height: 52px;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .nav-menu {
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    background-color: var(--surface);
    flex-direction: column;
    padding: var(--space-4);
    gap: var(--space-4);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    display: none;
  }
  
  .nav-menu.is-visible {
    display: flex;
  }
  
  .nav-cta {
    display: none;
  }

  .article-content {
    padding: var(--space-4);
  }
}

@media (max-width: 399px) {
  .hero h1 {
    font-size: 1.75rem;
  }
  
  .card-content {
    padding: var(--space-4);
  }
}

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