/* ══════════════════════════════════════════
   VARIABLES & RESET
══════════════════════════════════════════ */
:root {
    --bg:           #080610;
    --bg2:          #100c1c;
    --bg3:          #140f22;
    --gold:         #c8a84b;
    --gold-light:   #e8d080;
    --gold-dim:     rgba(200,168,75,0.35);
    --rose:         #d4708a;
    --purple:       #8a52b8;
    --purple-dim:   rgba(138,82,184,0.25);
    --stone:        #22202e;
    --stone-mid:    #2c2a3c;
    --stone-light:  #3a374e;
    --text:         #f0e8d8;
    --text-muted:   #7a6a8a;
    --paint:        #dc3c3c;
    --paint-glow:   rgba(220,60,60,0.65);
    --font-serif:   'Playfair Display', Georgia, serif;
    --font-sans:    'Inter', system-ui, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════
   SECTION 1 — OPENING
══════════════════════════════════════════ */
#opening {
    position: relative;
    height: 100dvh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 60%, rgba(80,40,120,0.18) 0%, var(--bg) 70%);
}

#particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.opening-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
    text-align: center;
    padding: 2rem;
}

.opening-subtitle {
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0;
    animation: fadeSlideDown 0.9s ease 0.4s forwards;
}

.opening-title {
    font-family: var(--font-serif);
    font-size: clamp(3.2rem, 10vw, 6.5rem);
    font-weight: 700;
    color: var(--gold);
    text-shadow:
        0 0 60px rgba(200,168,75,0.35),
        0 0 120px rgba(200,168,75,0.12);
    line-height: 1;
    opacity: 0;
    animation: fadeSlideDown 0.9s ease 0.7s forwards;
}

/* ── Envelope ── */
.envelope-wrapper {
    perspective: 900px;
    margin: 0.8rem 0;
    opacity: 0;
    animation: fadeIn 0.8s ease 1.1s forwards;
}

.envelope {
    position: relative;
    width: 210px;
    height: 145px;
    transform-style: preserve-3d;
}

.envelope-body {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, #1e1830 0%, #140f22 60%, #1a1428 100%);
    border: 1px solid rgba(200,168,75,0.28);
    border-top: none;
    border-radius: 2px 2px 6px 6px;
    box-shadow:
        0 10px 50px rgba(60,20,100,0.4),
        inset 0 1px 0 rgba(200,168,75,0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    overflow: hidden;
}

/* diagonal crease lines inside envelope */
.envelope-body::before,
.envelope-body::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 1px;
    background: rgba(200,168,75,0.08);
}
.envelope-body::before {
    top: 0; left: -50%;
    transform-origin: left top;
    transform: rotate(35deg);
}
.envelope-body::after {
    top: 0; right: -50%;
    transform-origin: right top;
    transform: rotate(-35deg);
}

.envelope-lines {
    display: flex;
    flex-direction: column;
    gap: 5px;
    opacity: 0.25;
}
.envelope-lines span {
    display: block;
    width: 80px;
    height: 1px;
    background: var(--gold);
    border-radius: 1px;
}
.envelope-lines span:nth-child(2) { width: 60px; }
.envelope-lines span:nth-child(3) { width: 45px; }

.envelope-seal {
    font-size: 1.3rem;
    color: var(--gold);
    text-shadow: 0 0 12px rgba(200,168,75,0.9);
    animation: sealPulse 2.4s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

.envelope-flap {
    position: absolute;
    top: 0; left: -1px; right: -1px;
    height: 0;
    border-left: 106px solid transparent;
    border-right: 106px solid transparent;
    border-top: 82px solid #1e1830;
    transform-origin: top center;
    transition: transform 0.85s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
    filter: drop-shadow(0 1px 0 rgba(200,168,75,0.2));
}

.envelope-flap.open {
    transform: rotateX(-175deg);
}

.opening-hint {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.05rem;
    color: var(--text-muted);
    opacity: 0;
    animation: fadeIn 0.8s ease 1.5s forwards;
}

.open-btn {
    margin-top: 0.3rem;
    padding: 0.75rem 2.8rem;
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.3s, color 0.3s, box-shadow 0.3s;
    opacity: 0;
    animation: fadeIn 0.8s ease 1.9s forwards, btnGlow 2.8s ease-in-out 2.5s infinite;
}

.open-btn:hover,
.open-btn:focus-visible {
    background: var(--gold);
    color: var(--bg);
    box-shadow: 0 0 35px rgba(200,168,75,0.45);
    animation: none;
    outline: none;
}

/* ══════════════════════════════════════════
   SECTION 2 — REVEAL
══════════════════════════════════════════ */
#reveal {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem 5rem;
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
    position: relative;
}

