/* ===== ROOT VARIABLES ===== */
:root {
    --bg-primary: #0a0015;
    --bg-secondary: #120025;
    --gold: #ffd700;
    --gold-light: #ffe66d;
    --gold-dark: #b8960f;
    --red: #ff3355;
    --red-light: #ff6b81;
    --pink: #ff69b4;
    --white: #ffffff;
    --cherry: #e74c6f;
    --white-soft: rgba(255, 255, 255, 0.9);
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 215, 0, 0.3);
    --shadow-gold: 0 0 40px rgba(255, 215, 0, 0.15);
    --shadow-glow: 0 0 80px rgba(255, 215, 0, 0.1);
    --font-heading: 'Be Vietnam Pro', 'Noto Sans', sans-serif;
    --font-script: 'Great Vibes', 'Dancing Script', cursive;
    --font-body: 'Be Vietnam Pro', 'Noto Sans', sans-serif;
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

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

/* ===== CANVAS FIREWORKS ===== */
#fireworks-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

body.fireworks-clickable #fireworks-canvas {
    pointer-events: auto;
    cursor: crosshair;
}

/* ===== SPARKLE OVERLAY ===== */
#sparkle-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

/* 🌸 CHERRY BLOSSOM PETALS */
.petal {
    position: absolute;
    background: radial-gradient(ellipse at 30% 30%,
            rgba(255, 182, 193, 0.9),
            rgba(255, 105, 140, 0.7) 50%,
            rgba(220, 80, 120, 0.4));
    border-radius: 80% 0 55% 50% / 55% 0 80% 50%;
    animation: petal-fall linear forwards;
    opacity: 0;
    filter: blur(0.3px);
    box-shadow: 0 0 4px rgba(255, 150, 180, 0.3);
}

@keyframes petal-fall {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0) rotate(0deg) scale(0.6);
    }

    10% {
        opacity: 0.9;
    }

    50% {
        transform: translateY(50vh) translateX(var(--drift, 50px)) rotate(240deg) scale(0.9);
    }

    80% {
        opacity: 0.6;
    }

    100% {
        opacity: 0;
        transform: translateY(105vh) translateX(calc(var(--drift, 50px) * 1.5)) rotate(520deg) scale(0.4);
    }
}

/* 🏮 FLOATING LANTERNS */
#lantern-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.lantern {
    position: absolute;
    animation: lantern-float linear forwards;
    opacity: 0;
    filter: blur(0.2px);
}

.lantern-body {
    width: 100%;
    height: 80%;
    background: radial-gradient(ellipse at 50% 40%,
            hsla(var(--lantern-hue, 15), 100%, 65%, 0.95),
            hsla(var(--lantern-hue, 15), 90%, 45%, 0.85) 60%,
            hsla(var(--lantern-hue, 15), 80%, 30%, 0.75));
    border-radius: 45% 45% 50% 50%;
    position: relative;
    box-shadow:
        0 0 15px hsla(var(--lantern-hue, 15), 100%, 50%, 0.5),
        0 0 40px hsla(var(--lantern-hue, 15), 100%, 50%, 0.2),
        inset 0 -5px 10px rgba(0, 0, 0, 0.15);
}

.lantern-glow {
    position: absolute;
    top: 20%;
    left: 20%;
    width: 60%;
    height: 40%;
    background: radial-gradient(ellipse,
            rgba(255, 255, 200, 0.6) 0%,
            transparent 70%);
    border-radius: 50%;
    animation: lantern-pulse 2s ease-in-out infinite alternate;
}

.lantern-string {
    width: 1px;
    height: 20%;
    background: rgba(200, 150, 50, 0.4);
    margin: 0 auto;
}

@keyframes lantern-float {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0) rotate(-2deg);
    }

    5% {
        opacity: 0.85;
    }

    50% {
        transform: translateY(-55vh) translateX(calc(var(--lantern-drift, 0px) * 0.6)) rotate(3deg);
    }

    90% {
        opacity: 0.6;
    }

    100% {
        opacity: 0;
        transform: translateY(-110vh) translateX(var(--lantern-drift, 0px)) rotate(-2deg);
    }
}

