:root {
    --bg-color: #FFF0F5;
    --text-color: #5D4037;
    --primary-color: #880E4F;
    --secondary-color: #FFCDD2;
    --accent-color: #D4AF37;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Poppins', sans-serif;
}

/* ── Welcome Overlay ── */
.welcome-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, #1a0a10 0%, #0d0208 100%);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: opacity .8s ease;
}

.welcome-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.welcome-content {
    text-align: center;
    color: #fff;
    font-family: var(--font-heading);
}

.welcome-emoji {
    font-size: 4rem;
    animation: welcomePulse 1.5s ease-in-out infinite;
}

.welcome-content h2 {
    font-size: 1.6rem;
    margin: 16px 0 10px;
    color: #f8bbd0;
}

.welcome-sub {
    font-size: 1rem;
    color: rgba(255, 255, 255, .6);
    font-family: var(--font-body);
    animation: bounce 2s infinite;
}

@keyframes welcomePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

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

/* Scroll behavior is controlled by JavaScript */
html {
    overflow-y: auto;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(180deg, #FFF0F5 0%, #FFF8E1 100%);
    color: var(--text-color);
    overflow-x: hidden;
}

/* ───────────── Particles ───────────── */
#particles-js {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ───────────── Typography ───────────── */
.title {
    font-family: var(--font-heading);
    color: var(--primary-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, .08);
}

.subtitle {
    color: #AD1457;
    font-weight: 300;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 50px;
    font-family: var(--font-heading);
    color: var(--primary-color);
}

/* ───────────── Hero ───────────── */
.hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 4.5rem;
    margin-bottom: 8px;
}

.hero .subtitle {
    font-size: 1.3rem;
    letter-spacing: 3px;
    margin-bottom: 25px;
}

/* Love Counter */
.love-counter {
    padding: 28px 50px;
    margin-top: 25px;
    display: inline-block;
    min-width: 340px;
    max-width: 90vw;
    border: 2px solid var(--accent-color);
    background: rgba(255, 255, 255, .85);
    border-radius: 16px;
    backdrop-filter: blur(6px);
    animation: counterGlow 3s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(183, 28, 28, .08);
}

@keyframes counterGlow {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(183, 28, 28, .08), 0 0 40px rgba(233, 30, 99, .05);
        border-color: var(--accent-color);
    }

    50% {
        box-shadow: 0 0 30px rgba(183, 28, 28, .18), 0 0 60px rgba(233, 30, 99, .12);
        border-color: var(--primary-color);
    }
}

.love-counter p {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-color);
}

#counter {
    font-size: 1.35rem;
    font-family: var(--font-heading);
    color: var(--primary-color);
    font-weight: bold;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.scroll-indicator {
    margin-top: 40px;
    color: var(--primary-color);
    opacity: .6;
}

/* ───────────── Full-Screen Photo Sections ───────────── */
.photo-section {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    z-index: 2;
    padding: 0;
}

.photo-wrapper {
    position: absolute;
    inset: 0;
    z-index: 1;
}

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

.photo-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, .02) 0%,
            rgba(0, 0, 0, .3) 60%,
            rgba(0, 0, 0, .6) 100%);
    z-index: 2;
}

.photo-caption {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 20px;
    margin-bottom: 60px;
    width: 100%;
}

.photo-caption p {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .5);
    font-style: italic;
}

/* ───────────── Sections Common ───────────── */
section {
    position: relative;
    z-index: 2;
}

/* ═══════════════════════════════════ */
/*        SIFATLARIN (Word Cloud)     */
/* ═══════════════════════════════════ */
.sifatlar-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    background: linear-gradient(180deg, #FFF0F5 0%, #FCE4EC 50%, #FFF8E1 100%);
}

.sifatlar-cloud {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 16px;
    max-width: 700px;
    margin: 10px auto 30px;
    padding: 0 15px;
}

.sifat {
    display: inline-block;
    font-family: var(--font-heading);
    color: var(--primary-color);
    background: rgba(255, 255, 255, .85);
    border: 1px solid rgba(233, 30, 99, .2);
    border-radius: 50px;
    padding: 12px 28px;
    backdrop-filter: blur(6px);
    transition: all .4s cubic-bezier(.22, .68, 0, 1.1);
    cursor: default;
    animation: sifatFloat 4s ease-in-out infinite;
}

