/* Variables */
:root {
    /* Palette 2 - Default Light/Dark Theme Colors */
    --p2-black: #000000;
    --p2-muted-teal: #839788;
    --p2-champagne: #eee0cb;
    --p2-khaki: #baa898;
    --p2-pale-sky: #bfd7ea;

    /* Palette 1 - Party Mode Colors */
    --p1-onyx: #0c0f0a;
    --p1-neon-pink: #ff206e;
    --p1-yellow: #fbff12;
    --p1-turquoise: #41ead4;
    --p1-white: #ffffff;

    /* Default Theme (Dark Mode by default for cybersecurity vibe) */
    --bg-primary: var(--p2-black);
    --bg-secondary: #111111;
    --text-primary: var(--p2-champagne);
    --text-secondary: var(--p2-pale-sky);
    --accent-color: var(--p2-muted-teal);
    --accent-hover: var(--p2-khaki);
    --card-bg: #1a1a1a;
    --nav-bg: rgba(0, 0, 0, 0.85);

    --font-main: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
}

[data-theme="light"] {
    --bg-primary: var(--p2-champagne);
    --bg-secondary: #f5f5f5;
    --text-primary: var(--p2-black);
    --text-secondary: #333333;
    --accent-color: var(--p2-muted-teal);
    --accent-hover: var(--p2-khaki);
    --card-bg: #ffffff;
    --nav-bg: rgba(238, 224, 203, 0.9);
}

[data-theme="party"] {
    --bg-primary: var(--p1-onyx);
    --bg-secondary: #1a1a1a;
    --text-primary: var(--p1-white);
    --text-secondary: var(--p1-turquoise);
    --accent-color: var(--p1-neon-pink);
    --accent-hover: var(--p1-yellow);
    --card-bg: #1f221d;
    --nav-bg: rgba(12, 15, 10, 0.9);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--accent-color);
    width: 0%;
    z-index: 1001;
    transition: width 0.1s ease-out;
}

