/* =========================================
   Where Has Benny Been? - Scrapbook Styles
   ========================================= */

:root {
    --parchment: #f4e4c1;
    --parchment-dark: #e8d4a8;
    --sepia: #8b7355;
    --sepia-dark: #5c4a3a;
    --accent: #c0392b;
    --accent-hover: #a93226;
    --shadow: rgba(92, 74, 58, 0.3);
    --shadow-dark: rgba(92, 74, 58, 0.5);
}

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

body {
    font-family: 'Lora', Georgia, serif;
    background:
        url('assets/bg-parchment.svg') center center / cover no-repeat fixed,
        linear-gradient(135deg, var(--parchment) 0%, var(--parchment-dark) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

/* =========================================
   View System
   ========================================= */

.view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

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

/* =========================================
   Collage View - Canvas
   ========================================= */

.canvas {
    position: relative;
    width: min(900px, 95vw);
    height: min(650px, 85vh);
    background:
        linear-gradient(145deg, rgba(255,255,255,0.1) 0%, transparent 50%),
        var(--parchment);
    border-radius: 12px;
    box-shadow:
        0 20px 60px var(--shadow-dark),
        inset 0 1px 0 rgba(255,255,255,0.5),
        inset 0 -1px 0 rgba(0,0,0,0.1);
    padding: 40px;
}

/* =========================================
   Collage Elements
   ========================================= */

.element {
    position: absolute;
    opacity: 0;
    transform: translateY(50px) scale(0.8);
    filter: blur(4px);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.element.visible {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(var(--rotate, 0deg));
    filter: blur(0);
}

/* Map Card */
.map-card {
    top: 5%;
    left: 5%;
    width: 280px;
    --rotate: -3deg;
    z-index: 1;
}

.map-card img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 8px 25px var(--shadow);
}

.map-pins {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.pin {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 5px var(--shadow);
    cursor: pointer;
    animation: pulse 2s ease-in-out infinite;
}

.pin:nth-child(2) { animation-delay: 0.3s; }
.pin:nth-child(3) { animation-delay: 0.6s; }

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Polaroids */
.polaroid {
    width: 160px;
    cursor: default;
}

.polaroid-inner {
    background: white;
    padding: 10px 10px 35px;
    box-shadow: 0 8px 20px var(--shadow);
}

.polaroid-inner img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.polaroid .caption {
    font-family: 'Caveat', cursive;
    font-size: 16px;
    color: var(--sepia);
    text-align: center;
    margin-top: 8px;
}

.polaroid-1 {
    top: 8%;
    right: 15%;
    --rotate: 5deg;
    z-index: 2;
}

.polaroid-2 {
    top: 45%;
    left: 35%;
    --rotate: -4deg;
    z-index: 3;
}

.polaroid-3 {
    bottom: 10%;
    right: 8%;
    --rotate: 3deg;
    z-index: 2;
}

/* Passport */
.passport {
    bottom: 12%;
    left: 8%;
    width: 140px;
    --rotate: 8deg;
    z-index: 4;
    cursor: pointer;
    transition: all 0.3s ease;
}

.passport:hover {
    transform: translateY(-5px) scale(1.05) rotate(8deg);
}

.passport img {
    width: 100%;
    border-radius: 4px;
    box-shadow: 0 10px 30px var(--shadow-dark);
}

.passport-label {
    font-family: 'Caveat', cursive;
    font-size: 14px;
    color: var(--sepia);
    text-align: center;
    margin-top: 8px;
    opacity: 0.7;
}

/* Logo Badge */
.logo-badge {
    bottom: 15%;
    right: 25%;
    width: 100px;
    --rotate: -5deg;
    z-index: 1;
}

.logo-badge img {
    width: 100%;
    filter: drop-shadow(0 4px 8px var(--shadow));
}

/* =========================================
   Book View
   ========================================= */

.book {
    perspective: 2000px;
}

.book-spread {
    display: flex;
    width: min(900px, 95vw);
    height: min(550px, 80vh);
    background:
        url('assets/book-spread.svg') center center / cover,
        linear-gradient(90deg, var(--parchment-dark) 0%, var(--parchment) 50%, var(--parchment-dark) 100%);
    border-radius: 8px;
    box-shadow:
        0 30px 80px var(--shadow-dark),
        0 0 0 1px rgba(0,0,0,0.1);
    overflow: hidden;
}

.page {
    flex: 1;
    padding: 50px;
    display: flex;
    flex-direction: column;
}

/* Book spine shadow */
.page-left {
    border-right: 1px solid rgba(0,0,0,0.1);
    box-shadow: inset -20px 0 40px rgba(0,0,0,0.08);
    justify-content: center;
}

.page-right {
    box-shadow: inset 20px 0 40px rgba(0,0,0,0.08);
    position: relative;
}

.headline {
    font-family: 'Caveat', cursive;
    font-size: clamp(28px, 5vw, 42px);
    color: var(--sepia-dark);
    line-height: 1.2;
    margin-bottom: 20px;
}

.intro {
    font-size: clamp(14px, 2vw, 18px);
    color: var(--sepia);
    line-height: 1.7;
    margin-bottom: 35px;
}

.buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    font-family: 'Lora', Georgia, serif;
    font-size: 16px;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 15px rgba(192, 57, 43, 0.3);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(192, 57, 43, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--sepia);
    border: 2px solid var(--sepia);
}

.btn-secondary:hover {
    background: var(--sepia);
    color: white;
}

/* Taped Photos on Right Page */
.taped-photos {
    position: relative;
    width: 100%;
    height: 100%;
}

.taped-photo {
    position: absolute;
    width: 130px;
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.book-view.active .taped-photo {
    opacity: 1;
    transform: scale(1) translateY(0) rotate(var(--rotate, 0deg));
}

.taped-photo img {
    width: 100%;
    border: 8px solid white;
    box-shadow: 0 4px 15px var(--shadow);
}

.photo-1 {
    top: 5%;
    left: 10%;
    --rotate: -5deg;
    transition-delay: 0.2s;
}

.photo-2 {
    top: 35%;
    right: 5%;
    --rotate: 4deg;
    transition-delay: 0.4s;
}

.photo-3 {
    bottom: 5%;
    left: 25%;
    --rotate: -3deg;
    transition-delay: 0.6s;
}

/* Tape Effect */
.tape {
    position: absolute;
    background: rgba(255, 255, 200, 0.7);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tape-top {
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 20px;
}

.tape-corner {
    top: -5px;
    right: -5px;
    width: 40px;
    height: 25px;
    transform: rotate(45deg);
}

/* =========================================
   Responsive
   ========================================= */

@media (max-width: 768px) {
    .canvas {
        height: auto;
        min-height: 500px;
        padding: 20px;
    }

    .element {
        position: relative;
        margin: 15px auto;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
    }

    .map-card {
        width: 100%;
        max-width: 280px;
    }

    .polaroid {
        width: 140px;
    }

    .passport {
        width: 120px;
    }

    .book-spread {
        flex-direction: column;
        height: auto;
    }

    .page {
        padding: 30px 25px;
    }

    .page-left {
        border-right: none;
        border-bottom: 1px solid rgba(0,0,0,0.1);
        box-shadow: inset 0 -20px 40px rgba(0,0,0,0.08);
    }

    .page-right {
        box-shadow: inset 0 20px 40px rgba(0,0,0,0.08);
        min-height: 300px;
    }

    .taped-photo {
        width: 100px;
    }
}

/* =========================================
   Loading State
   ========================================= */

body.loading .canvas,
body.loading .book {
    opacity: 0.5;
}
