/* =========================================================
   Design: Toskanische Boheme trifft Medizin
   60. Geburtstag – multikulti, nonkonform, Ärztin
   Skaliert zu 100 % mit dem Browserfenster – ohne @media
   Feste 16:9-Bühne → Elemente „springen" nicht
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=Karla:wght@300;400;500;700&display=swap');

/* ===== Reset & Grundlagen ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --cream:      #f7f2e8;
  --cream-dark: #ece3d1;
  --terracotta: #c9622f;
  --olive:      #6b7a3a;
  --chianti:    #8b2e2e;
  --brass:      #b8894a;
  --ink:        #2b2b2b;
  --ink-soft:   #5a5348;
}

html, body {
  height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Karla', sans-serif;
  overflow: hidden;
  transition: opacity 0.45s ease;
}

body { opacity: 0; }
body.loaded { opacity: 1; }

/* Filmkorn-Textur */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* =========================================================
   BÜHNE – feste 16:9-Fläche, die immer vollständig sichtbar ist
   und komplett skaliert (contain). Alle Kinder liegen relativ
   zu dieser Bühne → sie „springen" nicht beim Resize.
   ========================================================= */
.stage {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 56.25vw;              /* 16:9 */
  max-height: 100vh;
  max-width: 177.78vh;          /* 16:9 */
  transform: translate(-50%, -50%);
  background: var(--cream);
  overflow: hidden;
}

.stage > img.bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* =========================================================
   SEITE 1 – Startseite mit Hover-GIF
   ========================================================= */
.hover-zone {
  position: absolute;
  inset: 0;
  cursor: pointer;
}

.hover-zone img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.hover-zone .gif { display: none; }
.hover-zone:hover .gif { display: block; }
.hover-zone:hover .static { visibility: hidden; }

/* Zypressen-Deko unten – relativ zur Bühne */
.cypress-line {
  position: absolute;
  bottom: 2.5%;
  left: 50%;
  transform: translateX(-50%);
  width: 22%;
  height: 2%;
  opacity: 0.55;
  pointer-events: none;
  z-index: 50;
}
.cypress-line svg { width: 100%; height: 100%; }

/* Handschriftliche „60" – relativ zur Bühne */
.birthday-mark {
  position: absolute;
  top: 3%;
  right: 3%;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 5.5vw;
  color: var(--terracotta);
  opacity: 0.85;
  transform: rotate(-6deg);
  pointer-events: none;
  z-index: 60;
  letter-spacing: -0.05em;
  line-height: 1;
  text-shadow: 0.05em 0.05em 0 rgba(184,137,74,0.3);
}

.birthday-mark small {
  display: block;
  font-family: 'Karla', sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 0.85vw;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 0.15em;
  text-align: right;
}

/* =========================================================
   SEITE 2 – Filmstreifen
   Position relativ zur BÜHNE, nicht zum Viewport → kein Springen.
   Linke Kante bei 12 % der Bühnenbreite.
   Breite: 11 % der Bühnenbreite (entspricht ca. 210 px bei 1920).
   ========================================================= */
.thumbnails {
  position: absolute;
  top: 0;
  left: 12%;                     /* 230 / 1920 ≈ 12 % */
  width: 10.94%;                 /* 210 / 1920 ≈ 10,94 % */
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 5;
  padding: 1.3% 0 1.3% 0;
  background: linear-gradient(
    180deg,
    rgba(247,242,232,0.94) 0%,
    rgba(236,227,209,0.9) 100%
  );
  backdrop-filter: blur(3px);
  scrollbar-width: thin;
  scrollbar-color: var(--terracotta) var(--cream-dark);
  border-left: 1px solid rgba(184,137,74,0.35);
  border-right: 1px solid rgba(184,137,74,0.35);
  box-shadow: 0 0 1.2% rgba(43,43,43,0.08);
}

.thumbnails::-webkit-scrollbar { width: 8px; }
.thumbnails::-webkit-scrollbar-track { background: var(--cream-dark); }
.thumbnails::-webkit-scrollbar-thumb {
  background: var(--terracotta);
  border-radius: 4px;
}

/* Jeder Filmkader */
.thumbnails .kader {
  position: relative;
  display: flex;
  justify-content: center;
  /* margin-bottom wird per JS gesetzt – in vw, damit es mitskaliert */
}

.thumbnails img {
  display: block;
  width: 86%;                    /* ca. 180 / 210 */
  height: auto;
  cursor: pointer;
  transition: opacity 0.25s, transform 0.4s, box-shadow 0.3s;
  border: 1px solid rgba(184,137,74,0.4);
  box-shadow: 0 0.15vw 0.4vw rgba(43,43,43,0.15);
  background: #111;
}

.thumbnails img:hover {
  opacity: 0.85;
  transform: scale(1.03);
  box-shadow: 0 0.4vw 0.9vw rgba(201,98,47,0.35);
}

/* Film-Perforation links + rechts – relativ */
.thumbnails::before,
.thumbnails::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 5.7%;                   /* 12 / 210 ≈ 5,7 % */
  background-image: linear-gradient(#2b2b2b 0 42%, transparent 42% 100%);
  background-size: 100% 5.5%;
  opacity: 0.15;
  pointer-events: none;
}
.thumbnails::before { left: 0; }
.thumbnails::after  { right: 0; }

/* =========================================================
   OVERLAY – relativ zur Bühne (position: absolute), skaliert mit
   ========================================================= */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(30, 22, 15, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.overlay.active {
  display: flex;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.overlay img.big {
  max-width: 90%;
  max-height: 85%;
  object-fit: contain;
  box-shadow:
    0 0 0 1px rgba(184,137,74,0.5),
    0 2vw 5vw rgba(0,0,0,0.7);
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* ===== Buttons im Overlay – relativ zur Bühne ===== */
.btn {
  position: absolute;
  background: rgba(247,242,232,0.1);
  color: var(--cream);
  border: 1px solid rgba(184,137,74,0.6);
  font-size: 1.6vw;
  width: 3vw;
  height: 3vw;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, transform 0.25s, color 0.25s;
  user-select: none;
  font-family: 'Cormorant Garamond', serif;
}

.btn:hover {
  background: var(--brass);
  color: #fff;
  transform: scale(1.06);
}

.btn-prev {
  left: 1.5%;
  top: 50%;
  transform: translateY(-50%);
}
.btn-prev:hover { transform: translateY(-50%) scale(1.06); }

.btn-next {
  right: 1.5%;
  top: 50%;
  transform: translateY(-50%);
}
.btn-next:hover { transform: translateY(-50%) scale(1.06); }

.btn-close {
  top: 2%;
  right: 1.5%;
  font-size: 1.1vw;
  font-family: 'Karla', sans-serif;
}

/* =========================================================
   HOME-BUTTON – relativ zur Bühne (bleibt an seinem Platz)
   ========================================================= */
.home-btn {
  position: absolute;
  top: 2%;
  left: 1.5%;
  width: 3vw;
  height: 3vw;
  border-radius: 50%;
  background: var(--cream);
  color: var(--chianti);
  border: 1px solid rgba(184,137,74,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  z-index: 500;
  box-shadow: 0 0.3vw 0.9vw rgba(139,46,46,0.12);
  transition: background 0.25s, transform 0.25s, color 0.25s, box-shadow 0.25s;
  user-select: none;
}

.home-btn:hover {
  background: var(--terracotta);
  color: var(--cream);
  transform: scale(1.08) rotate(-4deg);
  box-shadow: 0 0.5vw 1.2vw rgba(201,98,47,0.35);
}

.home-btn svg {
  width: 55%;
  height: 55%;
  display: block;
}