:root {
    /* Modern 2026 Palette */
    --neon-green: #00ffa3;
    /* Spring Green */
    --neon-cyan: #00f3ff;
    --neon-purple: #bc13fe;
    --dark-green: #002415;
    --black: #050505;
    --bg-black: #020202;
    --terminal-bg: rgba(10, 10, 15, 0.65);
    /* Glass */
    --glass-border: rgba(255, 255, 255, 0.08);
    --font-main: 'JetBrains Mono', monospace;
    --glow-shadow: 0 0 15px rgba(0, 255, 163, 0.4);
    --text-glow: 0 0 8px rgba(0, 255, 163, 0.6);
}

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

body {
    background-color: var(--bg-black);
    color: var(--neon-green);
    font-family: var(--font-main);
    overflow-x: hidden;
    height: 100vh;
    font-weight: 300;
    /* Lighter modern weight */
}

/* Background Canvas */
#matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.25;
    /* Darker/More subtle */
}

/* CRT Effects */
.crs-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, transparent 60%, rgba(0, 0, 0, 0.8) 100%);
    pointer-events: none;
    z-index: 998;
}

.scanline {
    width: 100%;
    height: 100px;
    z-index: 999;
    /* Subtler scanline */
    background: linear-gradient(0deg, rgba(0, 0, 0, 0) 0%, rgba(0, 255, 163, 0.03) 50%, rgba(0, 0, 0, 0) 100%);
    opacity: 0.3;
    position: absolute;
    bottom: 100%;
    animation: scanline 10s linear infinite;
    pointer-events: none;
}

@keyframes scanline {
    0% {
        bottom: 100%;
    }

    100% {
        bottom: -100px;
    }
}

/* Glassmorphism Container */
#terminal-container {
    max-width: 1270px;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid var(--glass-border);
    background: var(--terminal-bg);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    min-height: 85vh;
    position: relative;
    transition: 0.3s ease;
}

