/* === SorglosVorsorgen — Base Reset & Design Tokens === */

/* --- CSS Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* --- Design Tokens --- */
:root {
  /* Colors — Primary Teal */
  --color-primary: #0B7A78;
  --color-primary-hover: #096563;
  --color-primary-active: #074F4D;
  --color-primary-light: #E6F5F5;
  --color-primary-lighter: #F0FAF9;

  /* Colors — Accent Gold */
  --color-accent: #D4A853;
  --color-accent-light: #FFF8E7;

  /* Colors — Success */
  --color-success: #2D7A3A;

  /* Colors — Text */
  --color-text: #1A1A1A;
  --color-text-body: #3D3D3D;
  --color-text-muted: #6B6B6B;
  --color-text-white: #FFFFFF;

  /* Colors — Backgrounds */
  --color-bg: #FFFFFF;
  --color-bg-alt: #F8F7F4;
  --color-bg-dark: #1A1A1A;

  /* Colors — Borders & Shadows */
  --color-border: #E5E5E5;
  --color-border-light: #F0F0F0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);

  /* Typography — Scale (fluid) */
  --text-xs: clamp(0.75rem, 0.7rem + 0.15vw, 0.8125rem);    /* 12-13px */
  --text-sm: clamp(0.8125rem, 0.775rem + 0.2vw, 0.9375rem);  /* 13-15px */
  --text-base: clamp(0.9375rem, 0.9rem + 0.2vw, 1.0625rem);  /* 15-17px */
  --text-lg: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);        /* 17-20px */
  --text-xl: clamp(1.25rem, 1.1rem + 0.6vw, 1.75rem);        /* 20-28px */
  --text-2xl: clamp(1.5rem, 1.2rem + 1.2vw, 2.5rem);         /* 24-40px */
  --text-3xl: clamp(2rem, 1.5rem + 2vw, 3.5rem);             /* 32-56px */
  --text-hero: clamp(2.5rem, 1.8rem + 3vw, 4.5rem);          /* 40-72px */

  /* Typography — Families */
  --font-display: 'Cabinet Grotesk', 'General Sans', system-ui, -apple-system, sans-serif;
  --font-body: 'Satoshi', 'General Sans', system-ui, -apple-system, sans-serif;

  /* Typography — Weights */
  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;

  /* Spacing */
  --space-1: 0.25rem;    /* 4px */
  --space-2: 0.5rem;     /* 8px */
  --space-3: 0.75rem;    /* 12px */
  --space-4: 1rem;       /* 16px */
  --space-5: 1.25rem;    /* 20px */
  --space-6: 1.5rem;     /* 24px */
  --space-8: 2rem;       /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */
  --space-20: 5rem;      /* 80px */
  --space-24: 6rem;      /* 96px */
  --space-32: 8rem;      /* 128px */

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Layout */
  --max-width: 1200px;
  --max-width-narrow: 800px;
  --max-width-wide: 1400px;
  --section-padding: clamp(var(--space-12), 8vw, var(--space-24));
  --container-padding: clamp(var(--space-4), 5vw, var(--space-8));

  /* Header */
  --header-height: 96px;
}

/* --- Base Styles --- */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  color: var(--color-text-body);
  background-color: var(--color-bg);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  color: var(--color-text);
  line-height: 1.15;
}

/* --- Utility: Container --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

.container--wide {
  max-width: var(--max-width-wide);
}

/* --- Utility: Section Spacing --- */
.section {
  padding-block: var(--section-padding);
}

/* --- Scroll-driven Reveal Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  animation: fadeInUp var(--duration-slow) var(--ease-out) forwards;
  animation-play-state: paused;
}

.reveal.is-visible {
  animation-play-state: running;
}

/* Staggered children */
.reveal-stagger > * {
  opacity: 0;
  animation: fadeInUp var(--duration-slow) var(--ease-out) forwards;
  animation-play-state: paused;
}

.reveal-stagger.is-visible > *:nth-child(1) { animation-play-state: running; animation-delay: 0ms; }
.reveal-stagger.is-visible > *:nth-child(2) { animation-play-state: running; animation-delay: 100ms; }
.reveal-stagger.is-visible > *:nth-child(3) { animation-play-state: running; animation-delay: 200ms; }
.reveal-stagger.is-visible > *:nth-child(4) { animation-play-state: running; animation-delay: 300ms; }

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-stagger > * {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* --- Focus Visible --- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* --- Skip Link --- */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: var(--color-text-white);
  padding: var(--space-2) var(--space-4);
  z-index: 100;
  transition: top var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
  top: 0;
}