.reveal-content {
    display: flex;
    gap: 5rem;
    align-items: center;
    max-width: 1080px;
    width: 100%;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s ease, transform 1s ease;
}

.reveal-content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Album scene ── */
.album-scene {
    position: relative;
    width: 300px;
    height: 300px;
    flex-shrink: 0;
    overflow: visible;
}

.album-sleeve {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    border-radius: 3px;
    overflow: hidden;
    box-shadow:
        -18px 18px 55px rgba(0,0,0,0.7),
        0 0 0 1px rgba(200,168,75,0.12);
}

.album-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.vinyl-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 270px;
    height: 270px;
    transform: translate(-50%, -50%);
    z-index: 1;
    transition:
        left 1.3s cubic-bezier(0.3, 0, 0.1, 1),
        transform 1.3s cubic-bezier(0.3, 0, 0.1, 1),
        opacity 0.4s ease;
    opacity: 0;
}

.vinyl-wrapper.ejected {
    left: calc(50% + 85px);
    transform: translate(-50%, -50%) rotate(15deg);
    opacity: 1;
    z-index: 3;
}

.vinyl {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    background:
        repeating-conic-gradient(
            from 0deg,
            rgba(255,255,255,0.015) 0deg 1deg,
            transparent 1deg 2deg
        ),
        radial-gradient(circle, #181818 0%, #111 40%, #1a1a1a 41%, #101010 55%, #181818 56%, #0d0d0d 100%);
    box-shadow:
        0 0 50px rgba(0,0,0,0.85),
        0 0 0 1px rgba(255,255,255,0.04),
        inset 0 0 30px rgba(0,0,0,0.6);
    animation: vinylSpin 10s linear infinite paused;
}

.vinyl.spinning {
    animation-play-state: running;
}

.vinyl-grooves {
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    background:
        repeating-radial-gradient(
            circle at center,
            transparent 0px,
            transparent 4px,
            rgba(255,255,255,0.012) 4px,
            rgba(255,255,255,0.012) 5px
        );
}

.vinyl-label {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #1c1228, #0c0812);
    border: 1px solid rgba(200,168,75,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vinyl-center-hole {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg);
    border: 1px solid rgba(200,168,75,0.15);
}

/* ── Reveal text ── */
.reveal-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 0;
}

.reveal-label {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--rose);
}

.reveal-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    font-weight: 700;
    line-height: 1.08;
    color: var(--text);
}

.reveal-title em {
    font-style: italic;
    color: var(--gold);
}

.reveal-format {
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(200,168,75,0.75);
    margin-top: 0.2rem;
}

.reveal-composer {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
}
.reveal-composer span {
    font-size: 0.8rem;
    opacity: 0.7;
}

.reveal-desc {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.98rem;
    color: rgba(240,232,216,0.65);
    line-height: 1.75;
    border-left: 2px solid var(--gold-dim);
    padding-left: 1.1rem;
    margin-top: 0.3rem;
}

.reveal-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--gold);
    text-decoration: none;
    font-size: 0.82rem;
    letter-spacing: 0.12em;
    transition: color 0.25s, gap 0.25s;
    width: fit-content;
    margin-top: 0.3rem;
}
.reveal-link:hover {
    color: var(--gold-light);
    gap: 0.7rem;
}

.scroll-hint {
    margin-top: 4rem;
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    color: var(--text-muted);
    animation: floatBob 2.2s ease-in-out infinite;
    opacity: 0.6;
    text-transform: uppercase;
}

/* ══════════════════════════════════════════
   SECTION 3 — MONOLITH / COUNTDOWN
══════════════════════════════════════════ */
#countdown {
    position: relative;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 100%, rgba(50,20,80,0.6) 0%, transparent 60%),
        radial-gradient(ellipse at 50% 50%, rgba(30,15,50,0.4) 0%, transparent 80%),
        var(--bg);
}

#countdownParticles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.5;
}

.countdown-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    padding: 2rem;
}

.countdown-pretext {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.05rem;
    color: rgba(180,130,220,0.65);
    letter-spacing: 0.08em;
    text-align: center;
}

/* ── Monolith scene ── */
.monolith-scene {
    display: flex;
    align-items: flex-end;
    gap: 0;
    position: relative;
}

/* ── Paintress ── */
.paintress {
    width: 170px;
    flex-shrink: 0;
    margin-right: -30px;
    margin-bottom: 10px;
    z-index: 1;
    animation: paintressFloat 5s ease-in-out infinite;
    filter: drop-shadow(0 0 22px rgba(140,70,200,0.3)) drop-shadow(0 0 8px rgba(200,168,75,0.15));
    position: relative;
}

