/* ==========================================================
   haskell.monster - Neubrutalist Bestiary
   ========================================================== */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.7;
    color: #1D1D1D;
    background: #FFFDF5;
    overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
}

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

/* --- Section Spacing --- */
section {
    position: relative;
}

.section-header {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================================
   HERO - LAIR ENTRANCE
   ========================================================== */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: #1D1D1D;
}

.hero-border {
    position: absolute;
    inset: 24px;
    border: 6px solid #1D1D1D;
    z-index: 2;
    overflow: hidden;
}

.hero-split {
    position: absolute;
    inset: 0;
    display: flex;
}

.hero-dark {
    width: 60%;
    height: 100%;
    background: #1D1D1D;
}

.hero-yellow {
    width: 40%;
    height: 100%;
    background: #FFE156;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hero-yellow.animate-in {
    transform: translateX(0);
}

.hero-border.border-animate {
    border-color: #FFFFFF;
}

.hero-title-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    width: 100%;
    text-align: center;
}

.hero-title {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #FFFFFF;
    opacity: 0;
    position: relative;
    display: inline-block;
    /* The text spans across the split boundary using background-clip */
    background: linear-gradient(to right, #FFFFFF 0%, #FFFFFF 57%, #1D1D1D 57%, #1D1D1D 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title.stamp-in {
    opacity: 1;
}

.hero-title.screen-shake {
    animation: shake 0.1s linear;
}

@keyframes shake {
    0% { transform: translate(0, 0); }
    25% { transform: translate(2px, -1px); }
    50% { transform: translate(-2px, 2px); }
    75% { transform: translate(1px, -2px); }
    100% { transform: translate(0, 0); }
}

.lambda-claw {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 360px;
    z-index: 5;
    opacity: 0.6;
    pointer-events: none;
}

.hero-tagline {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #FFFFFF;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease 0.8s;
}

.hero-tagline.visible {
    opacity: 1;
}

/* ==========================================================
   BESTIARY - Section 2
   ========================================================== */
.bestiary {
    position: relative;
    background: #FFFDF5;
    padding: 80px 40px 120px;
    border-top: 4px solid #1D1D1D;
}

.bestiary-header {
    text-align: center;
    margin-bottom: 60px;
    color: #1D1D1D;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    position: relative;
}

.bestiary-header::after {
    content: '';
    display: block;
    width: 120px;
    height: 4px;
    background: #FF6B6B;
    margin: 16px auto 0;
}

.bestiary-cards {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.bestiary-card {
    position: relative;
    padding: 40px;
    border: 4px solid #1D1D1D;
    box-shadow: 8px 8px 0 #1D1D1D;
    margin-bottom: 0;
    opacity: 0;
    transform: scale(0.8);
    border-radius: 0;
}

.bestiary-card:nth-child(1) {
    transform: scale(0.8) rotate(-1deg);
    z-index: 3;
}

.bestiary-card:nth-child(2) {
    margin-top: -40px;
    transform: scale(0.8) rotate(1.5deg);
    margin-left: 30px;
    z-index: 2;
}

.bestiary-card:nth-child(3) {
    margin-top: -40px;
    transform: scale(0.8) rotate(-0.5deg);
    margin-left: -20px;
    z-index: 1;
}

.bestiary-card.card-entered {
    opacity: 1;
}

.bestiary-card.card-entered:nth-child(1) {
    transform: scale(1) rotate(-1deg);
}

.bestiary-card.card-entered:nth-child(2) {
    transform: scale(1) rotate(1.5deg);
    margin-left: 30px;
}

.bestiary-card.card-entered:nth-child(3) {
    transform: scale(1) rotate(-0.5deg);
    margin-left: -20px;
}

.card-yellow {
    background: #FFE156;
}

.card-red {
    background: #FF6B6B;
}

.card-teal {
    background: #4ECDC4;
}

.monster-face {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
}

.monster-face svg {
    width: 100%;
    height: 100%;
}

.monster-name {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1D1D1D;
    margin-bottom: 4px;
}

.monster-type {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #1D1D1D;
    opacity: 0.7;
    margin-bottom: 16px;
    border-bottom: 2px solid #1D1D1D;
    padding-bottom: 12px;
}

.monster-desc {
    font-family: 'Work Sans', sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: #1D1D1D;
    margin-bottom: 20px;
}

.monster-desc code {
    background: rgba(29, 29, 29, 0.1);
    padding: 2px 6px;
    font-size: 0.9rem;
}

.monster-tag {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #FFFFFF;
    background: #1D1D1D;
    display: inline-block;
    padding: 6px 16px;
}

/* ==========================================================
   THE GAUNTLET - Section 3
   ========================================================== */
.gauntlet {
    background: #1D1D1D;
    padding: 80px 40px 100px;
    border-top: 4px solid #1D1D1D;
}

.gauntlet-header {
    color: #FFFFFF;
    text-align: center;
    margin-bottom: 10px;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.gauntlet-header::after {
    content: '';
    display: block;
    width: 120px;
    height: 4px;
    background: #FF6B6B;
    margin: 16px auto 0;
}

.gauntlet-subtitle {
    text-align: center;
    color: #6B6B6B;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 60px;
}

.code-blocks {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.code-block {
    position: relative;
    border: 3px solid #6B6B6B;
    border-left: 4px solid #FF6B6B;
    background: rgba(255, 255, 255, 0.03);
    padding: 0;
    border-radius: 0;
}

.code-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #FF6B6B;
    padding: 12px 20px;
    border-bottom: 2px solid #6B6B6B;
    background: rgba(255, 107, 107, 0.05);
}

.code-block pre {
    padding: 24px 20px;
    overflow-x: auto;
}

.code-block code {
    font-family: 'Fira Code', monospace;
    font-size: 1.2rem;
    line-height: 1.6;
    color: #FFFFFF;
    white-space: pre;
}

.code-block code .color-flash {
    transition: color 0.5s ease;
}

/* ==========================================================
   TROPHY WALL - Section 4
   ========================================================== */
.trophy-wall {
    background: #FFFDF5;
    padding: 80px 40px 100px;
    border-top: 4px solid #1D1D1D;
}

.trophy-header {
    text-align: center;
    color: #1D1D1D;
    margin-bottom: 10px;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.trophy-header::after {
    content: '';
    display: block;
    width: 120px;
    height: 4px;
    background: #4ECDC4;
    margin: 16px auto 0;
}

.trophy-subtitle {
    text-align: center;
    color: #6B6B6B;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 60px;
}

.trophy-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.trophy-card {
    width: 160px;
    height: 160px;
    border: 3px solid #1D1D1D;
    box-shadow: 8px 8px 0 #1D1D1D;
    background: #FFFDF5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: default;
    border-radius: 0;
    position: relative;
}

.trophy-card:nth-child(3n) {
    transform: translateY(20px);
}

.trophy-card:nth-child(3n+1) {
    transform: translateY(-10px);
}

.trophy-card:hover {
    transform: perspective(600px) rotateX(-5deg) rotateY(5deg);
    box-shadow: 12px 12px 0 #1D1D1D;
}

.trophy-card:nth-child(3n):hover,
.trophy-card:nth-child(3n+1):hover {
    transform: perspective(600px) rotateX(-5deg) rotateY(5deg);
    box-shadow: 12px 12px 0 #1D1D1D;
}

.trophy-glyph {
    width: 60px;
    height: 60px;
    transition: transform 0.3s ease;
}

.trophy-card:hover .trophy-glyph {
    transform: scale(1.1);
}

.trophy-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #1D1D1D;
}

/* ==========================================================
   FOOTER ROAR
   ========================================================== */
.footer-roar {
    background: #1D1D1D;
    padding: 80px 40px;
    text-align: center;
    overflow: hidden;
    border-top: 4px solid #1D1D1D;
    position: relative;
}

.footer-text {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: 20vw;
    color: #FFE156;
    line-height: 1;
    letter-spacing: 0.02em;
    mix-blend-mode: difference;
    text-transform: uppercase;
}

.footer-sub {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #6B6B6B;
    margin-top: 24px;
}

/* ==========================================================
   SEPARATOR LINES
   ========================================================== */
.bestiary::before,
.gauntlet::before,
.trophy-wall::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 4px;
    background: #1D1D1D;
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 768px) {
    .hero-border {
        inset: 12px;
        border-width: 4px;
    }

    .hero-split .hero-dark {
        width: 55%;
    }

    .hero-split .hero-yellow {
        width: 45%;
    }

    .hero-title {
        background: linear-gradient(to right, #FFFFFF 0%, #FFFFFF 52%, #1D1D1D 52%, #1D1D1D 100%);
        -webkit-background-clip: text;
        background-clip: text;
    }

    .lambda-claw {
        width: 180px;
        height: 220px;
    }

    .bestiary {
        padding: 60px 20px 80px;
    }

    .bestiary-card {
        padding: 28px;
    }

    .bestiary-card:nth-child(2) {
        margin-left: 10px;
    }

    .bestiary-card:nth-child(3) {
        margin-left: -10px;
    }

    .bestiary-card.card-entered:nth-child(2) {
        margin-left: 10px;
    }

    .bestiary-card.card-entered:nth-child(3) {
        margin-left: -10px;
    }

    .gauntlet {
        padding: 60px 16px 80px;
    }

    .code-block code {
        font-size: 0.9rem;
    }

    .trophy-wall {
        padding: 60px 20px 80px;
    }

    .trophy-card {
        width: 130px;
        height: 130px;
    }

    .trophy-grid {
        gap: 16px;
    }

    .footer-text {
        font-size: 15vw;
    }
}

@media (max-width: 480px) {
    .hero-tagline {
        font-size: 0.7rem;
        bottom: 30px;
    }

    .bestiary-card:nth-child(1),
    .bestiary-card:nth-child(2),
    .bestiary-card:nth-child(3) {
        transform: scale(0.8) rotate(0deg);
        margin-left: 0;
    }

    .bestiary-card.card-entered:nth-child(1),
    .bestiary-card.card-entered:nth-child(2),
    .bestiary-card.card-entered:nth-child(3) {
        transform: scale(1) rotate(0deg);
        margin-left: 0;
    }

    .trophy-card {
        width: 110px;
        height: 110px;
    }

    .trophy-card:nth-child(3n),
    .trophy-card:nth-child(3n+1) {
        transform: translateY(0);
    }
}
