/* ============ Fonts (lokal gehostet) ============ */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/fraunces.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/fraunces-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/manrope.woff2") format("woff2");
}

/* ============ Tokens ============ */
:root {
  --bg: #110e1b;
  --bg-2: #181427;
  --ink: #f5ecdc;
  --muted: #a99fbd;
  --line: rgba(245, 236, 220, 0.12);
  --accent: #ffc861;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 5vw, 72px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(16px, 1.05vw + 10px, 19px);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Körnung über allem für etwas Papier-Gefühl */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: inherit;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

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

/* ============ Fortschrittsbalken ============ */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 50;
  background: linear-gradient(90deg, #f4b04f, #e2774f, #9b87f5, #7cc56f, #f28bb0, #ffd166);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* ============ Seitennavigation ============ */
.dots {
  position: fixed;
  right: clamp(12px, 2vw, 28px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dots a {
  position: relative;
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
  transition: transform 0.4s var(--ease-out), background 0.3s, border-color 0.3s;
}

.dots a span {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translate(6px, -50%);
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 3px 10px;
  border-radius: 99px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s var(--ease-out);
}

.dots a:hover span,
.dots a:focus-visible span {
  opacity: 1;
  transform: translate(0, -50%);
}

.dots a.is-active {
  background: var(--dot, var(--accent));
  border-color: var(--dot, var(--accent));
  transform: scale(1.35);
}

/* ============ Hero ============ */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(120% 80% at 70% 10%, #3a2d63 0%, #221a3d 45%, #151124 100%);
}

.hero__layer {
  position: absolute;
  left: 0;
  width: 100%;
  will-change: transform;
}

.hero__stars {
  inset: 0;
  height: 100%;
}

.hero__stars circle {
  fill: #fff;
}

.hero__stars .twinkle {
  animation: twinkle var(--t, 3s) ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

@keyframes twinkle {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

.hero__moon {
  top: 8%;
  left: auto;
  right: 10%;
  width: clamp(110px, 16vw, 230px);
  height: auto;
}

.hero__hills {
  bottom: 0;
  height: 52%;
}

.hero__hills--far { height: 58%; }
.hero__hills--near { height: 40%; bottom: -1px; }

.hero__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 var(--gutter) 12vh;
  will-change: transform, opacity;
}

.hero__kicker {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(24px, 3.4vw, 46px);
  color: var(--accent);
  margin: 0 0 -0.1em;
  letter-spacing: 0.01em;
}

.hero__title {
  font-family: var(--serif);
  font-weight: 700;
  font-variation-settings: "opsz" 144;
  font-size: clamp(54px, 13.5vw, 210px);
  line-height: 0.9;
  letter-spacing: -0.035em;
  margin: 0;
  text-shadow: 0 10px 60px rgba(0, 0, 0, 0.35);
}

.hero__title .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.5em) rotate(8deg);
  animation: charIn 1s var(--ease-out) forwards;
  animation-delay: calc(var(--i) * 45ms + 200ms);
}

@keyframes charIn {
  to {
    opacity: 1;
    transform: none;
  }
}

.hero__sub {
  max-width: 32ch;
  margin: 1.4em auto 0;
  color: #d9cfe6;
  font-size: clamp(16px, 1.3vw + 10px, 22px);
  opacity: 0;
  animation: fadeUp 1s var(--ease-out) 0.9s forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.hero__floaters {
  inset: 0;
  height: 100%;
  pointer-events: none;
}

.floater {
  position: absolute;
  width: var(--s, 60px);
  animation: bob var(--dur, 6s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-14px) rotate(calc(var(--r, 0deg) * -1)); }
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  opacity: 0;
  animation: fadeUp 1s var(--ease-out) 1.4s forwards;
}

.scroll-hint .mouse {
  width: 24px;
  height: 38px;
  border: 2px solid var(--muted);
  border-radius: 14px;
  position: relative;
}

.scroll-hint .mouse::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 7px;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--accent);
  animation: wheel 1.8s ease-in-out infinite;
}

@keyframes wheel {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ============ Laufband ============ */
.marquee {
  position: relative;
  padding: clamp(28px, 5vw, 64px) 0;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.marquee__row {
  display: flex;
  white-space: nowrap;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(34px, 6vw, 88px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  will-change: transform;
}

.marquee__row span {
  padding-right: 0.5em;
}

.marquee__row--outline {
  color: transparent;
  -webkit-text-stroke: 1.2px rgba(245, 236, 220, 0.4);
  font-style: italic;
  font-weight: 400;
}

.marquee__row i {
  font-style: normal;
  color: var(--accent);
}

/* ============ Wunsch-Sektionen ============ */
.wish {
  --accent: #ffc861;
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 96px);
  padding: clamp(80px, 12vh, 160px) calc(var(--gutter) + 24px) clamp(80px, 12vh, 160px) var(--gutter);
  overflow: hidden;
  isolation: isolate;
}

.wish--flip .wish__art { order: 2; }

.wish__num {
  position: absolute;
  top: 50%;
  z-index: -1;
  margin-top: -0.55em;
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(200px, 38vw, 560px);
  line-height: 1;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1.5px color-mix(in srgb, var(--accent) 35%, transparent);
  user-select: none;
  pointer-events: none;
  will-change: transform;
}

.wish:not(.wish--flip) .wish__num { right: -0.05em; }
.wish--flip .wish__num { left: -0.08em; }

.wish__art {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  max-width: 600px;
  justify-self: center;
  perspective: 1000px;
}

.wish__art--wide {
  aspect-ratio: 7 / 5;
  max-width: 720px;
}

.wish__glow {
  position: absolute;
  inset: -10%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 38%, transparent), transparent 75%);
  filter: blur(10px);
  will-change: transform;
}

.tilt {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s var(--ease-out);
}

.wish__art svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.wish__art svg [data-speed],
.wish__art svg [data-rot] {
  transform-box: fill-box;
  transform-origin: center;
}

.wish__text {
  position: relative;
  max-width: 34rem;
}

.wish__label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.wish__label::before {
  content: "";
  width: 36px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.wish__title {
  font-family: var(--serif);
  font-weight: 650;
  font-variation-settings: "opsz" 120;
  font-size: clamp(40px, 5.6vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0 0 0.35em;
}

.wish__title em {
  display: block;
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

.wish__desc {
  margin: 0 0 1.6em;
  color: #d8cfe4;
  max-width: 40ch;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tags li {
  font-size: 14px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 99px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--ink);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding: 16px 26px;
  border-radius: 99px;
  background: var(--accent);
  color: #15111f;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  overflow: hidden;
  box-shadow: 0 12px 40px -12px color-mix(in srgb, var(--accent) 80%, transparent);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--ease-out);
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 18px 50px -12px color-mix(in srgb, var(--accent) 95%, transparent);
}

.btn:hover::before,
.btn:focus-visible::before {
  transform: translateX(120%);
}

.btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.35s var(--ease-out);
}

.btn:hover svg {
  transform: translate(3px, -3px);
}

.btn small {
  display: block;
  font-weight: 500;
  font-size: 12px;
  opacity: 0.7;
}

/* ============ Reveal-Animationen ============ */
.js .reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s var(--ease-out), transform 1.1s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 110ms);
}

