/* haskell.day - Isometric Technical Docs */
/* Palette: #f4f4f5, #ffffff, #7c3aed, #18181b, #3f3f46, #71717a, #d4d4d8, #ede9fe */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #f4f4f5;
    color: #18181b;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ===== Isometric Accent Shapes ===== */
.iso-accents {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.iso-cube {
    position: absolute;
    opacity: 0;
    animation: isoFloat 20s ease-in-out infinite;
}

.iso-cube-1 {
    top: 12%;
    left: 8%;
    animation-delay: 0s;
}

.iso-cube-2 {
    top: 35%;
    right: 6%;
    animation-delay: 4s;
}

.iso-cube-3 {
    top: 60%;
    left: 4%;
    animation-delay: 8s;
}

.iso-cube-4 {
    top: 80%;
    right: 10%;
    animation-delay: 12s;
}

.iso-cube-5 {
    top: 25%;
    right: 20%;
    animation-delay: 16s;
}

@keyframes isoFloat {
    0%, 100% {
        opacity: 0;
        transform: translateY(0) rotate(0deg);
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    50% {
        transform: translateY(-15px) rotate(3deg);
    }
}

/* ===== Hero Section (0-100vh) ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f4f4f5;
    z-index: 1;
    padding: 2rem;
}

.hero-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.hero-operator {
    position: absolute;
    font-family: 'Fira Code', monospace;
    font-size: 1.2rem;
    color: #7c3aed;
    opacity: 0.15;
    user-select: none;
}

.hero-op-left {
    top: 20%;
    left: -100px;
    animation: opPulse 4s ease-in-out infinite;
}

.hero-op-right {
    top: 60%;
    right: -100px;
    animation: opPulse 4s ease-in-out infinite 2s;
}

@keyframes opPulse {
    0%, 100% { opacity: 0.08; }
    50% { opacity: 0.2; }
}

.lambda-symbol {
    font-family: 'Source Code Pro', monospace;
    font-weight: 600;
    font-size: clamp(8rem, 25vw, 16rem);
    color: #7c3aed;
    line-height: 1;
    user-select: none;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.lambda-symbol:hover {
    transform: scale(1.05);
}

.brand-name {
    font-family: 'Source Code Pro', monospace;
    font-weight: 600;
    font-size: clamp(2rem, 5vw, 2.75rem);
    color: #18181b;
    margin-top: 1rem;
    letter-spacing: -0.02em;
}

.tagline {
    font-family: 'Source Code Pro', monospace;
    font-weight: 400;
    font-size: clamp(0.9rem, 2vw, 1.15rem);
    color: #71717a;
    margin-top: 0.75rem;
    letter-spacing: 0.08em;
}

.hero-sig {
    margin-top: 2.5rem;
    padding: 0.5rem 1.25rem;
    background: #ede9fe;
    border-radius: 6px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.hero-sig:hover {
    opacity: 1;
}

.hero-sig-text {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #3f3f46;
}

.scroll-hint {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollBounce 2.5s ease-in-out infinite;
}

.scroll-arrow {
    font-size: 1.5rem;
    color: #d4d4d8;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.4; }
    50% { transform: translateX(-50%) translateY(8px); opacity: 0.8; }
}

/* ===== Operator Dividers ===== */
.operator-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem 1rem;
    position: relative;
    z-index: 1;
}

.op-symbol {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #7c3aed;
    opacity: 0.35;
}

.op-line {
    width: 60px;
    height: 1px;
    background: #7c3aed;
    opacity: 0.15;
}

/* ===== Concepts Section (100-260vh) ===== */
.concepts {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    z-index: 1;
}

.section-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: #71717a;
    margin-bottom: 2rem;
    padding-left: 0.25rem;
    letter-spacing: 0.02em;
}

.concept-panel {
    background: #ffffff;
    border-left: 3px solid #7c3aed;
    padding: 24px;
    border-radius: 0 8px 8px 0;
    position: relative;
}

.concept-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.concept-title {
    font-family: 'Source Code Pro', monospace;
    font-weight: 600;
    font-size: 1.25rem;
    color: #18181b;
}

.concept-badge {
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
    color: #7c3aed;
    background: #ede9fe;
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.concept-text {
    font-size: 0.92rem;
    color: #3f3f46;
    line-height: 1.75;
    margin-bottom: 1.25rem;
}

.code-block {
    background: #ede9fe;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 1rem;
    overflow-x: auto;
}

.code-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: #71717a;
    margin-bottom: 0.5rem;
}

