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

:root {
    --green: #4af626;
    --green-dim: #27a822;
    --bg: #0c0c0c;
    --terminal-bg: #1a1a1a;
    --header-bg: #2d2d2d;
    --text: #c8c8c8;
    --text-dim: #666;
    --glow: rgba(74, 246, 38, 0.3);
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* CRT scanlines overlay */
.scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1000;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.12) 0px,
        rgba(0, 0, 0, 0.12) 1px,
        transparent 1px,
        transparent 3px
    );
}

/* ── Terminal window ───────────────────────────────── */

.terminal {
    width: 100%;
    max-width: 780px;
    background: var(--terminal-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow:
        0 0 40px rgba(74, 246, 38, 0.07),
        0 20px 60px rgba(0, 0, 0, 0.5);
}

.terminal-header {
    background: var(--header-bg);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    user-select: none;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.terminal-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.btn-close { background: #ff5f56; }
.btn-minimize { background: #ffbd2e; }
.btn-maximize { background: #27c93f; }

.terminal-title {
    color: #888;
    font-size: 12px;
}

.terminal-body {
    padding: 28px 28px 20px;
    min-height: 420px;
    overflow-y: auto;
}

/* ── Blocks & commands ─────────────────────────────── */

.block {
    margin-bottom: 24px;
}

.command-line {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.prompt {
    color: var(--green-dim);
    margin-right: 10px;
    flex-shrink: 0;
}

.command {
    color: #fff;
}

.cursor {
    color: var(--green);
    animation: blink 1s step-end infinite;
    margin-left: 2px;
}

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

/* Hide cursors by default; JS shows during animation */
html.js .cursor {
    display: none;
}

/* ── Output sections ───────────────────────────────── */

.output {
    margin-top: 10px;
    padding-left: 4px;
}

/* Profile / whoami */
.profile-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-pic {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 2px solid var(--green);
    object-fit: cover;
    flex-shrink: 0;
    filter: saturate(0.8);
    transition: filter 0.3s;
}

.profile-pic:hover {
    filter: saturate(1);
}

.name {
    color: var(--green);
    font-size: 20px;
    font-weight: 700;
    text-shadow: 0 0 8px var(--glow);
}

.role {
    color: var(--text);
    font-size: 14px;
    margin-top: 2px;
}

.affiliation {
    color: var(--text-dim);
    font-size: 13px;
}

/* About */
.about-text p {
    margin-bottom: 6px;
    color: var(--text);
    text-align: justify;
}

/* Publications */
.paper {
    margin-bottom: 14px;
    padding-left: 2px;
}

.paper-header {
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.paper-index {
    color: var(--green-dim);
    flex-shrink: 0;
}

.paper-title {
    color: var(--green);
    text-shadow: 0 0 5px var(--glow);
}

a.paper-title {
    text-decoration: none;
}

a.paper-title:hover {
    text-decoration: underline;
}

.paper-authors {
    padding-left: 0;
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 2px;
}

.author-self {
    color: #fff;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.15);
}

.paper-meta {
    padding-left: 0;
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 2px;
}

.paper-venue {
    color: var(--text-dim);
}

.paper-badge {
    color: var(--green-dim);
    font-weight: 400;
    margin-left: 4px;
}

.paper-links a {
    color: var(--green-dim);
    text-decoration: none;
    transition: color 0.2s;
}

.paper-links a:hover {
    color: var(--green);
    text-decoration: underline;
}

.paper-more {
    margin-top: 14px;
    padding-left: 2px;
    font-size: 13px;
}

.paper-more a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s;
}

.paper-more a:hover {
    color: var(--green);
}

/* Links */
.links-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.link-item {
    display: flex;
    gap: 8px;
}

.link-label {
    color: var(--text-dim);
    min-width: 100px;
}

.link-item a {
    color: var(--green-dim);
    text-decoration: none;
    transition: color 0.2s;
}

.link-item a:hover {
    color: var(--green);
}

/* Final prompt */
#final-prompt .cursor {
    display: inline;
}

/* ── Skip hint ─────────────────────────────────────── */

.skip-hint {
    position: fixed;
    bottom: 16px;
    right: 20px;
    color: #444;
    font-size: 12px;
    font-family: inherit;
    z-index: 1001;
    transition: opacity 0.4s;
    user-select: none;
}

/* ── Credit ────────────────────────────────────────── */

.credit {
    color: #444;
    font-size: 11px;
    font-family: inherit;
    user-select: none;
    text-align: center;
    padding: 8px 0;
}

.credit a {
    color: #444;
    text-decoration: none;
    transition: color 0.2s;
}

.credit a:hover {
    color: var(--green-dim);
}

/* ── JS animation states ──────────────────────────── */

html.js .block {
    display: none;
}

html.js #final-prompt {
    display: none;
}

/* ── Responsive ────────────────────────────────────── */

@media (max-width: 600px) {
    body {
        padding: 8px;
        align-items: flex-start;
    }

    .terminal {
        border-radius: 6px;
    }

    .terminal-body {
        padding: 18px 16px 14px;
        font-size: 12px;
    }

    .profile-section {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .profile-pic {
        width: 90px;
        height: 90px;
    }

    .paper-header {
        flex-direction: column;
        gap: 0;
    }

    .paper-meta {
        padding-left: 0;
    }

    .link-label {
        min-width: 80px;
    }
}
