/* ===================================================================
   BASE — reset, fonts, foundational typography
   =================================================================== */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/Archivo-Variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMono-Variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
/* NOTE: html/body deliberately do NOT set overflow-x: hidden.
   That rule was here for the full-bleed chapter block, but it turns
   both elements into scroll containers (overflow-y resolves to auto),
   which silently defeats every position: sticky on the site — the
   pinned gallery stack among them. The chapter block no longer needs
   it: initFullBleed() measures and sets its exact margins, so it
   bleeds to the viewport edges without overflowing. */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: var(--leading-body);
  font-weight: var(--w-regular);
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--dur-mid) var(--ease-in-out), color var(--dur-mid) var(--ease-in-out);
}

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

a { color: inherit; text-decoration: none; }
/* kein blaues Aufblitzen beim Antippen von Links und Knöpfen (Telefon) */
a, button { -webkit-tap-highlight-color: transparent; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--w-bold);
  font-stretch: var(--width-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  margin: 0;
}

p { margin: 0; }
p, li, dd, dt { font-weight: var(--w-regular); }
strong, b { font-weight: var(--w-bold); }

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--space-s);
  top: -3rem;
  background: var(--black);
  color: var(--white);
  font-weight: var(--w-semibold);
  padding: var(--space-2xs) var(--space-s);
  z-index: 200;
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: var(--space-s); }

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

/* Selection highlight is the true colour-wheel complement of whatever
   the page ground is (was a flat red everywhere). These complement
   hues exist only in this transient state — they are not part of the
   brand palette and never paint anything permanent. */
::selection {
  background: var(--black);
  color: var(--white);
}
[data-theme="orange"] ::selection { background: #1bacff; color: var(--black); }
[data-theme="pink"]   ::selection { background: #3efe96; color: var(--black); }

[data-theme="cream"]  ::selection { background: var(--black); color: var(--cream); }

input, textarea {
  caret-color: var(--fg);
}

.wrap {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- shared char-rise reveal for any [data-anim="wordmark"] heading ---------- */
/* gap is load-bearing: the space between .word spans is a plain text
   node, which collapses to zero width once two words land on the same
   flex line — gap keeps them visually separated regardless. */
[data-anim="wordmark"] { display: flex; flex-wrap: wrap; gap: 0 0.28em; }
[data-anim="wordmark"] .word {
  display: inline-flex;
  overflow: hidden;
  padding-bottom: 0.1em;
}
[data-anim="wordmark"] .char {
  display: inline-block;
  transform: translateY(112%) rotate(4deg);
  opacity: 0;
  animation: char-rise 1.1s var(--ease-out) forwards;
  animation-delay: calc(var(--i, 0) * 32ms + 120ms);
}
@keyframes char-rise {
  to { transform: translateY(0) rotate(0deg); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  [data-anim="wordmark"] .char { animation: none; opacity: 1; transform: none; }
}
