/* scire.dev - Terminal Developer Knowledge Platform */

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

html {
    background-color: #0f1219;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: #cbd5e1;
    background-color: #0f1219;
    overflow-x: hidden;
    position: relative;
}

/* ===== Scanline Overlay ===== */
#scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.04) 2px,
        rgba(0, 0, 0, 0.04) 3px
    );
}

/* ===== Active Block Indicator ===== */
#block-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 2px;
    height: 0;
    background: #28c840;
    z-index: 100;
    transition: top 0.3s ease, height 0.3s ease;
}

/* ===== Terminal Window ===== */
.terminal-window {
    max-width: 720px;
    width: 90%;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    background: #0f1219;
    border: 1px solid rgba(74, 85, 104, 0.3);
}

.terminal-bar {
    display: flex;
    align-items: center;
    height: 36px;
    padding: 0 12px;
    background: #1a2030;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }

.terminal-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 400;
    color: #4a5568;
    margin-left: 12px;
}

.terminal-body {
    padding: 24px 20px;
}

/* ===== Lines ===== */
.line {
    display: flex;
    align-items: flex-start;
    min-height: 28px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    line-height: 1.6;
}

.line-number {
    display: inline-block;
    width: 40px;
    min-width: 40px;
    text-align: right;
    padding-right: 16px;
    color: #4a5568;
    opacity: 0.6;
    font-size: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    user-select: none;
}

.line-content {
    flex: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.line-spacer {
    height: 16px;
}

.output-line .line-content {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    color: #cbd5e1;
}

/* ===== Syntax Highlighting ===== */
.prompt {
    color: #28c840;
    font-weight: 500;
}

.command {
    color: #e2e8f0;
    font-weight: 400;
}

.flag {
    color: #f7c948;
}

.string {
    color: #28c840;
}

.comment {
    color: #4a5568;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 300;
}

.output-text {
    color: #cbd5e1;
}

.output-text strong {
    color: #e2e8f0;
    font-weight: 600;
}

/* ===== Cursor ===== */
.cursor {
    display: inline-block;
    width: 8px;
    height: 20px;
    background: #28c840;
    animation: blink 1060ms step-end infinite;
    vertical-align: middle;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    50.01%, 100% { opacity: 0; }
}

.exit-cursor {
    animation: blinkThrice 3180ms step-end forwards;
}

@keyframes blinkThrice {
    0% { opacity: 1; }
    16.67% { opacity: 0; }
    33.33% { opacity: 1; }
    50% { opacity: 0; }
    66.67% { opacity: 1; }
    83.33% { opacity: 0; }
    100% { opacity: 0; }
}

/* ===== Progress Bar ===== */
.progress-bar {
    width: 200px;
    height: 4px;
    background: rgba(74, 85, 104, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: #28c840;
    border-radius: 2px;
    transition: width 0.4s ease;
}

.progress-fill.complete {
    width: 100%;
}

/* ===== Hidden ===== */
.hidden {
    display: none;
}

/* ===== Sections ===== */
#hero {
    padding: 100px 0 60px;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.knowledge-block {
    padding: 48px 0;
}

.knowledge-block .terminal-window {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.knowledge-block.visible .terminal-window {
    opacity: 1;
    transform: translateX(0);
}

.block-content .line {
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.knowledge-block.visible .block-content .line {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation delays for block content lines */
.knowledge-block.visible .block-content .line:nth-child(1) { transition-delay: 0.1s; }
.knowledge-block.visible .block-content .line:nth-child(2) { transition-delay: 0.15s; }
.knowledge-block.visible .block-content .line:nth-child(3) { transition-delay: 0.2s; }
.knowledge-block.visible .block-content .line:nth-child(4) { transition-delay: 0.25s; }
.knowledge-block.visible .block-content .line:nth-child(5) { transition-delay: 0.3s; }
.knowledge-block.visible .block-content .line:nth-child(6) { transition-delay: 0.35s; }
.knowledge-block.visible .block-content .line:nth-child(7) { transition-delay: 0.4s; }
.knowledge-block.visible .block-content .line:nth-child(8) { transition-delay: 0.45s; }
.knowledge-block.visible .block-content .line:nth-child(9) { transition-delay: 0.5s; }
.knowledge-block.visible .block-content .line:nth-child(10) { transition-delay: 0.55s; }
.knowledge-block.visible .block-content .line:nth-child(11) { transition-delay: 0.6s; }

/* ===== Footer ===== */
#footer-exit {
    padding: 60px 0 120px;
}

#footer-exit .terminal-window {
    opacity: 0;
    transition: opacity 0.6s ease;
}

#footer-exit.visible .terminal-window {
    opacity: 1;
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    .knowledge-block .terminal-window {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .block-content .line {
        opacity: 1;
        transform: none;
        transition: none;
    }

    #footer-exit .terminal-window {
        opacity: 1;
        transition: none;
    }

    .cursor {
        animation: none;
        opacity: 1;
    }

    #block-indicator {
        transition: none;
    }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .terminal-window {
        width: 95%;
    }

    .line {
        font-size: 14px;
    }

    .terminal-body {
        padding: 16px 12px;
    }

    #hero {
        padding: 60px 0 40px;
    }
}
