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

:root {
    --rose: #f5b8c4;
    --rose-deep: #d98da0;
    --cream: #fff7f3;
    --plum: #4a2b3a;
    --ink: #2a1824;
    --gold: #c8a67c;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cormorant Garamond', serif;
    background: linear-gradient(180deg,
        #ffe9ef 0%,
        #fcd5e0 20%,
        #f7c6d6 40%,
        #f2b4c8 60%,
        #e9a3be 80%,
        #d98da0 100%);
    color: var(--ink);
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- floating hearts background --- */
.hearts,
.petals {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.heart {
    position: absolute;
    bottom: -40px;
    width: 18px;
    height: 18px;
    background: var(--rose-deep);
    opacity: 0;
    transform: rotate(-45deg);
    animation: floatUp linear infinite;
}

.heart::before,
.heart::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: inherit;
    border-radius: 50%;
}

.heart::before {
    top: -9px;
    left: 0;
}

.heart::after {
    top: 0;
    left: 9px;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(-45deg) scale(0.8);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.4;
    }
    100% {
        transform: translateY(-110vh) rotate(-45deg) scale(1.1);
        opacity: 0;
    }
}

.petal {
    position: absolute;
    top: -40px;
    width: 14px;
    height: 20px;
    background: radial-gradient(ellipse at center, #fff 0%, #fbdce4 60%, #f5b8c4 100%);
    border-radius: 150% 0 150% 0;
    opacity: 0;
    animation: fall linear infinite;
}

@keyframes fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.9;
    }
    100% {
        transform: translateY(110vh) rotate(720deg);
        opacity: 0;
    }
}

/* --- scenes --- */
.scene {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8vh 6vw;
    text-align: center;
}

.scene.alt {
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.18) 0%,
        rgba(255, 255, 255, 0) 100%);
}

/* --- hero --- */
.scene-hero {
    min-height: 100vh;
}

.hero-content {
    max-width: 800px;
}

.hero-kicker {
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: var(--plum);
    opacity: 0.75;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(3.5rem, 9vw, 7rem);
    line-height: 1.05;
    color: var(--plum);
    margin-bottom: 2rem;
}

.name {
    font-family: 'Dancing Script', cursive;
    font-weight: 700;
    color: var(--rose-deep);
    font-size: 1.1em;
    display: inline-block;
    text-shadow: 0 2px 20px rgba(217, 141, 160, 0.4);
}

.hero-sub {
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--plum);
    opacity: 0.75;
    margin-bottom: 4rem;
}

.scroll-cue {
    display: inline-block;
    width: 22px;
    height: 36px;
    border: 1.5px solid var(--plum);
    border-radius: 20px;
    position: relative;
    opacity: 0.6;
}

.scroll-cue span {
    position: absolute;
    top: 7px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 7px;
    background: var(--plum);
    border-radius: 2px;
    animation: scrollDot 1.8s ease-in-out infinite;
}

@keyframes scrollDot {
    0% { transform: translate(-50%, 0); opacity: 1; }
    60% { transform: translate(-50%, 12px); opacity: 0; }
    100% { transform: translate(-50%, 0); opacity: 0; }
}

/* --- text scenes --- */
.big-line {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.3;
    color: var(--plum);
    max-width: 14ch;
}

.big-line em {
    font-family: 'Dancing Script', cursive;
    font-style: normal;
    color: var(--rose-deep);
    font-size: 1.15em;
}

.small-line {
    margin-top: 1.8rem;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--plum);
    opacity: 0.7;
}

