/* === CSS Variables === */
:root {
    --bg-deep: #0a0000;
    --bg-dark: #1a0a0a;
    --bg-card: #1e0e0e;
    --red-dark: #8B0000;
    --red-mid: #C41E3A;
    --red-light: #ff6b6b;
    --red-glow: rgba(196, 30, 58, 0.3);
    --text-primary: #e0c8c8;
    --text-secondary: #d4a8a8;
    --text-muted: #8a6060;
}

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    line-height: 1.7;
}

/* === Particle Canvas === */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* === Side Floral Ornaments (desktop only) === */
.side-ornaments {
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    isolation: isolate;
}

@media (max-width: 1399px) {
    .side-ornaments {
        display: none;
    }
}

.side-ornament {
    position: absolute;
    top: 0;
    bottom: 0;
    height: 100%;
    width: 260px;
    overflow: visible;
    opacity: 0.85;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%);
}

.side-ornament-left {
    left: 120px;
}

.side-ornament-right {
    right: 120px;
    transform: scaleX(-1);
}

/* === Background Floating Emoji === */
.bg-emojis {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

@media (max-width: 768px) {
    .bg-emojis {
        display: none;
    }
}

.bg-emoji {
    position: absolute;
    bottom: -40px;
    font-size: 22px;
    opacity: 0;
    color: rgba(255, 180, 140, 0.8);
    filter: drop-shadow(0 0 6px rgba(255, 120, 80, 0.4));
    animation-name: bgEmojiFloat;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    will-change: transform, opacity;
}

@keyframes bgEmojiFloat {
    0%   { transform: translateY(0) translateX(0);     opacity: 0; }
    10%  { opacity: 0.35; }
    50%  { transform: translateY(-55vh) translateX(20px); opacity: 0.4; }
    90%  { opacity: 0.3; }
    100% { transform: translateY(-110vh) translateX(-15px); opacity: 0; }
}

/* === Glow key words === */
.glow-word {
    animation: glowWordPulse 3.5s ease-in-out infinite;
}

@keyframes glowWordPulse {
    0%, 100% { text-shadow: 0 0 4px rgba(255, 120, 80, 0.35); }
    50%      { text-shadow: 0 0 14px rgba(255, 150, 100, 0.85), 0 0 22px rgba(255, 90, 50, 0.4); }
}

/* === Song mentions === */
.song-mention {
    position: relative;
    display: inline-block;
}

.note-emoji {
    position: absolute;
    left: 50%;
    top: -8px;
    font-size: 18px;
    opacity: 0;
    pointer-events: none;
    filter: drop-shadow(0 0 6px rgba(255, 180, 120, 0.6));
    will-change: transform, opacity;
}

/* === Typewriter cursor === */
.typewriter-cursor {
    display: inline-block;
    width: 2px;
    margin-left: 2px;
    background: currentColor;
    animation: typewriterBlink 0.8s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes typewriterBlink {
    0%, 50%   { opacity: 1; }
    51%, 100% { opacity: 0; }
}


/* === Sections === */
.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: 60px 20px;
}

/* === Enter Overlay === */
.enter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-deep);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

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

.enter-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--text-secondary);
    letter-spacing: 3px;
    animation: pulse-glow 2s ease-in-out infinite;
}

.enter-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.enter-credits {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 90%;
    text-align: center;
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    color: var(--text-secondary);
    opacity: 0.75;
    letter-spacing: 1px;
    line-height: 1.5;
    padding: 0 12px;
}

.enter-credits a {
    color: #ff6b6b;
    text-decoration: none;
    border-bottom: 1px dashed rgba(255, 107, 107, 0.5);
}

.enter-credits a:hover {
    color: #ff9999;
    border-bottom-color: #ff9999;
}

@keyframes pulse-glow {
    0%, 100% { text-shadow: 0 0 10px rgba(196, 30, 58, 0.3); }
    50% { text-shadow: 0 0 30px rgba(196, 30, 58, 0.6), 0 0 60px rgba(196, 30, 58, 0.3); }
}

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

