:root {
    --bg-color: #0d1117;
    --primary-dark: #0d1117;
    --card-bg: #161b22;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent-color: #58a6ff;
    --accent-glow: rgba(88, 166, 255, 0.3);
    --secondary-accent: #3fb950;
    --font-main: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --transition: all 0.3s ease;
}

body {
    cursor: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 4L11 20L13.5 13.5L20 11L4 4Z' fill='%2358a6ff' stroke='white' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E"), auto;
}

a, button, .skill-tag, .project-card, .btn-primary, .btn-secondary, .lang-btn, .theme-btn, .modal-close, .tab-btn, .gopher, .infra-status {
    cursor: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='%2358a6ff' stroke='white' stroke-width='1.5' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 13.5V4.5C9 3.67 9.67 3 10.5 3C11.33 3 12 3.67 12 4.5V10H13V5.5C13 4.67 13.67 4 14.5 4C15.33 4 16 4.67 16 5.5V10H17V6.5C17 5.67 17.67 5 18.5 5C19.33 5 20 5.67 20 6.5V13.5C20 17.09 17.09 20 13.5 20H10C6.69 20 4 17.31 4 14V11.5C4 10.67 4.67 10 5.5 10C6.33 10 7 10.67 7 11.5V13.5H9Z' /%3E%3C/svg%3E") 10 3, pointer;
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(to right, var(--accent-color), var(--secondary-accent));
    z-index: 10001; /* Above header */
    transition: width 0.1s ease;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Custom Cursor Dot/Ring removed - using high-performance CSS cursor above */

body.light-theme {
    --bg-color: #f8fafc;
    --primary-dark: #f1f5f9;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent-color: #2563eb;
    --accent-glow: rgba(37, 99, 235, 0.1);
    --secondary-accent: #10b981;
    cursor: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 4L11 20L13.5 13.5L20 11L4 4Z' fill='%232563eb' stroke='%230f172a' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E"), auto;
}

body.light-theme a, body.light-theme button, body.light-theme .skill-tag, body.light-theme .project-card, body.light-theme .btn-primary, body.light-theme .btn-secondary, body.light-theme .lang-btn, body.light-theme .theme-btn, body.light-theme .modal-close, body.light-theme .tab-btn, body.light-theme .gopher, body.light-theme .infra-status {
    cursor: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='%232563eb' stroke='%230f172a' stroke-width='1.5' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 13.5V4.5C9 3.67 9.67 3 10.5 3C11.33 3 12 3.67 12 4.5V10H13V5.5C13 4.67 13.67 4 14.5 4C15.33 4 16 4.67 16 5.5V10H17V6.5C17 5.67 17.67 5 18.5 5C19.33 5 20 5.67 20 6.5V13.5C20 17.09 17.09 20 13.5 20H10C6.69 20 4 17.31 4 14V11.5C4 10.67 4.67 10 5.5 10C6.33 10 7 10.67 7 11.5V13.5H9Z' /%3E%3C/svg%3E") 10 3, pointer;
}

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

p {
    text-align: justify;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    scrollbar-color: var(--text-secondary) var(--bg-color);
    scrollbar-width: thin;
}

html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-smooth iframe {
  pointer-events: none;
}


/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

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

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(125deg, #0d1117, #0d1117, #111d2e, #0d1117, #0d1117);
    background-size: 400% 400%;
    z-index: -1;
    animation: gradientMove 15s ease infinite;
    pointer-events: none;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Texture Grain Overlay */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.05;
    pointer-events: none;
    z-index: 9999;
}

body.light-theme::before {
    background: linear-gradient(125deg, #f0f2f5, #f8f9fb, #e5e7eb, #f0f2f5, #f8f9fb);
    background-size: 400% 400%;
}

/* Light Theme Specific Component Overrides */
body.light-theme header {
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(208, 215, 222, 0.5);
}

body.light-theme header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1),
                0 0 20px rgba(9, 105, 218, 0.15);
}

/* Boot Screen Overlay */
.boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #010409;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    color: #3fb950;
    font-family: var(--font-mono);
    font-size: 1rem;
    transition: opacity 0.8s ease, visibility 0.8s;
}

.boot-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.boot-line {
    margin-bottom: 0.5rem;
}

body.booting {
    overflow: hidden !important;
}