@keyframes lantern-pulse {
    from {
        opacity: 0.5;
    }

    to {
        opacity: 1;
    }
}

/* ✨ TEXT REVEAL ANIMATION */
.reveal-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(15px) scale(0.8);
    animation: char-appear 0.5s ease-out forwards;
}

@keyframes char-appear {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 🖱️ SPARKLE CURSOR TRAIL */
.cursor-sparkle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    animation: sparkle-fade 0.7s ease-out forwards;
    z-index: 9998;
}

@keyframes sparkle-fade {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.2) translateY(-8px);
    }

    100% {
        opacity: 0;
        transform: scale(0) translateY(-20px);
    }
}

/* 📸 AUTO-SLIDESHOW HIGHLIGHT */
.gallery-card.auto-active {
    transform: scale(1.04);
    box-shadow:
        0 0 20px rgba(255, 215, 0, 0.5),
        0 0 40px rgba(255, 215, 0, 0.2),
        inset 0 0 15px rgba(255, 215, 0, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.6);
    z-index: 5;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.gallery-card {
    transition: transform 0.4s ease, box-shadow 0.4s ease, border 0.3s ease;
}

/* ===== MAIN CONTENT ===== */
main {
    position: relative;
    z-index: 3;
}

/* ===== HERO SECTION ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: radial-gradient(ellipse at center bottom, rgba(100, 0, 50, 0.3) 0%, transparent 60%),
        radial-gradient(ellipse at 20% 80%, rgba(50, 0, 100, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(100, 50, 0, 0.15) 0%, transparent 50%);
    padding: 20px;
}

.hero-content {
    text-align: center;
    max-width: 700px;
    animation: fadeInUp 1.5s ease-out;
}

.year-display {
    margin-bottom: 40px;
}

.year-small {
    display: block;
    font-family: var(--font-heading);
    font-size: clamp(14px, 3vw, 22px);
    letter-spacing: 12px;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    animation: glowPulse 3s ease-in-out infinite;
    margin-bottom: 10px;
}

.year-big {
    font-family: var(--font-heading);
    font-size: clamp(80px, 20vw, 180px);
    font-weight: 900;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 30%, var(--white) 50%, var(--gold-light) 70%, var(--gold) 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s ease-in-out infinite;
    text-shadow: none;
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.3));
    line-height: 1;
}

.year-line {
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 20px auto;
    animation: expandLine 2s ease-out forwards;
}

/* ===== GREETING CARD ===== */
.greeting-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 4px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-gold), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: cardFloat 6s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.greeting-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, var(--gold), transparent 30%, transparent 70%, var(--gold));
    border-radius: 26px;
    z-index: -1;
    opacity: 0.5;
    animation: borderGlow 4s ease-in-out infinite alternate;
}

.card-inner {
    background: rgba(10, 0, 30, 0.7);
    border-radius: 20px;
    padding: clamp(30px, 5vw, 50px);
    position: relative;
}

.card-decoration {
    position: absolute;
    width: 40px;
    height: 40px;
    border-color: var(--gold);
    border-style: solid;
    opacity: 0.6;
}

.card-decoration.top-left {
    top: 15px;
    left: 15px;
    border-width: 2px 0 0 2px;
    border-radius: 4px 0 0 0;
}

.card-decoration.top-right {
    top: 15px;
    right: 15px;
    border-width: 2px 2px 0 0;
    border-radius: 0 4px 0 0;
}

.card-decoration.bottom-left {
    bottom: 15px;
    left: 15px;
    border-width: 0 0 2px 2px;
    border-radius: 0 0 0 4px;
}

.card-decoration.bottom-right {
    bottom: 15px;
    right: 15px;
    border-width: 0 2px 2px 0;
    border-radius: 0 0 4px 0;
}

.greeting-title {
    font-family: var(--font-script);
    font-size: clamp(32px, 7vw, 56px);
    color: var(--gold);
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
    margin-bottom: 20px;
    line-height: 1.3;
    letter-spacing: 3px;
    word-spacing: 8px;
}

.greeting-text {
    font-family: var(--font-body);
    font-size: clamp(15px, 2.5vw, 18px);
    line-height: 1.9;
    color: var(--white-soft);
    margin-bottom: 24px;
    font-style: italic;
}