[data-theme="party"] .scroll-progress {
    background: linear-gradient(90deg, var(--p1-neon-pink), var(--p1-turquoise), var(--p1-yellow));
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    font-size: 16px;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

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

ul {
    list-style: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0 0 10px 0;
    font-weight: 600;
    color: var(--text-primary);
}

.section-heading {
    display: flex;
    align-items: center;
    font-size: clamp(26px, 5vw, 32px);
    margin-bottom: 40px;
    white-space: nowrap;
}

.section-heading::after {
    content: "";
    display: block;
    width: 300px;
    height: 1px;
    background-color: var(--text-secondary);
    margin-left: 20px;
    opacity: 0.5;
}

.section-number {
    color: var(--accent-color);
    font-family: var(--font-mono);
    margin-right: 10px;
    font-size: 0.8em;
    font-weight: 400;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px;
    background-color: var(--nav-bg);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.nav-container {
    width: 90%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.logo .accent {
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-link {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.nav-link:hover {
    color: var(--accent-color);
}

.resume-btn {
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 8px 16px;
    border-radius: 4px;
}

.resume-btn:hover {
    background-color: rgba(131, 151, 136, 0.1);
    /* Using muted teal rgb */
}

/* Theme Toggle Button */
.theme-toggle {
    position: relative;
    width: 44px;
    height: 44px;
    border: none;
    background: var(--card-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: background 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

.theme-toggle:hover {
    background: var(--accent-color);
    transform: rotate(180deg);
}

.theme-toggle svg {
    position: absolute;
    transition: opacity 0.3s, transform 0.3s;
}

[data-theme="light"] .moon-icon,
[data-theme="dark"] .sun-icon,
[data-theme="party"] .sun-icon {
    opacity: 0;
    transform: scale(0);
}

.hamburger {
    display: none;
    cursor: pointer;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 70%;
    height: 100vh;
    background-color: var(--bg-secondary);
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 40px;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-link {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--text-primary);
}

/* Social Sidebar */
.social-sidebar {
    position: fixed;
    left: 40px;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 10;
}

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

.social-sidebar a i {
    transition: transform 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
}

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

.social-sidebar a:hover i {
    transform: translateY(-3px);
}

.social-line {
    width: 1px;
    height: 90px;
    background-color: var(--text-secondary);
    margin-top: 20px;
}

/* Main Content */
main {
    width: 85%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 100px 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Hero Section */
.hero-content {
    max-width: 800px;
}

.hero-greeting {
    font-family: var(--font-mono);
    color: var(--accent-color);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.hero-name {
    font-size: clamp(48px, 8vw, 96px);
    font-weight: 900;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 0px;
}

.hero-title {
    font-family: 'Hack', monospace;
    font-size: clamp(10px, 6vw, 20px);
    font-weight: 300;
    line-height: 1.1;
    color: var(--text-secondary);
    margin-bottom: 0px;
}

.hero-description {
    font-family: var(--font-main);
    max-width: 540px;
    font-size: clamp(20px, 3vw, 40px);
    font-weight: 700;
    color: var(--text-secondary);
    margin-top: 3px;
    margin-bottom: 30px;
    margin-left: 15px;
}

#experience-counter {
    font-family: 'Hack', monospace;
    color: var(--accent-color);
    font-weight: 700;
}

.cta-button {
    display: inline-block;
    padding: 1.25rem 1.75rem;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    font-family: var(--font-mono);
    border-radius: 4px;
    font-size: 0.9rem;
}

.cta-button:hover {
    background-color: rgba(131, 151, 136, 0.1);
}

.cursor {
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 50px;
}

.about-text p {
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.inline-link {
    color: var(--accent-color);
    position: relative;
    display: inline-block;
}

.inline-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: var(--accent-color);
    transition: var(--transition);
}

.inline-link:hover::after {
    width: 100%;
}

.image-wrapper {
    position: relative;
    width: 100%;
    max-width: 300px;
    aspect-ratio: 1;
    border-radius: 4px;
    background-color: var(--accent-color);
    transition: var(--transition);
}

.placeholder-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #333;
    border-radius: 4px;
    mix-blend-mode: multiply;
    filter: grayscale(100%) contrast(1);
    transition: var(--transition);
}

.image-wrapper:hover {
    transform: translate(-5px, -5px);
    box-shadow: 10px 10px 0 0 var(--accent-color);
}

.image-wrapper:hover .placeholder-image {
    filter: none;
    mix-blend-mode: normal;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    background-color: var(--card-bg);
    padding: 2rem 1.75rem;
    border-radius: 4px;
    transition: var(--transition);
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-7px);
}

.project-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.project-folder {
    color: var(--accent-color);
    font-size: 40px;
}

.project-links a {
    color: var(--text-secondary);
    margin-left: 10px;
    font-size: 20px;
}

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

.project-title {
    color: var(--text-primary);
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.project-description {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 20px;
}

.project-tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Skills Section */
.skills-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.skill-category h3 {
    margin-bottom: 20px;
    color: var(--accent-color);
}

.skill-bar-wrapper {
    margin-bottom: 20px;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.skill-bar {
    height: 10px;
    background-color: var(--bg-secondary);
    border-radius: 5px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background-color: var(--accent-color);
    width: 0;
    /* Animated via JS */
    border-radius: 5px;
    transition: width 1.5s ease-out;
}

/* Experience Section */
.experience-container {
    display: flex;
    gap: 50px;
}

.experience-tabs {
    display: flex;
    flex-direction: column;
    border-left: 2px solid var(--bg-secondary);
}

.tab-btn {
    background: none;
    border: none;
    text-align: left;
    padding: 15px 20px;
    cursor: pointer;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    border-left: 2px solid transparent;
    margin-left: -2px;
    transition: var(--transition);
}

.tab-btn:hover,
.tab-btn.active {
    background-color: rgba(131, 151, 136, 0.1);
    color: var(--accent-color);
}

.tab-btn.active {
    border-left-color: var(--accent-color);
}

.experience-content {
    flex: 1;
}

.job-panel {
    display: none;
}

.job-panel.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.company {
    color: var(--accent-color);
}

.job-range {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.job-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.job-list li::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

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

.big-heading {
    font-size: clamp(40px, 5vw, 60px);
    color: var(--text-primary);
    margin-bottom: 20px;
}

.contact-desc {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 50px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.social-links-footer {
    display: none;
    /* Shown on mobile */
    margin-bottom: 20px;
    gap: 20px;
    justify-content: center;
}

.social-links-footer a {
    font-size: 1.5rem;
}

/* Animation Classes */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, visibility;
}

.fade-in-section.visible {
    opacity: 1;
    transform: none;
}

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

    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .hamburger span {
        width: 30px;
        height: 2px;
        background-color: var(--accent-color);
    }

    .social-sidebar {
        display: none;
    }

    .social-links-footer {
        display: flex;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .image-wrapper {
        margin: 0 auto;
    }

    .skills-container {
        grid-template-columns: 1fr;
    }

    .experience-container {
        flex-direction: column;
    }

    .experience-tabs {
        flex-direction: row;
        border-left: none;
        border-bottom: 2px solid var(--bg-secondary);
        overflow-x: auto;
    }

    .tab-btn {
        border-left: none;
        border-bottom: 2px solid transparent;
        margin-left: 0;
        margin-bottom: -2px;
        white-space: nowrap;
    }

    .tab-btn.active {
        border-left: none;
        border-bottom-color: var(--accent-color);
    }
}

/* Glitch Effect */
.glitch {
    position: relative;
    color: inherit;
    /* Match existing color */
    /* Font styles inherited from parent */
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--nav-bg);
    /* Match background to hide main text */
    overflow: hidden;
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 red;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-1 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 blue;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim-2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {

    0%,
    90% {
        clip: rect(0, 0, 0, 0);
        text-shadow: -2px 0 red;
    }

    91% {
        clip: rect(70px, 350px, 120px, 30px);
        text-shadow: -3px -2px #ff00ff, 3px 2px #39ff14;
    }

    92% {
        clip: rect(20px, 350px, 100px, 30px);
        text-shadow: 4px 1px #ff003c, -2px -1px #ff00ff;
    }

    93% {
        clip: rect(85px, 350px, 140px, 30px);
        text-shadow: -2px 3px #39ff14, 2px -2px #ff003c;
    }

    94% {
        clip: rect(10px, 350px, 60px, 30px);
        text-shadow: 3px -1px #ff00ff, -4px 2px #39ff14;
    }

    95%,
    100% {
        clip: rect(0, 0, 0, 0);
        text-shadow: -2px 0 red;
    }
}

@keyframes glitch-anim-2 {

    0%,
    82% {
        clip: rect(0, 0, 0, 0);
        text-shadow: -2px 0 blue;
    }

    83% {
        clip: rect(40px, 350px, 90px, 30px);
        text-shadow: 2px -2px #39ff14, -3px 1px #ff003c;
    }

    84% {
        clip: rect(110px, 350px, 130px, 30px);
        text-shadow: -4px 2px #ff00ff, 2px -3px #39ff14;
    }

    85% {
        clip: rect(10px, 350px, 50px, 30px);
        text-shadow: 3px 1px #ff003c, -2px -2px #ff00ff;
    }

    86% {
        clip: rect(90px, 350px, 150px, 30px);
        text-shadow: -3px -1px #39ff14, 4px 2px #ff003c;
    }

    87%,
    100% {
        clip: rect(0, 0, 0, 0);
        text-shadow: -2px 0 blue;
    }
}