.js .reveal--art {
  transform: translateY(60px) scale(0.86) rotate(-3deg);
}

.js .wish--flip .reveal--art {
  transform: translateY(60px) scale(0.86) rotate(3deg);
}

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

.wish__title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.wish__title .line > span {
  display: block;
}

.js .wish__title .line > span {
  transform: translateY(105%);
  transition: transform 1.1s var(--ease-out);
}

.wish__title .line:nth-child(2) > span {
  transition-delay: 0.12s;
}

.js .is-in .wish__title .line > span {
  transform: none;
}

/* ============ Illustrations-Animationen ============ */
.steam path {
  stroke-dasharray: 60 140;
  animation: steam 3.2s linear infinite;
}

.steam path:nth-child(2) { animation-delay: -1.1s; }
.steam path:nth-child(3) { animation-delay: -2.2s; }

@keyframes steam {
  from { stroke-dashoffset: 200; opacity: 0; }
  30% { opacity: 0.8; }
  to { stroke-dashoffset: 0; opacity: 0; }
}

.float {
  animation: floaty 5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.float--2 { animation-duration: 6.5s; animation-delay: -2s; }
.float--3 { animation-duration: 4.2s; animation-delay: -1s; }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(6deg); }
}

.bulb-glow {
  animation: pulse 2.4s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.9); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

.window-glow {
  animation: flicker 4s ease-in-out infinite;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  45% { opacity: 0.85; }
  50% { opacity: 0.65; }
  55% { opacity: 0.9; }
}

.smoke circle {
  animation: smoke 4s ease-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.smoke circle:nth-child(2) { animation-delay: -1.3s; }
.smoke circle:nth-child(3) { animation-delay: -2.6s; }

@keyframes smoke {
  from { transform: translate(0, 0) scale(0.6); opacity: 0.5; }
  to { transform: translate(14px, -50px) scale(1.8); opacity: 0; }
}

/* ============ Überraschung ============ */
.surprise {
  --accent: #ffd166;
  position: relative;
  height: 260vh;
}

.surprise__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 96px);
  padding: 0 calc(var(--gutter) + 24px) 0 var(--gutter);
  overflow: hidden;
  isolation: isolate;
}

