/* ppuzzl.works - Pop-Art Puzzle Workshop */
/* Palette: Magenta #FF0066, Cyan #00E5FF, Black #0D0D0D, White #F5F0EB, Gray #B8B0A8, Violet #8B5CF6, Teal #06B6D4 */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: #F5F0EB;
    color: #0D0D0D;
    overflow-x: hidden;
    line-height: 1.65;
}

/* ========== HOME MARK (fixed top-right) ========== */
#home-mark {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    cursor: pointer;
    width: 48px;
    height: 48px;
    transition: transform 0.3s ease;
}

#home-mark:hover {
    transform: scale(1.1);
}

/* ========== AURORA CANVAS ========== */
#aurora-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.15;
    transition: opacity 0.6s ease;
}

#aurora-canvas.intensified {
    opacity: 0.4;
}

/* ========== PANELS (General) ========== */
.panel {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid #0D0D0D;
    border-radius: 12px;
    margin: 0;
}

.panel-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== HALFTONE OVERLAY (Ben-Day dots) ========== */
.halftone-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background-image: radial-gradient(circle, #FF0066 1px, transparent 1px);
    background-size: 8px 8px;
    opacity: 0.06;
}

.halftone-overlay.halftone-dark {
    background-image: radial-gradient(circle, #00E5FF 1px, transparent 1px);
    background-size: 8px 8px;
    opacity: 0.1;
}

.halftone-overlay.halftone-light {
    background-image: radial-gradient(circle, #FF0066 1px, transparent 1px);
    background-size: 8px 8px;
    opacity: 0.04;
}

/* ========== Z-DIAGONAL LINE ========== */
.z-diagonal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.z-diagonal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 141.4%;
    height: 1px;
    background: repeating-linear-gradient(
        90deg,
        #00E5FF 0px,
        #00E5FF 4px,
        transparent 4px,
        transparent 12px
    );
    opacity: 0.3;
    transform-origin: top left;
    transform: rotate(33deg);
}

/* ========== PANEL 1: THE NAME ========== */
.panel-1 {
    background-color: #F5F0EB;
}

.panel-1 .panel-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    width: 100%;
    height: 100vh;
    padding: 48px;
}

.hero-ppuzzl {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    justify-self: start;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 10vw, 8rem);
    letter-spacing: -0.04em;
    color: #FF0066;
    line-height: 1;
}

.hero-works {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    justify-self: end;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 10vw, 8rem);
    letter-spacing: -0.04em;
    color: #00E5FF;
    line-height: 1;
}

.hero-center-piece {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    align-self: center;
    justify-self: center;
    z-index: 3;
}

.rotating-piece {
    animation: slowRotate 8s linear infinite;
}

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

/* ========== GUTTER STRIPS ========== */
.gutter-strip {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #F5F0EB;
}

.gutter-piece {
    animation: slowRotate 8s linear infinite;
}

/* ========== PANEL 2: THE IDEA ========== */
.panel-2 {
    background-color: #F5F0EB;
}

.panel-2 .panel-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    width: 100%;
    height: 100vh;
    padding: 48px;
}

.panel-2-piece {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    justify-self: end;
    transform: translate(20px, -10px);
}

.panel-2-text {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
    justify-self: start;
    max-width: 480px;
}

.panel-2-text p {
    font-family: 'Outfit', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.65;
    color: #0D0D0D;
}

.stagger-text .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.stagger-text.visible .word {
    opacity: 1;
    transform: translateY(0);
}

/* ========== PANEL 3: THE HALFTONE STATEMENT ========== */
.panel-3 {
    background-color: #0D0D0D;
    position: relative;
}

.halftone-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: linear-gradient(var(--gradient-angle, 135deg), #FF0066, #00E5FF);
    opacity: 0.85;
}

.halftone-gradient::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, #0D0D0D 2px, transparent 2px);
    background-size: 12px 12px;
    opacity: 0.4;
}

.panel-3 .panel-content {
    z-index: 2;
}

.statement-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    color: #F5F0EB;
    text-align: center;
    max-width: 900px;
    padding: 0 48px;
    letter-spacing: -0.04em;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

/* ========== PANEL 4: THE INTERACTION ========== */
.panel-4 {
    background-color: #0D0D0D;
    cursor: none;
}

.panel-4 .panel-content {
    position: relative;
}

#puzzle-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.floating-piece {
    position: absolute;
    transition: transform 0.2s ease;
    pointer-events: none;
}

.floating-piece svg {
    display: block;
}

.floating-piece.pulse {
    animation: piecePulse 0.2s ease-out;
}

@keyframes piecePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Cursor glow for panel 4 */
.cursor-glow {
    position: fixed;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, rgba(6, 182, 212, 0.15) 40%, transparent 70%);
    pointer-events: none;
    z-index: 5;
    transform: translate(-50%, -50%);
    display: none;
}

/* ========== PANEL 5: THE CLOSE ========== */
.panel-5 {
    background-color: #F5F0EB;
    min-height: 100vh;
}

.panel-5 .panel-content {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 48px;
    max-width: 960px;
    margin: 0 auto;
}

.footer-rule {
    width: 100%;
    border: none;
    border-top: 1px solid #B8B0A8;
    margin-bottom: 48px;
}

.footer-columns {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-domain {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: #0D0D0D;
}

.footer-right {
    display: flex;
    gap: 24px;
}

.footer-link {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 0.875rem;
    color: #0D0D0D;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #FF0066;
}

/* ========== ACCENT LABELS ========== */
.accent-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #00E5FF;
}

/* ========== MONOSPACE (CODE/DATA) ========== */
.mono {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.875rem;
    background: rgba(0, 229, 255, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
}

/* ========== SPEECH BUBBLE ========== */
.speech-bubble {
    position: relative;
    background: #F5F0EB;
    border: 3px solid #0D0D0D;
    border-radius: 12px;
    padding: 16px 20px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    max-width: 280px;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 32px;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 16px solid #0D0D0D;
}

/* ========== SCROLL REVEAL ========== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .panel-1 .panel-content,
    .panel-2 .panel-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        padding: 32px;
    }

    .hero-ppuzzl {
        grid-column: 1;
        grid-row: 1;
    }

    .hero-center-piece {
        grid-column: 1;
        grid-row: 2;
    }

    .hero-works {
        grid-column: 1;
        grid-row: 3;
        justify-self: end;
    }

    .panel-2-piece {
        grid-column: 1;
        grid-row: 1;
        justify-self: center;
        transform: none;
    }

    .panel-2-piece svg {
        width: 200px;
        height: 200px;
    }

    .panel-2-text {
        grid-column: 1;
        grid-row: 2;
        max-width: 100%;
    }

    .statement-text {
        padding: 0 24px;
    }

    .footer-columns {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }

    .footer-left {
        justify-content: center;
    }
}
