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

:root {
    --gold: #c9a84c;
    --red:  #8b1a1a;
    --dark: #080808;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--dark);
    color: #fff;
}

/* ── GENERELT LAG-SYSTEM ── */
.layer {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* ── LAG 1: BAGGRUNDSBILLEDER ── */
.layer-bg {
    z-index: 1;
}

.bg-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    z-index: 1;
    transition: opacity 2.5s ease;
    will-change: opacity;
}

.bg-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.08) translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

.bg-slide.active {
    opacity: 1;
    z-index: 2;
}

.bg-slide.active img {
    /* Ken-burns starter 300ms inde så GPU-layer er klar */
    animation: ken-burns 12s ease-out forwards;
    animation-delay: 0.3s;
}

.bg-slide.outgoing {
    opacity: 1;
    z-index: 1;
}

@keyframes ken-burns {
    0%   { transform: scale(1.08) translateZ(0); }
    60%  { transform: scale(1.02) translateZ(0); }
    85%  { transform: scale(1.005) translateZ(0); }
    100% { transform: scale(1.0) translateZ(0); }
}

/* ── LAG 2: FARVEOVERLAY ── */
.layer-overlay {
    z-index: 2;
    background:
        radial-gradient(ellipse at 50% 60%, rgba(139,26,26,0.35) 0%, transparent 70%),
        linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, rgba(8,8,8,0.3) 50%, rgba(0,0,0,0.8) 100%);
}

/* ── LAG 3: TEKST ── */
.layer-text {
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Baggrundstekst (ZIGGY) */
.text-behind {
    position: absolute;
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(180px, 35vw, 480px);
    color: rgba(255,255,255,0.03);
    letter-spacing: 0.1em;
    white-space: nowrap;
    user-select: none;
    overflow: visible;
    animation: pulse-behind 28s ease-in-out infinite;
}

@keyframes pulse-behind {
    0%   { transform: scale(1.0);  opacity: 0;    }   /* usynlig, lille */
    12%  { transform: scale(1.0);  opacity: 0.55; }   /* fader ind */
    65%  { transform: scale(4.5);  opacity: 0;    }   /* vokser og fader ud */
    90%  { transform: scale(4.5);  opacity: 0;    }   /* pause — usynlig */
    100% { transform: scale(1.0);  opacity: 0;    }   /* snap tilbage (usynlig) */
}

/* Hoved-titel BOWIE */
.text-main {
    position: relative;
    display: flex;
    gap: 0.02em;
    z-index: 2;
}

.letter {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(100px, 22vw, 300px);
    color: rgba(255,255,255,0.45);
    line-height: 1;
    letter-spacing: 0.05em;
    animation: zoom-letter 10s ease-in-out infinite;
    text-shadow:
        0 0 40px rgba(201,168,76,0.4),
        0 0 100px rgba(201,168,76,0.15);
}

/* Hvert bogstav zoomer lidt forskudt */
.letter:nth-child(1) { animation-delay: 0s;    }
.letter:nth-child(2) { animation-delay: 0.3s;  }
.letter:nth-child(3) { animation-delay: 0.6s;  }
.letter:nth-child(4) { animation-delay: 0.9s;  }
.letter:nth-child(5) { animation-delay: 1.2s;  }

@keyframes zoom-letter {
    0%,100% { transform: scale(1.0) translateY(0);    opacity: 0.85; }
    50%      { transform: scale(1.06) translateY(-4px); opacity: 1;    }
}

/* Sangtitel (mellem BOWIE og undertekster) */
.text-song {
    position: absolute;
    font-family: 'Cormorant Garamond', serif;
    font-style: normal;
    font-weight: 600;
    font-size: clamp(32px, 6vw, 80px);
    color: rgba(201,168,76,0.75);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    top: calc(50% + 9vw);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    text-align: center;
    opacity: 0.75;
    animation: pulse-song 12s ease-in-out infinite;
    transition: opacity 1.2s ease;
}

/* Årstal under sangtitel */
.text-year {
    position: absolute;
    font-family: 'Cormorant Garamond', serif;
    font-style: normal;
    font-weight: 400;
    font-size: clamp(14px, 2.5vw, 36px);
    color: rgba(201,168,76,0.5);
    letter-spacing: 0.4em;
    text-transform: uppercase;
    top: calc(50% + 9vw + clamp(32px, 6vw, 80px) + 0.05em);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    opacity: 0.75;
    transition: opacity 1.2s ease;
}

@keyframes pulse-song {
    0%,100% { transform: translateX(-50%) scale(1.0);    }
    50%      { transform: translateX(-50%) scale(1.035);  }
}

/* Undertekster */
.text-sub {
    position: absolute;
    bottom: 5vh;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    z-index: 2;
}

.sub-line {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 300;
    color: rgba(201,168,76,0.85);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    animation: fade-sub 16s ease-in-out infinite;
}

.line1 { font-size: clamp(14px, 2vw, 22px); animation-delay: 0s;  }
.line2 { font-size: clamp(11px, 1.2vw, 16px); color: rgba(255,255,255,0.4); animation-delay: 2s; letter-spacing: 0.5em; }

@keyframes fade-sub {
    0%,100% { opacity: 0.3; transform: translateY(0);   }
    50%      { opacity: 1;   transform: translateY(-3px); }
}

/* Flydende sideord */
.text-float {
    position: absolute;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 300;
    font-size: clamp(12px, 1.4vw, 18px);
    color: rgba(255,255,255,0.2);
    letter-spacing: 0.4em;
    text-transform: uppercase;
    top: 50%;
    transform: translateY(-50%);
    animation: drift 20s ease-in-out infinite;
}

.text-float.left  { left: 4vw;  animation-delay: 0s;  }
.text-float.right { right: 4vw; animation-delay: 6s;  }

@keyframes drift {
    0%,100% { opacity: 0.15; transform: translateY(-50%) translateX(0);   }
    50%      { opacity: 0.45; transform: translateY(-52%) translateX(4px); }
}

/* ── LAG 4: GRAIN ── */
.layer-grain {
    z-index: 4;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 150px;
    pointer-events: none;
    animation: grain-shift 0.5s steps(2) infinite;
}

@keyframes grain-shift {
    0%   { transform: translate(0,    0);    }
    25%  { transform: translate(-3px, 2px);  }
    50%  { transform: translate(2px,  -3px); }
    75%  { transform: translate(-2px, -1px); }
    100% { transform: translate(3px,  1px);  }
}