.paintress-svg {
    width: 100%;
    height: auto;
    display: block;
}

/* ── The Monolith ── */
.monolith {
    position: relative;
    width: clamp(290px, 42vw, 430px);
    height: clamp(390px, 58vh, 540px);
    border-radius: 8px 8px 5px 5px;
    overflow: hidden;
    z-index: 0;

    /* Stone-like layered background */
    background:
        linear-gradient(
            175deg,
            rgba(255,255,255,0.025) 0%,
            transparent 30%
        ),
        linear-gradient(
            185deg,
            transparent 60%,
            rgba(0,0,0,0.15) 100%
        ),
        linear-gradient(
            160deg,
            #2e2a42 0%,
            #201c30 25%,
            #262235 50%,
            #1c1828 75%,
            #201d2e 100%
        );

    /* Stone texture via repeating lines */
    background-image:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 3px,
            rgba(255,255,255,0.006) 3px,
            rgba(255,255,255,0.006) 4px
        ),
        repeating-linear-gradient(
            180deg,
            transparent,
            transparent 12px,
            rgba(0,0,0,0.04) 12px,
            rgba(0,0,0,0.04) 13px
        ),
        linear-gradient(160deg, #2e2a42 0%, #201c30 25%, #262235 50%, #1c1828 75%, #201d2e 100%);

    box-shadow:
        0 0 0 1px rgba(200,168,75,0.08),
        0 0 60px rgba(70,40,110,0.4),
        0 0 150px rgba(40,20,80,0.35),
        -4px 0 20px rgba(0,0,0,0.4),
        4px 0 15px rgba(0,0,0,0.3),
        inset 0 0 80px rgba(0,0,0,0.45),
        inset 3px 0 20px rgba(255,255,255,0.018),
        inset -3px 0 15px rgba(0,0,0,0.35);
}

/* Top bevelled edge glow */
.monolith-top-edge {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(200,168,75,0.12) 20%,
        rgba(200,168,75,0.28) 50%,
        rgba(200,168,75,0.12) 80%,
        transparent 100%
    );
}

.monolith-inner {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.3rem;
    padding: 2.5rem 1.8rem;
}

.monolith-inscription {
    font-family: var(--font-serif);
    font-size: 0.65rem;
    letter-spacing: 0.55em;
    text-transform: uppercase;
    color: rgba(200,168,75,0.35);
    text-shadow: 0 0 10px rgba(200,168,75,0.15);
    /* Engraved look */
    filter: drop-shadow(0 1px 0 rgba(0,0,0,0.8)) drop-shadow(0 -1px 0 rgba(255,255,255,0.06));
}

/* ── Countdown numbers on monolith ── */
.countdown-display {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.countdown-num {
    font-family: var(--font-serif);
    font-size: clamp(2.4rem, 5.5vw, 3.8rem);
    font-weight: 700;
    color: rgba(238,228,208,0.88);
    line-height: 1;
    min-width: 2ch;
    text-align: center;
    position: relative;

    /* Carved/engraved text — light from above, shadow below */
    filter:
        drop-shadow(0 1px 0 rgba(255,255,255,0.08))
        drop-shadow(0 -2px 0 rgba(0,0,0,0.7))
        drop-shadow(0 2px 6px rgba(0,0,0,0.5));

    transition: color 0.2s ease, filter 0.2s ease;
}

/* Paint-fresh glow when digit changes */
.countdown-num.paint-fresh {
    color: rgba(255,195,175,0.97);
    filter:
        drop-shadow(0 0 12px var(--paint-glow))
        drop-shadow(0 0 28px rgba(220,60,60,0.4))
        drop-shadow(0 1px 0 rgba(255,255,255,0.06))
        drop-shadow(0 -2px 0 rgba(0,0,0,0.5));
    animation: paintDrip 1.6s ease forwards;
}

.countdown-label {
    font-family: var(--font-sans);
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.45em;
    text-transform: uppercase;
    color: rgba(200,168,75,0.42);
    /* Engraved */
    filter: drop-shadow(0 1px 0 rgba(0,0,0,0.9)) drop-shadow(0 -1px 0 rgba(255,255,255,0.04));
}

.countdown-sep {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    color: rgba(200,168,75,0.22);
    line-height: 1;
    margin-bottom: 1.3rem;
    animation: sepBlink 1s step-end infinite;
    filter: drop-shadow(0 1px 0 rgba(0,0,0,0.9));
}

.monolith-delivery {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(200,168,75,0.5);
    border-top: 1px solid rgba(200,168,75,0.12);
    padding-top: 1.1rem;
    width: 100%;
    text-align: center;
    filter: drop-shadow(0 1px 0 rgba(0,0,0,0.8));
}

.monolith-note {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.78rem;
    color: rgba(240,232,216,0.35);
    line-height: 1.65;
    text-align: center;
    filter: drop-shadow(0 1px 0 rgba(0,0,0,0.9));
}

/* Stone cracks */
.monolith-crack {
    position: absolute;
    pointer-events: none;
    opacity: 0.6;
}
.c1 {
    top: 12%; left: 18%;
    width: 1px; height: 70px;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.5) 30%, rgba(255,255,255,0.04) 50%, rgba(0,0,0,0.4), transparent);
    transform: rotate(14deg);
}
.c2 {
    top: 55%; right: 22%;
    width: 1px; height: 45px;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.4) 40%, rgba(255,255,255,0.03) 60%, transparent);
    transform: rotate(-9deg);
}
.c3 {
    top: 38%; left: 8%;
    width: 1px; height: 30px;
    background: linear-gradient(180deg, transparent, rgba(255,255,255,0.03) 50%, transparent);
    transform: rotate(6deg);
}

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
footer {
    padding: 4.5rem 2rem 3.5rem;
    background: var(--bg);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.4rem;
    border-top: 1px solid rgba(200,168,75,0.06);
}