.code-content {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: #3f3f46;
    white-space: pre;
    display: block;
    line-height: 1.6;
}

.type-signature {
    display: inline-block;
}

.type-sig-code {
    font-family: 'Fira Code', monospace;
    font-size: 0.78rem;
    color: #7c3aed;
    background: #f4f4f5;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    border: 1px solid #d4d4d8;
}

.concept-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0;
    position: relative;
}

.concept-connector::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: #7c3aed;
    opacity: 0.12;
}

.connector-op {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: #7c3aed;
    opacity: 0.4;
    background: #f4f4f5;
    padding: 0.15rem 0.5rem;
    position: relative;
    z-index: 1;
}

/* ===== Types Strip (260-340vh) ===== */
.types-strip {
    background: #18181b;
    padding: 5rem 2rem;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.types-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: #71717a;
    text-align: center;
    margin-bottom: 3rem;
    letter-spacing: 0.02em;
}

.sig-scroll-container {
    overflow: hidden;
    padding: 1rem 0;
    mask-image: linear-gradient(to right, transparent, #18181b 10%, #18181b 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, #18181b 10%, #18181b 90%, transparent);
}

.sig-scroll-track {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    white-space: nowrap;
    will-change: transform;
    animation: sigScroll 40s linear infinite;
}

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

.sig-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.sig-name {
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    font-weight: 500;
    color: #ffffff;
}

.sig-colon {
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    color: #7c3aed;
}

.sig-type {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #d4d4d8;
}

.sig-separator {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #7c3aed;
    opacity: 0.5;
    flex-shrink: 0;
}

.types-caption {
    text-align: center;
    margin-top: 3rem;
}

.types-caption p {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.9rem;
    color: #71717a;
    font-style: italic;
}

/* ===== Community Footer (340vh+) ===== */
.community-footer {
    background: #f4f4f5;
    padding: 6rem 2rem 4rem;
    position: relative;
    z-index: 1;
}

.footer-inner {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.footer-link {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: #7c3aed;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #18181b;
}

.footer-link-sep {
    color: #d4d4d8;
    font-size: 0.8rem;
}

.footer-lambda-mark {
    font-family: 'Source Code Pro', monospace;
    font-weight: 600;
    font-size: 2.5rem;
    color: #7c3aed;
    opacity: 0.3;
    margin-bottom: 1rem;
    transition: opacity 0.3s ease;
}

.footer-lambda-mark:hover {
    opacity: 0.6;
}

.footer-closing {
    font-family: 'Source Code Pro', monospace;
    font-weight: 600;
    font-size: 1.1rem;
    color: #18181b;
    margin-bottom: 0.75rem;
}

.footer-brand {
    font-family: 'Fira Code', monospace;
    font-size: 0.72rem;
    color: #71717a;
    letter-spacing: 0.03em;
}

/* ===== Reveal Animations ===== */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s cubic-bezier(0.23, 1, 0.32, 1),
                transform 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}

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

.reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal:nth-child(4) { transition-delay: 0.24s; }
.reveal:nth-child(5) { transition-delay: 0.32s; }

/* ===== Hero entrance animation ===== */
.hero .lambda-symbol {
    animation: lambdaEntrance 1.2s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.hero .brand-name {
    animation: fadeSlideUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) 0.4s forwards;
    opacity: 0;
}

.hero .tagline {
    animation: fadeSlideUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) 0.6s forwards;
    opacity: 0;
}

.hero .hero-sig {
    animation: fadeSlideUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) 0.8s forwards;
    opacity: 0;
}

@keyframes lambdaEntrance {
    0% {
        opacity: 0;
        transform: scale(0.85) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes fadeSlideUp {
    0% {
        opacity: 0;
        transform: translateY(16px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .concept-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .concept-panel {
        padding: 18px;
    }

    .hero-op-left,
    .hero-op-right {
        display: none;
    }

    .sig-scroll-track {
        gap: 1.5rem;
    }

    .sig-item {
        gap: 0.35rem;
    }

    .sig-name,
    .sig-colon,
    .sig-type {
        font-size: 0.75rem;
    }

    .types-strip {
        padding: 3rem 1rem;
    }

    .footer-links {
        gap: 0.5rem;
    }
}