/* Modern Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
    margin-bottom: 30px;
}

.prompt {
    font-weight: 600;
    color: var(--neon-cyan);
    letter-spacing: 1px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 25px;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 20px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
}

.nav-links a {
    text-decoration: none;
    color: #fff;
    opacity: 0.6;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    opacity: 1;
    color: var(--neon-green);
    text-shadow: var(--text-glow);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--neon-green);
    box-shadow: 0 0 8px var(--neon-green);
    border-radius: 2px;
}

/* Sections */
main section {
    display: none;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

main section.active-section {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
        filter: blur(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* Typography & Glitch */
h1.glitch {
    font-size: 3.5rem;
    font-weight: 700;
    position: relative;
    margin-bottom: 25px;
    color: #fff;
    text-shadow: 0 0 20px rgba(0, 255, 163, 0.3);
    letter-spacing: -2px;
}

h1.glitch::before,
h1.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--terminal-bg);
    /* .. keeping glitch logic but updated colors implied by blend modes or opacity */
    opacity: 0.7;
}

h1.glitch::before {
    left: 1px;
    text-shadow: -1px 0 rgba(255, 0, 0, 0.7);
    clip: rect(0, 0, 0, 0);
    animation: glitch-anim-soft 3s infinite linear alternate-reverse;
}

h1.glitch::after {
    left: -1px;
    text-shadow: 1px 0 rgba(0, 0, 255, 0.7);
    clip: rect(0, 0, 0, 0);
    animation: glitch-anim-soft-2 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim-soft {
    0% {
        clip: rect(0, 0, 0, 0);
    }

    4% {
        clip: rect(10px, 9999px, 30px, 0);
        transform: skew(0.5deg);
    }

    8% {
        clip: rect(0, 0, 0, 0);
        transform: skew(0);
    }

    60% {
        clip: rect(0, 0, 0, 0);
    }

    64% {
        clip: rect(40px, 9999px, 60px, 0);
        transform: translateX(-1px);
    }

    68% {
        clip: rect(0, 0, 0, 0);
    }

    100% {
        clip: rect(0, 0, 0, 0);
    }
}

@keyframes glitch-anim-soft-2 {
    0% {
        clip: rect(0, 0, 0, 0);
    }

    15% {
        clip: rect(0, 0, 0, 0);
    }

    19% {
        clip: rect(85px, 9999px, 100px, 0);
        transform: translateX(1px);
    }

    23% {
        clip: rect(0, 0, 0, 0);
    }

    100% {
        clip: rect(0, 0, 0, 0);
    }
}

.typing-effect {
    font-size: 1.1rem;
    color: var(--neon-cyan);
    border-right: 2px solid var(--neon-cyan);
    padding-right: 5px;
    margin-bottom: 30px;
    display: inline-block;
    white-space: pre-wrap;
    /* preservation of whitespace */
    overflow: hidden;
    width: fit-content;
    animation: blinkCursor 0.75s step-end infinite;
    min-height: 1.5em;
    /* Prevent layout shift */
}

@keyframes blinkCursor {
    50% {
        border-color: transparent;
    }
}

/* Progress Bars */
.skills-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.skill-item {
    margin-bottom: 15px;
}

.skill-item span {
    display: block;
    margin-bottom: 5px;
}

.progress-bar {
    height: 8px;
    /* Slimmer */
    border-radius: 4px;
    background: linear-gradient(90deg, var(--neon-green), var(--neon-cyan));
    width: 0%;
    /* Start at 0 for animation */
    transition: width 1.5s ease-out;
    box-shadow: 0 0 10px rgba(0, 255, 163, 0.3);
    position: relative;
}

/* Adding a 'loading' striped effect to bars */
.progress-bar::after {
    display: none;
    /* Cleaner look without stripes */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(45deg,
            rgba(0, 0, 0, 0.4) 25%,
            transparent 25%,
            transparent 50%,
            rgba(0, 0, 0, 0.4) 50%,
            rgba(0, 0, 0, 0.4) 75%,
            transparent 75%,
            transparent);
    background-size: 20px 20px;
    animation: moveStripes 1s linear infinite;
}

@keyframes moveStripes {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 20px 0;
    }
}

/* Intro Box */
.intro-box {
    border-left: 2px solid var(--neon-cyan);
    padding-left: 15px;
    margin-bottom: 25px;
    background: linear-gradient(90deg, rgba(0, 243, 255, 0.05) 0%, transparent 100%);
    padding: 15px;
    border-radius: 0 4px 4px 0;
}

.intro-text {
    font-size: 1.1rem;
    color: #e0e0e0;
    line-height: 1.6;
}

.intro-text strong {
    color: var(--neon-cyan);
    font-weight: 500;
}

/* Modern Buttons */
.terminal-btn {
    background: rgba(0, 255, 163, 0.05);
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    padding: 12px 24px;
    font-family: var(--font-main);
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    border-radius: 6px;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.terminal-btn:hover {
    background: var(--neon-green);
    color: var(--black);
    box-shadow: 0 0 25px rgba(0, 255, 163, 0.4);
    transform: translateY(-2px);
}

.terminal-btn:active {
    transform: translateY(0);
}

/* Modern Inputs */
.terminal-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    font-family: var(--font-main);
    padding: 15px;
    margin-top: 5px;
    margin-bottom: 25px;
    outline: none;
    transition: 0.3s;
    font-size: 1rem;
}

.terminal-input:focus {
    border-color: var(--neon-cyan);
    background: rgba(0, 243, 255, 0.05);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
}

.input-group label {
    color: #888;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    #terminal-container {
        margin: 0;
        min-height: 100vh;
        border: none;
    }

    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-links {
        flex-direction: column;
        gap: 10px;
        margin-top: 10px;
    }

    h1.glitch {
        font-size: 2rem;
    }
}

/* Modern Cards */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.terminal-card {
    border: 1px solid var(--glass-border);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border-radius: 12px;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.terminal-card:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 10px 30px -10px rgba(0, 243, 255, 0.2);
    transform: translateY(-5px) scale(1.02);
}

.card-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--glass-border);
}

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

.circle {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.red {
    background: #ff5f56;
}

.yellow {
    background: #ffbd2e;
}

.green {
    background: #27c93f;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin-left: auto;
}

.card-body {
    padding: 20px;
}

.card-body p {
    color: #aaa;
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.4;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 0.8rem;
    color: var(--neon-green);
}

.tags span {
    background: rgba(0, 255, 163, 0.1);
    color: var(--neon-green);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.card-actions {
    display: flex;
    gap: 10px;
}

.btn-small {
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid var(--glass-border);
    color: #ccc;
    font-family: var(--font-main);
    cursor: pointer;
    font-size: 0.8rem;
    transition: 0.2s;
    background: transparent;
}

.btn-small:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    background: rgba(0, 243, 255, 0.05);
}

/* Contact Feedback */
#form-feedback {
    margin-top: 15px;
    padding: 10px;
    border: 1px solid var(--neon-green);
    background: rgba(0, 255, 163, 0.05);
    border-radius: 8px;
    animation: blinkBorder 2s infinite;
}

.hidden {
    display: none;
}

.success {
    color: var(--neon-green);
    font-weight: bold;
}

@keyframes blinkBorder {
    50% {
        border-color: transparent;
    }
}