:root {
    --bg-color: #0b0e14;
    --header-bg: #151921;
    --text-primary: #4ade80;
    --text-secondary: #22d3ee;
    --text-prompt-user: #facc15;
    --text-prompt-dir: #67e8f9;
    --text-prompt-arrow: #4ade80;
    --text-muted: #94a3b8;
    --text-white: #e2e8f0;
    --border-cyan: #0891b2;
    --border-green: #16a34a;
    --border-window: #1e293b;
    --box-bg: rgba(15, 23, 42, 0.8);
    --status-bg: rgba(22, 163, 74, 0.1);
    --card-hover: rgba(74, 222, 128, 0.05);
    --glitch-shadow-1: rgba(255, 0, 255, 0.15);
    --glitch-shadow-2: rgba(0, 255, 255, 0.15);
    --font-mono: "Consolas", "Monaco", "Courier New", monospace;
    --crt-opacity: 0.1;
}

[data-theme="light"] {
    --bg-color: #f8fafc;
    --header-bg: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #0891b2;
    --text-prompt-user: #854d0e;
    --text-prompt-dir: #0e7490;
    --text-prompt-arrow: #0f172a;
    --text-muted: #64748b;
    --text-white: #020617;
    --border-cyan: #0891b2;
    --border-green: #334155;
    --border-window: #e2e8f0;
    --box-bg: rgba(241, 245, 249, 0.8);
    --status-bg: rgba(15, 23, 42, 0.05);
    --card-hover: rgba(15, 23, 42, 0.03);
    --glitch-shadow-1: #cbd5e1;
    --glitch-shadow-2: #e2e8f0;
    --crt-opacity: 0.02;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-mono);
    line-height: 1.6;
    overflow-x: hidden;
    transition:
        background-color 0.3s,
        color 0.3s;
    padding: 20px;
}

.crt::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background:
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.05) 50%),
        linear-gradient(
            90deg,
            rgba(255, 0, 0, 0.01),
            rgba(0, 255, 0, 0.01),
            rgba(0, 0, 255, 0.01)
        );
    z-index: 100;
    background-size:
        100% 2px,
        3px 100%;
    pointer-events: none;
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0),
        rgba(255, 255, 255, 0) 50%,
        rgba(0, 0, 0, 0.05) 50%,
        rgba(0, 0, 0, 0.05)
    );
    background-size: 100% 4px;
    z-index: 101;
    pointer-events: none;
    opacity: var(--crt-opacity);
}

.terminal {
    max-width: 900px;
    margin: 40px auto;
    background-color: var(--bg-color);
    border: 1px solid var(--border-window);
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10;
}

