/* ==========================================================================
   base.css – Site-Tokens, Reset, Typo, Layout, Barrierefreiheit
   Die Marken-Tokens (Farben, Schriften) kommen aus assets/brand/tokens.css
   und werden hier nicht verändert, nur ergänzt.
   ========================================================================== */

:root {
  /* Comic-Rahmen und Schatten der Website (Panels sind kräftiger als die App) */
  --line:          3px solid var(--ink);
  --line-strong:   4px solid var(--ink);
  --drop:          6px 6px 0 var(--ink);
  --drop-sm:       4px 4px 0 var(--ink);
  --drop-lg:       10px 10px 0 var(--ink);

  --radius-sm:     10px;
  --radius-md:     14px;
  --radius-lg:     18px;
  --radius-pill:   999px;

  /* Abstände im 4/8-Raster */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;  --s-5: 24px;
  --s-6: 32px; --s-7: 40px; --s-8: 56px; --s-9: 72px;  --s-10: 96px;

  --container: 1240px;
  --gutter: clamp(16px, 4vw, 24px);
  --header-h: 80px;

  /* Typo-Skala */
  --fs-body:    18px;
  --fs-small:   17px;   /* untere Grenze für Fliesstext */
  --fs-lead:    clamp(19px, 1.6vw, 21px);
  --fs-h3:      clamp(22px, 2vw, 25px);
  --fs-h2:      clamp(34px, 4.5vw, 56px);
  --fs-display: clamp(46px, 7vw, 96px);
  --fs-bang:    clamp(28px, 3vw, 34px);

  /* Bewegung: nur transform/opacity, siehe components.css */
  --ease-pop:   cubic-bezier(.34, 1.56, .64, 1);
  --ease-out:   cubic-bezier(.22, 1, .36, 1);
  --t-press:    .12s;
  --t-pop:      .5s;

  /* Fokus: dunkler Ring; auf dunklen Flächen gelb (setzt .on-ink) */
  --focus-color: var(--ink);
}

/* ---- Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
template { display: none; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---- Grundtypo --------------------------------------------------------- */
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  text-wrap: balance;
}
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.15; }
p  { text-wrap: pretty; }
strong, b { font-weight: 800; }

a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--hemp-dark); }
.on-ink a:hover { color: var(--sun); }

/* ---- Fokus & Barrierefreiheit ----------------------------------------- */
:focus-visible {
  outline: 3px solid var(--focus-color);
  outline-offset: 4px;
  border-radius: 4px;
}
.on-ink { --focus-color: var(--sun); }

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: 100;
  background: var(--sun);
  border: var(--line);
  border-radius: var(--radius-sm);
  padding: var(--s-2) var(--s-4);
  font-weight: 800;
  text-decoration: none;
}
.skip-link:focus { top: var(--s-4); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  text-shadow: none;
  -webkit-text-stroke: 0;
}

/* ---- Layout ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section       { padding-block: var(--s-10); }
.section--tight{ padding-block: var(--s-8); }
.stack > * + * { margin-top: var(--stack, var(--s-5)); }

/* Der Kopf ist fixiert: sein Wrapper hält den Platz frei (Höhe + 4px Rand),
   auch solange cms.js ihn noch einsetzt. Kein Layout-Sprung. */
[data-include="nav"]          { min-height: calc(var(--header-h) + 4px); }
[data-include="footer"]:empty { min-height: 160px; background: var(--ink); }

/* ---- Bewegung reduzieren: alles statisch ------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
