/* ==========================================================================
   Base — reset and element defaults.
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchor targets clear the fixed header */
  scroll-padding-top: 5.5rem;
  /*
     `clip` rather than `hidden`, and on <html> rather than <body>: `hidden`
     propagates to the viewport, which makes position:fixed elements size to
     the full window instead of the content box — the header then overhangs
     by the scrollbar width.
  */
  overflow-x: clip;
}

body {
  background-color: var(--c-cream);
  color: var(--c-ink-soft);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/*
   Locks scrolling while the mobile menu or checkout modal is open. The
   scrolling element on this page is <html>, not <body> — without this,
   overflow:hidden on body alone leaves the page scrollable underneath.
*/
body[data-scroll-locked] {
  overflow: hidden;
}

html:has(body[data-scroll-locked]) {
  /* clip, not hidden — hidden still permits a programmatic scrollTop nudge */
  overflow: clip;
}

h1,
h2,
h3,
h4 {
  color: var(--c-ink);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  text-wrap: balance;
  /*
     Deutsche Komposita sind länger als jede Spalte auf einem 320-px-Telefon.
     `hyphens: auto` greift auf die Silbentrennung zurück, die <html lang="de">
     mitbringt, und trennt erst, wenn die Zeile sonst nicht reicht; für Wörter
     ohne Trennstelle fängt `overflow-wrap` den Rest ab.

     Ohne beides lief "Datenschutzerklärung" auf /datenschutz/ um 93 px über
     den rechten Rand hinaus und wurde dort von `overflow-x: clip` am <html>
     wortlos abgeschnitten — die Überschrift der Seite war nicht zu Ende
     lesbar.
  */
  hyphens: auto;
  overflow-wrap: break-word;
}

p {
  text-wrap: pretty;
}

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

img {
  height: auto;
}

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

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

ul,
ol {
  list-style: none;
  padding: 0;
}

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

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

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--sp-4);
  left: var(--sp-4);
  z-index: var(--z-overlay);
  padding: 0.7rem 1.2rem;
  border-radius: var(--r-pill);
  background: var(--c-ink);
  color: var(--c-cream);
  font-size: var(--fs-meta);
  transform: translateY(-200%);
  transition: transform var(--dur-fast) var(--ease-out);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