.footer-ornament svg {
    width: 340px;
    max-width: 100%;
    opacity: 0.7;
}

.footer-wishes {
    font-family: var(--font-serif);
    font-size: clamp(1.6rem, 5vw, 2.4rem);
    color: var(--gold);
    text-shadow: 0 0 30px rgba(200,168,75,0.3);
}

.footer-date {
    font-size: 0.78rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.footer-note {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.95rem;
    max-width: 480px;
    line-height: 1.85;
    color: rgba(240,232,216,0.42);
}

.footer-symbol {
    font-size: 1rem;
    color: var(--gold);
    opacity: 0.3;
    margin-top: 0.5rem;
}

/* ══════════════════════════════════════════
   KEYFRAMES
══════════════════════════════════════════ */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-18px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes sealPulse {
    0%,100% { transform: scale(1);    opacity: 1;   }
    50%      { transform: scale(1.12); opacity: 0.75;}
}

@keyframes btnGlow {
    0%,100% { box-shadow: 0 0 8px  rgba(200,168,75,0.15); }
    50%      { box-shadow: 0 0 28px rgba(200,168,75,0.45); }
}

@keyframes vinylSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes floatBob {
    0%,100% { transform: translateY(0);  }
    50%      { transform: translateY(-9px); }
}

@keyframes paintressFloat {
    0%,100% { transform: translateY(0)    rotate(-1.5deg); }
    50%      { transform: translateY(-14px) rotate(1deg);  }
}

@keyframes sepBlink {
    0%,100% { opacity: 1;   }
    50%      { opacity: 0.15; }
}

@keyframes paintDrip {
    0%   { color: rgba(255,195,175,0.97); }
    15%  { color: rgba(255,195,175,0.97); }
    50%  { color: rgba(255,195,175,0.7);  }
    100% {
        color: rgba(238,228,208,0.88);
        filter:
            drop-shadow(0 1px 0 rgba(255,255,255,0.08))
            drop-shadow(0 -2px 0 rgba(0,0,0,0.7))
            drop-shadow(0 2px 6px rgba(0,0,0,0.5));
    }
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 820px) {
    .reveal-content {
        flex-direction: column;
        gap: 3rem;
        align-items: center;
        text-align: center;
    }

    .reveal-desc {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--gold-dim);
        padding-top: 1rem;
    }

    .reveal-link {
        margin: 0 auto;
    }

    .album-scene {
        width: 260px;
        height: 260px;
    }

    .vinyl-wrapper {
        width: 235px;
        height: 235px;
    }

    .vinyl-wrapper.ejected {
        left: calc(50% + 80px);
    }

    .monolith-scene {
        flex-direction: column;
        align-items: center;
    }

    .paintress {
        width: 110px;
        margin-right: 0;
        margin-bottom: -28px;
        z-index: 3;
    }
}

@media (max-width: 460px) {
    .countdown-display {
        gap: 0.2rem;
    }

    .countdown-sep {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }

    .countdown-num {
        font-size: 2rem;
    }

    .vinyl-wrapper.ejected {
        left: calc(50% + 70px);
    }
}
