/* =============================================
   PPADDL.com — Memphis Noir
   ============================================= */

/* --- CSS Variables --- */
:root {
    --abyss-navy: #0a0e27;
    --deep-indigo: #151a3a;
    --midnight-plum: #1e1435;
    --electric-cyan: #00e5ff;
    --neon-pink: #ff2d7b;
    --memphis-yellow: #ffe14d;
    --lavender-gray: #c8cee0;
    --slate-fog: #6b7394;
    --corrupt-green: #39ff14;
}

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

html {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: 18px;
    line-height: 1.75;
    color: var(--lavender-gray);
    background: var(--abyss-navy);
    overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Bebas Neue', cursive;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-shadow: 2px 2px 0 var(--electric-cyan), 0 0 20px rgba(0, 229, 255, 0.3);
    color: #ffffff;
}

.section-title {
    font-size: 36px;
    margin-bottom: 24px;
}

.body-text {
    color: var(--lavender-gray);
    margin-bottom: 20px;
}

.text-emphasis {
    font-weight: 600;
    color: var(--neon-pink);
}

/* --- Navigation --- */
#nav-bubbles {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    gap: 12px;
}

.nav-pill {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    text-decoration: none;
    color: var(--electric-cyan);
    background: transparent;
    border: 1px solid rgba(0, 229, 255, 0.4);
    padding: 8px 18px;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-pill:hover {
    background: var(--electric-cyan);
    color: var(--abyss-navy);
    border-color: var(--electric-cyan);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
}

/* --- Scene Base --- */
.scene {
    position: relative;
    min-height: 100vh;
    scroll-snap-align: start;
    overflow: hidden;
}

.scene-1 { background: var(--abyss-navy); }
.scene-2 { background: var(--deep-indigo); }
.scene-3 { background: var(--abyss-navy); }
.scene-4 { background: var(--abyss-navy); }

.scene-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    padding: 80px 60px;
}

/* --- Glitch Band System --- */
.scene::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 12px;
    background: repeating-linear-gradient(
        90deg,
        #39ff14 0px,
        transparent 2px,
        #00e5ff 4px,
        transparent 6px
    );
    mix-blend-mode: screen;
    opacity: 0;
    top: -20px;
    z-index: 10;
    pointer-events: none;
}

.scene-1::after { animation: glitchSweep 6s 0s infinite; }
.scene-2::after { animation: glitchSweep 6s 1.5s infinite; }
.scene-3::after { animation: glitchSweep 6s 3s infinite; }
.scene-4::after { animation: glitchSweep 6s 4.5s infinite; }

@keyframes glitchSweep {
    0% { top: -20px; opacity: 0; }
    5% { opacity: 1; }
    15% { opacity: 1; }
    20% { top: 100%; opacity: 0; }
    100% { opacity: 0; }
}

/* --- Terrazzo Dots --- */
.terrazzo-dots {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

/* Terrazzo dots generated by JS */

/* --- Bubble System --- */
.bubble {
    width: var(--size, 50px);
    height: var(--size, 50px);
    border-radius: 50%;
    background: radial-gradient(
        circle at 30% 30%,
        rgba(255, 255, 255, 0.15),
        rgba(0, 229, 255, 0.05) 60%,
        transparent
    );
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(0, 229, 255, 0.15);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float var(--duration, 6s) var(--delay, 0s) ease-in-out infinite;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.bubble:hover {
    transform: scale(1.15);
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.3);
}

.bubble-text {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(0, 229, 255, 0.6);
    pointer-events: none;
}

@keyframes float {
    0% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-15px) translateX(4px); }
    50% { transform: translateY(-30px) translateX(8px); }
    75% { transform: translateY(-15px) translateX(4px); }
    100% { transform: translateY(0) translateX(0); }
}

.bubble-cluster {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.scene-bubbles {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.scene-bubbles .bubble {
    position: absolute;
    left: var(--x, 50%);
    top: var(--y, 50%);
}

/* --- Z-Pattern Grid (Hero) --- */
.z-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto 1fr;
    grid-template-areas:
        "top-left top-right"
        "diagonal diagonal"
        "bottom-left bottom-right";
    gap: 40px;
    align-items: center;
}

.z-top-left {
    grid-area: top-left;
    padding-top: 40px;
}

.z-top-right {
    grid-area: top-right;
    display: flex;
    justify-content: flex-end;
    padding-top: 40px;
}

.z-diagonal {
    grid-area: diagonal;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    position: relative;
    padding: 40px 0;
}

.z-bottom-right {
    grid-area: bottom-right;
    text-align: right;
    padding-bottom: 40px;
}

/* --- Hero Headline --- */
#hero-headline {
    font-size: clamp(72px, 12vw, 140px);
    line-height: 0.9;
    transform: rotate(-12deg);
    transform-origin: left center;
    display: inline-block;
}

