:root {
    /* Classic Terminal Color Palette (Dark) */
    --bg-main: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --bg-terminal-block: #000;
    --bg-nav: rgba(13, 17, 23, 0.9);
    --bg-rec-card: rgba(13, 17, 23, 0.8);

    /* "Grep" Accents */
    --accent: #39ff14;
    --accent-cyan: #00ffff;
    --accent-red: #ff3333;

    /* Typography */
    --font-mono: 'Fira Code', monospace;

    /* Layout */
    --nav-height: 80px;
    --transition: all 0.25s ease-in-out;
}

body.light-theme {
        /* Warm Kindle / Evening Reading Theme */
        --bg-main: #faf6f1; /* Warm parchment */
        --bg-secondary: #f0ebe4; /* Soft cream */
        --bg-tertiary: #d6cfc6; /* Muted warm grey */
        --text-primary: #3d3229; /* Deep warm brown */
        --text-secondary: #6b5e52; /* Soft brown */
        --bg-terminal-block: #f0ebe4;
        --bg-nav: rgba(250, 246, 241, 0.95);
        --bg-rec-card: #faf6f1;

        /* Accent colors for light mode */
        --accent: #9333ea; /* Deeper Purple for warm bg */
        --accent-cyan: #0369a1; /* Deep Blue */
        --accent-red: #15803d; /* Forest Green */
    }

    /* Override neon shadows in light mode for readability */
    body.light-theme .name,
    body.light-theme a:hover {
        text-shadow: none !important;
    }

    body.light-theme .terminal-window {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    }

    body.light-theme .terminal-box:hover,
    body.light-theme .btn:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
        background-color: rgba(9, 105, 218, 0.05);
    }

    body.light-theme .match {
        background-color: rgba(9, 105, 218, 0.1);
    }

    body.light-theme .timeline-dot {
        box-shadow: none !important;
    }

    body.light-theme .rec-card::before {
        display: none;
        /* remove the radial gradient glow */
    }

    /* Stop the CRT flickering and blinking in Light Mode */
    body.light-theme.crt::before {
        display: none !important;
    }

    /* Make terminal boxes stand out more with colorful top borders */
    body.light-theme .terminal-box {
        border-top: 3px solid var(--accent);
    }

    body.light-theme .skill-category {
        border-top: 3px solid var(--accent-cyan);
    }

    body.light-theme .timeline-content {
        border-top: 3px solid var(--accent-red);
    }

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

    html {
        scroll-behavior: smooth;
        scrollbar-width: thin;
        scrollbar-color: var(--accent) var(--bg-main);
    }

    /* CRT Scanline Effect */
    .crt::before {
        content: " ";
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        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));
        z-index: 2;
        background-size: 100% 2px, 3px 100%;
        pointer-events: none;
    }

    body {
        font-family: var(--font-mono);
        background-color: var(--bg-main);
        color: var(--text-primary);
        line-height: 1.6;
        overflow-x: hidden;
        position: relative;
    }

    .mt-4 {
        margin-top: 1.5rem;
    }

    /* Typography Utility */
    h1,
    h2,
    h3,
    h4,
    h5 {
        color: var(--text-primary);
        font-weight: 500;
    }

    a {
        color: var(--accent);
        text-decoration: none;
        transition: var(--transition);
    }

    a:hover {
        color: var(--accent-cyan);
        text-shadow: 0 0 5px var(--accent-cyan);
    }

    .section-padding {
        padding: 100px 0;
    }

    .section-container {
        max-width: 1000px;
        margin: 0 auto;
        padding: 0 24px;
    }

    .section-title {
        display: flex;
        align-items: center;
        font-size: 1.5rem;
        margin-bottom: 40px;
        color: var(--accent-cyan);
    }

    .section-title span {
        color: var(--accent);
        margin-right: 15px;
        font-weight: bold;
    }

    .section-title::after {
        content: "";
        display: block;
        height: 1px;
        width: 300px;
        background-color: var(--bg-tertiary);
        margin-left: 20px;
    }

    /* Terminal Boxes */
    .terminal-box {
        background-color: var(--bg-secondary);
        border: 1px solid var(--bg-tertiary);
        padding: 25px;
        border-radius: 4px;
        transition: var(--transition);
    }

    .terminal-box:hover {
        border-color: var(--accent);
        box-shadow: 0 0 10px rgba(57, 255, 20, 0.1);
    }

    /* Buttons */
    .btn {
        display: inline-block;
        padding: 12px 24px;
        border-radius: 2px;
        font-family: var(--font-mono);
        font-size: 0.9rem;
        cursor: pointer;
        transition: var(--transition);
        text-align: center;
        background-color: transparent;
        border: 1px solid var(--accent);
        color: var(--accent);
    }

    .btn:hover {
        background-color: rgba(57, 255, 20, 0.1);
        box-shadow: 0 0 15px rgba(57, 255, 20, 0.3);
    }

    .secondary-btn {
        border-color: var(--text-secondary);
        color: var(--text-secondary);
    }

    .secondary-btn:hover {
        border-color: var(--text-primary);
        color: var(--text-primary);
        background-color: rgba(255, 255, 255, 0.05);
        box-shadow: none;
    }

    .btn-large {
        padding: 18px 36px;
        font-size: 1rem;
    }

    /* Horizontal Theme Toggle Switch */
    .theme-switch {
        position: relative;
        display: inline-block;
        width: 44px;
        height: 22px;
        margin-left: 15px;
    }

    .theme-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

    .slider {
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: transparent;
        border: 1px solid var(--accent);
        transition: .4s;
        border-radius: 22px;
    }

    .slider:before {
        position: absolute;
        content: "";
        height: 14px;
        width: 14px;
        left: 3px;
        bottom: 3px;
        background-color: var(--accent);
        transition: .4s;
        border-radius: 50%;
    }

    input:checked+.slider {
        background-color: rgba(9, 105, 218, 0.1);
    }

    input:checked+.slider:before {
        transform: translateX(22px);
    }

    /* Navbar */
    .navbar {
        position: fixed;
        top: 0;
        width: 100%;
        height: var(--nav-height);
        background-color: var(--bg-nav);
        border-bottom: 1px solid var(--bg-tertiary);
        z-index: 100;
        transition: var(--transition);
    }

    .nav-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 40px;
        height: 100%;
    }

    .logo {
        font-size: 1.5rem;
        font-weight: bold;
        color: var(--text-primary);
    }

    .logo span {
        color: var(--accent);
        animation: blink 1s step-end infinite;
    }

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

    .nav-links {
        display: flex;
        list-style: none;
        gap: 30px;
    }

    .nav-links a {
        color: var(--text-secondary);
        font-size: 0.9rem;
    }

    .hamburger {
        display: none;
        color: var(--accent);
        font-size: 1.5rem;
        cursor: pointer;
    }

    /* Hero Terminal */
    .hero {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .terminal-window {
        width: 100%;
        max-width: 900px; /* Increased from 800px for a more commanding presence */
        background-color: var(--bg-main);
        border: 1px solid var(--bg-tertiary);
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    }

    .terminal-header {
        background-color: var(--bg-secondary);
        padding: 10px 15px;
        display: flex;
        align-items: center;
        border-bottom: 1px solid var(--bg-tertiary);
    }

    .btn-mac {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        margin-right: 8px;
    }

    .red {
        background-color: #ff5f56;
    }

    .yellow {
        background-color: #ffbd2e;
    }

    .green {
        background-color: #27c93f;
    }

    .terminal-title {
        margin: 0 auto;
        color: var(--text-secondary);
        font-size: 0.85rem;
    }

    .terminal-body {
        padding: 40px; /* Increased padding for better breathing room */
        font-size: 1.15rem; /* Slightly larger text */
    }

    .prompt {
        color: var(--accent);
        margin-right: 10px;
    }

    .highlight-line {
        color: var(--accent-cyan);
        margin-top: 15px;
    }

    .name {
        font-size: clamp(30px, 6vw, 60px);
        font-weight: 700;
        color: var(--accent);
        text-shadow: 0 0 10px rgba(57, 255, 20, 0.2);
        margin-bottom: 5px;
    }

    .title {
        font-size: clamp(20px, 4vw, 30px);
        color: var(--text-primary);
        margin-bottom: 20px;
    }

    .subtitle {
        color: var(--text-secondary);
        max-width: 600px;
    }

    .hidden {
        display: none;
    }

    .cursor {
        display: inline-block;
        width: 10px;
        background-color: var(--accent);
        animation: blink 1s step-end infinite;
    }

    /* About Section */
    .about-text p {
        margin-bottom: 15px;
    }

    .about-text strong {
        color: var(--accent-cyan);
    }

    .about-text em {
        color: var(--accent);
        font-style: normal;
    }

    /* Skills Section */
    .skills-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }

    .skill-category h3 {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 20px;
        font-size: 1.1rem;
        color: var(--accent-cyan);
    }

    .skill-category ul {
        list-style: none;
    }

    .skill-category ul li {
        margin-bottom: 10px;
        font-size: 0.95rem;
    }

    .skill-category ul li::before {
        content: ">> ";
        color: var(--text-secondary);
        margin-right: 10px;
    }

    .match {
        color: var(--accent);
        background-color: rgba(57, 255, 20, 0.1);
        padding: 0 4px;
        border-radius: 2px;
    }

    /* Experience Timeline */
    .timeline {
        position: relative;
        max-width: 800px;
        margin: 0 auto;
    }

    .timeline::before {
        content: '';
        position: absolute;
        width: 2px;
        background-color: var(--bg-tertiary);
        top: 0;
        bottom: 0;
        left: 20px;
        margin-left: -1px;
    }

    .timeline-item {
        padding: 20px 0 20px 60px;
        position: relative;
    }

    .timeline-dot {
        position: absolute;
        width: 12px;
        height: 12px;
        background-color: var(--accent);
        border-radius: 50%;
        left: 20px;
        top: 35px;
        margin-left: -6px;
        box-shadow: 0 0 10px var(--accent);
    }

    .timeline-content h3 {
        color: var(--accent-cyan);
        font-size: 1.2rem;
        margin-bottom: 5px;
    }

    .timeline-content h4 {
        color: var(--text-secondary);
        font-size: 0.9rem;
        margin-bottom: 15px;
    }

    .timeline-content h4 span {
        color: var(--accent);
    }

    .timeline-content p {
        color: var(--text-primary);
        font-size: 0.95rem;
    }

    /* Certifications */
    .cert-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
    }

    .cert-card {
        display: flex;
        flex-direction: column;
        text-align: center;
        text-decoration: none;
        color: inherit;
        height: 100%;
    }

    .cert-icon {
        font-size: 2.5rem;
        color: var(--accent-cyan);
        margin-bottom: 15px;
    }

    .cert-card h3 {
        font-size: 1.1rem;
        color: var(--text-primary);
        margin-bottom: 10px;
    }

    .cert-card p {
        font-size: 0.85rem;
        color: var(--text-secondary);
        margin-bottom: 15px;
    }

    .verify-link {
        font-size: 0.85rem;
        color: var(--accent);
        font-weight: bold;
        margin-top: auto;
        padding-top: 15px;
    }

    /* Recommendations (SIEM Log Dashboard Vibe) */
    .rec-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }

    .rec-card {
        border: 1px solid var(--bg-tertiary);
        border-top: 3px solid var(--accent-cyan);
        background-color: var(--bg-rec-card);
        display: flex;
        flex-direction: column;
        position: relative;
        overflow: hidden;
    }

    .rec-card::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: radial-gradient(circle at top left, rgba(0, 255, 255, 0.05), transparent 70%);
        pointer-events: none;
    }

    .rec-meta {
        display: flex;
        justify-content: space-between;
        font-size: 0.75rem;
        color: var(--text-secondary);
        margin-bottom: 15px;
        font-family: var(--font-mono);
        border-bottom: 1px dashed var(--bg-tertiary);
        padding-bottom: 5px;
    }

    .log-level {
        color: var(--accent);
        font-weight: bold;
    }

    .rec-header {
        margin-bottom: 15px;
        position: relative;
        z-index: 1;
    }

    .rec-header h3 i {
        color: var(--accent-cyan);
        margin-right: 8px;
        font-size: 0.9rem;
    }

    .rec-header h3 a {
        font-size: 1.1rem;
        color: var(--text-primary);
        text-decoration: none;
    }

    .rec-header h3 a:hover {
        color: var(--accent);
    }

    .rec-title {
        font-size: 0.8rem;
        color: var(--accent-cyan);
        margin-top: 5px;
    }

    .rec-payload {
        background-color: var(--bg-terminal-block);
        padding: 15px;
        border-radius: 4px;
        flex-grow: 1;
        border-left: 2px solid var(--bg-tertiary);
        position: relative;
        z-index: 1;
    }

    .rec-text {
        font-size: 0.85rem;
        color: var(--text-secondary);
        line-height: 1.6;
    }

    /* Contact Section */
    .contact-box {
        text-align: center;
        max-width: 600px;
        margin: 0 auto;
    }

    .social-links {
        display: flex;
        justify-content: center;
        gap: 30px;
    }

    .social-links a {
        color: var(--text-secondary);
        font-size: 1.5rem;
    }

    .social-links a:hover {
        color: var(--accent);
    }

    /* Footer */
    footer {
        text-align: center;
        padding: 30px;
        font-size: 0.85rem;
        color: var(--text-secondary);
        border-top: 1px dashed var(--bg-tertiary);
    }

    /* Animations */
    .fade-up {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    }

    .fade-up.visible {
        opacity: 1;
        transform: translateY(0);
    }

    /* Responsive */
    @media (max-width: 768px) {
        .nav-links {
            display: none;
        }

        .hamburger {
            display: block;
        }

        .terminal-body {
            padding: 15px;
        }
    }

