/* ==========================================================================
   haskell.day - Mid-Century Modern Functional Programming Celebration
   ========================================================================== */

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

:root {
    --bg-cream: #FFF5E8;
    --sunset-orange: #E86830;
    --sunset-gold: #D4A060;
    --charcoal: #3A3A3A;
    --mid-gray: #8A8A8A;
    --cream-dark: #F0E4D4;
    --teal: #3A8A8A;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-cream);
    color: var(--charcoal);
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1.05vw, 17px);
    line-height: 1.8;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Josefin Sans', sans-serif;
    letter-spacing: 0.06em;
}

code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    background: rgba(58, 58, 58, 0.06);
    padding: 2px 6px;
    border-radius: 3px;
}

a {
    color: var(--teal);
    text-decoration: none;
    transition: color 200ms ease-out;
}

a:hover {
    color: var(--sunset-orange);
}

/* --- Starburst Motif --- */
.starburst {
    width: 24px;
    height: 24px;
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.starburst::before,
.starburst::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 100%;
    background: var(--sunset-gold);
    transform-origin: center;
}

.starburst::before {
    transform: translate(-50%, -50%);
}

.starburst::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.starburst-extra-1,
.starburst-extra-2 {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 100%;
    background: var(--sunset-gold);
    transform-origin: center;
}

/* We use a box-shadow trick for the other two lines */
.starburst {
    background:
        linear-gradient(var(--sunset-gold), var(--sunset-gold)) center / 2px 100% no-repeat,
        linear-gradient(var(--sunset-gold), var(--sunset-gold)) center / 100% 2px no-repeat;
}

.starburst::before {
    width: 2px;
    height: 100%;
    background: var(--sunset-gold);
    transform: translate(-50%, -50%) rotate(45deg);
}

.starburst::after {
    width: 2px;
    height: 100%;
    background: var(--sunset-gold);
    transform: translate(-50%, -50%) rotate(-45deg);
}

.corner-starburst {
    position: absolute;
    opacity: 0;
    transform: scale(0);
    transition: opacity 300ms ease-out, transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.corner-starburst.visible {
    opacity: 1;
    transform: scale(1);
}

#hero-starburst-tl { top: 30px; left: 30px; }
#hero-starburst-tr { top: 30px; right: 80px; }
#hero-starburst-bl { bottom: 60px; left: 80px; }
#hero-starburst-br { bottom: 30px; right: 30px; }

.inline-starburst {
    width: 12px;
    height: 12px;
    margin-top: 16px;
}

/* --- Hover-Lift Interaction --- */
.hover-lift {
    transition: transform 200ms ease-out, box-shadow 200ms ease-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   SECTION 1: HERO
   ========================================================================== */

#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    background-color: var(--bg-cream);
    overflow: hidden;
}

#hero-lambda {
    position: absolute;
    top: 8vh;
    right: 5vw;
    width: 30vw;
    max-width: 400px;
    min-width: 180px;
    height: auto;
}

#lambda-path {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
}

#lambda-path.animate {
    animation: drawLambda 1500ms ease-in-out forwards;
}

@keyframes drawLambda {
    to {
        stroke-dashoffset: 0;
    }
}

#lambda-fill {
    opacity: 0;
    transition: opacity 400ms ease-out;
}

#lambda-fill.visible {
    opacity: 1;
}

#hero-rule {
    position: absolute;
    top: 60%;
    left: 8vw;
    right: 8vw;
    height: 1px;
    background: var(--charcoal);
    transform-origin: left center;
    transform: scaleX(0);
    transition: transform 800ms ease-out;
}

#hero-rule.animate {
    transform: scaleX(1);
}

#hero-tagline {
    position: absolute;
    top: -28px;
    right: 0;
    font-family: 'Josefin Sans', sans-serif;
    font-size: clamp(11px, 1.2vw, 14px);
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--mid-gray);
    white-space: nowrap;
}

#hero-logotype {
    position: absolute;
    bottom: 18vh;
    left: 8vw;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(36px, 7vw, 96px);
    letter-spacing: 0.06em;
    color: var(--charcoal);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 400ms ease-out, transform 400ms ease-out;
}

#hero-logotype.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   SECTION 2: CONCEPTS (Broken Grid)
   ========================================================================== */

#concepts {
    position: relative;
    padding: 120px 8vw 100px;
    display: grid;
    grid-template-columns: 55% 35%;
    grid-template-rows: auto auto;
    gap: 40px 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.concept-block {
    position: relative;
    background: var(--cream-dark);
    padding: 40px;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 500ms ease-out, transform 500ms ease-out;
}

.concept-block.visible {
    opacity: 1;
}

.concept-accent-line {
    position: absolute;
    width: 2px;
    height: calc(100% + 20px);
    background: var(--sunset-orange);
    top: -10px;
}

.concept-large {
    grid-column: 1;
    grid-row: 1 / 3;
    margin-left: -40px;
    transform: translateX(-60px);
}

.concept-large .concept-accent-line {
    left: 0;
}

.concept-large.visible {
    transform: translateX(-40px);
}

.concept-medium {
    grid-column: 2;
    grid-row: 1;
    margin-top: -30px;
    transform: translateY(-20px);
}

.concept-medium .concept-accent-line {
    right: -10px;
    left: auto;
}

.concept-medium.visible {
    transform: translateY(-30px);
}

.concept-small {
    grid-column: 2;
    grid-row: 2;
    margin-top: -20px;
    transform: translateY(20px);
}

