/* haskell.day - McBling Functional Programming Gallery */
/* Colors from DESIGN.md */
/* Deep Background: #0e0e12 | Panel Background: #1a1a24 | Primary Text: #f0eef5 */
/* Accent Primary (McBling Pink): #e8a0bf | Chrome Silver: #c0c4d6 | Hot Fuchsia: #ff3cac */
/* Code Background: #14111f | Lilac Shimmer: #c9a0ff | Mint Chrome: #7dffcb */
/* Gold Bling: #ffd700 | Emerald Shine: #3cffa0 | Grey: #8a8ea0 */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #0e0e12;
    color: #f0eef5;
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    line-height: 1.65;
    overflow-x: hidden;
}

/* ============================
   LENS FLARES
   ============================ */
#lens-flares {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.flare {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.flare-1 {
    width: 300px;
    height: 300px;
    top: 15%;
    left: 20%;
    background: radial-gradient(circle, rgba(255,60,172,0.4) 0%, rgba(232,160,191,0.2) 30%, rgba(255,60,172,0.08) 60%, transparent 80%);
    animation: flarePulse1 6s ease-in-out infinite;
}

.flare-2 {
    width: 200px;
    height: 200px;
    top: 35%;
    right: 15%;
    background: radial-gradient(circle, rgba(255,60,172,0.3) 0%, rgba(232,160,191,0.15) 35%, rgba(255,60,172,0.05) 65%, transparent 85%);
    animation: flarePulse2 8s ease-in-out infinite;
}

.flare-3 {
    width: 250px;
    height: 250px;
    top: 55%;
    left: 40%;
    background: radial-gradient(circle, rgba(232,160,191,0.35) 0%, rgba(255,60,172,0.15) 40%, rgba(232,160,191,0.05) 70%, transparent 85%);
    animation: flarePulse3 7s ease-in-out infinite;
}

.flare-4 {
    width: 180px;
    height: 180px;
    top: 70%;
    left: 10%;
    background: radial-gradient(circle, rgba(255,60,172,0.25) 0%, rgba(232,160,191,0.12) 40%, transparent 75%);
    animation: flarePulse1 5s ease-in-out infinite 1s;
}

.flare-5 {
    width: 220px;
    height: 220px;
    top: 20%;
    right: 30%;
    background: radial-gradient(circle, rgba(232,160,191,0.3) 0%, rgba(255,60,172,0.1) 50%, transparent 80%);
    animation: flarePulse2 6.5s ease-in-out infinite 2s;
}

.flare-6 {
    width: 160px;
    height: 160px;
    top: 85%;
    right: 20%;
    background: radial-gradient(circle, rgba(255,60,172,0.2) 0%, rgba(232,160,191,0.1) 45%, transparent 80%);
    animation: flarePulse3 4.5s ease-in-out infinite 0.5s;
}

@keyframes flarePulse1 {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

@keyframes flarePulse2 {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.12); }
}

@keyframes flarePulse3 {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.05); }
}

/* ============================
   RHINESTONE DOTS
   ============================ */
#rhinestone-dots {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(circle 1.5px, rgba(192,196,214,0.2) 100%, transparent 100%),
        radial-gradient(circle 1px, rgba(192,196,214,0.15) 100%, transparent 100%),
        radial-gradient(circle 2px, rgba(192,196,214,0.12) 100%, transparent 100%),
        radial-gradient(circle 1px, rgba(192,196,214,0.18) 100%, transparent 100%);
    background-size: 340px 280px, 220px 350px, 480px 420px, 310px 260px;
    background-position: 20px 40px, 80px 90px, 150px 20px, 250px 180px;
}

/* ============================
   SCROLL INDICATORS
   ============================ */
#scroll-indicators {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(192,196,214,0.3);
    cursor: pointer;
    transition: all 0.4s ease;
}

.indicator-dot.active {
    background: #e8a0bf;
    box-shadow: 0 0 8px rgba(232,160,191,0.6);
    transform: scale(1.3);
}

