/* ============================================
   haskell.day — Lambda Noir Cinema Styles
   ============================================ */

:root {
    --deep-black: #0A0A0F;
    --dark-purple: #1A1A24;
    --plum: #2D1B2E;
    --muted-mauve: #8A6B7A;
    --blush: #D4B8C7;
    --pale-blush: #FCEEF5;
    --hot-pink: #FF69B4;
    --magenta: #E83E8C;

    --font-display: 'Libre Baskerville', Georgia, serif;
    --font-body: 'Source Sans 3', 'Helvetica Neue', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

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

html {
    scroll-snap-type: y proximity;
    font-size: 16px;
}

body {
    background-color: var(--deep-black);
    color: var(--blush);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
}

/* Scanline Overlay */
.scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
}

/* Letterbox Bars */
.letterbox {
    position: fixed;
    left: 0;
    width: 100%;
    height: 5vh;
    background: #000;
    z-index: 500;
}

.letterbox--top {
    top: 0;
}

.letterbox--bottom {
    bottom: 0;
}

/* Opening Line */
.opening-line-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    z-index: 600;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.opening-line-container.visible {
    opacity: 1;
}

.opening-line-container.hidden {
    opacity: 0;
}

.opening-line-svg {
    width: 100%;
    height: 2px;
}

.opening-line {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 1.2s ease-in-out;
}

.opening-line.drawn {
    stroke-dashoffset: 0;
}

/* Main Reel */
.reel {
    position: relative;
    z-index: 1;
}

/* Frame Base */
.frame {
    min-height: 100vh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10vh 80px;
    position: relative;
    overflow: hidden;
}

/* Title Frame */
.frame--title {
    background: var(--deep-black);
}

.frame--title .frame__content {
    text-align: center;
    position: relative;
    max-width: 800px;
}

.lambda-watermark {
    position: absolute;
    font-size: 400px;
    color: var(--magenta);
    opacity: 0.03;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: Georgia, serif;
    pointer-events: none;
}

.lambda-logo {
    font-size: 72px;
    color: var(--magenta);
    font-family: Georgia, serif;
    margin-bottom: 24px;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.lambda-logo.visible {
    opacity: 1;
    transform: scale(1);
}

.film-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 56px;
    line-height: 1.15;
    color: var(--pale-blush);
    margin-bottom: 16px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease 0.3s, transform 0.6s ease 0.3s;
}

.film-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.film-subtitle {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 18px;
    color: var(--muted-mauve);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 32px;
    opacity: 0;
    transition: opacity 0.6s ease 0.6s;
}

.film-subtitle.visible {
    opacity: 1;
}

.title-meta {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 14px;
    color: var(--muted-mauve);
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 0.6s ease 0.9s;
}

.title-meta.visible {
    opacity: 1;
}

.meta-divider {
    margin: 0 16px;
    color: var(--magenta);
    opacity: 0.5;
}

/* Act Frames */
.frame--act {
    background: var(--dark-purple);
    padding: 10vh 80px;
}

.frame--act:nth-child(odd) {
    background: var(--deep-black);
}

.frame--act .frame__content {
    max-width: 1000px;
    width: 100%;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 64px;
    align-items: start;
}

.act-number {
    position: absolute;
    top: 10vh;
    right: 80px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 120px;
    color: var(--magenta);
    opacity: 0.06;
    line-height: 1;
}

.act-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 36px;
    line-height: 1.2;
    color: var(--pale-blush);
    margin-bottom: 32px;
    grid-column: 1 / -1;
}

.act-body {
    grid-column: 1;
}

.act-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    color: var(--blush);
    margin-bottom: 20px;
}

.code-block {
    background: rgba(45, 27, 46, 0.6);
    border-left: 2px solid var(--magenta);
    padding: 24px;
    margin: 24px 0;
    border-radius: 2px;
}

.code-text {
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.8;
    color: var(--pale-blush);
}

.code-keyword {
    color: var(--hot-pink);
}

.pull-quote {
    grid-column: 2;
    grid-row: 2;
    padding: 24px;
    border-left: 1px solid var(--magenta);
    align-self: center;
}

.pull-quote p {
    font-family: var(--font-display);
    font-weight: 400;
    font-style: italic;
    font-size: 18px;
    line-height: 1.5;
    color: var(--muted-mauve);
    margin-bottom: 8px;
}

.pull-quote cite {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 13px;
    color: var(--magenta);
    font-style: normal;
}

/* Fade and Slide Animations */
.fade-in {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Credits Frame */
.frame--credits {
    background: var(--deep-black);
    text-align: center;
}

.frame--credits .frame__content {
    max-width: 600px;
}

.credits-lambda {
    font-size: 48px;
    color: var(--magenta);
    font-family: Georgia, serif;
    margin-bottom: 24px;
    opacity: 0.3;
}

.credits-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 36px;
    color: var(--pale-blush);
    margin-bottom: 40px;
}

.credits-list {
    margin-bottom: 40px;
}

.credit-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 12px 0;
    border-bottom: 1px solid rgba(232, 62, 140, 0.1);
}

.credit-role {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 13px;
    color: var(--magenta);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.credit-name {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 14px;
    color: var(--muted-mauve);
}

.credits-divider {
    width: 40px;
    height: 1px;
    background: var(--magenta);
    margin: 32px auto;
    opacity: 0.5;
}

.credits-closing {
    font-family: var(--font-display);
    font-weight: 400;
    font-style: italic;
    font-size: 20px;
    color: var(--muted-mauve);
}

/* ============================================
   Responsive: < 768px
   ============================================ */
@media (max-width: 768px) {
    .frame {
        padding: 10vh 24px;
    }

    .film-title {
        font-size: 36px;
    }

    .film-subtitle {
        font-size: 14px;
    }

    .frame--act .frame__content {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .act-title {
        font-size: 28px;
    }

    .act-number {
        right: 24px;
        font-size: 72px;
    }

    .pull-quote {
        grid-column: 1;
        grid-row: auto;
    }

    .letterbox {
        height: 3vh;
    }

    .lambda-watermark {
        font-size: 200px;
    }

    .credit-line {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }

    .opening-line-container {
        width: 80%;
    }
}