.surprise .wish__num {
  left: -0.08em;
}

.surprise__art { order: 2; }

.surprise__art {
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1;
  justify-self: center;
}

.surprise__art svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.surprise__art #lid,
.surprise__art #qmark,
.surprise__art #rays {
  transform-box: view-box;
}

.surprise__art #lid { transform-origin: 200px 205px; }
.surprise__art #qmark { transform-origin: 200px 290px; opacity: 0; }
.surprise__art #rays { transform-origin: 200px 220px; opacity: 0; }
.surprise__art #sparks { opacity: 0; }

.surprise__art .box {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.surprise__art .box.wiggle {
  animation: wiggle 3.2s ease-in-out infinite;
}

@keyframes wiggle {
  0%, 78%, 100% { transform: rotate(0); }
  82% { transform: rotate(-3deg); }
  86% { transform: rotate(3deg); }
  90% { transform: rotate(-2deg); }
  94% { transform: rotate(1deg); }
}

.surprise__hint {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.surprise__hint .bar {
  position: relative;
  width: 120px;
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
}

.surprise__hint .bar i {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.surprise__reveal {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(22px, 2.2vw, 30px);
  color: var(--accent);
  margin: 0.4em 0 0;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.surprise.is-open .surprise__reveal {
  opacity: 1;
  transform: none;
}

#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 60;
}

/* ============ Footer ============ */
.footer {
  position: relative;
  padding: clamp(100px, 16vh, 180px) var(--gutter) 48px;
  text-align: center;
  overflow: hidden;
}

.footer .footer__big {
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 700;
  font-variation-settings: "opsz" 144;
  font-size: clamp(56px, 11vw, 170px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin: 0;
}

.footer__big em {
  font-weight: 400;
  color: var(--accent);
}

.footer p {
  color: var(--muted);
  margin: 1.2em auto 0;
  max-width: 36ch;
}

.footer__heart {
  display: inline-block;
  color: #f28bb0;
  animation: beat 1.4s ease-in-out infinite;
}

@keyframes beat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.25); }
  30% { transform: scale(1); }
  45% { transform: scale(1.15); }
}

.to-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  padding: 12px 22px;
  border: 1px solid var(--line);
  border-radius: 99px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: border-color 0.3s, background 0.3s;
}

.to-top:hover {
  border-color: var(--accent);
  background: rgba(255, 200, 97, 0.08);
}

.footer__small {
  margin-top: 64px !important;
  font-size: 13px;
}

.shooting-star {
  position: absolute;
  top: 12%;
  left: 62%;
  width: 150px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #fff, rgba(255, 255, 255, 0));
  opacity: 0;
  transform: rotate(-20deg);
  animation: shoot 9s ease-in 3s infinite;
}

@keyframes shoot {
  0% { opacity: 0; transform: translate(0, 0) rotate(-20deg); }
  2% { opacity: 1; }
  9% { opacity: 0; transform: translate(-420px, 153px) rotate(-20deg); }
  100% { opacity: 0; transform: translate(-420px, 153px) rotate(-20deg); }
}

.footer__glow {
  position: absolute;
  left: 50%;
  top: 30%;
  width: min(900px, 120vw);
  aspect-ratio: 1;
  margin-left: max(-450px, -60vw);
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(155, 135, 245, 0.22), rgba(255, 200, 97, 0.08) 55%, transparent 75%);
  pointer-events: none;
}

.footer { isolation: isolate; }

/* ============ Responsive ============ */
@media (max-width: 600px) {
  .hide-sm { display: none; }
}

@media (max-width: 860px) {
  .dots { display: none; }

  .surprise__art { order: 0; }

  .wish,
  .surprise__sticky {
    grid-template-columns: 1fr;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
    text-align: left;
  }

  .wish {
    min-height: auto;
    gap: 8px;
  }

  .wish--flip .wish__art { order: 0; }

  .wish__art {
    max-width: 420px;
  }

  .wish__art--wide {
    max-width: 520px;
  }

  .wish__num {
    top: 18%;
    font-size: 62vw;
  }

  .surprise__sticky {
    align-content: center;
    gap: 0;
  }

  .surprise__art {
    max-width: min(340px, 42vh);
  }

  .surprise .wish__title { font-size: clamp(36px, 10vw, 54px); }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal,
  .hero__title .char,
  .hero__sub,
  .scroll-hint {
    opacity: 1;
    transform: none;
  }
}
