
:root {
    --bg: #090609;
    --surface: #160b10;
    --crimson: #c71940;
    --bright: #ff3158;
    --text: #f7e9ec;
    --muted: #a9959b;
    --serif: "Cormorant Garamond", Georgia, serif;
    --sans: "Inter", sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
}

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

.ambient-glow {
    position: fixed;
    width: 500px;
    height: 500px;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(150, 10, 45, .13), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.topbar, footer {
    position: fixed;
    left: 0;
    width: 100%;
    padding: 22px 7%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.topbar {
    top: 0;
}

footer {
    bottom: 0;
    font-size: 9px;
    letter-spacing: 2px;
    color: #806e74;
}

.brand {
    font-size: 12px;
    letter-spacing: 5px;
    font-weight: 600;
}

.music-button {
    border: 1px solid #4a2832;
    color: var(--text);
    background: rgba(30, 10, 18, .7);
    border-radius: 30px;
    padding: 9px 15px;
    font-size: 11px;
    cursor: pointer;
}

main {
    position: relative;
    z-index: 1;
}

.scene {
    min-height: 100svh;
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 22px 85px;
    text-align: center;
    animation: sceneEnter 1s ease both;
}

.scene.active {
    display: flex;
}

@keyframes sceneEnter {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.eyebrow {
    font-size: 9px;
    letter-spacing: 4px;
    color: #d56b82;
    display: block;
    margin-bottom: 22px;
}

h1, h2 {
    font-family: var(--serif);
    font-weight: 400;
    line-height: 1.08;
}

h1 {
    font-size: clamp(42px, 8vw, 78px);
}

h2 {
    font-size: clamp(32px, 6vw, 52px);
}

h1 em, h2 em {
    color: #f05272;
    font-weight: 400;
}

.intro-content p,
#finalScene p {
    color: var(--muted);
    font-size: 13px;
    line-height: 2;
    margin-top: 25px;
}

.primary-button {
    border: 1px solid #963149;
    background: linear-gradient(120deg, #8e1230, #d01e48);
    color: white;
    padding: 15px 25px;
    border-radius: 3px;
    font-family: var(--sans);
    font-size: 11px;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: 35px;
    box-shadow: 0 0 30px rgba(205, 24, 65, .15);
    transition: .3s ease;
}

.primary-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 35px rgba(255, 40, 85, .35);
}

.primary-button span {
    margin-left: 8px;
}

.bottom-note {
    position: absolute;
    bottom: 90px;
    color: #806b73;
    font-size: 9px;
    letter-spacing: 3px;
}

.section-heading {
    margin-bottom: 15px;
}

.heart-wrapper {
    width: min(95vw, 570px);
    height: min(95vw, 570px);
    max-height: 55vh;
    display: grid;
    place-items: center;
}

#heartCanvas {
    width: 100%;
    height: 100%;
}

.scene-caption, .ring-caption {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
}

.letter-card {
    width: min(100%, 550px);
    padding: 35px 28px;
    background: linear-gradient(145deg, rgba(39, 13, 24, .9), rgba(15, 8, 12, .9));
    border: 1px solid rgba(202, 54, 91, .3);
    box-shadow: 0 15px 80px rgba(0, 0, 0, .35);
    text-align: left;
}

.letter-card h2 {
    margin-bottom: 25px;
}

#letterText {
    color: #d8c1c8;
    font-family: var(--serif);
    font-size: 20px;
    line-height: 1.8;
    min-height: 130px;
    white-space: pre-line;
}

.letter-signature {
    margin-top: 25px;
    color: #c99da9;
    font-family: var(--serif);
    line-height: 1.7;
}

.letter-signature em {
    color: #f05b7a;
}

.secret-box {
    margin-top: 35px;
    padding: 35px;
    width: min(100%, 360px);
    background: rgba(45, 12, 25, .55);
    border: 1px solid #612536;
}

.envelope {
    width: 100px;
    height: 75px;
    margin: auto;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #8f1737, #3e101e);
    font-size: 35px;
    box-shadow: 0 0 35px rgba(255, 25, 75, .2);
    animation: heartbeat 2s infinite;
}

.secret-box p {
    margin-top: 20px;
    font-size: 12px;
    color: var(--muted);
}

.secret-message {
    max-width: 420px;
    color: #f4c4d0;
    font-family: var(--serif);
    font-size: 25px;
    line-height: 1.6;
    margin-top: 30px;
    animation: sceneEnter 1.5s ease;
}

.hidden {
    display: none !important;
}

.final-heart {
    font-size: 85px;
    color: #ef2854;
    filter: drop-shadow(0 0 25px #e91d4b);
    animation: heartbeat 1.5s infinite;
    margin-bottom: 25px;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.13); }
    30% { transform: scale(1); }
    45% { transform: scale(1.08); }
}

@media (max-width: 600px) {
    .topbar {
        padding: 20px;
    }

    footer {
        padding: 15px 20px;
    }

    .scene {
        padding-left: 18px;
        padding-right: 18px;
    }

    .letter-card {
        padding: 27px 22px;
    }

    .heart-wrapper {
        max-height: 48vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* ETERNAL — cosmic atmosphere */
#heartScene,
#ringScene {
    position: relative;
    isolation: isolate;
}

#heartScene::before,
#ringScene::before {
    content: "";
    position: absolute;
    width: min(90vw, 650px);
    height: min(90vw, 650px);
    left: 50%;
    top: 48%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(190, 0, 48, .12),
        rgba(90, 0, 30, .04) 45%,
        transparent 72%
    );
    filter: blur(35px);
    z-index: -1;
    pointer-events: none;
}

#heartCanvas {
    filter: drop-shadow(0 0 12px rgba(255, 20, 75, .35));
}

#ringContainer {
    filter: drop-shadow(0 0 20px rgba(255, 0, 55, .15));
}