/* === Section 1: Hero === */
.hero-section {
    background: radial-gradient(ellipse at center, #2a0a0a 0%, var(--bg-deep) 70%);
    flex-direction: column;
    text-align: center;
    gap: 30px;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: var(--red-mid);
    text-shadow: 0 0 40px rgba(196, 30, 58, 0.5), 0 0 80px rgba(196, 30, 58, 0.2);
    opacity: 0;
    letter-spacing: 2px;
}

.rainbow-text {
    background: linear-gradient(
        90deg,
        #ff0000, #ff8000, #ffff00, #00ff00, #00bfff, #8000ff, #ff00ff, #ff0000
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow-shift 10s linear infinite;
    filter: drop-shadow(0 0 20px rgba(196, 30, 58, 0.4));
}

@keyframes rainbow-shift {
    0%   { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

.hero-subtitle {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: var(--text-secondary);
    opacity: 0;
    font-style: italic;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    animation: fade-in-delay 1s 3s forwards;
}

.scroll-indicator span {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border-right: 2px solid var(--red-mid);
    border-bottom: 2px solid var(--red-mid);
    transform: rotate(45deg);
    animation: bounce-arrow 2s ease-in-out infinite;
}

@keyframes bounce-arrow {
    0%, 100% { transform: rotate(45deg) translateY(0); }
    50% { transform: rotate(45deg) translateY(8px); }
}

@keyframes fade-in-delay {
    to { opacity: 1; }
}

/* === Section 2: Portrait Photo === */
.photo-section {
    background: linear-gradient(180deg, var(--bg-deep) 0%, #150505 50%, var(--bg-deep) 100%);
    flex-direction: column;
    gap: 40px;
}

.photo-container {
    position: relative;
    max-width: 500px;
    width: 80%;
}

.photo-container img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 0 60px rgba(139, 0, 0, 0.4), 0 0 120px rgba(139, 0, 0, 0.15);
    clip-path: circle(0% at 50% 50%);
}

.photo-caption {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    color: var(--text-secondary);
    text-align: center;
    font-style: italic;
    max-width: 600px;
    opacity: 0;
}

/* === Section 3: Letter === */
.letter-section {
    background: linear-gradient(180deg, var(--bg-deep) 0%, #120404 50%, var(--bg-deep) 100%);
    flex-direction: column;
    align-items: center;
    padding: 100px 20px;
}

.letter-container {
    max-width: 700px;
    width: 100%;
}

.letter-paragraph {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-secondary);
    margin-bottom: 35px;
    opacity: 0;
    transform: translateY(30px);
    line-height: 1.9;
}

.letter-highlight {
    color: var(--red-mid);
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.3rem, 2.5vw, 1.7rem);
    display: block;
    margin: 50px 0;
    text-align: center;
    text-shadow: 0 0 20px rgba(196, 30, 58, 0.3);
}

.letter-divider {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--red-mid), transparent);
    margin: 40px auto;
    opacity: 0;
}

/* === Section 4: Group Photo === */
.parallax-section {
    background: var(--bg-deep);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    flex-direction: column;
    gap: 30px;
}

.parallax-photo-wrapper {
    position: relative;
    max-width: 700px;
    width: 85%;
    overflow: hidden;
    border-radius: 12px;
}

.parallax-photo-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    box-shadow: 0 0 80px rgba(139, 0, 0, 0.3);
    clip-path: circle(0% at 50% 50%);
}

.photo-vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 100px 40px var(--bg-deep);
    border-radius: 12px;
    pointer-events: none;
}

.parallax-quote {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--red-light);
    text-align: center;
    max-width: 600px;
    font-style: italic;
    opacity: 0;
    text-shadow: 0 0 20px rgba(255, 107, 107, 0.2);
}

/* === Section 5: Letter from Avital === */
.letter-section-avital {
    background: linear-gradient(180deg, var(--bg-deep) 0%, #0f0808 50%, var(--bg-deep) 100%);
}

.letter-author-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.5rem, 3.5vw, 2.2rem);
    color: var(--red-mid);
    text-align: center;
    margin-bottom: 50px;
    text-shadow: 0 0 30px rgba(196, 30, 58, 0.4);
    opacity: 0;
}