body.light-theme .hero-text h1 {
    background: linear-gradient(135deg, #1f2328 0%, #656d76 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-theme .badge {
    color: var(--accent-color);
    background: rgba(9, 105, 218, 0.1);
    border: 1px solid rgba(9, 105, 218, 0.3);
    box-shadow: 0 0 20px rgba(9, 105, 218, 0.15);
}

body.light-theme .project-card {
    border-color: rgba(208, 215, 222, 0.8);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

body.light-theme .contact-box {
    background: linear-gradient(rgba(240, 246, 252, 0.95), rgba(240, 246, 252, 0.95)), url('https://images.unsplash.com/photo-1558494949-ef0109121c0e?q=80&w=1920&auto=format&fit=crop');
    background-size: cover;
    border-color: rgba(208, 215, 222, 0.8);
}

/* Contact Form Premium Styles */
.contact-form {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(48, 54, 61, 0.5);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-color);
}

.form-group input, 
.form-group textarea {
    background: rgba(13, 17, 23, 0.6);
    border: 1px solid rgba(48, 54, 61, 0.8);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: var(--transition);
}

body.light-theme .form-group input,
body.light-theme .form-group textarea {
    background: #ffffff;
    border-color: rgba(208, 215, 222, 1);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-glow);
    background: rgba(13, 17, 23, 0.8);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.w-full {
    width: 100%;
}

.form-status {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    min-height: 1.5rem;
}

.form-status.success { color: var(--secondary-accent); }
.form-status.error { color: #f85149; }

body.light-theme .skill-tag {
    background: #ffffff;
    border: 1px solid rgba(208, 215, 222, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

body.light-theme .carousel-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(9, 105, 218, 0.2);
    color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body.light-theme .carousel-btn:hover {
    background: var(--accent-color);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(9, 105, 218, 0.25);
}

body.light-theme .dot {
    background: rgba(208, 215, 222, 0.8);
}

body.light-theme .dot.active {
    background: var(--accent-color);
    box-shadow: 0 0 10px rgba(9, 105, 218, 0.3);
}

body.light-theme .footer {
    background: #f8f9fb;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

body.light-theme .copyright {
    color: #656d76;
    opacity: 0.8;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.infra-status {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
    background: rgba(13, 17, 23, 0.4);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(48, 54, 61, 0.5);
    border-radius: 20px;
    color: var(--text-secondary);
}

body.light-theme .infra-status {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(208, 215, 222, 0.8);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--secondary-accent);
    position: relative;
}

.status-dot.online::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--secondary-accent);
    animation: pulseStatus 2s infinite;
}

@keyframes pulseStatus {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(3); opacity: 0; }
}

.status-text .highlight {
    color: var(--secondary-accent);
}

.status-divider {
    color: rgba(48, 54, 61, 0.5);
}

.status-uptime {
    opacity: 0.9;
}

#uptime-value {
    color: var(--text-primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(48, 54, 61, 0.5);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 1.5rem 0;
}

header.scrolled {
    padding: 0.6rem 0;
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--accent-color);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7),
                0 0 20px rgba(88, 166, 255, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    gap: 2rem;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-right: 2rem;
}

.logo-socials {
    display: flex;
    gap: 1.5rem;
    border-left: 1px solid rgba(48, 54, 61, 0.5);
    padding-left: 2rem;
    transition: var(--transition);
}

.mobile-socials {
    display: none;
    margin-top: 1rem;
    width: 100%;
}

.nav-socials {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem 0;
}

.nav-socials a {
    color: var(--text-secondary);
    font-size: 1.5rem;
    transition: var(--transition);
}

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

.logo-socials a {
    color: var(--text-secondary);
    font-size: 1.3rem;
    transition: var(--transition);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    opacity: 0.7;
    text-decoration: none !important;
}

.logo-socials a::after {
    display: none !important;
}

/* Force override for devicon colors */
.logo-socials .devicon-linkedin-plain.colored {
    color: var(--text-secondary) !important;
}

.logo-socials a:hover {
    color: var(--accent-color);
    transform: translateY(-2px);
    opacity: 1;
}

.logo-socials a:hover .devicon-linkedin-plain.colored {
    color: var(--accent-color) !important;
}

.youtube-icon svg {
    width: 24px !important;
    height: 24px !important;
    fill: currentColor;
    transition: var(--transition);
}

.youtube-icon:hover svg {
    fill: var(--accent-color);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
    text-decoration: none;
}

.logo .prefix { color: var(--text-primary); }
.logo-dot { 
    color: var(--accent-color);
    font-weight: 900;
}
.logo .suffix { color: var(--text-secondary); }

.nav-links {
    display: flex;
    list-style: none;
    gap: 0.8rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    transition: var(--transition);
}

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

.theme-switcher {
    display: flex;
    align-items: center;
    margin-left: 0.5rem;
}

.theme-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.theme-btn:hover {
    color: var(--accent-color);
    transform: rotate(15deg);
    opacity: 1;
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
    padding-left: 0.5rem;
    border-left: 1px solid rgba(48, 54, 61, 0.5);
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.lang-btn:hover {
    color: var(--text-primary);
}

.lang-btn.active {
    color: var(--accent-color);
}

.lang-divider {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Language Transition */
body [data-i18n] {
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                filter 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.lang-transitioning [data-i18n] {
    opacity: 0.2; /* Better than 0 to avoid "stuck" invisible states */
    filter: blur(4px);
    transform: translateY(2px);
}

.btn-primary {
    background: var(--accent-color);
    color: #ffffff !important;
    padding: 0.8rem 1.6rem;
    border-radius: 8px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.btn-primary:hover {
    background: #3b82f6;
    box-shadow: 0 8px 25px var(--accent-glow);
    transform: translateY(-2px);
}

body.light-theme .btn-primary {
    border: none;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

body.light-theme .btn-primary:hover {
    background: #1d4ed8;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

/* Base sections */
section {
    padding: 8rem 0;
}

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.section-number {
    font-family: var(--font-mono);
    color: var(--accent-color);
    font-size: 1.2rem;
}

.section-title {
    font-size: 2rem;
}

.section-line {
    height: 1px;
    background: rgba(48, 54, 61, 0.5);
    width: 100%;
    max-width: 300px;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 4rem;
    align-items: start;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

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

.about-image {
    display: flex;
    justify-content: center;
    position: relative;
}

.gopher-wrapper {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    width: 160px; /* Wider for new body */
    z-index: 1; /* Behind image wrapper */
    pointer-events: all;
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-delay: 0.5s;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.3)); /* Sticker shadow */
}

.about.reveal .gopher-wrapper {
    opacity: 1;
    transform: translateX(-50%) translateY(-140px); /* Moved higher to show mouth */
}

.pupil {
    transition: transform 0.1s ease-out; /* Snap back quickly or follow JS */
}

.pupil-container, .gopher-teeth {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: center;
}

.about-image:hover .pupil-container {
    transform: scale(1.3);
}

.about-image:hover .gopher-teeth {
    transform: translateY(3px);
}

.image-wrapper {
    position: relative;
    border: 2px solid var(--accent-color);
    border-radius: 12px;
    z-index: 10;
    width: 300px; /* Fixed width to control size */
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

/* Gopher Click Animation */
.gopher.bounce {
    animation: gopherBounce 0.6s cubic-bezier(0.36, 0, 0.66, -0.56);
}

@keyframes gopherBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-30px); }
}

.gopher.wink .pupil-container:last-child {
    transform: scaleY(0.1);
}

/* Gopher Hands Effect */
.image-wrapper::before,
.image-wrapper::after {
    content: '';
    position: absolute;
    top: -8px; /* Slightly above the border */
    width: 28px;
    height: 18px;
    background: #7FD5EA;
    border: 1.8px solid #000;
    border-radius: 50% 50% 40% 40%;
    z-index: 10;
    box-shadow: 0 0 0 3px #ffffff; /* White sticker outline */
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-delay: 0.6s;
    pointer-events: none;
}

.image-wrapper::before {
    left: 50%;
    transform: translateX(-56px); /* Align with Gopher body */
}

.image-wrapper::after {
    right: 50%;
    transform: translateX(56px); /* Align with Gopher body */
}

.about.reveal .image-wrapper::before,
.about.reveal .image-wrapper::after {
    opacity: 1;
    top: -5px;
}

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

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    filter: grayscale(20%);
    transition: var(--transition);
}

.image-wrapper:hover .profile-img {
    filter: grayscale(0%);
}

/* Experience Section */
.timeline {
    position: relative;
    max-width: 800px;
    margin-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 0;
    width: 2px;
    background: rgba(48, 54, 61, 0.5);
}

.timeline-item {
    position: relative;
    padding-left: 3rem;
    margin-bottom: 4rem;
}

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

.timeline-content h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.timeline-org {
    color: var(--accent-color);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.timeline-content ul {
    list-style: none;
}

.timeline-content li {
    position: relative;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
}

.timeline-content li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

/* Projects Section */
.carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 2rem 0;
}

.carousel-viewport {
    overflow: hidden;
    width: 100%;
    position: relative;
}

.carousel-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    gap: 2rem;
    padding: 1rem 0;
}

.carousel-btn {
    background: rgba(48, 54, 61, 0.5);
    border: 1px solid rgba(88, 166, 255, 0.2);
    color: var(--text-primary);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
    font-size: 1.2rem;
    backdrop-filter: blur(5px);
}

.carousel-btn:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    box-shadow: 0 0 15px var(--accent-glow);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: rgba(10, 25, 47, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-btn {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-download {
    background: transparent;
    border: 1px solid var(--accent-light);
    color: var(--accent-light);
}

.btn-download:hover {
    background: rgba(100, 255, 218, 0.1);
    transform: translateY(-2px);
}

.btn-github {
    background: var(--accent-light);
    color: var(--bg-dark);
}

.btn-github:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(100, 255, 218, 0.2);
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 1rem;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(48, 54, 61, 0.8);
    cursor: pointer;
    transition: var(--transition);
}

.dot.active {
    background: var(--accent-color);
    transform: scale(1.3);
    box-shadow: 0 0 10px var(--accent-glow);
}

.project-card {
    background: var(--card-bg);
    border: 1px solid rgba(48, 54, 61, 0.5);
    border-radius: 8px;
    padding: 2.5rem;
    transition: var(--transition);
    flex: 0 0 calc(33.333% - 1.35rem); /* Default 3 items on desktop */
    min-width: 300px;
}

@media (max-width: 1024px) {
    .project-card {
        flex: 0 0 calc(50% - 1rem); /* 2 items on tablets */
    }
}

/* Matrix Mode Terminal Effect */
body.matrix-mode::after {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.15;
    background-color: rgba(0, 50, 0, 0.4);
    animation: matrixGlitch 0.2s infinite;
}

@keyframes matrixGlitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

.neofetch {
    color: var(--text-primary);
    line-height: 1.4;
    margin-top: 0.5rem;
    padding-left: 0.5rem;
    border-left: 2px solid var(--accent-color);
}

@media (max-width: 768px) {
    .project-card {
        flex: 0 0 100%; /* 1 item on mobile */
    }
    
    .carousel-btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .carousel-btn.prev { left: -10px; }
    .carousel-btn.next { right: -10px; }
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-color);
}

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

.project-folder {
    font-size: 2rem;
    color: var(--accent-color);
}

.project-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.5rem;
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.project-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

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

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

.skills-category h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(48, 54, 61, 0.5);
    padding-bottom: 0.5rem;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.skill-tag {
    background: rgba(48, 54, 61, 0.3);
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-size: 0.95rem;
    color: var(--text-primary);
    text-decoration: none;
    border: 1px solid rgba(88, 166, 255, 0.1);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    opacity: 0;
    transform: translateY(20px);
    transition-delay: var(--delay, 0s);
}

.skills.reveal .skill-tag {
    opacity: 1;
    transform: translateY(0);
}

.skill-tag i {
    font-size: 1.2rem;
}

.skill-tag:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-5px);
    background: rgba(88, 166, 255, 0.1);
    box-shadow: 0 5px 15px rgba(88, 166, 255, 0.1);
}