#hero-headline .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(40px);
    animation: charReveal 0.5s forwards;
}

#hero-headline .char:nth-child(1) { animation-delay: 0.1s; }
#hero-headline .char:nth-child(2) { animation-delay: 0.15s; }
#hero-headline .char:nth-child(3) { animation-delay: 0.2s; }
#hero-headline .char:nth-child(4) { animation-delay: 0.25s; }
#hero-headline .char:nth-child(5) { animation-delay: 0.3s; }
#hero-headline .char:nth-child(6) { animation-delay: 0.35s; }

@keyframes charReveal {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Glitch flicker after headline reveal */
#hero-headline.revealed {
    animation: headlineGlitch 0.3s 0.8s ease-out;
}

@keyframes headlineGlitch {
    0% { transform: rotate(-12deg) translateX(0); text-shadow: 2px 2px 0 var(--electric-cyan); }
    20% { transform: rotate(-12deg) translateX(-5px); text-shadow: -3px 2px 0 var(--neon-pink), 5px -2px 0 var(--electric-cyan); }
    40% { transform: rotate(-12deg) translateX(3px); text-shadow: 4px -1px 0 var(--corrupt-green), -2px 3px 0 var(--electric-cyan); }
    60% { transform: rotate(-12deg) translateX(-2px); text-shadow: -2px 3px 0 var(--electric-cyan); }
    80% { transform: rotate(-12deg) translateX(1px); text-shadow: 3px 1px 0 var(--neon-pink); }
    100% { transform: rotate(-12deg) translateX(0); text-shadow: 2px 2px 0 var(--electric-cyan), 0 0 20px rgba(0, 229, 255, 0.3); }
}

/* --- Z-Connector Diagonal --- */
.z-connector {
    width: 200px;
    height: 3px;
    border-top: 3px dashed var(--memphis-yellow);
    transform: rotate(-45deg);
    opacity: 0.7;
}

/* --- Memphis Primitives --- */
.memphis-primitives {
    display: flex;
    gap: 30px;
    align-items: center;
}

.memphis-triangle {
    width: 0;
    height: 0;
    border-left: 35px solid transparent;
    border-right: 35px solid transparent;
    border-bottom: 60px solid var(--neon-pink);
    transform: rotate(15deg);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.memphis-triangle:hover {
    transform: rotate(30deg) scale(1.1);
}

.memphis-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 2px solid var(--electric-cyan);
    background: transparent;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.memphis-circle:hover {
    transform: rotate(15deg) scale(1.1);
}

.memphis-squiggle {
    width: 180px;
    height: 40px;
}

.memphis-squiggle path {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    animation: squiggleDraw 3s ease-in-out forwards, squiggleCrawl 8s 3s linear infinite;
}

@keyframes squiggleDraw {
    to { stroke-dashoffset: 0; }
}

@keyframes squiggleCrawl {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -400; }
}

/* --- Tagline & Pulse CTA --- */
.tagline {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 300;
    color: var(--lavender-gray);
    margin-bottom: 30px;
}

.pulse-explore {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100px;
    height: 100px;
    cursor: pointer;
}

.pulse-label {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--electric-cyan);
    z-index: 2;
}

.pulse-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid var(--electric-cyan);
    animation: pulseRing 2s ease-out infinite;
}

.pulse-ring:nth-child(2) {
    animation-delay: 1s;
}

@keyframes pulseRing {
    0% { transform: scale(0.6); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* --- Narrative Section (Scene 2) --- */
.narrative-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 80px;
    align-items: center;
}

.narrative-image-col {
    display: flex;
    justify-content: center;
}

.duotone-image {
    width: 320px;
    height: 480px;
    overflow: hidden;
    position: relative;
}

.duotone-cyan {
    clip-path: ellipse(50% 50% at 50% 50%);
    background: linear-gradient(135deg, var(--abyss-navy), var(--electric-cyan));
}

.duotone-pink {
    clip-path: polygon(15% 0%, 85% 0%, 100% 100%, 0% 100%);
    background: linear-gradient(135deg, var(--abyss-navy), var(--neon-pink));
}

.photo-placeholder {
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.03) 10px,
        rgba(255, 255, 255, 0.03) 20px
    );
}

/* --- Memphis Shelves --- */
.memphis-shelf {
    position: relative;
    padding: 30px 30px 30px 40px;
    margin-bottom: 30px;
}

.memphis-shelf::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--memphis-yellow);
    clip-path: polygon(0% 0%, 100% 0%, 95% 100%, 5% 100%);
}

.shelf-1::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--neon-pink);
}

.shelf-2::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--electric-cyan);
}

.shelf-3::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--corrupt-green);
}

/* --- Gallery (Scene 3) --- */
.gallery-title {
    text-align: center;
    margin-bottom: 60px;
    font-size: 48px;
}

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

.gallery-tile {
    position: relative;
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
}

