/* ==========================================================================
   Base: Reset, Typografie, Layout-Utilities
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
img { font-style: italic; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--color-primary); text-decoration: none; transition: color var(--dur-fast) var(--ease); }
a:hover { color: var(--color-primary-hover); }
ul, ol { margin: 0; padding: 0; }
ul.list { padding-left: 1.25rem; margin: 0 0 var(--space-4); }
ul.list li { margin-bottom: var(--space-2); }
p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }
hr { border: 0; border-top: 1px solid var(--color-border); margin: var(--space-8) 0; }
strong, b { font-weight: 600; }
small { font-size: var(--text-sm); }
address { font-style: normal; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 3px solid rgba(29, 137, 228, 0.45); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgba(29, 137, 228, 0.2); }

/* Headings */
h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4 { margin: 0 0 var(--space-4); font-weight: 600; line-height: var(--leading-tight); color: var(--color-text); letter-spacing: -0.02em; text-wrap: balance; }
h1, .h1 { font-size: var(--text-5xl); font-weight: 600; letter-spacing: -0.03em; }
h2, .h2 { font-size: var(--text-4xl); }
h3, .h3 { font-size: var(--text-3xl); }
h4, .h4 { font-size: var(--text-xl); line-height: var(--leading-snug); letter-spacing: -0.01em; }
h5 { font-size: var(--text-lg); line-height: var(--leading-snug); letter-spacing: 0; }
.lead { font-size: var(--text-lg); line-height: var(--leading-relaxed); color: var(--color-text-muted); }
.eyebrow { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-primary); margin-bottom: var(--space-4); }
.eyebrow::before { content: ""; width: 24px; height: 2px; background: currentColor; border-radius: 2px; }
.text-muted { color: var(--color-text-muted); }
.text-light { color: var(--color-text-light); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.fw-600 { font-weight: 600; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: var(--font-mono); font-size: 0.9em; }
.prose p { margin-bottom: var(--space-4); }
.prose ul { padding-left: 1.25rem; margin-bottom: var(--space-4); }
.prose li { margin-bottom: var(--space-2); }
.prose h2 { font-size: var(--text-2xl); margin-top: var(--space-10); }
.prose h3 { font-size: var(--text-xl); margin-top: var(--space-8); }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }

/* Layout */
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.container-narrow { max-width: calc(var(--container-narrow) + 2 * var(--gutter)); }
.container-wide { max-width: calc(var(--container-wide) + 2 * var(--gutter)); }
.section { padding-block: var(--section-y); }
.section-sm { padding-block: var(--section-y-sm); }
.section-soft { background: var(--color-bg-soft); }
.section-muted { background: var(--color-bg-muted); }
.section-dark { background: var(--color-bg-dark); color: var(--color-text-on-dark); }
.section-dark h1, .section-dark h2, .section-dark h3, .section-dark h4 { color: #fff; }
.section-dark p, .section-dark .lead { color: var(--color-text-on-dark-muted); }
.section-dark .eyebrow { color: var(--blue-300); }
.section-head { max-width: 760px; margin-bottom: clamp(2rem, 4vw, 3.5rem); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head .lead { margin-bottom: 0; }
.section + .section:not(.section-soft):not(.section-dark):not(.section-muted) { padding-top: 0; }

.grid { display: grid; gap: var(--space-6); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.split-narrow { gap: clamp(1.5rem, 3vw, 2.5rem); }
.split.reverse > :first-child { order: 2; }
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .split { grid-template-columns: 1fr; } .split.reverse > :first-child { order: 0; } }

.stack > * + * { margin-top: var(--space-4); }
.stack-lg > * + * { margin-top: var(--space-8); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.cluster-between { justify-content: space-between; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-10 { margin-top: var(--space-10); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.w-full { width: 100%; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: -100px; left: 16px; background: var(--color-primary); color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); z-index: 1000; font-weight: 600; }
.skip-link:focus { top: 16px; color: #fff; }

/* Icons */
.icon { width: 1.25em; height: 1.25em; flex-shrink: 0; vertical-align: -0.25em; }
.icon-sm { width: 1em; height: 1em; }
.icon-lg { width: 1.6em; height: 1.6em; }

/* Reveal on scroll (progressive enhancement, no layout shift without JS) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease); }
.reveal.is-visible, .no-js .reveal { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }

/* Media aspect helpers (avoid CLS) */
.media { position: relative; overflow: hidden; border-radius: var(--radius-xl); background: var(--color-bg-muted); }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media-16-9 { aspect-ratio: 16 / 9; }
.media-4-3 { aspect-ratio: 4 / 3; }
.media-3-2 { aspect-ratio: 3 / 2; }
.media-square { aspect-ratio: 1; }
.media-shadow { box-shadow: var(--shadow-lg); }