.sifat:hover {
    transform: scale(1.15) translateY(-5px);
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 12px 35px rgba(183, 28, 28, .25);
    border-color: var(--primary-color);
}

/* Sizes */
.sifat-sm {
    font-size: .9rem;
    padding: 8px 20px;
}

.sifat-md {
    font-size: 1.1rem;
    padding: 12px 28px;
}

.sifat-lg {
    font-size: 1.4rem;
    padding: 14px 32px;
    font-weight: 600;
}

.sifat-xl {
    font-size: 1.8rem;
    padding: 16px 38px;
    font-weight: 700;
}

/* Staggered float animation */
.sifat:nth-child(1) {
    animation-delay: 0s;
}

.sifat:nth-child(2) {
    animation-delay: .3s;
}

.sifat:nth-child(3) {
    animation-delay: .6s;
}

.sifat:nth-child(4) {
    animation-delay: .9s;
}

.sifat:nth-child(5) {
    animation-delay: 1.2s;
}

.sifat:nth-child(6) {
    animation-delay: 1.5s;
}

.sifat:nth-child(7) {
    animation-delay: 1.8s;
}

.sifat:nth-child(8) {
    animation-delay: .2s;
}

.sifat:nth-child(9) {
    animation-delay: .5s;
}

.sifat:nth-child(10) {
    animation-delay: .8s;
}

.sifat:nth-child(11) {
    animation-delay: 1.1s;
}

.sifat:nth-child(12) {
    animation-delay: 1.4s;
}

.sifat:nth-child(13) {
    animation-delay: 1.7s;
}

.sifat:nth-child(14) {
    animation-delay: 2s;
}

.sifat:nth-child(15) {
    animation-delay: .4s;
}

.sifat:nth-child(16) {
    animation-delay: .7s;
}

@keyframes sifatFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

.sifatlar-footer {
    font-family: var(--font-heading);
    font-style: italic;
    color: var(--primary-color);
    font-size: 1rem;
    opacity: .75;
}

/* ═══════════════════════════════════ */
/*          ENVELOPE                  */
/* ═══════════════════════════════════ */
.letter-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 8vh;
}

.envelope-scene {
    position: relative;
    width: 320px;
    height: 220px;
    cursor: pointer;
}

/* ── Letter Popup Overlay ── */
.letter-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .65);
    z-index: 9000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .4s ease;
    backdrop-filter: blur(4px);
}

.letter-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.letter-popup {
    background: linear-gradient(135deg, #fffaf0 0%, #fff5ee 100%);
    border-radius: 16px;
    padding: 32px 28px;
    max-width: 340px;
    width: 85vw;
    text-align: center;
    font-family: var(--font-heading);
    color: #444;
    font-size: .88rem;
    line-height: 1.65;
    box-shadow: 0 25px 80px rgba(136, 14, 79, .25),
        0 0 0 1px rgba(212, 175, 55, .2);
    position: relative;
    transform: scale(0.3) translateY(200px);
    opacity: 0;
    transition: transform .6s cubic-bezier(.22, .68, 0, 1.1),
        opacity .4s ease;
}

.letter-overlay.active .letter-popup {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.letter-popup h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--accent-color);
    padding-bottom: 8px;
    display: inline-block;
}

.letter-popup p {
    margin-bottom: 10px;
}

.letter-sign {
    margin-top: 14px;
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1rem;
}

.letter-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #999;
    cursor: pointer;
    transition: color .2s;
    line-height: 1;
}

.letter-close:hover {
    color: var(--primary-color);
}

/* ── Envelope Shape ── */
.envelope-shape {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 180px;
    background: #922b21;
    /* Dark inside color */
    border-radius: 0 0 5px 5px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 3;
    overflow: visible !important;
}

