/* ==========================================================
   Vogelquartierfest – Design-Tokens
   ========================================================== */
@font-face {
  font-family: "Oswald";
  src: url("../fonts/oswald-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Oswald";
  src: url("../fonts/oswald-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  /* Farben */
  --color-yellow: #efff5e;
  --color-pink: #d9376e;
  --color-mint: #d4f6e8;
  --color-navy: #032234;
  --color-violet: #6a12d8;   /* Laufband */
  --color-lilac: #9a80e6;    /* Ort / Footer */
  --color-white: #ffffff;

  /* Verlauf */
  --bg-base: #a48ae2;
  --bg-overlay: rgba(160, 128, 226, 0.55);

  /* Schriften */
  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-text: "Oswald", "Arial Narrow", sans-serif;
  --font-badge: "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* Grössen */
  --fs-date: clamp(2.5rem, 4.6vw, 6.5rem);
  --fs-h2: clamp(2.125rem, 4.2vw, 5.75rem);
  --fs-lead: clamp(1.375rem, 2.6vw, 3.5rem);
  --fs-text: clamp(1.25rem, 2.1vw, 2.75rem);
  --fs-small: clamp(0.875rem, 1vw, 1.25rem);

  /* Abstände */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;
  --space-8: 96px;
  --space-9: 128px;
  --gutter: clamp(20px, 4vw, 104px);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg-base);
  color: var(--color-yellow);
  font-family: var(--font-text);
  font-weight: 600;
  line-height: 1.2;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, p, figure { margin: 0; }

a { color: inherit; }
a:focus-visible {
  outline: 3px solid var(--color-navy);
  outline-offset: 3px;
}

/* ==========================================================
   Animierter Hintergrund
   ========================================================== */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--bg-base);
}
/* eigener Verlauf im Infobereich, damit er den stehenden Header überdeckt */
.bg--local {
  position: absolute;
  z-index: -1;
}
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg-overlay);
}
.bg__blob {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  filter: blur(8vmax);
  opacity: 0.9;
  will-change: transform;
}
.bg__blob--1 { background: #c98ae8; top: -30vmax; left: -15vmax; animation: drift1 22s ease-in-out infinite alternate; }
.bg__blob--2 { background: #eeeab8; top: 10vmax; left: 15vmax;  width: 50vmax; height: 50vmax; animation: drift2 26s ease-in-out infinite alternate; }
.bg__blob--3 { background: #7fe0a8; top: -25vmax; right: -15vmax; animation: drift3 24s ease-in-out infinite alternate; }
.bg__blob--4 { background: #6fc8f4; bottom: -30vmax; right: -10vmax; animation: drift4 28s ease-in-out infinite alternate; }

@keyframes drift1 { to { transform: translate(18vw, 22vh) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-12vw, 14vh) scale(0.85); } }
@keyframes drift3 { to { transform: translate(-20vw, 18vh) scale(1.15); } }
@keyframes drift4 { to { transform: translate(-16vw, -20vh) scale(0.9); } }

/* ==========================================================
   Herumfliegende Illustrationen
   ========================================================== */
.deco {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}
@media (max-width: 899px) {
  .deco {
    left: var(--mx, var(--x));
    top: var(--my, var(--y));
    width: calc(var(--w) * 0.75);
  }
}
.deco img {
  width: 100%;
  rotate: var(--r, 0deg);
  animation: float 6s ease-in-out infinite alternate;
}
.deco:nth-of-type(2n) img { animation-duration: 7.5s; animation-delay: -2s; }
.deco:nth-of-type(3n) img { animation-duration: 5.2s; animation-delay: -4s; animation-name: float-b; }
.deco--star img { animation: twinkle 3s ease-in-out infinite alternate; }
.deco .flip { scale: -1 1; }
.deco--front { z-index: 2; }

/* eingefangen: über allem, kleiner Hüpfer */
.deco.is-caught,
.deco.is-flung { z-index: 50; }
.deco.is-caught img { animation: caught 0.45s ease-out, float 6s ease-in-out 0.45s infinite alternate; }
@keyframes caught {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35) rotate(-10deg); }
  100% { transform: scale(1); }
}

@media (max-width: 899px) {
  .deco--desk { display: none; }
}

@keyframes float {
  0%   { transform: translate(0, 0) rotate(-4deg); }
  50%  { transform: translate(10px, -16px) rotate(3deg); }
  100% { transform: translate(-8px, 8px) rotate(-1deg); }
}
@keyframes float-b {
  0%   { transform: translate(0, 0) rotate(5deg); }
  100% { transform: translate(-14px, -12px) rotate(-5deg); }
}
@keyframes twinkle {
  from { transform: scale(0.8) rotate(0deg); opacity: 0.7; }
  to   { transform: scale(1.15) rotate(25deg); opacity: 1; }
}

/* ==========================================================
   Hero
   ========================================================== */
/* Header bleibt stehen, der Rest schiebt sich darüber.
   --hero-top (per JS) sorgt dafür, dass ein Header, der höher als
   der Bildschirm ist, erst ganz sichtbar wird, bevor er stehen bleibt. */
.hero {
  position: sticky;
  top: var(--hero-top, 0px);
  min-height: 100svh;
  padding: var(--space-6) var(--gutter);
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas:
    "badge"
    "title"
    "date"
    "intro";
  align-content: center;
  gap: var(--space-5);
}
.hero > *:not(.deco) { position: relative; z-index: 1; }

.hero__title {
  grid-area: title;
  justify-self: center;
  width: min(100%, 620px);
}

.badge {
  grid-area: badge;
  justify-self: end;
  --badge-size: clamp(170px, 15.5vw, 320px);
  width: var(--badge-size);
  height: var(--badge-size);
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-pink);
  color: var(--color-yellow);
  font-family: var(--font-badge);
  font-weight: 400;
  font-size: calc(var(--badge-size) * 0.102);
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  display: grid;
  place-items: center;
  rotate: 8deg;
  /* 3D-Schatten wie beim Titel (dunkelblau nach links unten) */
  box-shadow:
    -1px 1px 0 var(--color-navy), -2px 2px 0 var(--color-navy),
    -3px 3px 0 var(--color-navy), -4px 4px 0 var(--color-navy),
    -5px 5px 0 var(--color-navy), -6px 6px 0 var(--color-navy),
    -7px 7px 0 var(--color-navy), -8px 8px 0 var(--color-navy),
    -9px 9px 0 var(--color-navy), -10px 10px 0 var(--color-navy);
}

