/* Reset, Typografie, Animationen, Barrierefreiheits-Hilfen. Keine Farbwerte, nur Tokens. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.5;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  min-width: 0;
}

[hidden] {
  display: none !important;
}

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

h1,
h2,
h3,
h4,
p,
ul,
ol,
pre {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--c-white);
}

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

a {
  color: var(--c-accent-light);
}

a:hover {
  color: var(--c-white);
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

code,
pre,
kbd {
  font-family: var(--font-mono);
}

/* Sichtbarer Fokus */
:focus-visible {
  outline: 2px solid var(--c-accent-light);
  outline-offset: 3px;
}

main:focus {
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -80px;
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--c-white);
  color: var(--c-navy);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-3);
  color: var(--c-navy);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* ---------- Keyframes ---------- */
@keyframes av-up {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes av-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@keyframes av-pulse {
  0% {
    box-shadow: 0 0 0 0 var(--pulse-from);
  }
  100% {
    box-shadow: 0 0 0 9px var(--pulse-to);
  }
}

@keyframes av-feed {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-50%);
  }
}

@keyframes av-grow {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

@keyframes av-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes av-glow {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.08);
  }
}

@keyframes av-caret {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

@keyframes av-pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.25);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes av-shine {
  from {
    transform: translateX(-120%) skewX(-20deg);
  }
  to {
    transform: translateX(320%) skewX(-20deg);
  }
}

@keyframes av-slide {
  from {
    opacity: 0;
    transform: translateX(-14px);
    background-color: var(--c-teal-deep);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.anim-in {
  /* "backwards" statt "both": nach dem Ende gilt wieder der normale Stil, damit Hover-Transforms greifen. */
  animation: av-up 0.9s var(--ease) backwards;
}
.anim-d1 {
  animation-delay: 0.12s;
}
.anim-d2 {
  animation-delay: 0.24s;
}
.anim-d3 {
  animation-delay: 0.36s;
}
.anim-d4 {
  animation-delay: 0.5s;
}
.anim-float {
  animation: av-float 7s ease-in-out infinite;
}
.anim-pulse {
  animation: av-pulse 1.6s ease-out infinite;
}
.anim-feed {
  animation: av-feed 22s linear infinite;
}
.anim-bar {
  transform-origin: bottom;
  animation: av-grow 1.2s var(--ease) backwards;
}
.anim-marquee {
  animation: av-marquee 40s linear infinite;
}
.anim-glow {
  animation: av-glow 6s ease-in-out infinite;
}
.anim-caret {
  animation: av-caret 1s step-end infinite;
}
.anim-pop {
  animation: av-pop 0.5s var(--ease);
}
.anim-slide {
  animation: av-slide 0.6s var(--ease);
}

/* Scroll-Reveal (IntersectionObserver, siehe src/scripts/reveal.mjs).
   Nur aktiv, wenn JavaScript die Klasse "js" gesetzt hat. */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Bewegungsreduktion: alle Animationen und Uebergaenge aus. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