/* Flaps Helper Mixin (concept) */
.env-flap-left,
.env-flap-right,
.env-flap-bottom,
.env-flap-top {
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

/* Left Flap */
.env-flap-left {
    top: 0;
    left: 0;
    border-width: 90px 0 90px 150px;
    border-color: transparent transparent transparent #c0392b;
    z-index: 3;
}

/* Right Flap */
.env-flap-right {
    top: 0;
    right: 0;
    border-width: 90px 150px 90px 0;
    border-color: transparent #c0392b transparent transparent;
    z-index: 3;
}

/* Bottom Flap */
.env-flap-bottom {
    bottom: 0;
    left: 0;
    border-width: 0 150px 100px 150px;
    border-color: transparent transparent #e74c3c transparent;
    z-index: 4;
    transform-origin: bottom;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

/* Top Flap */
.env-flap-top {
    top: 0;
    left: 0;
    border-width: 110px 150px 0 150px;
    border-color: #a93226 transparent transparent transparent;
    z-index: 5;
    transform-origin: top;
    transition: transform .6s cubic-bezier(.4, 0, .2, 1), z-index .6s;
}

/* Wax Seal - positioned relative to top flap */
.env-seal {
    position: absolute;
    top: -85px;
    /* Inside the top border triangle */
    left: 50%;
    transform: translateX(-50%);
    width: 46px;
    height: 46px;
    background: radial-gradient(circle at 30% 30%, #b03a2e, #7b241c);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: 2px solid #641e16;
    color: #f1c40f;
    font-family: var(--font-heading);
    font-weight: bold;
    font-size: 0.85rem;
    pointer-events: none;
}

.env-seal span {
    display: inline-block;
}

.env-seal .heart {
    color: #f1c40f;
    font-size: 0.6rem;
    margin: 0 1px;
}

/* ── Open State ── */
.envelope-scene.open .env-flap-top {
    transform: rotateX(180deg);
    z-index: 1;
    /* Go behind letter when open */
    transition-delay: 0s;
}

.click-hint {
    position: static;
    margin-top: 16px;
    text-align: center;
    color: var(--primary-color);
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1rem;
    animation: bounce 2s infinite;
    transition: opacity .4s;
}

/* ───────────── Footer & Music ───────────── */
footer {
    text-align: center;
    padding: 30px;
    color: #aaa;
    font-size: .8rem;
    position: relative;
    z-index: 2;
    height: auto;
    min-height: 60px;
    scroll-snap-align: none;
    /* Footer doesn't need snap */
}

.floating-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 55px;
    height: 55px;
    background: rgba(255, 255, 255, .9);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 50%;
    font-size: 1.3rem;
    z-index: 100;
    transition: all .3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
}

.floating-btn:hover {
    transform: scale(1.1);
    background: var(--primary-color);
    color: #fff;
}

/* ───────────── Animations ───────────── */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* ───────────── Mobile ───────────── */
@media (max-width: 768px) {

    html,
    body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    .hero h1 {
        font-size: 3.2rem;
    }

    .hero .subtitle {
        font-size: 1.1rem;
        letter-spacing: 2px;
    }

    .love-counter {
        padding: 20px 28px;
        width: 92%;
        min-width: unset;
    }

    #counter {
        font-size: 1.05rem;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 35px;
    }

    .photo-caption p {
        font-size: 1.5rem;
    }

    .sifatlar-cloud {
        gap: 10px;
        max-width: 100%;
    }

    .sifat-sm {
        font-size: .8rem;
        padding: 6px 16px;
    }

    .sifat-md {
        font-size: .95rem;
        padding: 10px 22px;
    }

    .sifat-lg {
        font-size: 1.15rem;
        padding: 11px 26px;
    }

    .sifat-xl {
        font-size: 1.4rem;
        padding: 13px 30px;
    }

    .sifatlar-footer {
        font-size: .85rem;
        padding: 0 20px;
        text-align: center;
    }

    /* Envelope mobile - Scale down instead of resizing borders */
    .envelope-scene {
        transform: scale(0.8);
        transform-origin: bottom center;
        margin: 0 auto;
        display: block;
        /* Ensure it respects margin auto */
    }



    .floating-btn {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
        bottom: 18px;
        right: 18px;
    }
}