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

:root {
    --bg: #0d1117;
    --surface: #161b22;
    --border: #30363d;
    --green: #39d353;
    --cyan: #58a6ff;
    --yellow: #e3b341;
    --red: #f85149;
    --purple: #bc8cff;
    --text: #c9d1d9;
    --muted: #6e7681;
    --prompt-user: #39d353;
    --prompt-host: #58a6ff;
    --font: 'Cascadia Code', 'Fira Code', 'Consolas', 'Courier New', monospace;
}

html,
body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
}

/* ── Layout ── */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ── Top bar ── */
#topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    gap: 12px;
    flex-shrink: 0;
}

#topbar .title {
    color: var(--green);
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 0.05em;
}

.traffic-lights {
    display: flex;
    gap: 6px;
}

.traffic-lights span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.tl-red {
    background: #ff5f57;
}

.tl-yellow {
    background: #ffbd2e;
}

.tl-green {
    background: #28c840;
}

#mode-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px;
}

#mode-toggle button {
    background: transparent;
    border: none;
    color: var(--muted);
    font-family: var(--font);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

#mode-toggle button.active {
    background: var(--surface);
    color: var(--green);
}

#mode-toggle button:hover:not(.active) {
    color: var(--text);
}

/* ── Terminal view ── */
#terminal-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

#output {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px 8px;
    scroll-behavior: smooth;
}

#output::-webkit-scrollbar {
    width: 6px;
}

#output::-webkit-scrollbar-track {
    background: transparent;
}

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

.line {
    margin: 2px 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.line.prompt-line {
    display: flex;
    align-items: baseline;
    gap: 0;
}

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

.prompt-at {
    color: var(--muted);
}

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

.prompt-colon {
    color: var(--muted);
}

.prompt-path {
    color: var(--purple);
}

.prompt-dollar {
    color: var(--text);
    margin-right: 6px;
}

.cmd-echo {
    color: var(--text);
}

.output-block {
    padding: 6px 0 6px 4px;
}

.c-green {
    color: var(--green);
}

.c-cyan {
    color: var(--cyan);
}

.c-yellow {
    color: var(--yellow);
}

.c-red {
    color: var(--red);
}

.c-purple {
    color: var(--purple);
}

.c-muted {
    color: var(--muted);
}

.c-bold {
    font-weight: bold;
}

.c-underline {
    text-decoration: underline;
}

/* Input row */
#input-row {
    display: flex;
    align-items: center;
    padding: 8px 20px 12px;
    gap: 0;
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

.input-prompt {
    display: flex;
    align-items: baseline;
    gap: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

#cmd-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    flex: 1;
    caret-color: var(--green);
    margin-left: 6px;
}

/* Blinking cursor (shown when input is empty) */
#cursor {
    display: inline-block;
    width: 9px;
    height: 17px;
    background: var(--green);
    vertical-align: middle;
    animation: blink 1s step-end infinite;
    margin-left: 1px;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* ── Explorer view ── */
#explorer-view {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 32px 24px;
}

#explorer-view::-webkit-scrollbar {
    width: 6px;
}

#explorer-view::-webkit-scrollbar-track {
    background: transparent;
}

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

.explorer-section {
    margin-bottom: 40px;
}

.explorer-section h2 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-bottom: 16px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

/* About card */
.about-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
}

.about-card .name {
    font-size: 22px;
    font-weight: bold;
    color: var(--green);
    margin-bottom: 4px;
}

.about-card .tagline {
    color: var(--cyan);
    margin-bottom: 12px;
    font-size: 14px;
}

.about-card .bio {
    color: var(--text);
    line-height: 1.7;
}

.about-card .tags {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--purple);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
}

/* Project grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.project-card:hover {
    border-color: var(--cyan);
    transform: translateY(-2px);
}

.project-card .proj-name {
    font-weight: bold;
    color: var(--cyan);
    font-size: 16px;
    margin-bottom: 6px;
}

.project-card .proj-lang {
    font-size: 12px;
    color: var(--yellow);
    margin-bottom: 8px;
}

.project-card .proj-desc {
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
}

.project-card .proj-status {
    margin-top: 12px;
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
}

.status-active {
    background: #1a3a25;
    color: var(--green);
    border: 1px solid var(--green);
}

.status-wip {
    background: #3a2e1a;
    color: var(--yellow);
    border: 1px solid var(--yellow);
}

.status-archived {
    background: #2a2a2a;
    color: var(--muted);
    border: 1px solid var(--border);
}

/* Contact / links */
.link-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.link-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 14px;
    color: var(--cyan);
    text-decoration: none;
    font-size: 13px;
    transition: border-color 0.2s;
}

.link-pill:hover {
    border-color: var(--cyan);
}

/* GitHub activity */
.activity-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
}

.activity-card p {
    color: var(--text);
    margin-bottom: 10px;
    font-size: 13px;
}

.activity-card a {
    color: var(--cyan);
}

/* Hint bar */
#hint-bar {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 5px 20px;
    font-size: 11px;
    color: var(--muted);
    flex-shrink: 0;
}

#hint-bar kbd {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1px 5px;
    color: var(--text);
    font-family: var(--font);
    font-size: 10px;
}

/* Mobile responsive */
@media (max-width: 600px) {

    html,
    body {
        font-size: 13px;
    }

    #output {
        padding: 10px 12px 6px;
    }

    #input-row {
        padding: 6px 12px 8px;
    }

    #explorer-view {
        padding: 20px 14px;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }
}
