/* ============================================================================
   BASE — reset, typografi-roller, layout-fundament
   Kræver tokens.css indlæst FØR denne fil. Hardcode aldrig — brug var(--*).
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
/* hidden-attributten skal altid vinde over display fra klasser (fx .btn) */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  line-height: var(--lh-normal);
  color: var(--c-ink);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }
img { font-style: italic; background-size: cover; }

input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }

/* ---- TYPOGRAFI-ROLLER (tynd, elegant profil) ---------------------------- */
h1, h2, h3, h4 { color: var(--c-ink-strong); letter-spacing: var(--ls-tight); }
h1 { font-size: var(--fs-h1); font-weight: var(--fw-h1); line-height: var(--lh-snug); }
h2 { font-size: var(--fs-h2); font-weight: var(--fw-h2); line-height: var(--lh-snug); }
h3 { font-size: var(--fs-h3); font-weight: var(--fw-h3); line-height: var(--lh-snug); letter-spacing: var(--ls-normal); }
h4 { font-size: var(--fs-h4); font-weight: var(--fw-h4); line-height: var(--lh-snug); letter-spacing: var(--ls-normal); }

.u-display {
  font-size: var(--fs-display);
  font-weight: var(--fw-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--c-ink-strong);
}

.lead {
  font-size: var(--fs-lead);
  font-weight: var(--fw-lead);
  line-height: var(--lh-normal);
  color: var(--c-ink);
}

.eyebrow {
  display: inline-block;
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-eyebrow);
  text-transform: uppercase;
  letter-spacing: var(--ls-eyebrow);
  color: var(--c-accent);
}

.small, small { font-size: var(--fs-small); }
.muted { color: var(--c-ink-soft); }
.faint { color: var(--c-ink-faint); }
.accent { color: var(--c-accent); }
strong, b { font-weight: var(--fw-medium); }

p { max-width: var(--maxw-text); }
p + p { margin-top: var(--sp-4); }

/* ---- LAYOUT ------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: var(--maxw-narrow); }
.measure { max-width: var(--maxw-text); }
.measure-wide { max-width: 52ch; }

.section { padding-block: var(--section-y); position: relative; }
/* Alle sektioner (undt. hero): 20px mindre luft i top og bund */
.section:not(.hero) { padding-block: calc(var(--section-y) - 20px); }
/* Waved sektioner: kompensér for bølgen i bunden, så indhold står lodret centreret over den */
.section:not(.hero):has(> .wave) { padding-bottom: calc(var(--section-y) - 20px + clamp(38px, 6vw, 84px)); }
.section--tight { padding-block: calc(var(--section-y) * 0.62); }
section[id], [id].section, [data-anchor] { scroll-margin-top: clamp(74px, 8vh, 96px); }

/* Bløde sektions-baggrunde (baggrund vandrer creme → sand → creme) */
.bg-cream { background: var(--c-bg); }
.bg-soft  { background: var(--c-bg-soft); }
.bg-sand  { background: var(--c-bg-deep); }

/* Stable utilities */
.stack > * + * { margin-top: var(--sp-4); }
.stack-sm > * + * { margin-top: var(--sp-2); }
.stack-lg > * + * { margin-top: var(--sp-6); }
.center { text-align: center; }
.center-x { margin-inline: auto; }

/* ---- A11Y --------------------------------------------------------------- */
.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;
}
:focus-visible {
  outline: 3px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: 3px;
}
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute; left: var(--sp-4); top: -100px;
  background: var(--c-ink); color: var(--c-cream-0);
  padding: var(--sp-3) var(--sp-5); border-radius: var(--r-pill);
  z-index: var(--z-modal); transition: top var(--dur-fast) var(--ease-soft);
}
.skip-link:focus { top: var(--sp-4); }

::selection { background: var(--c-accent-soft); color: var(--c-ink-strong); }
