/* ppuzzl.works - Maximalist Duotone Theater */

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

html {
    scroll-behavior: smooth;
    overflow: hidden;
    height: 100%;
}

body {
    font-family: 'Work Sans', sans-serif;
    height: 100%;
    overflow: hidden;
    background: #0A0818;
}

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

/* ========================================
   THEATER LAYOUT - Split Screen 55/45
   ======================================== */
.theater {
    display: flex;
    width: 100%;
    height: 100vh;
    position: relative;
}

.panel {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    scrollbar-width: thin;
}

.panel-dark {
    width: 55%;
    background: #0A0818;
    scrollbar-color: #C8A060 #0A0818;
}

.panel-light {
    width: 45%;
    background: #F8E8D8;
    scrollbar-color: #C8A060 #F8E8D8;
}

.panel-dark::-webkit-scrollbar,
.panel-light::-webkit-scrollbar {
    width: 6px;
}

.panel-dark::-webkit-scrollbar-track {
    background: #0A0818;
}

.panel-dark::-webkit-scrollbar-thumb {
    background: #C8A060;
    border-radius: 3px;
}

.panel-light::-webkit-scrollbar-track {
    background: #F8E8D8;
}

.panel-light::-webkit-scrollbar-thumb {
    background: #C8A060;
    border-radius: 3px;
}

.panel-inner {
    padding: 4rem 3rem 6rem;
    min-height: 100%;
}

/* ========================================
   STAGE DIVIDER
   ======================================== */
.stage-divider {
    width: 3px;
    background: #C8A060;
    height: 100vh;
    position: relative;
    flex-shrink: 0;
    z-index: 5;
    box-shadow: 0 0 20px rgba(200, 160, 96, 0.3),
                0 0 40px rgba(200, 160, 96, 0.1);
}

.stage-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: #C8A060;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(200, 160, 96, 0.6);
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

