:root {
  /* Soft Modern Aesthetic Scale */
  --color-bg: #f9fafb;
  --color-surface: #ffffff;
  --color-text-main: #1f2937;
  --color-text-muted: #4b5563;
  --color-text-light: #9ca3af;
  --color-accent: #6366f1;
  --color-accent-hover: #4f46e5;
  --color-accent-soft: #e0e7ff;
  --color-accent-surface: #f5f3ff;
  --color-border: #e5e7eb;
  --color-error: #ef4444;
  
  /* Spacing Scale */
  --sp-4: 4px;
  --sp-8: 8px;
  --sp-12: 12px;
  --sp-16: 16px;
  --sp-24: 24px;
  --sp-40: 40px;
  --sp-64: 64px;
  
  /* Radii */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.06);
}

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

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--color-text-main);
  background-color: var(--color-bg);
  scroll-behavior: smooth;
}

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

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

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: var(--sp-16);
  line-height: 1.2;
  color: var(--color-text-main);
  overflow-wrap: anywhere;
}

p, ul, ol, dl, table, pre {
  margin-top: 0;
  margin-bottom: var(--sp-16);
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease;
  overflow-wrap: anywhere;
}

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

/* Accessibility */
*:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

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

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

main {
  flex: 1;
}

/* Typography Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-small { font-size: 0.875rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-12) var(--sp-24);
  border-radius: var(--radius-sm);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
  text-decoration: none;
  font-size: 1rem;
}

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

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

.btn-outline {
  background-color: transparent;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
}

.btn-outline:hover {
  background-color: var(--color-accent-soft);
  color: var(--color-accent-hover);
}

/* Header */
.site-header {
  height: 64px;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: relative;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 var(--sp-24);
}

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

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

.nav-desktop {
  display: none;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: var(--sp-24);
}

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

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

.header-cta {
  display: none;
}

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

.menu-toggle svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* Mobile Nav Overlay */
.nav-mobile {
  display: none;
  position: absolute;
  top: 64px;
  left: 0;
  width: 100%;
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: var(--sp-24);
  box-shadow: var(--shadow-sm);
}

.nav-mobile.is-visible {
  display: block;
}

.nav-mobile .nav-list {
  flex-direction: column;
  gap: var(--sp-16);
}

/* Responsive Header adjustments */
@media (max-width: 767px) {
  .site-header {
    height: 52px;
  }
  .nav-mobile {
    top: 52px;
  }
}

@media (min-width: 768px) {
  .menu-toggle { display: none; }
  .nav-desktop { display: block; }
  .header-cta { display: block; }
}

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

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

/* Hero Section */
.hero {
  padding: var(--sp-64) 0;
  text-align: center;
  background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-accent-soft) 100%);
}

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

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

/* Horizontal Split Cards (Soft Modern) */
.guides-grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-40);
  min-width: 0;
}

.card-horizontal {
  display: flex;
  flex-direction: column;
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 0;
  border: 1px solid rgba(0,0,0,0.02);
}

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

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

.card-media img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

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

.card-tag {
  display: inline-block;
  background-color: var(--color-accent-soft);
  color: var(--color-accent);
  padding: 4px var(--sp-12);
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: var(--sp-16);
  align-self: flex-start;
}

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

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

.card-cta {
  margin-top: auto;
  align-self: flex-start;
}

@media (min-width: 768px) {
  .card-horizontal {
    flex-direction: row;
  }
  .card-media {
    flex: 0 0 40%;
  }
  .card-media img {
    height: 100%;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  }
  .card-content {
    padding: var(--sp-40);
  }
}

/* Stats Block */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-24);
  margin-top: var(--sp-40);
  min-width: 0;
}

.stat-item {
  background-color: var(--color-surface);
  padding: var(--sp-24);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

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

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

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Article Content Layout */
.article-header {
  padding: var(--sp-64) 0 var(--sp-40);
  text-align: center;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.article-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  max-width: 800px;
  margin: 0 auto var(--sp-24);
}

.article-body {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--sp-64) var(--sp-24);
  font-size: 1.125rem;
}

.article-body h2 {
  font-size: 2rem;
  margin-top: var(--sp-40);
}

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

.article-body p {
  margin-bottom: var(--sp-24);
  color: var(--color-text-muted);
}

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

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

.article-image {
  margin: var(--sp-40) 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

/* Tables (for specs and policies) */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: var(--sp-24);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

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

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

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

/* Legal Pages */
.legal-content {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--sp-64) var(--sp-24);
}

.legal-content section {
  margin-bottom: var(--sp-40);
}

/* Contact Form */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-64);
  max-width: 1000px;
  margin: 0 auto;
  min-width: 0;
}

@media (min-width: 768px) {
  .contact-layout {
    grid-template-columns: 1fr 1fr;
  }
}

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

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

.form-control {
  width: 100%;
  padding: var(--sp-16);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  color: var(--color-text-main);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

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

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

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

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

.contact-info {
  background-color: var(--color-surface);
  padding: var(--sp-40);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.static-map {
  margin-top: var(--sp-24);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

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

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-40);
  margin-bottom: var(--sp-40);
  min-width: 0;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer-col h4 {
  font-size: 1.125rem;
  margin-bottom: var(--sp-16);
}

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

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

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

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

.footer-bottom {
  text-align: center;
  padding-top: var(--sp-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: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--color-border);
  padding: var(--sp-24);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
  z-index: 999;
  transform: translateY(0);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.cookie-banner[hidden] {
  display: block !important;
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.cookie-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-16);
  min-width: 0;
}

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

@media (min-width: 768px) {
  .cookie-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* Breakpoint for very small devices */
@media (max-width: 399px) {
  .container {
    padding: 0 var(--sp-16);
  }
  .card-content, .contact-info, .stat-item {
    padding: var(--sp-16);
  }
  .cookie-actions {
    flex-direction: column;
  }
  .cookie-actions button {
    width: 100%;
  }
}