.letter-signature {
    text-align: right;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: var(--text-muted);
    margin-top: 40px;
}

/* === Section 6: Wishes === */
.wishes-section {
    background: linear-gradient(180deg, var(--bg-deep) 0%, #1a0505 50%, var(--bg-deep) 100%);
    flex-direction: column;
    gap: 30px;
    padding: 80px 20px;
}

.wishes-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--red-mid);
    text-align: center;
    margin-bottom: 40px;
    opacity: 0;
}

.wishes-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
    max-width: 600px;
    width: 100%;
}

.wish-card {
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.15), rgba(30, 14, 14, 0.8));
    border: 1px solid rgba(196, 30, 58, 0.3);
    border-radius: 16px;
    padding: 25px 30px;
    opacity: 0;
    transform: translateX(-80px);
    backdrop-filter: blur(10px);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.wish-card:nth-child(even) {
    transform: translateX(80px);
}

.wish-card:hover {
    border-color: var(--red-mid);
    box-shadow: 0 0 30px rgba(196, 30, 58, 0.2);
}

.wish-card .wish-icon {
    font-size: 1.8rem;
    margin-bottom: 10px;
    display: block;
}

.wish-card .wish-text {
    font-size: 1.1rem;
    color: var(--text-primary);
    line-height: 1.6;
}

/* === Section 6: Finale === */
.finale-section {
    background: radial-gradient(ellipse at center, #2a0a0a 0%, var(--bg-deep) 70%);
    flex-direction: column;
    text-align: center;
    gap: 40px;
}

.finale-text {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.5rem, 4vw, 3rem);
    color: var(--red-mid);
    text-shadow: 0 0 40px rgba(196, 30, 58, 0.4);
    max-width: 700px;
    opacity: 0;
    line-height: 1.5;
}

.finale-sub {
    font-size: 1.1rem;
    color: var(--text-muted);
    opacity: 0;
    font-style: italic;
}

.finale-btn {
    display: inline-block;
    padding: 16px 40px;
    background: linear-gradient(135deg, var(--red-dark), var(--red-mid));
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    letter-spacing: 1px;
    opacity: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 20px rgba(139, 0, 0, 0.4);
}

.finale-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 35px rgba(196, 30, 58, 0.5);
    color: white;
}

/* === Audio Widget === */
.audio-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(26, 10, 10, 0.9);
    border: 1px solid rgba(196, 30, 58, 0.3);
    border-radius: 50px;
    padding: 8px 12px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.audio-widget:hover {
    border-color: var(--red-mid);
    box-shadow: 0 0 20px rgba(196, 30, 58, 0.2);
}

.audio-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--red-mid);
    background: transparent;
    color: var(--red-light);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.audio-btn:hover {
    background: rgba(196, 30, 58, 0.2);
}

.audio-widget input[type="range"] {
    width: 70px;
    accent-color: var(--red-mid);
    cursor: pointer;
}

.audio-track-name {
    font-size: 0.7rem;
    color: var(--text-muted);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: none;
}

.audio-widget:hover .audio-track-name {
    display: block;
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
    background: var(--red-dark);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--red-mid);
}

/* === Responsive === */
@media (max-width: 768px) {
    .section {
        padding: 40px 15px;
    }

    .photo-container {
        width: 90%;
    }

    .parallax-photo-wrapper {
        width: 95%;
    }

    .wish-card {
        padding: 20px;
    }

    .audio-widget {
        bottom: 15px;
        right: 15px;
        padding: 6px 10px;
    }

    .audio-widget input[type="range"] {
        width: 50px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        letter-spacing: 1px;
    }

    .letter-paragraph {
        font-size: 1rem;
        margin-bottom: 25px;
    }

    .wish-card,
    .wish-card:nth-child(even) {
        transform: translateY(40px);
        transform: none;
    }
}

/* === Prefers reduced motion === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