/* Display Headings - Fraunces */
.title-fragment {
    font-family: 'Fraunces', serif;
    font-size: clamp(2.4rem, 5.5vw, 4.2rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.1;
    transition: font-weight 0.6s ease, font-variation-settings 0.6s ease;
}

.title-dark {
    color: #E8C878;
}

.title-light {
    color: #1A0818;
}

/* Section Headings */
.section-heading {
    font-family: 'Fraunces', serif;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 300;
    letter-spacing: 0.02em;
    line-height: 1.2;
    margin-bottom: 1.2rem;
    transition: font-weight 0.4s ease;
}

.heading-dark {
    color: #E8C878;
}

.heading-light {
    color: #1A0818;
}

/* Body Text - Work Sans */
.body-text {
    font-family: 'Work Sans', sans-serif;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    font-weight: 300;
    line-height: 1.85;
}

.body-dark {
    color: #A89878;
}

.body-light {
    color: #4A3828;
}

/* Accent Labels - JetBrains Mono */
.accent-label {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    font-size: 0.7rem;
    color: #C8A060;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.8rem;
}

.accent-label-light {
    color: #C8A060;
}

/* ========================================
   HERO SECTIONS
   ======================================== */
.hero-title-dark,
.hero-title-light {
    padding-top: 3rem;
    padding-bottom: 4rem;
    position: relative;
}

.hero-title-dark {
    border-bottom: 1px solid rgba(200, 160, 96, 0.15);
    margin-bottom: 4rem;
}

.hero-title-light {
    border-bottom: 1px solid rgba(74, 56, 40, 0.15);
    margin-bottom: 4rem;
}

.hero-subtitle-dark {
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.85;
    color: #A89878;
    margin-top: 1.5rem;
    max-width: 90%;
}

.hero-subtitle-light {
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.85;
    color: #4A3828;
    margin-top: 1.5rem;
    max-width: 90%;
}

/* ========================================
   CONTENT BLOCKS
   ======================================== */
.content-block {
    margin-bottom: 4rem;
    padding: 2rem 0;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.content-block.visible {
    opacity: 1;
    transform: translateY(0);
}

.content-dark {
    border-left: 2px solid rgba(200, 160, 96, 0.2);
    padding-left: 2rem;
}

.content-light {
    border-left: 2px solid rgba(74, 56, 40, 0.2);
    padding-left: 2rem;
}

/* ========================================
   VINTAGE PHOTO FRAMES
   ======================================== */
.vintage-frame {
    margin: 3rem 0;
    padding: 1rem;
    border: 2px solid #C8A060;
    position: relative;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 1s ease, transform 1s ease;
}

.vintage-frame.visible {
    opacity: 1;
    transform: scale(1);
}

.vintage-frame::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border: 1px solid rgba(200, 160, 96, 0.3);
    pointer-events: none;
}

.vintage-frame-light {
    border-color: #4A3828;
}

.vintage-frame-light::before {
    border-color: rgba(74, 56, 40, 0.3);
}

.vintage-photo {
    filter: sepia(0.6) contrast(1.1);
    overflow: hidden;
}

.vintage-photo svg {
    width: 100%;
    height: auto;
    display: block;
}

.vintage-photo-light {
    filter: sepia(0.3) contrast(1.05);
}

/* ========================================
   PUZZLE INTERACTION
   ======================================== */
.interaction-zone {
    margin: 4rem 0;
    padding: 2.5rem 2rem;
    border: 1px solid rgba(200, 160, 96, 0.2);
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.interaction-zone.visible {
    opacity: 1;
    transform: translateY(0);
}

.interaction-zone-light {
    border-color: rgba(74, 56, 40, 0.2);
}

.puzzle-grid {
    display: flex;
    gap: 0.6rem;
    margin: 1.5rem 0;
    justify-content: center;
}

.puzzle-piece {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fraunces', serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: #E8C878;
    background: rgba(232, 200, 120, 0.08);
    border: 1px solid rgba(200, 160, 96, 0.3);
    cursor: pointer;
    user-select: none;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.3s ease,
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}

.puzzle-piece:hover {
    background: rgba(232, 200, 120, 0.15);
    border-color: #C8A060;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(200, 160, 96, 0.2);
}

.puzzle-piece.active {
    background: rgba(232, 200, 120, 0.25);
    border-color: #E8C878;
    box-shadow: 0 0 15px rgba(232, 200, 120, 0.3);
}

.puzzle-piece.correct {
    background: rgba(200, 160, 96, 0.2);
    border-color: #C8A060;
    color: #C8A060;
}

.puzzle-piece-light {
    color: #1A0818;
    background: rgba(26, 8, 24, 0.05);
    border-color: rgba(74, 56, 40, 0.3);
}

.puzzle-piece-light:hover {
    background: rgba(26, 8, 24, 0.1);
    border-color: #4A3828;
    box-shadow: 0 6px 20px rgba(74, 56, 40, 0.15);
}

.puzzle-piece-light.active {
    background: rgba(74, 56, 40, 0.2);
    border-color: #4A3828;
    box-shadow: 0 0 15px rgba(74, 56, 40, 0.2);
}

.puzzle-piece-light.correct {
    background: rgba(74, 56, 40, 0.15);
    border-color: #4A3828;
    color: #4A3828;
}

.interaction-hint {
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.6;
    margin-top: 0.5rem;
}

/* ========================================
   SHAKE-ERROR ANIMATION
   ======================================== */
@keyframes theatricalShake {
    0% { transform: translateX(0); }
    15% { transform: translateX(-8px); }
    30% { transform: translateX(8px); }
    45% { transform: translateX(-6px); }
    60% { transform: translateX(6px); }
    75% { transform: translateX(-3px); }
    90% { transform: translateX(3px); }
    100% { transform: translateX(0); }
}

.shake {
    animation: theatricalShake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* ========================================
   ENTRANCE ANIMATIONS
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes titleReveal {
    0% {
        opacity: 0;
        transform: translateY(30px);
        font-weight: 100;
    }
    50% {
        font-weight: 900;
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        font-weight: 800;
    }
}

@keyframes dividerGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(200, 160, 96, 0.3),
                    0 0 40px rgba(200, 160, 96, 0.1);
    }
    50% {
        box-shadow: 0 0 30px rgba(200, 160, 96, 0.5),
                    0 0 60px rgba(200, 160, 96, 0.2);
    }
}

.hero-title-dark,
.hero-title-light {
    animation: fadeInUp 1.2s ease forwards;
}

.hero-title-light {
    animation-delay: 0.2s;
    opacity: 0;
}

.hero-title-dark .title-fragment {
    animation: titleReveal 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-title-light .title-fragment {
    animation: titleReveal 1.8s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards;
    opacity: 0;
}

.stage-divider {
    animation: dividerGlow 4s ease-in-out infinite;
}

/* ========================================
   VARIABLE FONT HOVER EFFECTS
   ======================================== */
.section-heading:hover {
    font-weight: 800;
}

.title-fragment:hover {
    font-weight: 300;
    letter-spacing: 0.12em;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .theater {
        flex-direction: column;
        height: auto;
    }

    .panel {
        width: 100% !important;
        height: auto;
        overflow-y: visible;
    }

    .stage-divider {
        width: 100%;
        height: 3px;
    }

    .stage-divider::before {
        width: 12px;
        height: 12px;
    }

    .panel-inner {
        padding: 2.5rem 1.5rem 4rem;
    }

    .puzzle-piece,
    .puzzle-piece-light {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
}
