/* ========================================
   SAN VALENTINO WRAPPED - REFINED V10 (LIQUID + FIXED BG)
   ======================================== */

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

html,
body {
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    background: #000;
    color: #fff;
    -webkit-tap-highlight-color: transparent;
}

/* Fonts */
.font-kalam {
    font-family: 'Kalam', cursive;
}

.font-caveat {
    font-family: 'Caveat', cursive;
}

.font-patrick {
    font-family: 'Patrick Hand', cursive;
}

.font-marker {
    font-family: 'Permanent Marker', cursive;
    letter-spacing: 1px;
}

/* Global Background Layer */
#background-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.bg-layer {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    /* Styles for the collage content inside */
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    filter: blur(5px) brightness(0.5);
}

.bg-layer.active {
    opacity: 0.4;
    /* Or desired visibility level */
}

.bg-layer img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: fadeIn 1.5s ease forwards;
}

/* Start Overlay */
.start-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #000 0%, #1a1a1a 100%);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

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

.start-content {
    text-align: center;
}

.emoji-large {
    font-size: 4rem;
    animation: pulse 2s infinite;
    display: block;
    margin-bottom: 2rem;
}

.start-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.start-content p {
    font-size: 1.2rem;
    opacity: 0.8;
    animation: bounce 2s infinite;
}

/* Progress Bar */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 2000;
}

.progress-bar {
    height: 100%;
    background: #1DB954;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(29, 185, 84, 0.5);
}

.nav-arrow {
    display: none !important;
}

/* Slides Container */
.slides-container {
    height: 100%;
    width: 100%;
    position: relative;
    z-index: 10;
}

/* Slides - Transparent now */
.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    background: transparent;
    /* Changed from #000 */
    overflow: hidden;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 10;
    transform: none !important;
    filter: none !important;
}

/* Varied Transitions */
.slide.enter-right {
    transform: translateX(100%);
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.slide.active.enter-right {
    transform: translateX(0);
}

.slide.enter-up {
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.slide.active.enter-up {
    transform: translateY(0);
}

.slide.enter-zoom {
    transform: scale(0.5);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.slide.active.enter-zoom {
    transform: scale(1);
    opacity: 1;
}

.slide.enter-rotate {
    transform: rotate(-20deg) scale(0.8);
    opacity: 0;
    transition: all 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.slide.active.enter-rotate {
    transform: rotate(0) scale(1);
    opacity: 1;
}

.slide.enter-blur {
    filter: blur(20px);
    opacity: 0;
    transition: all 0.8s ease;
}

.slide.active.enter-blur {
    filter: blur(0);
    opacity: 1;
}

/* Slide Content Base */
.slide-content {
    position: relative;
    z-index: 2;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.slide-photo .slide-content {
    justify-content: flex-start;
    padding-top: 5vh;
    padding-bottom: 5vh;
    gap: 2vh;
}

/* Typography & Liquid Glass Year */
.huge-title {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
    text-align: center;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    margin: 1rem 0;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.year-intro-content {
    text-align: center;
}

/* LIQUID GLASS EFFECT */
.year-title {
    font-size: 8rem;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    font-family: 'Inter', sans-serif;

    /* Silver/Liquid Gradient */
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.8) 0%,
            rgba(255, 255, 255, 0.2) 25%,
            rgba(255, 255, 255, 0.9) 50%,
            rgba(255, 255, 255, 0.2) 75%,
            rgba(255, 255, 255, 0.8) 100%);
    background-size: 200% auto;

    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    /* Dropshadow for liquid depth */
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3)) drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));

    animation: liquidFlow 4s linear infinite;
}

@keyframes liquidFlow {
    0% {
        background-position: 0% 50%;
    }

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

.year-subtitle {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 1rem;
    color: #1DB954;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
}

/* Photo Container */
.photo-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
    min-height: 0;
}

/* Sizing */
.layout-1,
.layout-2 {
    width: 100%;
    height: 100%;
    max-height: 80vh;
}

.layout-3,
.layout-4 {
    width: 100%;
    max-height: 60vh;
    margin-bottom: auto;
}

/* IMAGES */
img {
    border-radius: 12px;
}

.layout-1 {
    display: flex;
    justify-content: center;
    align-items: center;
}

.layout-1 img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.layout-2 {
    display: flex;
    flex-direction: column;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.layout-2 img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 48%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    background: transparent;
}

.layout-3 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 0.8fr 1fr;
    gap: 8px;
}

.layout-3 img,
.layout-4 img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    box-shadow: none;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.5));
    background: transparent;
}

.layout-3 img:nth-child(1) {
    grid-column: 1 / -1;
    grid-row: 1;
}

.layout-3 img:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
}

.layout-3 img:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
}

.layout-4 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
}

/* Captions */
.caption-overlay {
    position: relative;
    width: 90%;
    max-width: 500px;
    padding: 1.2rem;
    z-index: 20;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.caption-text {
    font-size: 1.2rem;
    line-height: 1.3;
    font-weight: 700;
    text-align: center;
    color: #000;
}

.cap-bg-1 {
    background: #fff;
}

.cap-bg-2 {
    background: #fff8e1;
}

.cap-bg-3 {
    background: #f3e5f5;
}

.cap-bg-4 {
    background: #e0f2f1;
}

.cap-bg-5 {
    background: #ffebee;
}

.cap-bg-6 {
    background: #e8eaf6;
}

.cap-bg-7 {
    background: #f1f8e9;
}

/* Letter */
.slide-letter .slide-content {
    padding: 0;
    justify-content: center;
}

.postcard-container {
    width: 100%;
    height: 100%;
    background: url('assets/chiusura/postcard_bg.png') no-repeat center center;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    color: #3e2723;
}

.postcard-text-area {
    width: 100%;
    max-width: 600px;
    height: 80%;
    overflow-y: auto;
    font-size: 1.4rem;
    line-height: 1.5;
    padding: 1rem;
}

.scroll-indicator {
    position: absolute;
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%);
    color: #3e2723;
    font-size: 2rem;
    animation: bounce 1.5s infinite;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.scroll-indicator.visible {
    opacity: 0.7;
}

.letter-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 700;
    display: block;
}

.slide-final .slide-content {
    margin-top: -20px;
}

.heart-final {
    font-size: 8rem;
    animation: heartbeat 1.5s infinite;
}

/* Desktop */
@media (min-width: 768px) {
    .huge-title {
        font-size: 6rem;
    }

    .layout-1,
    .layout-2,
    .layout-3,
    .layout-4 {
        width: 600px;
        margin: 0 auto;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes pulse {

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

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

@keyframes bounce {

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

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

@keyframes heartbeat {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }

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

@keyframes slideInUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

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

.anim-pop {
    animation: pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.anim-slide-up {
    animation: slideInUp 0.8s ease both;
}

.anim-fade {
    animation: fadeIn 1s ease both;
}

@keyframes pop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}