.greeting-signature {
    text-align: center;
}

.signature-text {
    font-family: 'Dancing Script', cursive;
    font-size: clamp(22px, 4vw, 30px);
    color: var(--gold-light);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    letter-spacing: 2px;
    word-spacing: 4px;
}

/* ===== SCROLL HINT ===== */
.scroll-hint {
    margin-top: 50px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    letter-spacing: 2px;
    animation: fadeInUp 2s ease-out 1s both;
}

.scroll-arrow {
    font-size: 24px;
    margin-top: 10px;
    animation: bounce 2s ease-in-out infinite;
}

/* ===== GALLERY SECTION ===== */
.gallery-section {
    padding: 80px 20px 100px;
    position: relative;
    background: linear-gradient(180deg, transparent 0%, rgba(50, 0, 80, 0.1) 50%, transparent 100%);
}

.section-title {
    text-align: center;
    font-family: var(--font-heading);
    font-size: clamp(24px, 5vw, 40px);
    color: var(--gold);
    margin-bottom: 60px;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    letter-spacing: 4px;
}

.title-star {
    display: inline-block;
    margin: 0 15px;
    animation: starSpin 4s linear infinite;
    color: var(--gold-light);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

.gallery-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 3 / 4;
    border: 2px solid rgba(255, 215, 0, 0.2);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation: cardReveal 0.8s ease-out both;
}

.gallery-card:nth-child(1) {
    animation-delay: 0.1s;
}

.gallery-card:nth-child(2) {
    animation-delay: 0.2s;
}

.gallery-card:nth-child(3) {
    animation-delay: 0.3s;
}

.gallery-card:nth-child(4) {
    animation-delay: 0.4s;
}

.gallery-card:nth-child(5) {
    animation-delay: 0.5s;
}

.gallery-card:nth-child(6) {
    animation-delay: 0.6s;
}

.gallery-card.featured {
    grid-row: span 1;
}

.gallery-card .card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
    pointer-events: none;
}

.gallery-card:hover .card-glow {
    opacity: 1;
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--gold);
    box-shadow: 0 20px 60px rgba(255, 215, 0, 0.2), 0 0 40px rgba(255, 215, 0, 0.1);
}

.gallery-card:hover img {
    transform: scale(1.1);
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 20px 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
    z-index: 2;
}

.gallery-card:hover .card-overlay {
    opacity: 1;
    transform: translateY(0);
}

.card-caption {
    font-family: var(--font-script);
    font-size: 20px;
    color: var(--gold-light);
}

/* ===== FOOTER GREETING ===== */
.footer-greeting {
    padding: 60px 20px 80px;
    text-align: center;
    position: relative;
}

.footer-wish {
    font-family: var(--font-body);
    font-size: clamp(16px, 3vw, 22px);
    color: var(--white-soft);
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.footer-year {
    font-family: var(--font-heading);
    font-size: clamp(40px, 8vw, 80px);
    font-weight: 900;
    background: linear-gradient(135deg, var(--gold), var(--red-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.3));
}

/* ===== LIGHTBOX ===== */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: var(--white);
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.3s, transform 0.3s;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    color: var(--gold);
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 36px;
    color: var(--white);
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    cursor: pointer;
    z-index: 1001;
    width: 50px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s;
}

.lightbox-nav:hover {
    background: rgba(255, 215, 0, 0.2);
    color: var(--gold);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.2);
    animation: lightboxZoom 0.4s ease-out;
}

.lightbox-caption {
    text-align: center;
    margin-top: 15px;
    font-family: var(--font-script);
    font-size: 22px;
    color: var(--gold-light);
}

/* ===== CLICK HINT ===== */
.click-hint {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 30px;
    padding: 10px 24px;
    font-size: 14px;
    color: var(--gold-light);
    z-index: 100;
    backdrop-filter: blur(10px);
    animation: fadeInUp 1s ease-out 3s both;
    transition: opacity 0.5s;
    white-space: nowrap;
}

.click-hint.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ===== KEYFRAMES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes glowPulse {

    0%,
    100% {
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    }

    50% {
        text-shadow: 0 0 40px rgba(255, 215, 0, 0.8), 0 0 60px rgba(255, 215, 0, 0.3);
    }
}

