/* ============================================
   haskeller.net - Terminal-Native Community Hub
   ============================================ */

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

:root {
    --terminal-bg: #0D1117;
    --phosphor-green: #00FF41;
    --comment-gray: #6A737D;
    --warning-amber: #FFB627;
    --error-red: #FF6B6B;
    --cyan-info: #79C0FF;
    --cursor-white: #F0F6FC;
    --selection-bg: #1F2937;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: var(--terminal-bg);
    color: var(--phosphor-green);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.9rem;
    line-height: 1.55;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background-color: var(--selection-bg);
    color: var(--cursor-white);
}

/* --- Shell Header (Fixed, 48px) --- */
#shell-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background-color: var(--terminal-bg);
    border-bottom: 1px solid var(--selection-bg);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 100;
    opacity: 0;
    transition: opacity 200ms ease;
}

#shell-header.visible {
    opacity: 1;
}

.shell-prompt {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--phosphor-green);
}

.shell-cursor {
    display: inline-block;
    width: 8px;
    height: 18px;
    background-color: var(--cursor-white);
    margin-left: 8px;
    vertical-align: middle;
    animation: cursor-blink 1060ms step-end infinite;
}

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

.shell-uptime {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--comment-gray);
}

/* --- Terminal Buffer (Main Content) --- */
#terminal-buffer {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px;
    padding-top: 48px;
    padding-bottom: 32px;
}

/* --- MOTD Section (Hero) --- */
.motd-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 48px;
}

.motd-line {
    white-space: pre-wrap;
    font-family: 'JetBrains Mono', monospace;
}

#motd-welcome {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--phosphor-green);
    margin-bottom: 16px;
}

#motd-art {
    font-size: 0.85rem;
    line-height: 1.2;
    color: var(--phosphor-green);
    margin-bottom: 24px;
}

#motd-stats {
    font-size: 0.9rem;
    color: var(--comment-gray);
    line-height: 1.6;
}

/* --- Dash Dividers --- */
.dash-divider {
    width: 100%;
    height: 32px;
    display: flex;
    align-items: center;
    overflow: hidden;
    opacity: 0;
    transition: opacity 400ms ease;
}

.dash-divider.visible {
    opacity: 1;
}

.dash-divider::before {
    content: '────────────────────────────────────────────────────────────────────────────────';
    color: var(--comment-gray);
    opacity: 0.4;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
}

/* --- Content Sections --- */
.terminal-section {
    text-align: left;
}

.content-section {
    padding: 16px 0;
}

.content-section .section-prompt {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 300ms ease, transform 300ms ease;
}

.content-section.revealed .section-prompt {
    opacity: 1;
    transform: translateY(0);
}

.content-section .section-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 600ms ease, opacity 400ms ease 200ms;
}

.content-section.revealed .section-content {
    max-height: 2000px;
    opacity: 1;
}

/* --- Section Prompt (lambda>) --- */
.section-prompt {
    margin-bottom: 12px;
}

.prompt-lambda {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--phosphor-green);
    margin-right: 8px;
}

.prompt-command {
    font-weight: 700;
    font-size: 1rem;
    color: var(--cursor-white);
    text-transform: uppercase;
}

/* --- Section Content --- */
.section-content p {
    margin: 0;
    padding: 0;
    line-height: 1.55;
}

/* --- Syntax Highlighting --- */
.syntax-keyword {
    color: var(--error-red);
    font-weight: 700;
}

.syntax-type {
    color: var(--warning-amber);
}

.syntax-string {
    color: var(--phosphor-green);
}

.syntax-comment {
    color: var(--comment-gray);
}

.syntax-function {
    color: var(--cyan-info);
}

/* --- Code Block --- */
.code-block {
    padding: 8px 0;
    border-left: 2px solid var(--selection-bg);
    padding-left: 16px;
    margin: 8px 0;
}

.code-block[data-syntax] .syntax-keyword,
.code-block[data-syntax] .syntax-type,
.code-block[data-syntax] .syntax-string,
.code-block[data-syntax] .syntax-comment,
.code-block[data-syntax] .syntax-function {
    transition: color 800ms ease;
}

.code-block.syntax-mono .syntax-keyword,
.code-block.syntax-mono .syntax-type,
.code-block.syntax-mono .syntax-string,
.code-block.syntax-mono .syntax-comment,
.code-block.syntax-mono .syntax-function {
    color: var(--phosphor-green);
}

/* --- Directory Listings --- */
.dir-listing {
    font-size: 0.9rem;
    line-height: 1.7;
}

/* --- Man Page Header --- */
.man-header {
    color: var(--cursor-white);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Link Text --- */
.link-text {
    color: var(--cyan-info);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* --- Output Success --- */
.output-success {
    color: var(--phosphor-green);
}

/* --- Status Bar (Fixed, 32px) - Vim-style --- */
#status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32px;
    background-color: var(--selection-bg);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 100;
    font-size: 0.75rem;
    font-weight: 400;
    opacity: 0;
    transition: opacity 200ms ease;
}

#status-bar.visible {
    opacity: 1;
}

.status-mode {
    color: var(--phosphor-green);
    font-weight: 700;
    margin-right: 24px;
}

.status-section {
    color: var(--cursor-white);
    flex: 1;
}

.status-position {
    color: var(--comment-gray);
    margin-left: auto;
}

/* --- Terminal Padding --- */
.terminal-padding {
    height: 120px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    #terminal-buffer {
        padding: 0 16px;
        padding-top: 48px;
        padding-bottom: 32px;
    }

    .motd-section {
        min-height: 100vh;
        padding-top: 60px;
    }

    #motd-art {
        font-size: 0.55rem;
        line-height: 1.15;
    }

    #shell-header {
        padding: 0 16px;
    }

    #status-bar {
        padding: 0 16px;
    }
}

@media (max-width: 480px) {
    #motd-art {
        font-size: 0.4rem;
    }

    #motd-welcome {
        font-size: 1rem;
    }
}
