/* desca.dev - Terminal Command Line Dev
   Fonts: "JetBrains Mono" / "Inter" / "Fira Code" (Google Fonts)
   Interactive-feeling code examples with input/output formatting.
   Line numbers visible.
*/

:root {
    --bg: #0d1117;
    --surface: #161b22;
    --text: #c9d1d9;
    --green: #7ee787;
    --orange: #ffa657;
    --purple: #d2a8ff;
    --border: #30363d;
    --blue: #58a6ff;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Dot-grid background at very low opacity */
.dot-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(201, 209, 217, 0.06) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* Tab Bar (terminal window chrome) */
.tab-bar {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 50;
}

.traffic-lights {
    display: flex;
    gap: 6px;
    margin-right: 1.5rem;
}

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

.tl-red { background: #ff5f56; }
.tl-yellow { background: #ffbd2e; }
.tl-green { background: #27c93f; }

.tabs {
    display: flex;
    gap: 0;
}

.tab {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: rgba(201, 209, 217, 0.5);
    padding: 0.4rem 1rem;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: color 0.25s ease, border-bottom-color 0.25s ease;
}

.tab:hover {
    color: rgba(201, 209, 217, 0.8);
}

.tab.active {
    color: var(--text);
    border-bottom-color: var(--blue);
}

/* Tab Panels */
.tab-panel {
    display: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.tab-panel.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Terminal Content Column */
.terminal-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    position: relative;
    z-index: 1;
}

/* Hero / Boot */
.hero {
    padding: 4rem 0 3rem;
}

.prompt-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.prompt {
    color: var(--blue);
}

.typed-static {
    color: var(--text);
}

.cursor {
    animation: blink 1s step-end infinite;
    color: var(--text);
}

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

/* Hero output lines - hidden by default for staggered reveal */
.output-block .output-line {
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.output-block .output-line.revealed {
    opacity: 1;
    transform: translateY(0);
}

.output-block .output-line.dim.revealed {
    opacity: 0.4;
}

.output-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text);
    line-height: 1.8;
}

.output-line.dim {
    color: rgba(201, 209, 217, 0.4);
}

.output-dim {
    color: rgba(201, 209, 217, 0.4);
}

/* Section Headers - comment-style */
.section-header {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1rem;
    color: var(--green);
    margin: 3rem 0 1rem;
}

.comment-hash {
    color: rgba(126, 231, 135, 0.5);
    margin-right: 0.3rem;
}

/* Body Text */
.body-text {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.highlight-orange { color: var(--orange); }
.highlight-purple { color: var(--purple); }

/* Code Blocks */
.code-block {
    background: var(--surface);
    border-left: 3px solid var(--green);
    border-radius: 6px;
    padding: 16px 20px;
    margin: 1.25rem 0;
    display: flex;
    gap: 16px;
    overflow-x: auto;
    transition: border-color 0.3s ease;
}

.code-block:hover {
    border-left-color: var(--blue);
}

.code-block.example-output {
    border-left-color: var(--orange);
}

.code-block.example-output:hover {
    border-left-color: var(--purple);
}

.line-numbers {
    display: flex;
    flex-direction: column;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: rgba(201, 209, 217, 0.2);
    line-height: 1.7;
    user-select: none;
    text-align: right;
    min-width: 1.5em;
}

.code-pre {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--text);
    line-height: 1.7;
    margin: 0;
    white-space: pre;
}

/* Syntax highlighting classes */
.kw { color: var(--purple); }
.str { color: #a5d6ff; }
.fn { color: var(--orange); }
.num { color: var(--orange); }
.comment { color: rgba(201, 209, 217, 0.35); font-style: italic; }
.prompt-char { color: var(--blue); }

/* Exit Section */
.exit-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

/* Fade-In Animation (scroll reveal) */
.fade-in {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

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

/* Stagger children within a tab panel */
.tab-panel.active .fade-in.visible:nth-child(2) { transition-delay: 0.05s; }
.tab-panel.active .fade-in.visible:nth-child(3) { transition-delay: 0.1s; }
.tab-panel.active .fade-in.visible:nth-child(4) { transition-delay: 0.15s; }
.tab-panel.active .fade-in.visible:nth-child(5) { transition-delay: 0.2s; }

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(88, 166, 255, 0.4);
}

/* Selection color */
::selection {
    background: rgba(88, 166, 255, 0.3);
    color: var(--text);
}

/* Responsive */
@media (max-width: 768px) {
    .terminal-content {
        padding: 1.5rem 1rem 3rem;
    }

    .hero {
        padding: 2rem 0 2rem;
    }

    .prompt-line {
        font-size: 1rem;
    }

    .code-block {
        padding: 12px 14px;
        gap: 12px;
    }

    .code-pre {
        font-size: 0.72rem;
    }
}
