:root {
  --bg: #f9f9f9;
  --fg: #15362F;
  --muted: #74968c;
  --accent: #d4af37;
  --display: 'Cormorant Garamond', serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---- debug HUD, remove in production ---- */
#debug-hud {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 999;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 11px;
  color: var(--bg);
  line-height: 1.6;
  background: rgba(20,20,22,0.85);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 10px 14px;
  pointer-events: none;
  white-space: pre;
}

#progress-bar-track {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.08);
  z-index: 998;
}
#progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transform-origin: left;
}

/* ---- layout ---- */
.intro, .outro {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 0 24px;
}
.intro h1, .outro h1 { font-size: clamp(28px, 5vw, 48px); font-weight: 600; margin: 0 0 12px; }
.intro p, .outro p { color: var(--muted); max-width: 480px; }

#hero-card {
  transform: translate(-50%, calc(-50% + var(--cardOffsetY))) scale(var(--cardScale));
  opacity: var(--cardOpacity);
}

#hero-card2 {
  transform: translate(-50%, calc(-50% + var(--cardOffsetY))) scale(var(--cardScale));
  opacity: var(--cardOpacity);
}

#runway-umschlag {
  position: relative;
  height: 300vh;
}

.stage-umschlag {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
    filter: drop-shadow(0px 0px 30px rgba(0, 0, 0, 0.3));
}

.umschlag-container {
  position: relative;
  width: min(1520px, 90vw);
  height: min(75vh, 1000px);
  perspective: 900px;
}

.umschlag-front {
  position: absolute;
  left:0; right:0; bottom:0; top: 20%;
  z-index: 2;
  transform: translateY(var(--umschlagYpx));
}

.umschlag-front-seite-gruppe {
  filter: drop-shadow(0px -5px 10px rgba(0, 0, 0, 0.4));
}

.umschlag-front-seite {
  position: absolute;
  left:0; right:0; bottom:0; top: 0;
  background: var(--fg);
  clip-path: polygon(0% 5%, 3% 6%, 50% 50%, 97% 6%, 100% 5%, 100% 100%, 0% 100%);
}

.umschlag-front-seite::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* see https://www.transparenttextures.com for other textures!!!*/
  background-image: url('assets/images/textured-paper.png');
  background-size: 400px;
  background-position: center;
  background-repeat: repeat;
  opacity: 0.25;
  z-index: 1;
}

.umschlag-front-unten-gruppe {
  filter: drop-shadow(0px 0px 10px rgba(0, 0, 0, 0.25));
}

.umschlag-front-unten {
  position: absolute;
  left:0; right:0; bottom:0; top: 0;
  background: var(--fg);
  clip-path: polygon(0% 100%, 25% 37%, 75% 37%,  100% 100%, 0% 100%)
}

.umschlag-front-unten::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* see https://www.transparenttextures.com for other textures!!!*/
  background-image: url('assets/images/textured-paper.png');
  background-size: 400px;
  background-position: center;
  background-repeat: repeat;
  opacity: 0.25;
  z-index: 1;
}

.umschlag-hinten {
  position: absolute;
  left: 0; right: 0; bottom: 0; top: 20%;
  transform: translateY(var(--umschlagYpx));
}

.umschlag-hinten-hintergrund {
  position: absolute;
  left: 0; right: 0; bottom: 0; top: 0;
  background: var(--fg);
  opacity: 1;
}

.umschlag-hinten-hintergrund::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('assets/images/textured-paper.png');
  background-size: 400px;
  background-position: center;
  background-repeat: repeat;
  opacity: 0.25;
  z-index: 1;
}

.umschlag-hinten-vordergrund {
  position: absolute;
  left: 3%; right: 3%; bottom: 0; top: 0;
  background-color: var(--bg);
  background-image: url('assets/images/textured-paper.png');
  background-size: 400px;
  background-position: center;
  background-repeat: repeat;
  z-index: 1;
}

.umschlag-klappe-schatten {
  position: absolute;
  left: 0; right: 0;
  bottom: 0; top: 19%;
  height: var(--umschlagKlappeSchattenHeight);
  transform-origin: top center;
  filter: drop-shadow(0px 10px 15px rgba(0, 0, 0, 1));
  z-index: 2;
}

.umschlag-klappe-schatten::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: 0; top: 2%;
  clip-path: url(#realisticFlapClip); 
  background-color: rgba(0, 0, 0, 1);
  opacity: var(--umschlagKlappeSchattenOpacity); 
}

.umschlag-klappe-gruppe {
  position: absolute;
  left:0; right:0; bottom: 0; top: 20%; height: 45%;
  transform-origin: top center;
  z-index: var(--umschlagKlappeGruppeZindex);
  transform: rotateX(var(--umschlagKlappeXdeg)) translateY(var(--umschlagYpx));
}

.umschlag-klappe {
  position: absolute;
  inset: 0;
  background: var(--umschlagKlappeColor);
  clip-path: url(#realisticFlapClip); 
  /* clip-path: polygon(0 0, 100% 0, 50% 100%); */
  z-index: var(--umschlagKlappeZindex);
}

.umschlag-klappe::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('assets/images/textured-paper.png');
  background-size: 400px;
  background-position: center;
  background-repeat: repeat;
  opacity: 0.25;
  z-index: 1;
}
 
.umschlag-klappe-wax {
  position: absolute;
  left: 50%; top: 95%;
  width: 170px; height: 170px;
  border-radius: 50%;
  background-image: url(/assets/images/wax.webp);
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  z-index: 5;
}

.umschlag-klappe-wax span {
  font-family: var(--display);
  font-style: italic;
  color: var(--paper);
  font-size: 2rem;
  display: none;
}
 
.umschlag-hinweis {
  position: absolute;
  left: 0; right: 0; bottom: 2.4rem;
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  z-index: 6;
}

.einladungskarte {
  position: absolute;
  left: 4%; right: 4%;
  bottom: 4%; top: 25%;
  background: var(--bg);
  box-shadow: 0 0 45px rgba(0,0,0,0.45);
  z-index: 1;
  padding: 4% 10% 0;
  text-align: center;
  transform: translateY(var(--karteYpx));
}

.einladungskarte::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('assets/images/textured-paper.png');
  background-size: 400px;
  background-position: center;
  background-repeat: repeat;
  opacity: 0.25;
  z-index: 1;
}

.letter-content h1 {
  color: var(--text);
  font-size: clamp(2rem, 7vw, 2.8rem);
  font-style: italic;
}

.letter-content .date-line {
  font-family: var(--utility);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-top: 1.6rem;
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* the tall runway that provides scroll distance for the pinned phases */
.scroll-runway {
  position: relative;
  height: 300vh;
}

.scroll-runway2 {
  position: relative;
  height: 50vh;
}

/* the pinned stage that stays fixed in viewport while runway scrolls past */
.stage {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f5f3f3;
}

.stage2 {
  height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f5f3f3;
}

.stage-content {
  position: relative;
  text-align: center;
}

.stage-content h2 {
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 600;
  margin: 0;
}

.phase-label {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.05em;
  z-index: 100;
}

.card {
  width: 220px;
  height: 140px;
  border-radius: 16px;
  background: linear-gradient(135deg, #d4af37, #AF8D11);
  position: absolute;
  top: 50%;
  left: 50%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}