.indicator-dot:hover {
    background: #c0c4d6;
    transform: scale(1.2);
}

/* ============================
   HERO SECTION
   ============================ */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.lambda-watermark {
    position: absolute;
    width: 400px;
    height: 500px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    opacity: 0;
    animation: lambdaFadeIn 2s ease forwards 0.5s;
}

@keyframes lambdaFadeIn {
    to { opacity: 1; }
}

.hero-flare {
    position: absolute;
    width: 400px;
    height: 400px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,60,172,0.5) 0%, rgba(232,160,191,0.25) 30%, rgba(255,60,172,0.08) 55%, transparent 75%);
    z-index: 1;
    opacity: 0;
    animation: heroFlareBoom 2s ease forwards;
}

@keyframes heroFlareBoom {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
    50% { opacity: 1; }
    100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
}

.hero-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: clamp(3rem, 7vw, 5rem);
    letter-spacing: -0.03em;
    line-height: 1.08;
    z-index: 2;
    opacity: 0;
    animation: fadeSlideUp 1.2s cubic-bezier(0.22,1,0.36,1) forwards 1.5s;
    background: linear-gradient(135deg, #f0eef5, #e8a0bf, #c0c4d6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-family: 'Source Sans 3', sans-serif;
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #c0c4d6;
    z-index: 2;
    opacity: 0;
    animation: fadeSlideUp 1.2s cubic-bezier(0.22,1,0.36,1) forwards 1.9s;
    margin-top: 16px;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================
   CURVE DIVIDERS
   ============================ */
.curve-divider {
    width: 100%;
    height: 80px;
    overflow: hidden;
    position: relative;
}

.curve-divider svg {
    width: 200%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
}

.curve-path-1 {
    animation: curveDrift 20s linear infinite;
}

.curve-path-2 {
    animation: curveDrift 25s linear infinite reverse;
}

@keyframes curveDrift {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ============================
   GALLERY SECTIONS
   ============================ */
.gallery-section {
    padding: 60px 24px;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================
   PANELS
   ============================ */
.panel {
    background: #1a1a24;
    border: 1px solid transparent;
    border-image: linear-gradient(135deg, #c0c4d6, #8a8ea0, #c0c4d6) 1;
    padding: 32px;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.panel::before {
    content: '';
    position: absolute;
    inset: -1px;
    border: 1px solid transparent;
    border-image: linear-gradient(135deg, rgba(192,196,214,0.4), rgba(138,142,160,0.2), rgba(192,196,214,0.4)) 1;
    pointer-events: none;
    z-index: 1;
}

.panel:hover {
    box-shadow: 0 0 24px rgba(232,160,191,0.27), 0 0 48px rgba(255,60,172,0.13);
}

/* Curved corners */
.panel-curved-br {
    border-radius: 0 0 64px 0;
    border-image: none;
    border: 1px solid rgba(192,196,214,0.3);
}
.panel-curved-br::before { display: none; }

.panel-curved-tl {
    border-radius: 48px 0 0 0;
    border-image: none;
    border: 1px solid rgba(192,196,214,0.3);
}
.panel-curved-tl::before { display: none; }

.panel-curved-bl {
    border-radius: 0 0 0 64px;
    border-image: none;
    border: 1px solid rgba(192,196,214,0.3);
}
.panel-curved-bl::before { display: none; }

.panel-curved-tr {
    border-radius: 0 48px 0 0;
    border-image: none;
    border: 1px solid rgba(192,196,214,0.3);
}
.panel-curved-tr::before { display: none; }

.panel-hero {
    padding: 40px;
}

.panel-jewel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
}

.panel-image {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* ============================
   PANEL CONTENT
   ============================ */
.panel-label {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #e8a0bf;
    display: block;
    margin-bottom: 12px;
}

.panel-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    letter-spacing: -0.02em;
    line-height: 1.08;
    color: #f0eef5;
    margin-bottom: 20px;
}

.panel-subtitle {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: #f0eef5;
    margin-bottom: 12px;
}

.panel-text {
    color: #c0c4d6;
    font-size: clamp(0.9rem, 1.5vw, 1.05rem);
    line-height: 1.65;
}

.jewel-label {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: linear-gradient(135deg, #f0eef5, #e8a0bf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Pulse-attention glow */
.pulse-glow {
    animation: pulseAttention 3s ease-in-out infinite;
}

@keyframes pulseAttention {
    0%, 100% { text-shadow: 0 0 20px rgba(232,160,191,0.2); filter: brightness(1); }
    50% { text-shadow: 0 0 40px rgba(232,160,191,0.6); filter: brightness(1.1); }
}

/* ============================
   CODE BLOCKS
   ============================ */
.code-block {
    background: #14111f;
    border-top: 1px solid;
    border-image: linear-gradient(135deg, #c0c4d6, #8a8ea0, #c0c4d6) 1;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
    padding: 24px;
    border-radius: 0 0 8px 8px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.85rem, 1.4vw, 1rem);
    line-height: 1.55;
    font-feature-settings: 'liga' 1, 'calt' 1;
}

.code-block-sm {
    padding: 16px;
    font-size: clamp(0.8rem, 1.2vw, 0.95rem);
}

.code-block code {
    color: #f0eef5;
}

/* Syntax highlighting */
.kw { color: #c9a0ff; } /* Keywords - Lilac Shimmer */
.ty { color: #ffd700; } /* Types - Gold Bling */
.st { color: #7dffcb; } /* Strings - Mint Chrome */
.sy { color: #e8a0bf; } /* Symbols - McBling Pink */
.cm { color: #8a8ea0; font-style: italic; } /* Comments */

/* ============================
   INTERSTITIAL NARRATIVES
   ============================ */
.interstitial {
    padding: 100px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.narrative-content {
    max-width: 680px;
    margin: 0 auto;
    text-align: left;
}

.narrative-heading {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: clamp(2.2rem, 5vw, 4rem);
    letter-spacing: -0.02em;
    line-height: 1.08;
    margin-bottom: 32px;
    background: linear-gradient(135deg, #f0eef5, #e8a0bf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.narrative-content p {
    margin-bottom: 20px;
    color: #c0c4d6;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    line-height: 1.8;
}

.narrative-content em {
    color: #e8a0bf;
    font-style: italic;
}

.inline-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    color: #e8a0bf;
    background: #14111f;
    padding: 2px 8px;
    border-radius: 4px;
    font-feature-settings: 'liga' 1, 'calt' 1;
}

.narrative-code {
    margin: 24px 0;
}

/* ============================
   FLOW SVG
   ============================ */
.flow-svg {
    width: 100%;
    height: auto;
    max-width: 400px;
}

/* ============================
   CLOSING SECTION
   ============================ */
.closing-lambda {
    display: block;
    width: 120px;
    height: 150px;
    margin: 0 auto 32px;
}

.closing-heading {
    text-align: center;
}

.closing-tagline {
    text-align: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    color: #f0eef5 !important;
    margin-top: 32px;
}

#closing .narrative-content p {
    text-align: center;
}

/* ============================
   REVEAL ANIMATIONS
   ============================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.22,1,0.36,1), transform 0.8s cubic-bezier(0.22,1,0.36,1);
}

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

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .panel-hero,
    .panel-medium {
        grid-column: span 6 !important;
    }

    .panel-jewel {
        grid-column: span 3 !important;
    }

    .panel-image {
        grid-column: span 6 !important;
    }
}

@media (max-width: 640px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .panel,
    .panel-hero,
    .panel-medium,
    .panel-jewel,
    .panel-image {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }

    .gallery-section {
        padding: 40px 16px;
    }

    .interstitial {
        padding: 60px 16px;
    }

    #scroll-indicators {
        right: 12px;
    }

    .indicator-dot {
        width: 6px;
        height: 6px;
    }

    .hero-flare {
        width: 250px;
        height: 250px;
    }

    .lambda-watermark {
        width: 250px;
        height: 312px;
    }

    .closing-lambda {
        width: 80px;
        height: 100px;
    }
}