/* Contact Section */
.contact-box {
    text-align: center;
    padding: 4rem;
    background: linear-gradient(rgba(13, 17, 23, 0.8), rgba(13, 17, 23, 0.8)), url('https://images.unsplash.com/photo-1558494949-ef0109121c0e?q=80&w=1920&auto=format&fit=crop'); /* Added a techy background feeling */
    background-size: cover;
    border-radius: 12px;
    border: 1px solid rgba(48, 54, 61, 0.5);
}

.contact-box h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.contact-actions .btn-secondary i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.contact-box p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.social-links {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.social-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    transition: var(--transition);
}

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

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

.badge {
    background: rgba(88, 166, 255, 0.2);
    color: #ffffff; /* pure white for best contrast */
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2rem;
    display: inline-block;
    border: 1px solid rgba(88, 166, 255, 0.4);
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.2);
    backdrop-filter: blur(8px);
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 140px; 
    padding-bottom: 4rem;
}

.hero-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-text h1 {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, #8b949e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

#hero-name::after {
    content: '';
    display: inline-block;
    width: 4px;
    height: 0.9em;
    background-color: var(--accent-color);
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 6px;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    -webkit-text-fill-color: initial;
}

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

.hero-text h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.hero-text p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin-bottom: 2.5rem;
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
}