.window-header {
    background-color: var(--header-bg);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-top-left-radius: 7px;
    border-top-right-radius: 7px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.window-controls {
    display: flex;
    gap: 8px;
}

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

.dot.red {
    background-color: #0aade8;
}
.dot.yellow {
    background-color: #0aade8;
}
.dot.green {
    background-color: #0aade8;
}

.window-title {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

.btn-theme {
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-theme:hover {
    opacity: 0.7;
}

.terminal-content {
    padding: 40px;
}

.prompt-arrow {
    color: var(--text-prompt-arrow);
    margin-right: 5px;
}
.prompt-home {
    color: var(--text-prompt-user);
}
.prompt-dir {
    color: var(--text-prompt-dir);
}
.prompt-sign {
    color: var(--text-prompt-user);
    margin-left: 5px;
}

.section {
    margin-bottom: 60px;
}

.command-line {
    font-size: 1.05rem;
    margin-bottom: 15px;
}

.prompt {
    color: var(--text-primary);
}
.command {
    color: var(--text-primary);
    opacity: 0.9;
}

.header h1 {
    font-size: 4rem;
    color: var(--text-white);
    margin: 15px 0;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow:
        1px 1px var(--glitch-shadow-1),
        -1px -1px var(--glitch-shadow-2);
}

.status-box {
    margin: 25px 0;
    padding: 15px 20px;
    border-left: 3px solid var(--text-primary);
    background: var(--status-bg);
}

.status-line {
    margin-bottom: 12px;
    font-size: 1rem;
    line-height: 1.8;
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
}

.status-text {
    margin-right: 8px;
    white-space: nowrap;
}

.status-badges {
    display: contents;
}

.status-break {
    display: none;
    flex-basis: 100%;
    height: 0;
}

.status-separator {
    color: var(--text-primary);
    font-weight: bold;
    margin: 0 8px;
}

.arrow {
    color: var(--text-primary);
    margin-right: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.highlight-green {
    background-color: var(--text-primary);
    color: var(--bg-color);
    padding: 2px 6px;
    font-weight: bold;
    display: inline-block;
    line-height: 1.35;
}

.comment {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.95rem;
    margin-top: 10px;
}

.nav-commands {
    margin-top: 35px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-cmd {
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--text-primary);
    padding: 8px 18px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.btn-cmd:hover {
    background: var(--text-primary);
    color: var(--bg-color);
}

.json-box {
    border: 1px solid var(--border-cyan);
    padding: 20px;
    background: var(--box-bg);
    border-radius: 4px;
    overflow-x: hidden; /* Prevent box itself from leaking */
}

.json-box pre {
    white-space: pre-wrap; /* CSS3 */
    white-space: -moz-pre-wrap; /* Firefox */
    white-space: -pre-wrap; /* Opera <7 */
    white-space: -o-pre-wrap; /* Opera 7 */
    word-wrap: break-word; /* IE */
}

.json-key {
    color: var(--text-secondary);
}
.json-val {
    color: var(--text-white);
}

.timeline {
    border-left: 2px solid var(--text-primary);
    margin-left: 10px;
    padding-left: 30px;
    position: relative;
}

.timeline-item {
    margin-bottom: 40px;
    position: relative;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -41px;
    top: 5px;
    width: 20px;
    height: 20px;
    background: var(--bg-color);
    border: 2px solid var(--text-primary);
    border-radius: 50%;
    z-index: 2;
}

.badge {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.timeline-content h3 {
    color: var(--text-white);
    margin: 5px 0;
}

.sub-title {
    color: var(--text-primary);
    font-weight: bold;
}
.desc {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.contact-card {
    text-decoration: none;
    border: 1px solid var(--text-primary);
    padding: 20px;
    transition: all 0.3s;
    display: block;
}

.contact-card:hover {
    background: repeating-linear-gradient(
        0deg,
        var(--text-primary),
        var(--text-primary) 2px,
        rgba(0, 0, 0, 0.15) 2px,
        rgba(0, 0, 0, 0.15) 4px
    );
    background-color: var(--text-primary);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.contact-card:hover .card-title,
.contact-card:hover .card-desc {
    color: var(--bg-color);
}

.card-title {
    color: var(--text-primary);
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 5px;
    transition: color 0.3s;
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer {
    margin-top: 80px;
    padding-bottom: 40px;
}

.separator {
    border: none;
    border-top: 1px solid var(--text-muted);
    margin-bottom: 20px;
    opacity: 0.2;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.active-prompt {
    display: flex;
    align-items: center;
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 1.2rem;
    background: var(--text-primary);
    margin-left: 5px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    from,
    to {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

.glitch-text {
    position: relative;
}

.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 1px;
    text-shadow: -1px 0 var(--glitch-shadow-1);
    background: transparent;
    overflow: hidden;
    clip: rect(0, 900px, 0, 0);
    animation: glitch-anim 4s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(10px, 9999px, 30px, 0);
    }
    100% {
        clip: rect(20px, 9999px, 50px, 0);
    }
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    .terminal {
        margin: 20px auto;
    }
    .header h1 {
        font-size: 2.5rem;
    }
    .nav-commands {
        flex-direction: column;
    }
    .timeline {
        margin-left: 8px;
        padding-left: 22px;
    }
    .timeline-item {
        margin-bottom: 34px;
    }
    .timeline-item::before {
        left: -31px;
        top: 4px;
        width: 16px;
        height: 16px;
    }
    .timeline-content h3 {
        font-size: 1rem;
        line-height: 1.4;
        word-break: break-word;
    }
    .sub-title,
    .desc {
        font-size: 0.9rem;
        line-height: 1.6;
    }
    .terminal-content {
        padding: 20px;
    }
    .status-break {
        display: block;
    }
    .status-separator {
        display: none;
    }
}
