:root {
    --bg-color: #000;
    --text-color: #00ff41;
    --accent-color: #f0f;
    --font-retro: 'VT323', monospace;
    --font-clean: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --container-width: 800px;
    --crt-flicker: flicker 0.15s infinite;
}

body.clean-mode {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --accent-color: #2563eb;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-clean);
}

body.retro-mode {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-retro);
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* CRT EFFECTS */
.retro-mode .crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    z-index: 100;
}

.retro-mode .scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 99;
}

.retro-mode .screen-container {
    filter: blur(0.4px);
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.7);
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% {
        opacity: 0.987;
    }

    5% {
        opacity: 0.991;
    }

    10% {
        opacity: 0.985;
    }

    15% {
        opacity: 0.993;
    }

    20% {
        opacity: 0.989;
    }

    25% {
        opacity: 0.995;
    }

    30% {
        opacity: 0.986;
    }

    35% {
        opacity: 0.997;
    }

    40% {
        opacity: 0.988;
    }

    45% {
        opacity: 0.994;
    }

    50% {
        opacity: 0.989;
    }

    55% {
        opacity: 0.996;
    }

    60% {
        opacity: 0.987;
    }

    65% {
        opacity: 0.998;
    }

    70% {
        opacity: 0.989;
    }

    75% {
        opacity: 0.993;
    }

    80% {
        opacity: 0.985;
    }

    85% {
        opacity: 0.991;
    }

    90% {
        opacity: 0.988;
    }

    95% {
        opacity: 0.994;
    }

    100% {
        opacity: 0.987;
    }
}

/* Layout */
.screen-container {
    max-width: var(--container-width);
    margin: 2rem auto;
    padding: 2rem;
    border: 2px solid var(--text-color);
    min-height: 80vh;
    position: relative;
    background: var(--bg-color);
}

.clean-mode .screen-container {
    border: none;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    margin-top: 4rem;
}

/* Headings */
.pixel-heading {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    line-height: 1;
}

.clean-mode .pixel-heading {
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
}

.role-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.8;
}

/* Sections */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Nav */
.terminal-nav ul {
    list-style: none;
    margin-top: 3rem;
}

.terminal-nav li {
    margin: 1rem 0;
}

.terminal-nav a,
.back-home {
    color: var(--text-color);
    text-decoration: none;
    border: 1px solid var(--text-color);
    padding: 0.5rem 1rem;
    display: inline-block;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 1.2rem;
}

.retro-mode a:hover,
.retro-mode button:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

.clean-mode a:hover,
.clean-mode button:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
    border-top: 1px dashed var(--text-color);
    border-bottom: 1px dashed var(--text-color);
    padding: 1rem 0;
}

/* Toggle */
.main-header {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

#toggle-mode {
    font-weight: bold;
}

/* Typography elements */
.summary-box {
    margin: 1.5rem 0;
    line-height: 1.4;
    font-size: 1.3rem;
}

.clean-mode .summary-box {
    font-size: 1.1rem;
    color: #4b5563;
}

.pixel-list {
    list-style: none;
}

.pixel-list li::before {
    content: "> ";
}

/* CV and Projects */
.cv-block {
    margin: 2rem 0;
}

.cv-block h2 {
    border-bottom: 1px solid var(--text-color);
    margin-bottom: 1rem;
}

.project-card {
    border: 1px solid var(--text-color);
    padding: 1rem;
    margin-bottom: 1rem;
}

.blink-cursor {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .pixel-heading {
        font-size: 2rem;
    }

    .screen-container {
        margin: 0;
        border: none;
    }

    .main-header {
        position: static;
        text-align: right;
        padding: 1rem;
    }
}

/* Printing */
@media print {

    .main-header,
    .terminal-nav,
    .back-home,
    .action-bar,
    .crt-overlay,
    .scanlines {
        display: none !important;
    }

    .screen-container {
        border: none;
        width: 100%;
        max-width: none;
    }

    body,
    .screen-container {
        background: white !important;
        color: black !important;
    }

    .content-section {
        display: block !important;
        page-break-after: always;
    }

    #home {
        page-break-after: avoid;
    }
}

/* Pong Game */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 2rem 0;
}

#pong-canvas {
    border: 2px solid var(--text-color);
    max-width: 100%;
    cursor: none;
}

.game-hint {
    margin-top: 1rem;
    font-size: 1rem;
    opacity: 0.7;
}

.game-link {
    color: var(--accent-color) !important;
}

/* Utility Hidden */
.hidden {
    display: none !important;
}