.hero__intro {
  grid-area: intro;
  color: var(--color-pink);
  font-size: var(--fs-lead);
  font-weight: 600;
  line-height: 1.2;
}
@media (max-width: 899px) {
  .hero__intro br { display: none; }
}

.hero__date {
  grid-area: date;
  color: var(--color-pink);
  text-align: right;
}
.hero__day {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-date);
  line-height: 0.98;
  white-space: nowrap;
}
.hero__alt {
  display: block;
  margin-top: var(--space-4);
  font-size: var(--fs-lead);
  font-weight: 600;
  line-height: 1.1;
}

@media (min-width: 900px) {
  .hero {
    height: 100svh;
    min-height: 640px;
    padding: var(--space-5) var(--gutter) var(--space-6);
    grid-template-columns: 1fr 2fr 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      ".     title  badge"
      ".     title  ."
      "intro intro  date";
    align-content: stretch;
    gap: var(--space-4);
  }
  /* Titel über die ganze Fläche, genau in der Mitte */
  .hero__title {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    place-self: center;
    width: min(48vw, 80vh);
    margin: 0;
    translate: 0 -9vh;
  }
  .badge { align-self: start; }
  .hero__intro { align-self: end; }
  .hero__date { align-self: end; }
}

/* ==========================================================
   Laufband
   ========================================================== */
.marquee,
main,
.footer {
  position: relative;
  z-index: 1;
}

/* eingesammelte Illustrationen liegen in einer Ebene über allem */
.deco-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

.marquee {
  background: var(--color-violet);
  color: var(--color-pink);
  overflow: hidden;
  padding: var(--space-3) 0;
}
.marquee__track {
  display: flex;
  width: max-content;
  align-items: center;
  gap: clamp(32px, 5vw, 96px);
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.4vw, 5.5rem);
  line-height: 1.1;
  white-space: nowrap;
  animation: marquee 30s linear infinite;
}
.marquee__star { font-family: var(--font-badge); font-size: 0.8em; }

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

/* ==========================================================
   Infobereich
   ========================================================== */
.info {
  position: relative;
  isolation: isolate;
  padding: var(--space-8) var(--gutter) var(--space-9);
  display: grid;
  gap: var(--space-8);
}
.info__block { position: relative; z-index: 1; }
.info__block--right { text-align: right; justify-self: end; }

.h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h2);
  line-height: 1;
  text-transform: uppercase;
  margin-bottom: var(--space-5);
}
.h2--yellow { color: var(--color-yellow); }
.h2--pink   { color: var(--color-pink); }
.h2--mint   { color: var(--color-mint); }

.text {
  font-size: var(--fs-text);
  font-weight: 600;
  line-height: 1.18;
  max-width: 34ch;
}
.text--wide { max-width: 46ch; }
.info__block--right .text { max-width: none; }
.text--yellow { color: var(--color-yellow); }
.text--pink   { color: var(--color-pink); }
.text--mint   { color: var(--color-mint); }
.text u { text-underline-offset: 0.12em; text-decoration-thickness: 0.06em; }

@media (min-width: 900px) {
  .info { gap: var(--space-9); }
}

/* ==========================================================
   Ort und Kontakt
   ========================================================== */
.place {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--color-lilac);
}
.place__text {
  position: relative;
  padding: var(--space-7) var(--gutter);
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
}
.place__text .text { font-size: var(--fs-lead); max-width: 30ch; }
.place .h2 { text-transform: none; }
.place .h2--yellow { text-transform: uppercase; }

.place__text > div:not(.deco) { position: relative; z-index: 1; }

.place__map {
  background: var(--color-white);
  min-height: 360px;
}
.place__map img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 75% 55%;
}

@media (min-width: 900px) {
  .place { grid-template-columns: 2fr 3fr; min-height: 100svh; }
  .place__text {
    padding-block: var(--space-8);
    justify-content: space-between;
  }
}

/* ==========================================================
   Footer
   ========================================================== */
.footer {
  background: var(--color-lilac);
  padding: var(--space-6) var(--gutter) var(--space-4);
}
.footer__copy {
  border-top: 2px solid var(--color-yellow);
  padding-top: var(--space-5);
  text-align: right;
  font-size: var(--fs-small);
  color: var(--color-yellow);
}
.footer__copy a { text-decoration: none; }
.footer__copy a:hover { text-decoration: underline; }

/* ==========================================================
   Weniger Bewegung
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
  .bg__blob,
  .deco img,
  .marquee__track { animation: none !important; }
  .marquee__track { transform: none; }
}