@keyframes expandLine {
    from {
        width: 0;
        opacity: 0;
    }

    to {
        width: 200px;
        opacity: 1;
    }
}

@keyframes cardFloat {

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

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

@keyframes borderGlow {
    0% {
        opacity: 0.3;
    }

    100% {
        opacity: 0.7;
    }
}

@keyframes bounce {

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

    50% {
        transform: translateY(10px);
    }
}

@keyframes starSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes cardReveal {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes lightboxZoom {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero {
        padding: 15px;
    }

    .year-small {
        letter-spacing: 6px;
        font-size: clamp(12px, 2.5vw, 18px);
    }

    .year-big {
        font-size: clamp(60px, 18vw, 140px);
    }

    .greeting-title {
        font-size: clamp(26px, 6vw, 42px);
        letter-spacing: 2px;
        word-spacing: 5px;
    }

    .greeting-text {
        font-size: clamp(13px, 2.2vw, 16px);
        line-height: 1.8;
    }

    .signature-text {
        font-size: clamp(18px, 3.5vw, 26px);
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .gallery-card.featured {
        grid-row: span 1;
    }

    .card-decoration {
        width: 25px;
        height: 25px;
    }

    .section-title {
        font-size: clamp(20px, 4vw, 32px);
        margin-bottom: 30px;
        letter-spacing: 2px;
    }

    .lightbox-nav {
        width: 40px;
        height: 50px;
        font-size: 28px;
    }

    .lightbox-prev {
        left: 5px;
    }

    .lightbox-next {
        right: 5px;
    }

    .click-hint {
        font-size: 11px;
        padding: 8px 14px;
        bottom: 15px;
        max-width: 90vw;
        text-align: center;
    }

    .scroll-hint {
        margin-top: 30px;
        font-size: 13px;
    }

    .footer-wish {
        font-size: clamp(14px, 2.8vw, 18px);
    }

    .footer-year {
        font-size: clamp(36px, 7vw, 60px);
    }

    /* Lanterns smaller on mobile */
    .lantern {
        opacity: 0.7;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 10px;
        min-height: 100svh;
    }

    .hero-content {
        max-width: 100%;
    }

    .year-small {
        letter-spacing: 4px;
        font-size: 12px;
        margin-bottom: 6px;
    }

    .year-big {
        font-size: clamp(55px, 22vw, 100px);
    }

    .year-line {
        width: 120px;
        margin: 12px auto;
    }

    .greeting-card {
        border-radius: 14px;
        margin: 0 -2px;
    }

    .card-inner {
        padding: 22px 16px;
    }

    .greeting-title {
        font-size: clamp(22px, 7vw, 36px);
        letter-spacing: 1.5px;
        word-spacing: 4px;
        margin-bottom: 14px;
    }

    .greeting-text {
        font-size: 14px;
        line-height: 1.75;
        margin-bottom: 18px;
    }

    .signature-text {
        font-size: 18px;
        letter-spacing: 1.5px;
        word-spacing: 3px;
    }

    .card-decoration {
        width: 20px;
        height: 20px;
        top: 10px;
    }

    .card-decoration.bottom-left,
    .card-decoration.bottom-right {
        bottom: 10px;
        top: auto;
    }

    .card-decoration.top-left,
    .card-decoration.bottom-left {
        left: 10px;
    }

    .card-decoration.top-right,
    .card-decoration.bottom-right {
        right: 10px;
    }

    .gallery-section {
        padding: 50px 12px 60px;
    }

    .gallery-grid {
        gap: 10px;
    }

    .gallery-card {
        border-radius: 14px;
    }

    .scroll-hint {
        margin-top: 20px;
        font-size: 12px;
        letter-spacing: 1px;
    }

    .scroll-arrow {
        font-size: 20px;
    }

    .click-hint {
        font-size: 11px;
        padding: 7px 12px;
        bottom: 12px;
        border-radius: 20px;
    }

    .footer-greeting {
        padding: 40px 15px 60px;
    }

    .footer-wish {
        font-size: 14px;
    }

    .footer-year {
        font-size: clamp(32px, 12vw, 60px);
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 32px;
    }
}