.tile-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
}

.bubble-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(
        circle at 35% 35%,
        rgba(255, 255, 255, 0.12),
        rgba(0, 229, 255, 0.06) 50%,
        rgba(10, 14, 39, 0.7)
    );
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(0, 229, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bubble-overlay .bubble-text {
    font-size: 18px;
    color: rgba(0, 229, 255, 0.8);
}

.gallery-tile:hover .bubble-overlay {
    opacity: 0;
    transform: scale(1.3);
}

/* Bubble particles on hover */
.bubble-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--electric-cyan);
    opacity: 0;
    top: 50%;
    left: 50%;
}

.gallery-tile:hover .particle {
    animation: particleBurst 0.6s ease-out forwards;
}

.gallery-tile:hover .particle:nth-child(1) { animation-delay: 0s; --px: -40px; --py: -50px; }
.gallery-tile:hover .particle:nth-child(2) { animation-delay: 0.05s; --px: 45px; --py: -35px; }
.gallery-tile:hover .particle:nth-child(3) { animation-delay: 0.1s; --px: -55px; --py: 20px; }
.gallery-tile:hover .particle:nth-child(4) { animation-delay: 0.15s; --px: 30px; --py: 50px; }
.gallery-tile:hover .particle:nth-child(5) { animation-delay: 0.08s; --px: 0px; --py: -60px; }

@keyframes particleBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--px), var(--py)) scale(0);
    }
}

/* --- Closer Section (Scene 4) --- */
.closer-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.orbit-system {
    position: relative;
    width: 500px;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.orbit-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(0, 229, 255, 0.1);
}

.orbit-ring-1 {
    width: 400px;
    height: 400px;
    animation: orbitSpin 20s linear infinite;
}

.orbit-ring-2 {
    width: 460px;
    height: 460px;
    animation: orbitSpin 30s linear infinite reverse;
}

.orbit-ring-3 {
    width: 500px;
    height: 500px;
    animation: orbitSpin 25s linear infinite;
}

@keyframes orbitSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.orbit-primitive {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.orbit-triangle {
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 20px solid var(--memphis-yellow);
}

.orbit-square {
    width: 18px;
    height: 18px;
    background: var(--neon-pink);
    transform: translateX(-50%) rotate(45deg);
}

.orbit-diamond {
    width: 16px;
    height: 16px;
    background: var(--electric-cyan);
    transform: translateX(-50%) rotate(45deg);
}

.closer-bubble {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(
        circle at 35% 35%,
        rgba(255, 255, 255, 0.08),
        rgba(0, 229, 255, 0.04) 50%,
        rgba(10, 14, 39, 0.6)
    );
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 229, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 50px;
    z-index: 2;
}

.closer-text {
    font-size: 28px;
    line-height: 1.2;
    margin-bottom: 16px;
    text-shadow: 2px 2px 0 var(--electric-cyan), 0 0 30px rgba(0, 229, 255, 0.4);
}

.closer-sub {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--slate-fog);
}

/* --- Duotone Tile Variations --- */
.gallery-tile:nth-child(odd) .tile-image {
    background: linear-gradient(135deg, var(--abyss-navy), var(--electric-cyan));
}

.gallery-tile:nth-child(even) .tile-image {
    background: linear-gradient(135deg, var(--abyss-navy), var(--neon-pink));
}

/* --- Glitch Text Content Displacement --- */
.scene.glitch-active::before {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 12px;
    background: rgba(57, 255, 20, 0.15);
    z-index: 20;
    pointer-events: none;
    animation: glitchDisplace 0.15s ease-out;
}

@keyframes glitchDisplace {
    0% { transform: translateX(0); }
    25% { transform: translateX(5px); }
    50% { transform: translateX(-3px); }
    75% { transform: translateX(6px); }
    100% { transform: translateX(0); }
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .z-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "top-left"
            "top-right"
            "diagonal"
            "bottom-right";
    }

    .z-top-right {
        justify-content: center;
    }

    .z-bottom-right {
        text-align: center;
    }

    .narrative-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

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

    #nav-bubbles {
        top: 12px;
        right: 12px;
        gap: 6px;
    }

    .nav-pill {
        font-size: 11px;
        padding: 6px 12px;
    }

    #hero-headline {
        font-size: clamp(48px, 15vw, 96px);
    }

    .orbit-system {
        width: 320px;
        height: 320px;
    }

    .orbit-ring-1 { width: 260px; height: 260px; }
    .orbit-ring-2 { width: 300px; height: 300px; }
    .orbit-ring-3 { width: 320px; height: 320px; }

    .closer-bubble {
        width: 220px;
        height: 220px;
        padding: 30px;
    }

    .closer-text {
        font-size: 20px;
    }

    .scene-content {
        padding: 60px 24px;
    }

    .duotone-image {
        width: 240px;
        height: 360px;
    }
}