.btn-secondary {
    border: 1px solid var(--text-secondary);
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
}

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

/* Terminal Mock */
.terminal-mock {
    background: #010409;
    border: 1px solid #30363d;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    width: 100%;
    max-width: 550px;
    margin: 0 auto;
}

.terminal-header {
    background: #161b22;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.terminal-header .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.red { background: #ff5f56 !important; }
.yellow { background: #ffbd2e !important; }
.green { background: #27c93f !important; }

/* Force terminal dots to keep their colors in light theme */
body.light-theme .terminal-header .dot.red { background: #ff5f56 !important; }
body.light-theme .terminal-header .dot.yellow { background: #ffbd2e !important; }
body.light-theme .terminal-header .dot.green { background: #27c93f !important; }

.terminal-title {
    margin-left: 1rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.terminal-body {
    padding: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.terminal-body .prompt { color: var(--secondary-accent); margin-right: 8px; }
.terminal-output {
    color: var(--text-secondary);
    margin: 0.2rem 0;
}

#interactive-terminal {
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#terminal-history p {
    margin: 0.2rem 0;
}

.terminal-input-line {
    display: flex;
    align-items: center;
    margin-top: 0.2rem;
}

#terminal-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: inherit;
    outline: none;
    flex: 1;
    margin-left: 0.5rem;
    caret-color: var(--accent-color);
}

.blink {
    animation: blink 1s infinite;
    display: inline-block;
}

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

/* Animations */
section {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

section.reveal {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 968px) {
    .hero-content {
        display: flex !important;
        flex-direction: column !important;
        text-align: center;
        gap: 3rem;
    }

    .hero-text {
        align-items: center !important;
    }

    .hero-text h1 {
        font-size: clamp(2.5rem, 8vw, 3.5rem);
    }

    .hero-text p {
        margin: 0 auto 2rem auto;
    }

    .hero-actions {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    section {
        padding: 4rem 0;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-header {
        margin-bottom: 2rem;
    }

    .menu-toggle {
        display: block;
        cursor: pointer;
        z-index: 1101;
        padding: 10px;
        margin-right: -10px;
    }

    .menu-toggle .bar {
        display: block;
        width: 25px;
        height: 2px;
        margin: 6px auto;
        background-color: var(--text-primary);
        transition: var(--transition);
        border-radius: 2px;
    }

    .menu-toggle.active .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .menu-toggle.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .logo-socials {
        display: none !important;
    }

    .mobile-socials {
        display: block !important;
    }

    .nav-links {
        position: fixed;
        right: -100%;
        top: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background: #0d1117; /* Solid background to avoid overlap confusion */
        transition: 0.5s cubic-bezier(0.77,0.2,0.05,1.0);
        padding: 0;
        z-index: 1100;
        gap: 1.8rem;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        opacity: 0;
        transform: translateY(30px);
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .nav-links.active li {
        opacity: 1;
        transform: translateY(0);
        transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }

    /* Staggered entry for menu items */
    .nav-links.active li:nth-child(1) { transition-delay: 0.1s; }
    .nav-links.active li:nth-child(2) { transition-delay: 0.2s; }
    .nav-links.active li:nth-child(3) { transition-delay: 0.3s; }
    .nav-links.active li:nth-child(4) { transition-delay: 0.4s; }
    .nav-links.active li:nth-child(5) { transition-delay: 0.5s; }
    .nav-links.active li:nth-child(6) { transition-delay: 0.6s; }
    .nav-links.active li:nth-child(7) { transition-delay: 0.7s; }
    .nav-links.active li:nth-child(8) { transition-delay: 0.8s; }
    .nav-links.active li:nth-child(9) { transition-delay: 0.9s; }

    .nav-links a {
        font-size: 1.35rem;
        font-weight: 600;
        color: var(--text-primary);
        letter-spacing: 1.5px;
        width: 100%;
        padding: 0.6rem 0;
        display: block;
    }

    .nav-links .btn-primary {
        margin-top: 1rem;
        width: auto;
        padding: 0.8rem 2.5rem;
        display: inline-block;
    }

    .about-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 2rem;
    }

    .about-image {
        display: flex !important;
        order: -1;
        margin-top: 7rem; /* Increased further to ensure gopher doesn't hit title */
        margin-bottom: 1rem;
        justify-content: center !important;
    }

    .image-wrapper {
        width: 200px !important;
        height: 200px !important;
    }

    .gopher-wrapper {
        width: 100px !important;
        display: block !important;
    }

    .about.reveal .gopher-wrapper {
        transform: translateX(-50%) translateY(-90px) !important;
    }

    .skills-wrapper {
        display: flex !important;
        flex-direction: column !important;
        gap: 2rem;
    }

    .projects-grid {
        display: flex !important;
        flex-direction: column !important;
    }

    .badge {
        font-size: 0.75rem;
        padding: 0.4rem 1rem;
        background: rgba(88, 166, 255, 0.3); /* More opaque for mobile */
    }
}



/* Project Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(1, 4, 9, 0.85);
    backdrop-filter: blur(8px);
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid rgba(48, 54, 61, 0.8);
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    height: 80vh;
    position: relative;
    z-index: 2001;
    display: flex;
    flex-direction: column;
    animation: modalSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.footer {
    padding: 3rem 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(10, 25, 47, 0.3);
}

.copyright {
    color: var(--text-dim);
    font-size: 0.9rem;
    font-family: var(--font-mono);
    opacity: 0.7;
}

.modal-close {
    position: absolute;
    top: 0.8rem;
    right: 1.5rem;
    font-size: 1.8rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--accent-color);
}

.modal-header {
    padding: 1.2rem 2.5rem 0.6rem;
    border-bottom: 1px solid rgba(48, 54, 61, 0.5);
}

.modal-header h2 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.modal-tabs {
    display: flex;
    gap: 2rem;
}

.tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    padding: 0.5rem 0;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-primary);
}

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

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2.5rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Markdown Rendering Styles */
.markdown-body {
    color: var(--text-secondary);
    line-height: 1.6;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.markdown-body code {
    background: rgba(48, 54, 61, 0.5);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.markdown-body pre {
    background: #010409;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.markdown-body img {
    max-width: 100%;
}

.markdown-body ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

/* File List Styles */
.file-list {
    font-family: var(--font-mono);
}

.file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    transition: all 0.2s ease;
}

.file-item.clickable {
    cursor: pointer;
    color: var(--text-main);
}

.file-item.clickable:hover {
    background: rgba(255, 255, 255, 0.05);
    padding-left: 1.5rem;
}

.file-item.clickable:hover i {
    color: var(--accent-light);
    transform: scale(1.1);
}

.file-item i {
    font-size: 1.1rem;
    width: 20px;
}

.file-item .fa-folder { color: #f0ad4e; }
.file-item .fa-file { color: #8b949e; }
.file-item .fa-code { color: var(--accent-color); }

.modal-footer {
    padding: 0.8rem 2.5rem;
    border-top: 1px solid rgba(48, 54, 61, 0.5);
    display: flex;
    justify-content: flex-end;
}

/* --- Light Theme Modal Overrides --- */
.light-theme .modal-content {
    background: #ffffff;
    border-color: #d0d7de;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.light-theme .modal-header {
    background: #f6f8fa;
    border-bottom: 1px solid #d0d7de;
}

.light-theme .modal-header h2 {
    color: #1f2328;
}

.light-theme .tab-btn {
    color: #656d76;
}

.light-theme .tab-btn:hover {
    color: #1f2328;
}

.light-theme .tab-btn.active {
    color: #0969da;
    border-bottom-color: #0969da;
}

.light-theme .modal-body {
    background: #ffffff;
}

.light-theme .modal-footer {
    background: #f6f8fa;
    border-top: 1px solid #d0d7de;
}

.light-theme .file-item {
    border-bottom-color: #d0d7de;
    color: #1f2328;
}

.light-theme .file-item.clickable:hover {
    background: #f3f4f6;
}

.light-theme .markdown-body {
    color: #1f2328;
}

.light-theme .markdown-body h1, 
.light-theme .markdown-body h2, 
.light-theme .markdown-body h3 {
    color: #1f2328;
}

.light-theme .markdown-body pre {
    background: #f6f8fa;
    border: 1px solid #d0d7de;
}

.light-theme .markdown-body code {
    background: rgba(175, 184, 193, 0.2);
    color: #1f2328;
}

/* Light Theme Modal Scrollbar */
.light-theme .modal-body::-webkit-scrollbar {
    width: 10px;
}

.light-theme .modal-body::-webkit-scrollbar-track {
    background: #f6f8fa;
}

.light-theme .modal-body::-webkit-scrollbar-thumb {
    background: #d0d7de;
    border: 2px solid #f6f8fa;
    border-radius: 10px;
}

.light-theme .modal-body::-webkit-scrollbar-thumb:hover {
    background: #afb8c1;
}

/* --- Light Theme Terminal Overrides --- */
.light-theme .terminal-window {
    background: #ffffff;
    border: 1px solid #d0d7de;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

.light-theme .terminal-header {
    background: #f6f8fa;
    border-bottom: 1px solid #d0d7de;
    color: #656d76;
}

.light-theme .terminal-body {
    background: #ffffff;
}

.light-theme .prompt {
    color: #057a15; /* More readable green on white */
}

.light-theme .cmd-text {
    color: #1f2328;
}

.light-theme .terminal-output {
    color: #3f4b5a;
}

.light-theme .highlight {
    color: #0969da; /* Bright GitHub Blue */
}

.light-theme .terminal-input {
    color: #1f2328;
}

/* Loader */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-secondary);
    gap: 1rem;
}

.loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(88, 166, 255, 0.1);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-details {
    width: 100%;
    margin-top: 1.5rem;
    background: transparent;
    border: 1px solid rgba(88, 166, 255, 0.3);
    color: var(--accent-color);
    padding: 0.6rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-details:hover {
    background: rgba(88, 166, 255, 0.1);
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(88, 166, 255, 0.1);
}

@media (max-width: 768px) {
    .modal-content {
        height: 90vh;
        max-width: 100%;
    }
    
    .modal {
        padding: 1rem;
    }
    
    .modal-tabs {
        gap: 1rem;
    }
}
/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(22, 27, 34, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(88, 166, 255, 0.2);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 99;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--accent-color);
    color: #ffffff;
    transform: translateY(-5px);
    box-shadow: 0 12px 40px var(--accent-glow);
    border-color: transparent;
}

.light-theme .back-to-top {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(9, 105, 218, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.light-theme .back-to-top:hover {
    background: var(--accent-color);
    box-shadow: 0 12px 40px var(--accent-glow);
}

@media screen and (max-width: 800px) {
    header .logo-wrapper .logo-socials {
        display: none !important;
    }

    .back-to-top {
        bottom: 1.5rem !important;
        right: 1.5rem !important;
        width: 44px !important;
        height: 44px !important;
    }

    .nav-links li.mobile-socials {
        display: block !important;
    }

    .nav-links li.mobile-socials .nav-socials {
        display: flex !important;
    }
}

@media screen and (max-width: 600px) {
    header .container nav {
        height: auto !important;
        padding: 1rem 0;
    }

    .hero .hero-actions {
        flex-direction: column !important;
        gap: 1rem !important;
        width: 100%;
        max-width: 300px;
        margin: 0 auto !important;
    }

    .hero .hero-actions a {
        width: 100% !important;
        text-align: center;
        justify-content: center;
    }

    .hero-text h1 {
        font-size: clamp(2rem, 10vw, 2.8rem) !important;
    }

    .hero-text h2 {
        font-size: clamp(1.1rem, 5vw, 1.4rem) !important;
    }

    .container {
        padding: 0 1rem !important;
    }

    .terminal-mock {
        font-size: 0.75rem !important;
    }

    .terminal-header {
        padding: 0.5rem 0.8rem !important;
    }

    .terminal-body {
        padding: 0.8rem !important;
    }

    .badge {
        font-size: 0.7rem !important;
        white-space: normal;
        text-align: center;
    }
    
    .contact-actions {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    
    .contact-actions .btn-primary,
    .contact-actions .btn-secondary {
        width: 100% !important;
    }
}

/* Setup Modal Specific Styles */
.setup-link {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    margin-left: auto;
    padding: 0 5px;
    opacity: 0.6;
    transition: var(--transition);
}

.setup-link:hover {
    color: var(--accent-color);
    opacity: 1;
    transform: scale(1.1);
}

.setup-modal-content {
    max-width: 600px !important;
    width: 95% !important;
    max-height: 90vh !important;
    background: rgba(22, 27, 34, 0.95) !important;
    border-color: var(--accent-color) !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.light-theme .setup-modal-content {
    background: rgba(255, 255, 255, 0.98) !important;
    border-color: var(--accent-color) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

body.light-theme .setup-info h2 {
    color: var(--accent-color);
}

body.light-theme .setup-caption {
    color: var(--text-secondary);
}

body.light-theme .setup-stats-mini {
    border-top-color: rgba(0, 0, 0, 0.1);
}

.setup-body {
    padding: 1.5rem;
    text-align: center;
    overflow-y: auto;
    flex: 1;
}

.setup-image-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 1px solid rgba(88, 166, 255, 0.2);
    max-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.setup-img {
    width: 100%;
    display: block;
    transition: transform 0.5s ease;
}

.setup-image-container:hover .setup-video {
    transform: scale(1.02);
}

.setup-video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    transition: var(--transition);
    object-fit: contain;
}

/* Video Overlay Live Feed Style */
.video-overlay-live {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 5;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    color: #ff3e3e;
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    pointer-events: none;
}

.live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #ff3e3e;
    border-radius: 50%;
    margin-right: 0.4rem;
    animation: pulseRed 1s infinite;
}

@keyframes pulseRed {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

.cam-id {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.65rem;
}

/* CRT Scanline Effect */
.crt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    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));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    z-index: 4;
}

/* Setup Mini Stats */
.setup-stats-mini {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(48, 54, 61, 0.3);
}

.stat-mini {
    display: flex;
    flex-direction: column;
}

.stat-mini .label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.stat-mini .value {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent-color);
    font-weight: 700;
}

/* Infrastructure Telemetry Dashboard */
.telemetry-dashboard {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 320px;
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid var(--accent-color);
    border-radius: 12px;
    z-index: 9999;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-glow);
    display: none; /* Hidden by default */
    flex-direction: column;
    overflow: hidden;
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Light theme overrides */
body.light-theme .telemetry-dashboard {
    background: rgba(255, 255, 255, 0.97);
    border-color: var(--accent-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12), 0 0 20px var(--accent-glow);
}

body.light-theme .telemetry-header {
    background: rgba(37, 99, 235, 0.07);
    border-bottom-color: rgba(37, 99, 235, 0.15);
}

body.light-theme .telemetry-bar-wrapper {
    background: rgba(0, 0, 0, 0.08);
}

body.light-theme .telemetry-logs {
    border-top-color: rgba(0, 0, 0, 0.1);
    color: var(--secondary-accent);
}

@keyframes slideInRight {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.telemetry-header {
    padding: 1rem;
    background: rgba(88, 166, 255, 0.1);
    border-bottom: 1px solid rgba(88, 166, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.telemetry-header h3 {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.telemetry-header button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.telemetry-header button:hover { color: var(--text-primary); }

.telemetry-body { padding: 1.2rem; }

.telemetry-grid {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.telemetry-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.telemetry-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.telemetry-bar-wrapper {
    height: 6px;
    background: rgba(48, 54, 61, 0.5);
    border-radius: 3px;
    overflow: hidden;
}

.telemetry-bar {
    height: 100%;
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-glow);
    transition: width 0.5s ease;
}

.telemetry-value {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-primary);
    text-align: right;
    margin-top: 0.2rem;
}

.telemetry-logs {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(48, 54, 61, 0.3);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--secondary-accent);
    height: 60px;
    overflow-y: auto;
}

.log-line { margin-bottom: 0.2rem; }

/* Matrix Rain Canvas */
.matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease;
    background: rgba(0, 0, 0, 0.9);
}

.matrix-canvas.active {
    opacity: 1;
}

/* Make footer status look clickable */
.infra-status {
    cursor: pointer;
    transition: var(--transition);
}

.infra-status:hover {
    border-color: var(--accent-color);
    background: rgba(88, 166, 255, 0.1);
    color: var(--text-primary);
}

.setup-badge {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(5px);
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    border: 1px solid var(--accent-color);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

body.light-theme .setup-badge {
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-primary);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Light theme scrollbar inside setup modal */
body.light-theme .setup-body::-webkit-scrollbar-track {
    background: #f1f5f9;
}

body.light-theme .setup-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}

body.light-theme .setup-body::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

.setup-badge i {
    font-size: 1.2rem;
}

.setup-info h2 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-family: var(--font-mono);
}

.setup-caption {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 1.1rem;
}

/* --- Education Section --- */
.edu-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.edu-card {
    background: rgba(22, 27, 34, 0.4);
    border: 1px solid rgba(48, 54, 61, 0.5);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    transition: var(--transition);
}

.edu-card:hover {
    border-color: rgba(88, 166, 255, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.edu-icon {
    font-size: 2.5rem;
    color: var(--accent-color);
    background: rgba(88, 166, 255, 0.1);
    padding: 1rem;
    border-radius: 12px;
}

.edu-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.edu-inst {
    color: var(--accent-light);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 1rem;
}

.edu-info p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.certs-container h4 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

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

.cert-badge {
    background: rgba(22, 27, 34, 0.4);
    border: 1px solid rgba(48, 54, 61, 0.5);
    padding: 1.2rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: var(--transition);
}

.cert-badge i {
    font-size: 1.8rem;
}

.cert-badge:hover {
    border-color: var(--accent-color);
    background: rgba(88, 166, 255, 0.1);
    transform: translateY(-2px);
}

/* --- Metrics Section --- */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    perspective: 1000px;
}

@media (min-width: 768px) {
    .metrics-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .metrics-grid {
        grid-template-columns: 1.8fr 1.2fr;
    }
}

.metric-card {
    background: rgba(22, 27, 34, 0.6);
    border: 1px solid rgba(88, 166, 255, 0.15);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    transition: transform 0.1s ease-out, border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.live-status-badge {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
    background: rgba(74, 222, 128, 0.1);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    width: fit-content;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.live-dot-pulse {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    position: relative;
}

.live-dot-pulse::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: inherit;
    border-radius: inherit;
    transform: translate(-50%, -50%);
    animation: live-pulse 2s infinite;
}

@keyframes live-pulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(3.5); opacity: 0; }
}

.live-text-tag {
    font-size: 0.7rem;
    color: #4ade80;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.card-glare {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at var(--mouseX) var(--mouseY), rgba(255, 255, 255, 0.15), transparent 80%);
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.metric-card:hover .card-glare, .project-card:hover .card-glare {
    opacity: 1;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.05) 0%, transparent 100%);
    pointer-events: none;
}

.metric-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-color);
    box-shadow: 0 15px 40px rgba(0, 173, 216, 0.15);
}

.metric-card h3 {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    padding-left: 1rem;
    border-left: 3px solid var(--accent-color);
}

.gh-live-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    flex: 1;
    margin-top: 0.8rem;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(88, 166, 255, 0.1);
}

.gh-live-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.3rem;
    text-align: center;
    background: rgba(88, 166, 255, 0.03);
    transition: background 0.3s ease;
}

.gh-live-stat-item:hover { background: rgba(88, 166, 255, 0.08); }

.gh-live-stat-item:nth-child(1),
.gh-live-stat-item:nth-child(2),
.gh-live-stat-item:nth-child(3) { border-right: 1px solid rgba(88, 166, 255, 0.1); }

.gh-live-stat-icon {
    font-size: 0.65rem;
    color: var(--accent-color);
    opacity: 0.6;
    margin-bottom: 0.15rem;
}

.gh-live-stat-value {
    font-size: 1.2rem;
    font-family: var(--font-mono);
    font-weight: 800;
    color: var(--accent-color);
    line-height: 1;
}

.gh-live-stat-label {
    font-size: 0.55rem;
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 0.15rem;
}

body.light-theme .gh-live-stats-grid { border-color: rgba(37, 99, 235, 0.12); }
body.light-theme .gh-live-stat-item { background: rgba(37, 99, 235, 0.02); }
body.light-theme .gh-live-stat-item:hover { background: rgba(37, 99, 235, 0.06); }
body.light-theme .gh-live-stat-item:nth-child(1),
body.light-theme .gh-live-stat-item:nth-child(2),
body.light-theme .gh-live-stat-item:nth-child(3) { border-right-color: rgba(37, 99, 235, 0.1); }

.gh-calendar-container {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    /* Hide scrollbar visually */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.gh-calendar-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.gh-chart-img {
    min-width: 700px;
    width: 100%;
    height: auto;
    display: block;
}

.stats-img-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.stats-img-wrapper img {
    max-width: 100%;
    height: auto;
}

/* Light theme inversions */
.light-theme .theme-invertible {
    filter: grayscale(20%) opacity(0.75) brightness(0.85);
}

.light-theme .edu-card, .light-theme .cert-badge, .light-theme .metric-card {
    background: #ffffff;
    border-color: #d0d7de;
}

.light-theme .cert-badge:hover, .light-theme .edu-card:hover {
    background: #f3f4f6;
    border-color: #0969da;
}


@media (max-width: 600px) {
    .setup-body {
        padding: 1rem;
    }
    .setup-badge {
        bottom: 1rem;
        right: 1rem;
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Custom Top Languages Chart */
.top-langs-chart {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    flex: 1;
    justify-content: center;
}

.langs-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--accent-color);
    font-size: 1.5rem;
    height: 80px;
}

.lang-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    gap: 2px;
    width: 100%;
}

.lang-bar-seg {
    height: 100%;
    border-radius: 4px;
    transition: opacity 0.2s ease;
}

.lang-bar-seg:hover { opacity: 0.75; }

.lang-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem 1rem;
}

.lang-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--text-primary);
}

.lang-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.lang-name {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.lang-pct {
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-family: var(--font-mono);
}
