/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #1E1E2E 0%, #2A2A3E 50%, #12121E 100%);
    color: #E2E8F0;
    line-height: 1.7;
    overflow-x: hidden;
    background-attachment: fixed;
}

code, pre {
    font-family: 'Fira Code', monospace;
}

/* Leather-grain texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, #12121E 1px, transparent 1px);
    background-size: 50px 50px;
    background-attachment: fixed;
    opacity: 0.03;
    pointer-events: none;
    z-index: 1;
}

/* Zones */
.zone {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    scroll-behavior: smooth;
}

/* Zone A: Hero */
.zone-a {
    background: linear-gradient(180deg, #12121E 0%, #1E1E2E 50%, #2A2A3E 100%);
    padding: 4rem 2rem;
}

.hero-container {
    text-align: center;
    max-width: 900px;
    position: relative;
    z-index: 10;
}

.wordmark {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 700;
    color: #E2E8F0;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1rem;
    text-shadow:
        0 0 30px rgba(168, 85, 247, 0.4),
        0 0 60px rgba(45, 212, 191, 0.2);
    animation: wordmarkGlow 3s ease-in-out infinite;
}

@keyframes wordmarkGlow {
    0%, 100% { text-shadow: 0 0 30px rgba(168, 85, 247, 0.4), 0 0 60px rgba(45, 212, 191, 0.2); }
    50% { text-shadow: 0 0 40px rgba(168, 85, 247, 0.6), 0 0 80px rgba(45, 212, 191, 0.3); }
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #94A3B8;
    margin-bottom: 3rem;
    font-weight: 300;
    letter-spacing: 0.05em;
}

/* Floating puzzle pieces */
.floating-puzzles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: hidden;
}

.floating-puzzle {
    position: absolute;
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(5deg); }
}

/* Zone B: Masonry Grid */
.zone-b {
    background: linear-gradient(180deg, #2A2A3E 0%, #1E1E2E 50%, #12121E 100%);
    padding: 4rem 2rem;
}

.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    align-items: start;
}

@media (min-width: 768px) {
    .masonry-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .masonry-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

/* Puzzle Cards */
.puzzle-card {
    background: linear-gradient(135deg, #2E2E42 0%, #2A2A3E 100%);
    border-radius: 12px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(168, 85, 247, 0.1);
    clip-path: polygon(
        0% 0%, 95% 0%, 100% 5%, 100% 95%, 95% 100%, 0% 100%, 0% 0%
    );
    min-height: 200px;
}

.puzzle-card-large {
    grid-column: span 2;
    grid-row: span 2;
}

.puzzle-card-medium {
    grid-column: span 1;
    grid-row: span 1;
}

.puzzle-card-small {
    grid-column: span 1;
    grid-row: span 1;
    min-height: 150px;
}

.puzzle-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.puzzle-card:hover::before {
    left: 100%;
}

.puzzle-card:hover {
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.4),
        0 0 30px rgba(168, 85, 247, 0.3);
    transform: translateY(-8px);
}

.puzzle-card:nth-child(2) {
    border-color: rgba(45, 212, 191, 0.2);
}

.puzzle-card:nth-child(2):hover {
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.4),
        0 0 30px rgba(45, 212, 191, 0.3);
}

.puzzle-card:nth-child(5) {
    border-color: rgba(251, 113, 133, 0.2);
}

.puzzle-card:nth-child(5):hover {
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.4),
        0 0 30px rgba(251, 113, 133, 0.3);
}

.card-content {
    position: relative;
    z-index: 2;
}

.puzzle-card h2 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: #E2E8F0;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.puzzle-card h3 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    font-weight: 700;
    color: #2DD4BF;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.puzzle-card:nth-child(2) h3,
.puzzle-card:nth-child(5) h3 {
    color: #A855F7;
}

.puzzle-card:nth-child(7) h3 {
    color: #FB7185;
}

.puzzle-card p {
    font-size: 0.95rem;
    color: #94A3B8;
    line-height: 1.6;
}

/* Ripple Effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.6), transparent);
    transform: scale(0);
    animation: rippleEffect 0.5s ease-out;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Zone C: Features */
.zone-c {
    background: linear-gradient(180deg, #12121E 0%, #1E1E2E 50%, #2A2A3E 100%);
    padding: 4rem 2rem;
}

.feature-container {
    max-width: 1200px;
    margin: 0 auto;
}

.feature-container h2 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: #E2E8F0;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 3rem;
    text-align: center;
    text-shadow: 0 0 30px rgba(168, 85, 247, 0.2);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

@media (min-width: 768px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .feature-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.feature-item {
    background: linear-gradient(135deg, #2E2E42 0%, #2A2A3E 100%);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(168, 85, 247, 0.15);
    text-align: center;
    transition: all 0.3s ease;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.feature-item:nth-child(1) {
    border-color: rgba(45, 212, 191, 0.2);
}

.feature-item:nth-child(2) {
    border-color: rgba(168, 85, 247, 0.2);
}

.feature-item:nth-child(3) {
    border-color: rgba(251, 113, 133, 0.2);
}

.feature-item:nth-child(4) {
    border-color: rgba(45, 212, 191, 0.2);
}

.feature-item:hover {
    transform: translateY(-10px);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 30px rgba(168, 85, 247, 0.2);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #A855F7;
    font-weight: bold;
}

.feature-item:nth-child(1) .feature-icon {
    color: #2DD4BF;
}

.feature-item:nth-child(2) .feature-icon {
    color: #A855F7;
}

.feature-item:nth-child(3) .feature-icon {
    color: #FB7185;
}

.feature-item:nth-child(4) .feature-icon {
    color: #2DD4BF;
}

.feature-item h3 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #E2E8F0;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.feature-item p {
    font-size: 0.9rem;
    color: #94A3B8;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: #12121E;
    color: #94A3B8;
    text-align: center;
    padding: 2rem;
    border-top: 1px solid rgba(168, 85, 247, 0.1);
    font-size: 0.9rem;
    position: relative;
    z-index: 2;
}

.footer p {
    letter-spacing: 0.05em;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .puzzle-card-large {
        grid-column: span 1;
        grid-row: span 1;
    }

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

    .puzzle-card {
        min-height: 180px;
        padding: 1.5rem;
    }

    .puzzle-card h2 {
        font-size: 1.2rem;
    }

    .puzzle-card h3 {
        font-size: 1rem;
    }

    .zone {
        padding: 2rem 1rem;
    }
}

@media (max-width: 480px) {
    .masonry-grid {
        grid-template-columns: 1fr;
    }

    .puzzle-card {
        min-height: 150px;
    }

    .wordmark {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }
}

/* Smooth scrolling behavior */
html {
    scroll-behavior: smooth;
}

/* Selection styles */
::selection {
    background: rgba(168, 85, 247, 0.3);
    color: #E2E8F0;
}

::-moz-selection {
    background: rgba(168, 85, 247, 0.3);
    color: #E2E8F0;
}
