/* Root and Global Styles */
:root {
    --color-primary: #FF2D7B;
    --color-accent: #00E5CC;
    --color-bg-light: #FAFAF7;
    --color-bg-mid: #E8E8E3;
    --color-text-dark: #1A1A1A;
    --color-text-light: #B8B8B0;

    --font-display: 'Caveat', cursive;
    --font-body: 'IBM Plex Sans', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-light);
    color: var(--color-text-dark);
    overflow-x: hidden;
}

/* Scroll Indicator */
.scroll-indicator {
    position: fixed;
    top: 2rem;
    left: 2rem;
    font-size: 2rem;
    color: var(--color-text-dark);
    opacity: 0.6;
    animation: pulse 2s ease-in-out infinite;
    z-index: 1000;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* Chamber Layout */
.chamber {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    position: relative;
    overflow: hidden;
}

.chamber-1 {
    background: linear-gradient(135deg, var(--color-bg-light) 0%, var(--color-bg-mid) 100%);
}

.chamber-2 {
    background-color: var(--color-bg-light);
}

.chamber-3 {
    background-color: var(--color-bg-mid);
}

.chamber-4 {
    background: linear-gradient(135deg, var(--color-text-dark) 0%, #2a2a2a 100%);
    color: var(--color-bg-light);
}

/* Puzzle Piece Clip-Paths */
.puzzle-piece {
    position: relative;
    transition: all 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    clip-path: polygon(
        5% 0%, 100% 0%, 100% 85%, 95% 85%, 95% 100%, 0% 100%, 0% 15%, 5% 15%
    );
    background-color: white;
    padding: 3rem;
    max-width: 100%;
}

.puzzle-piece:hover {
    transform: scale(1.04);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* Hero Section */
.hero-piece {
    text-align: center;
    padding: 6rem;
    clip-path: polygon(2% 0%, 98% 0%, 100% 3%, 100% 97%, 98% 100%, 2% 100%, 0% 97%, 0% 3%);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(232, 232, 227, 0.9));
}

.hero-wordmark {
    font-family: var(--font-display);
    font-size: clamp(3rem, 7vw, 6rem);
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--color-text-dark);
    margin-bottom: 1rem;
    line-height: 1;
    text-shadow: 2px 2px 0px rgba(255, 45, 123, 0.1);
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--color-text-light);
    letter-spacing: 0.1em;
    text-transform: lowercase;
}

/* Chamber Titles */
.chamber-title {
    position: absolute;
    top: 3rem;
    left: 4rem;
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: var(--color-text-dark);
    text-transform: lowercase;
    opacity: 0.8;
}

.chamber-4 .chamber-title {
    color: var(--color-bg-light);
}

/* Featured Puzzle Section */
.puzzle-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 8rem;
}

.featured-puzzle {
    width: 90%;
    max-width: 600px;
    padding: 4rem;
    clip-path: polygon(3% 0%, 97% 0%, 100% 5%, 100% 95%, 97% 100%, 3% 100%, 0% 95%, 0% 5%);
    background: white;
}

.puzzle-image {
    width: 100%;
    aspect-ratio: 3 / 2;
    margin-bottom: 2rem;
    border-radius: 4px;
    overflow: hidden;
    background: var(--color-bg-mid);
}

.puzzle-image svg {
    width: 100%;
    height: 100%;
    display: block;
}

.puzzle-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--color-text-dark);
    margin-bottom: 1rem;
    text-transform: capitalize;
}

.puzzle-description {
    font-size: 1rem;
    color: var(--color-text-light);
    line-height: 1.85;
    font-weight: 400;
}

/* Glitch Art Effect */
.glitch-art {
    position: relative;
}

.glitch-art::before,
.glitch-art::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: all 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.glitch-art::before {
    background: repeating-linear-gradient(
        0deg,
        rgba(255, 45, 123, 0.15),
        rgba(255, 45, 123, 0.15) 2px,
        transparent 2px,
        transparent 4px
    );
    clip-path: inset(0 0 50% 0);
}

.glitch-art::after {
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 229, 204, 0.15),
        rgba(0, 229, 204, 0.15) 2px,
        transparent 2px,
        transparent 4px
    );
    clip-path: inset(50% 0 0 0);
}

.puzzle-piece:hover .glitch-art::before,
.puzzle-piece:hover .glitch-art::after {
    opacity: 0;
}

/* Puzzle Grid */
.puzzle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2.5rem;
    width: 100%;
    max-width: 1200px;
    margin-top: 10rem;
    padding: 0 2rem;
}

.grid-puzzle {
    aspect-ratio: 4 / 3;
    padding: 1.5rem;
    clip-path: polygon(8% 0%, 92% 0%, 100% 10%, 100% 90%, 92% 100%, 8% 100%, 0% 90%, 0% 10%);
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.grid-puzzle h4 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--color-text-dark);
    text-transform: capitalize;
    margin-top: 1rem;
}

.grid-puzzle .puzzle-image {
    flex: 1;
    margin-bottom: 1rem;
    aspect-ratio: auto;
    min-height: 120px;
}

/* About Section */
.about-piece {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4rem;
    text-align: center;
    clip-path: polygon(5% 0%, 95% 0%, 100% 8%, 100% 92%, 95% 100%, 5% 100%, 0% 92%, 0% 8%);
    backdrop-filter: blur(10px);
    color: var(--color-bg-light);
}

.about-piece h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    text-transform: lowercase;
}

.about-piece p {
    font-size: 1rem;
    line-height: 1.85;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.footer-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.link-item {
    color: var(--color-accent);
    text-decoration: none;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 2px solid transparent;
    transition: all 300ms ease;
    padding-bottom: 0.3rem;
}

.link-item:hover {
    border-bottom-color: var(--color-accent);
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chamber {
        padding: 2rem;
    }

    .scroll-indicator {
        top: 1rem;
        left: 1rem;
        font-size: 1.5rem;
    }

    .hero-wordmark {
        font-size: clamp(2rem, 5vw, 4rem);
    }

    .chamber-title {
        font-size: 1.8rem;
        top: 2rem;
        left: 2rem;
    }

    .puzzle-container {
        margin-top: 6rem;
    }

    .featured-puzzle {
        padding: 2rem;
    }

    .puzzle-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-top: 8rem;
    }

    .puzzle-piece:hover {
        transform: scale(1.02);
    }

    .footer-links {
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .chamber {
        padding: 1rem;
    }

    .hero-wordmark {
        font-size: clamp(1.5rem, 4vw, 3rem);
    }

    .chamber-title {
        font-size: 1.3rem;
        top: 1.5rem;
        left: 1.5rem;
    }

    .featured-puzzle {
        padding: 1.5rem;
    }

    .about-piece {
        padding: 2rem;
    }

    .puzzle-title {
        font-size: 1.3rem;
    }
}