/* Floating Theme Palette */
.theme-palette-wrapper {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.palette-trigger {
    background-color: var(--bg-secondary);
    border: 1px solid var(--accent);
    border-left: none;
    padding: 14px 14px 14px 10px;
    border-radius: 0 8px 8px 0;
    color: var(--accent);
    cursor: pointer;
    font-size: 1.3rem;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.4);
    transition: var(--transition);
    position: relative;
    z-index: 2;
}

.palette-trigger:hover {
    background-color: rgba(57, 255, 20, 0.1);
    padding-left: 14px;
}

body.light-theme .palette-trigger:hover {
    background-color: rgba(234, 88, 12, 0.08);
}

.theme-palette {
    position: absolute;
    left: 60px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 8px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 30px;
    padding: 8px 12px;
    box-shadow: 4px 4px 20px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    transform: translateY(-50%) translateX(-10px);
}

.theme-palette.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0);
}

.color-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    background-color: var(--dot-color);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.color-dot i {
    font-size: 0.6rem;
    color: #000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.color-dot.active {
    border-color: #fff;
    box-shadow: 0 0 8px var(--dot-color);
}

.color-dot.active i {
    opacity: 1;
}

.color-dot:hover {
    transform: scale(1.2);
    box-shadow: 0 0 12px var(--dot-color);
}