:root {
    /* Fonts */
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;

    /* Dark Mode (Default) */
    --bg-color: #05050a;
    --text-color: #e0e0e0;
    --primary-color: #00f3ff;
    /* Neon Cyan */
    --secondary-color: #bc13fe;
    /* Neon Purple */
    --accent-color: #ff0055;
    /* Neon Red/Pink */
    --glass-bg: rgba(10, 10, 20, 0.6);
    --glass-border: rgba(0, 243, 255, 0.2);
    --card-bg: rgba(20, 20, 30, 0.8);
    --shadow: 0 0 20px rgba(0, 243, 255, 0.1);

    /* Spacing & Layout */
    --header-height: 80px;
    --container-width: 1400px;
}

[data-theme="light"] {
    --bg-color: #eef2f5;
    --text-color: #1a1a2e;
    --primary-color: #0055ff;
    /* Tech Blue */
    --secondary-color: #6a00ff;
    /* Deep Purple */
    --accent-color: #ff3366;
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(0, 85, 255, 0.2);
    --card-bg: rgba(255, 255, 255, 0.8);
    --shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Background Canvas */
#bg-canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 2px;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 5rem);
    text-shadow: 0 0 10px var(--primary-color);
}

h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60%;
    height: 4px;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

/* Layout */
.interface-overlay {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link::before {
    content: '[';
    margin-right: 5px;
    opacity: 0;
    color: var(--primary-color);
    transition: opacity 0.3s;
}

.nav-link::after {
    content: ']';
    margin-left: 5px;
    opacity: 0;
    color: var(--primary-color);
    transition: opacity 0.3s;
}

.nav-link:hover::before,
.nav-link:hover::after,
.nav-link.active::before,
.nav-link.active::after {
    opacity: 1;
}

/* Theme Toggle */
.theme-toggle-container button {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.theme-toggle-container button:hover {
    background: var(--primary-color);
    color: var(--bg-color);
    box-shadow: 0 0 15px var(--primary-color);
}

/* Sections */
.section {
    padding: 6rem 5%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Home */
#home {
    text-align: center;
}

.tagline {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-top: 1rem;
    font-weight: 600;
}

/* Grid Layouts */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 5px;
    backdrop-filter: blur(5px);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow), 0 0 30px var(--glass-border);
    border-color: var(--primary-color);
}

.card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.tech-tag {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    font-size: 0.8rem;
    margin-right: 0.5rem;
    margin-top: 0.5rem;
    text-transform: uppercase;
}

/* Glitch Effect */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 red;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s 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 {
    0% {
        clip: rect(10px, 9999px, 30px, 0);
    }

    20% {
        clip: rect(80px, 9999px, 100px, 0);
    }

    40% {
        clip: rect(10px, 9999px, 50px, 0);
    }

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

    80% {
        clip: rect(20px, 9999px, 60px, 0);
    }

    100% {
        clip: rect(90px, 9999px, 120px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(60px, 9999px, 80px, 0);
    }

    20% {
        clip: rect(10px, 9999px, 30px, 0);
    }

    40% {
        clip: rect(90px, 9999px, 110px, 0);
    }

    60% {
        clip: rect(10px, 9999px, 40px, 0);
    }

    80% {
        clip: rect(50px, 9999px, 70px, 0);
    }

    100% {
        clip: rect(20px, 9999px, 40px, 0);
    }
}

/* Mobile */
.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    nav {
        position: fixed;
        top: var(--header-height);
        right: -100%;
        width: 70%;
        height: calc(100vh - var(--header-height));
        background: var(--bg-color);
        border-left: 1px solid var(--glass-border);
        transition: right 0.3s ease;
        padding: 2rem;
    }

    nav.active {
        right: 0;
    }

    nav ul {
        flex-direction: column;
    }

    .section {
        padding: 4rem 5%;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }
}

/* Project Styles */
.project-card {
    position: relative;
}

.badge-card img {
    max-width: 120px;
    height: auto;
    display: block;
    margin: 0 auto 1rem auto;
}

.credential-type-tag {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid var(--primary-color);
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    border-radius: 3px;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.certificate-card h3,
.badge-card h3 {
    margin-bottom: 0.5rem;
}

.certificate-card p,
.badge-card p {
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.activity-card h3 {
    margin-bottom: 0.5rem;
}

.activity-card p {
    margin-bottom: 1rem;
}

.activity-card a {
    display: inline-block;
    margin-top: 0.5rem;
}

.github-activity-calendar {
    width: 100%;
    height: auto;
    border-radius: 5px;
    display: block;
}

.activity-viz-container {
    margin: 1rem 0;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    border: 1px solid var(--glass-border);
    padding: 10px;
}

.calendar-wrapper {
    margin: 1rem 0;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.calendar-wrapper iframe {
    filter: invert(1) hue-rotate(180deg) brightness(0.8);
}

[data-theme="light"] .calendar-wrapper iframe {
    filter: none;
}

.dim {
    opacity: 0.6;
    font-size: 0.9rem;
}

.contact-grid {
    display: grid;
    gap: 2rem;
    margin-top: 2rem;
}

/* Dynamic Icon Style (for Simple Icons CDN) */
.dynamic-icon {
    width: 1.5em;
    /* Match i font-size roughly */
    height: 1.5em;
    display: inline-block;
    background-color: currentColor;
    /* Inherit color from parent (primary-color or text-color) */
    -webkit-mask-image: var(--url);
    mask-image: var(--url);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    vertical-align: middle;
    margin-bottom: 0.2rem;
    /* Minor alignment fix */
}

.email-link {
    color: var(--primary-color);
    font-size: 1.5rem;
    text-decoration: none;
    display: block;
    margin-top: 1rem;
    word-break: break-all;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}

.social-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s;
}

.social-card i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.social-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.stat-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    border: 1px solid var(--glass-border);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.7;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--secondary-color);
}

.profile-card p {
    margin-bottom: 0.5rem;
}

.profile-card strong {
    color: var(--primary-color);
}