/* --- photo scenes --- */
.photo-frame {
    width: min(380px, 80vw);
    aspect-ratio: 3 / 4;
    background: linear-gradient(135deg, #fff 0%, #ffeef2 100%);
    border-radius: 6px;
    padding: 18px 18px 60px;
    box-shadow:
        0 20px 50px rgba(74, 43, 58, 0.25),
        0 6px 18px rgba(74, 43, 58, 0.15);
    transform: rotate(-2deg);
    position: relative;
    transition: transform 0.6s ease;
}

.photo-frame:nth-of-type(even) {
    transform: rotate(2deg);
}

.photo-frame:hover {
    transform: rotate(0deg) scale(1.02);
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3px;
    display: block;
}

.frame-caption {
    position: absolute;
    bottom: 18px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: 'Dancing Script', cursive;
    font-size: 1.2rem;
    color: var(--rose-deep);
    opacity: 0;
    transition: opacity 0.3s;
}

.photo-frame.placeholder {
    background: repeating-linear-gradient(
        45deg,
        #ffeef2,
        #ffeef2 10px,
        #fcd5e0 10px,
        #fcd5e0 20px
    );
}

.photo-frame.placeholder .frame-caption {
    opacity: 1;
}

.scene-photo .caption {
    margin-top: 2.5rem;
    font-family: 'Dancing Script', cursive;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    color: var(--plum);
}

/* --- finale --- */
.scene-finale {
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    min-height: 100vh;
}

.finale-heart {
    margin-bottom: 2rem;
    animation: heartbeat 1.6s ease-in-out infinite;
}

.finale-heart svg {
    fill: var(--rose-deep);
    filter: drop-shadow(0 8px 20px rgba(217, 141, 160, 0.5));
}

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

.finale-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(3rem, 8vw, 6rem);
    line-height: 1.1;
    color: var(--plum);
    margin-bottom: 1.5rem;
}

.finale-sig {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    color: var(--rose-deep);
}

/* --- reveal animation --- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s ease, transform 1.2s ease;
    transition-delay: var(--delay, 0s);
}

.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* stagger children */
.scene .reveal:nth-child(1) { --delay: 0s; }
.scene .reveal:nth-child(2) { --delay: 0.25s; }
.scene .reveal:nth-child(3) { --delay: 0.5s; }
.scene .reveal:nth-child(4) { --delay: 0.75s; }

/* --- password gate --- */
html.locked,
html.locked body {
    overflow: hidden;
    height: 100%;
}

html.locked body > *:not(#gate) {
    display: none !important;
}

#gate {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(180deg,
        #ffe9ef 0%,
        #fcd5e0 35%,
        #f7c6d6 70%,
        #e9a3be 100%);
    align-items: center;
    justify-content: center;
    padding: 6vw;
}

html.locked #gate {
    display: flex;
}

#gate.unlocking {
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.gate-card {
    background: rgba(255, 255, 255, 0.55);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-radius: 14px;
    padding: 2.6rem 2.2rem;
    text-align: center;
    box-shadow:
        0 20px 60px rgba(74, 43, 58, 0.18),
        0 6px 20px rgba(74, 43, 58, 0.1);
    max-width: 380px;
    width: 100%;
}

.gate-heart {
    margin-bottom: 0.8rem;
    display: flex;
    justify-content: center;
}

.gate-heart svg {
    fill: var(--rose-deep);
    animation: heartbeat 1.6s ease-in-out infinite;
    filter: drop-shadow(0 4px 12px rgba(217, 141, 160, 0.4));
}

.gate-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: 2rem;
    color: var(--plum);
    margin-bottom: 0.3rem;
}

.gate-sub {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    color: var(--plum);
    opacity: 0.7;
    margin-bottom: 1.4rem;
    font-size: 1rem;
}

#gate-input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid rgba(74, 43, 58, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.85);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.15rem;
    color: var(--plum);
    text-align: center;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 0.9rem;
}

#gate-input:focus {
    border-color: var(--rose-deep);
    box-shadow: 0 0 0 4px rgba(217, 141, 160, 0.18);
}

.gate-btn {
    width: 100%;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 8px;
    background: var(--rose-deep);
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.gate-btn:hover { background: #c97a90; }
.gate-btn:active { transform: scale(0.98); }

.gate-error {
    margin-top: 0.9rem;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 0.95rem;
    color: var(--rose-deep);
    min-height: 1.2em;
    opacity: 0;
    transition: opacity 0.3s;
}

.gate-error.show { opacity: 0.9; }

/* --- reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
    }
    .heart, .petal, .finale-heart, .scroll-cue span {
        animation: none;
    }
}
