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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--ui);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3, .display {
  font-family: var(--display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.05;
  margin: 0;
}

.wrap { max-width: 78rem; margin: 0 auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(3.5rem, 9vw, 7rem); }
.section-title { font-size: clamp(2rem, 5vw, 3.25rem); margin-bottom: 1.5rem; }
.section-lead { max-width: 46rem; margin: 0 0 2.5rem; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--red); color: #fff; padding: 0.75rem 1rem;
}
.skip:focus { left: 0; }

:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

/* The sprite is a definitions block; never rendered directly. */
.logo-sprite { display: none; }

/* Every place the logo appears carries both of the designers' variants, and
   the theme shows one. It has to be done from outside like this: a <use>
   renders its symbol into a shadow tree that document CSS cannot select into,
   so the switch lives on the <use> elements themselves, which are ordinary
   markup. The custom properties are set per theme in tokens.css.

   The fallbacks matter: without them, a missing property would resolve to
   display's initial value and draw both variants on top of each other. With
   them, anything unexpected falls back to the positive logo alone. */
.logo-positive { display: var(--logo-positive, inline); }
.logo-negative { display: var(--logo-negative, none); }

/* Visually hidden but still available to assistive tech. */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ---- header ---- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1rem;
  height: var(--nav-h); padding-inline: var(--edge);
  background: var(--bg); border-bottom: 1px solid var(--rule);
}
.nav-brand {
  display: flex; align-items: center; gap: 0.6rem;
  text-decoration: none; font-family: var(--display);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  opacity: 0; transition: opacity 0.4s ease;
}
.nav-brand.is-visible { opacity: 1; }
.nav-brand svg { width: 2.1rem; height: 2.1rem; }

.nav-panel { display: flex; align-items: center; gap: 1.75rem; margin-left: auto; }
.nav-links { display: flex; gap: 1.75rem; }
.nav-links a {
  text-decoration: none; font-weight: 700; font-size: 0.95rem;
  text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 2px solid transparent; padding-bottom: 2px;
}
.nav-links a:hover { border-bottom-color: var(--red); }

.lang-toggle, .theme-toggle {
  background: transparent; color: inherit;
  border: 2px solid var(--red); border-radius: 2px;
  font: inherit; font-weight: 700; font-size: 0.85rem;
  min-width: 2.75rem; height: 2.75rem; padding-inline: 0.6rem;
  cursor: pointer;
}
.lang-toggle:hover, .theme-toggle:hover { background: var(--red); color: #fff; }

/* Without JS the toggle has nothing to do; hide it like .burger below. */
.lang-toggle { display: none; }
.js .lang-toggle { display: inline-block; }

.burger { display: none; }
.burger span { display: block; width: 100%; height: 2px; background: var(--fg); }

@media (max-width: 46rem) {
  .nav-brand span { display: none; }
  .js .burger {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 2.75rem; height: 2.75rem; padding: 0 0.6rem; margin-left: auto;
    background: transparent; border: 2px solid var(--red); border-radius: 2px;
    cursor: pointer;
  }
  .nav-panel {
    position: absolute; top: 100%; left: 0; right: 0;
    display: none; flex-direction: column; align-items: stretch; gap: 0;
    margin-left: 0; padding: 0.25rem var(--edge) 1.25rem;
    background: var(--bg); border-bottom: 3px solid var(--red);
  }
  .nav.is-open .nav-panel { display: flex; }
  .nav-links { flex-direction: column; gap: 0; }
  .nav-links a { padding-block: 0.9rem; border-bottom: 1px solid var(--rule); }
  .nav-toggles { display: flex; gap: 0.75rem; margin-top: 1.25rem; }
}

/* ---- footer ---- */
.footer {
  background: var(--surface);
  padding-block: clamp(3rem, 7vw, 5rem);
  font-size: 0.95rem;
}
.footer-title { font-size: 1.5rem; margin: 2.5rem 0 1rem; }
.footer-title:first-child { margin-top: 0; }
.impressum { display: grid; gap: 1.25rem; }
@media (min-width: 44rem) {
  .impressum { grid-template-columns: repeat(3, 1fr); }
}
.datenschutz p { max-width: 60rem; }

/* ---- buttons ---- */
.btn {
  display: inline-block; padding: 0.85rem 1.5rem;
  font-family: var(--display); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  text-decoration: none; border: 0; cursor: pointer; font-size: 1rem;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--fg); }