.concept-small .concept-accent-line {
    right: -10px;
    left: auto;
}

.concept-small.visible {
    transform: translateY(0);
}

.concept-illustration {
    width: 120px;
    height: 100px;
    margin-bottom: 20px;
}

.concept-illustration .draw-path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 800ms ease-out;
}

.concept-block.visible .draw-path {
    stroke-dashoffset: 0;
}

.concept-block h2 {
    font-weight: 600;
    font-size: clamp(22px, 3vw, 36px);
    margin-bottom: 12px;
    color: var(--charcoal);
}

.concept-block p {
    color: var(--charcoal);
    line-height: 1.8;
}

/* ==========================================================================
   SECTION 3: CODE POSTER
   ========================================================================== */

#code-poster {
    background: linear-gradient(135deg, var(--sunset-orange) 0%, var(--sunset-gold) 100%);
    padding: 100px 8vw;
    display: flex;
    justify-content: center;
    align-items: center;
}

#code-poster-card {
    background: var(--bg-cream);
    max-width: 620px;
    width: 100%;
    padding: 50px;
    position: relative;
    cursor: default;
}

.poster-border {
    border: 1px solid var(--charcoal);
    padding: 40px;
    position: relative;
    outline: 1px solid var(--charcoal);
    outline-offset: 4px;
}

.poster-starburst {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 36px;
    height: 36px;
}

.poster-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(32px, 5vw, 56px);
    letter-spacing: 0.06em;
    color: var(--charcoal);
    margin-bottom: 4px;
}

.poster-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(13px, 1.4vw, 16px);
    color: var(--mid-gray);
    margin-bottom: 24px;
}

.poster-divider {
    width: 100%;
    height: 1px;
    background: var(--charcoal);
    margin-bottom: 24px;
    position: relative;
}

.poster-divider::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--charcoal);
}

.poster-code {
    background: transparent;
    padding: 0;
    margin: 0;
    overflow-x: auto;
}

.poster-code code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    line-height: 1.7;
    color: var(--charcoal);
    background: transparent;
    padding: 0;
    border-radius: 0;
    white-space: pre;
}

.poster-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--mid-gray);
}

.poster-credit {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--mid-gray);
}

/* ==========================================================================
   SECTION 4: TIMELINE
   ========================================================================== */

#timeline {
    padding: 120px 8vw;
    background-color: var(--bg-cream);
    max-width: 1200px;
    margin: 0 auto;
}

#timeline-heading {
    font-weight: 700;
    font-size: clamp(28px, 5vw, 64px);
    margin-bottom: 80px;
    color: var(--charcoal);
    text-align: center;
}

#timeline-track {
    position: relative;
    padding-left: 60px;
}

.timeline-connector {
    position: absolute;
    left: 27px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--mid-gray);
}

.timeline-item {
    position: relative;
    padding: 24px 30px;
    margin-bottom: 40px;
    background: var(--cream-dark);
    border-radius: 2px;
    cursor: default;
}

.timeline-marker {
    position: absolute;
    left: -48px;
    top: 28px;
    width: 30px;
    height: 30px;
}

.marker-shape {
    width: 24px;
    height: 24px;
}

.timeline-year {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--sunset-orange);
    font-weight: 400;
    letter-spacing: 0.05em;
}

.timeline-item h3 {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(18px, 2.5vw, 28px);
    color: var(--charcoal);
    margin: 4px 0 8px;
}

.timeline-item p {
    color: var(--charcoal);
    line-height: 1.7;
    font-size: clamp(14px, 1vw, 16px);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

#site-footer {
    padding: 40px 8vw;
    background: var(--bg-cream);
}

.footer-rule {
    height: 1px;
    background: var(--charcoal);
    width: 100%;
}

#footer-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    padding: 24px 0;
    flex-wrap: wrap;
}

.footer-link {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--charcoal);
    transition: color 200ms ease-out;
}

.footer-link:hover {
    color: var(--teal);
}

.footer-separator {
    display: flex;
    align-items: center;
}

.starburst-icon {
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 900px) {
    #concepts {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 30px;
    }

    .concept-large {
        grid-column: 1;
        grid-row: auto;
        margin-left: 0;
    }

    .concept-large.visible {
        transform: translateX(0);
    }

    .concept-medium {
        grid-column: 1;
        grid-row: auto;
        margin-top: 0;
    }

    .concept-medium.visible {
        transform: translateY(0);
    }

    .concept-small {
        grid-column: 1;
        grid-row: auto;
        margin-top: 0;
    }

    .concept-small.visible {
        transform: translateY(0);
    }

    .concept-accent-line {
        display: none;
    }

    #code-poster-card {
        padding: 30px;
    }

    .poster-border {
        padding: 24px;
    }

    #timeline-track {
        padding-left: 50px;
    }
}

@media (max-width: 600px) {
    #hero-lambda {
        width: 45vw;
        top: 12vh;
        right: 3vw;
    }

    #hero-logotype {
        bottom: 12vh;
        left: 6vw;
    }

    #hero-rule {
        left: 6vw;
        right: 6vw;
    }

    #concepts {
        padding: 80px 6vw;
    }

    .concept-block {
        padding: 28px;
    }

    #code-poster {
        padding: 60px 5vw;
    }

    #timeline {
        padding: 80px 5vw;
    }

    #footer-nav {
        gap: 16px;
    }
}
