/* Reset and Base Styles */
:root {
    /* Dark Theme (Default) */
    --bg-color: #050505;
    --card-bg: rgba(22, 22, 22, 0.7); /* Restored transparency */
    --skill-bg: #1a1a1a;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --accent-color: #3b82f6; /* Professional Blue */
    --border-color: #333333;
    --header-bg: rgba(5, 5, 5, 0.6);
    --header-border: rgba(255, 255, 255, 0.05);
    --project-card-bg: rgba(255, 255, 255, 0.03);
    --modal-backdrop: rgba(0, 0, 0, 0.85);
    --mobile-menu-bg: rgba(22, 22, 22, 0.9);
}

body[data-theme="light"] {
    --bg-color: #f5f5f5;
    --card-bg: rgba(255, 255, 255, 0.85); /* Cleaner, higher opacity white */
    --skill-bg: #f0f0f0;
    --text-main: #1a1a1a;
    --text-muted: #555555;
    --border-color: #e0e0e0;
    --header-bg: rgba(255, 255, 255, 0.7);
    --header-border: rgba(255, 255, 255, 0.5); /* Whiter border for glass feel */
    --project-card-bg: rgba(0, 0, 0, 0.03);
    --modal-backdrop: rgba(245, 245, 245, 0.85);
    --mobile-menu-bg: rgba(250, 250, 250, 0.95);
}

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

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.5s ease;
}

/* Custom Selection Color */
::selection {
    background: rgba(59, 130, 246, 0.3); /* Accent color with opacity */
    color: var(--text-main);
}

#particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: transparent;
    pointer-events: none;
}

/* Ambient Orbs */
.ambient-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -2; /* Behind particles */
    opacity: 0.15; /* Subtle */
    pointer-events: none;
    animation: floatOrb 20s infinite alternate cubic-bezier(0.45, 0.05, 0.55, 0.95);
}

.orb1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-color), transparent 70%);
    top: -100px;
    left: -100px;
}

.orb2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-color), transparent 70%);
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

@keyframes floatOrb {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Custom Page Scrollbar */
html::-webkit-scrollbar {
    width: 10px;
}

html::-webkit-scrollbar-track {
    background: transparent;
}

html::-webkit-scrollbar-thumb {
    background-color: rgba(59, 130, 246, 0.5); /* Semi-transparent accent */
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box; /* Makes the border act as padding */
}

html::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent-color);
}

/* Scroll Progress Bar */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--accent-color);
    width: 0%;
    z-index: 9999;
}

/* Header */
header {
    background: var(--header-bg);
    backdrop-filter: blur(16px); /* Stronger glass effect */
    border-bottom: 1px solid var(--header-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    color: var(--text-main);
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 2000; /* Ensure header stays on top */
    transition: background 0.3s ease;
}

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

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    padding: 2rem;
}

/* Styling for inline links in main content */
main a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500; /* Makes links stand out slightly in paragraphs */
    background-image: linear-gradient(var(--accent-color), var(--accent-color));
    background-size: 0% 2px;
    background-position: 0% 100%;
    background-repeat: no-repeat;
    transition: background-size 0.3s ease;
}

main a:hover {
    background-size: 100% 2px;
}

nav h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1; /* Fix for vertical alignment with menu toggle */
}

nav h1 a {
    background: linear-gradient(to right, #ffffff, #a0a0a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent; /* Fallback */
    text-decoration: none;
    transition: opacity 0.3s ease;
    position: relative;
}

/* Theme Toggle Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    margin-left: 1rem; /* Space from previous item */
    gap: 10px;
}

.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 48px;
}

.theme-switch input {
    display:none;
}

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

.slider:before {
    background-color: #fff;
    bottom: 3px;
    content: "";
    height: 18px;
    left: 3px;
    position: absolute;
    transition: .4s;
    width: 18px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .slider {
    background-color: var(--accent-color);
}

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

.theme-icon {
    color: var(--text-muted);
    transition: color 0.3s ease;
}

body[data-theme="light"] nav h1 a {
    background: linear-gradient(to right, var(--text-main), var(--text-muted));
    -webkit-background-clip: text;
    background-clip: text;
}

nav h1 a:hover::before,
nav h1 a:hover::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

nav h1 a:hover::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    animation: glitch-anim 5s infinite linear alternate-reverse;
    color: var(--text-main);
}

nav h1 a:hover::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9;
    animation: glitch-anim-2 5s infinite linear alternate-reverse;
    color: var(--text-main);
}

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

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    padding: 5px 0;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-main);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--accent-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links .hire-me-btn {
    background-color: var(--accent-color);
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    font-size: 0.9rem;
    line-height: 1;
}

.nav-links .hire-me-btn:hover {
    background-color: #2563eb;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    color: #ffffff;
}

.nav-links .hire-me-btn::after {
    display: none;
}

/* "Open to Work" Status Dot */
.nav-links .hire-me-btn::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background-color: #22c55e; /* Green status color */
    border-radius: 50%;
    animation: pulse-green 1.5s infinite;
}

@keyframes pulse-green {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

.nav-links .hire-me-btn svg {
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.nav-links .hire-me-btn:hover svg {
    transform: rotate(20deg) translateX(2px) translateY(-2px);
}

/* Hamburger Menu */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0; /* Override global button margin */
    z-index: 2001; /* Above mobile menu */
}

.menu-toggle .bar {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-main);
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

/* Add hover effect to menu toggle */
.menu-toggle:hover .bar {
    background-color: var(--accent-color);
}

.hero {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 1000px;
    width: 100%;
    scroll-margin-top: 80px;
    
    /* Animation Setup */
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}



body[data-theme="light"] .hero {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.6); /* Enhanced glass border for light mode */
}

.hero.in-view {
    opacity: 1;
    transform: translateY(0);
}

#canvas-container {
    width: 100%;
    height: 400px;
    margin: 1rem 0;
    cursor: grab;
}

.interaction-note {
    font-size: 0.85rem;
    color: var(--accent-color);
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
}

/* Landing Section */
.landing-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    min-height: 60vh;
    padding: 3rem;    
    text-align: center;

    /* Glassmorphism Background */
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    margin-top: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);    
    position: relative;
}

.landing-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    position: relative;
    background: linear-gradient(135deg, var(--text-main) 30%, #a0a0a0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent; /* Fallback/Ensure transparency */
}

/* Light mode specific gradient for better contrast */
body[data-theme="light"] .landing-content h1 {
    background: linear-gradient(135deg, #1a1a1a 30%, #555555 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.landing-content h1::before,
.landing-content h1::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    opacity: 0.8; 
}

.landing-content h1::before {
    left: 3px;
    text-shadow: -2px 0 #ff00c1;
    /* Solid color for texture */
    -webkit-text-fill-color: #ff00c1;
    animation: glitch-anim 8s infinite linear alternate-reverse;
    filter: url(#noiseFilter);
}

.landing-content h1::after {
    left: -3px;
    text-shadow: -2px 0 #00fff9;
    /* Solid color for texture */
    -webkit-text-fill-color: #00fff9;
    animation: glitch-anim-2 8s infinite linear alternate-reverse;
    filter: url(#noiseFilter);
}

.landing-content .subtitle {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-weight: 500;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(34, 197, 94, 0.3);
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(10px);
    animation: status-fade-in 0.6s forwards;
}

@keyframes status-fade-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    animation: pulse-green 1.5s infinite;
}

.landing-visual {
    width: 100%;
    max-width: 600px;
    text-align: center;
}

@media (min-width: 768px) {
    .landing-section {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
    .landing-content {
        max-width: 50%;
        text-align: left;
    }
    .landing-visual {
        width: 45%;
    }
}


button {
    margin-top: 1.5rem;
    padding: 12px 28px;
    background-color: transparent;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

button:hover {
    background-color: var(--accent-color);
    color: var(--text-main);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.3);
}

/* Footer */
footer {
    background: var(--header-bg); /* Use header bg for consistency */
    backdrop-filter: blur(10px);
    color: var(--text-muted);
    border-top: 1px solid rgba(59, 130, 246, 0.2);
    padding: 4rem 2rem 2rem;
    margin-top: auto;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-column h3 {
    color: var(--text-main);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.footer-column p {
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 0.8rem;
}

.footer-column a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-column a:hover {
    color: var(--accent-color);
    padding-left: 5px; /* Subtle slide effect */
}

.footer-socials {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    color: var(--text-muted);
    transition: color 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
}

.social-links a:hover {
    color: var(--accent-color);
    transform: translateY(-3px);
}

.social-links svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Responsive Styles */
@media (max-width: 768px) {
    main {
        padding: 1rem;
    }

    header {
        padding: 0 1rem;
    }

    .contact-info-wrapper {
        border-right: none;
    }

    .contact-scroll-wrapper {
        overflow-x: auto;
        width: 100%;
        padding-bottom: 1rem; /* Space for scrollbar */
    }

    nav h1 {
        font-size: 1.2rem;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: calc(100% + 10px);
        right: 1rem;
        width: auto;
        flex-direction: column;
        align-items: center;
        background-color: var(--mobile-menu-bg);
        backdrop-filter: blur(20px);
        padding: 1.5rem;
        border: 1px solid var(--header-border);
        border-radius: 16px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        
        /* Animation for menu */
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
        transform-origin: top right;
        transition: opacity 0.3s ease, transform 0.3s ease;
        
    }

    .theme-switch-wrapper {
        margin-left: 0;
        margin-bottom: 0;
        margin-top: 1rem;
    }

    .nav-links.active {
        display: flex;
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    .nav-links li {
        margin: 0.5rem 0;
    }

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

    .landing-section {
        padding: 2rem 1rem;
        min-height: auto;
    }

    .landing-content h1 {
        font-size: 2.5rem;
    }

    #canvas-container {
        height: 300px;
    }

    .hero {
        padding: 1.5rem;
    }

    .contact-container {
        min-width: 650px; /* Force container to be wide, creating the scrollbar */
    }

    .contact-details li a {
        font-size: 0.9rem;
    }
}

/* Contact Form */
#contact.hero {
    text-align: left;
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    width: 100%;
}

.form-group {
    position: relative;
    margin-bottom: 2rem;
}

.form-group label {
    position: absolute;
    top: 14px;
    left: 14px;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: all 0.3s ease;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px;    
    background-color: var(--project-card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
    50% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.4); }
    100% { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
}

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

/* Floating label effect */
.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
    top: -10px;
    left: 10px;
    font-size: 0.8rem;
    color: var(--accent-color);
    background-color: var(--card-bg); /* Match the hero background for cutout effect */
    padding: 0 5px;
}

/* Honeypot for spam protection */
.honeypot {
    position: absolute;
    left: -5000px;
}

/* New Contact Section Styles */
.contact-info-wrapper {
    padding: 3rem;
    border-right: 1px solid var(--border-color);
}

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

.contact-info-wrapper p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 90%;
}

.contact-details {
    list-style: none;
    margin-bottom: 2rem;
}

.contact-details li a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
    color: var(--text-muted);
    font-weight: 500;
    background-image: none; /* Override main link style */
}

.contact-details li a:hover {
    color: var(--accent-color);
    background-size: 0; /* Override main link style */
}

.contact-details svg {
    width: 24px;
    height: 24px;
    stroke: var(--accent-color);
}

.contact-details svg,
.social-links svg {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.contact-details.visible svg,
.social-links.visible svg {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays can be handled in CSS if we know the order, or JS. 
   Let's use a simple transition for now, triggered by the parent class. */


.contact-socials-prompt {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.contact-info-wrapper .social-links {
    justify-content: flex-start;
}

.contact-form-wrapper {
    padding: 3rem;
    position: relative;
}

.contact-form {
    display: flex;
    flex-direction: column;
}

#submit-btn {
    position: relative;
    width: 100%;
    background: linear-gradient(45deg, var(--accent-color), #2563eb, var(--accent-color));
    background-size: 200% 200%;
    border: none;
    color: white;
    transition: background-position 0.5s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

#submit-btn:hover {
    background-position: 100% 0;
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

#submit-btn.loading .button-text {
    opacity: 0;
}

#submit-btn::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#submit-btn.loading::after {
    opacity: 1;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

#form-status {
    text-align: center;
    margin-top: 1.5rem;
    font-weight: 500;
}

/* Enhanced About Me Section */
#about.hero {
    position: relative;
    border: 1px solid rgba(59, 130, 246, 0.25);
    background: var(--card-bg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 0 50px rgba(59, 130, 246, 0.1);
}

#about h2 {
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

#about h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* About Me Typing Animation */
.about-text-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.skip-typing-btn {
    position: absolute;
    bottom: 1.5rem; /* Position inside the card's padding */
    right: 1.5rem;  /* Position inside the card's padding */
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    opacity: 0.7;
    transition: opacity 0.3s ease, color 0.3s ease, transform 0.3s ease;
    margin: 0;
    box-shadow: none;
}

#about-text-3 {
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.skip-typing-btn:hover {
    opacity: 1;
    transform: translateX(3px);
    color: var(--accent-color);
    box-shadow: none;
    background: transparent;
}

#about-text-2 {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* Set initial state for the button animation */
#action-btn {
    opacity: 0;
    transform: translateY(20px);
}

/* About Me Typing Animation */
.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: var(--accent-color);
    animation: typing-blink 1s step-end infinite;
    vertical-align: bottom;
    margin-left: 2px;
}

@keyframes typing-blink {
    from, to { background-color: transparent; }
    50% { background-color: var(--accent-color); }
}

.about-reveal {
    opacity: 0;
    transition: opacity 0.8s ease-in;
}

.about-reveal.visible {
    opacity: 1;
}

/* Animate the button in after the parent is visible */
.about-reveal.visible #action-btn {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease 0.3s, transform 0.6s ease 0.3s;
}

#action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(45deg, var(--accent-color), #2563eb);
    color: white;
    border: none;
}

/* Skills Section */
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.skills-grid.is-glowing .skill-item.visible {
    /* This glow will be active during the animation phase */
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.6);
    transition: box-shadow 0.5s ease; /* Smoothly fade out the glow */
}

.skill-item {
    background-color: var(--skill-bg);
    border: 1px solid transparent; /* Hide default border for spotlight */
    color: var(--text-main);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease, box-shadow 1.5s ease-out, transform 0.3s ease, background-color 0.3s ease;
    cursor: default;
    opacity: 0;
    transform: translateY(30px) scale(0.9);
    position: relative;
    background-clip: padding-box; /* Important for border gradient */
}

/* Spotlight Border Effect via pseudo-element */
.skill-item::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: -1;
    border-radius: inherit;
    background: radial-gradient(
        400px circle at var(--mouse-x, 0) var(--mouse-y, 0), 
        rgba(59, 130, 246, 0.08), 
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.skills-grid:hover .skill-item::before {
    opacity: 1;
}

.skill-item.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: skillEntrance 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes skillEntrance {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    /* Glow is now handled by a parent class to control its duration globally */
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.skill-item:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Projects Section */
.projects-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    perspective: 1500px; /* Enable 3D space for children */
    padding: 0 60px;
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);    
    background: rgba(18, 18, 18, 0.6);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: all 0.3s ease;
    padding: 0;
    margin: 0; /* Override global button margin */
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

body[data-theme="light"] .scroll-btn {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-main);
}

.scroll-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.prev-btn { left: 0; }
.next-btn { right: 0; }

/* Adjust for mobile to keep buttons inside or visible */
@media (max-width: 768px) {
    .projects-wrapper {
        padding: 0;
    }
    .prev-btn { left: 0; }
    .next-btn { right: 0; }
}

.projects-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 2rem;
    width: 100%;
    margin-top: 1.5rem;
    padding: 1rem 0.5rem 2rem 0.5rem; /* Bottom padding for scrollbar */
    
    /* Custom Scrollbar Styles */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) rgba(255, 255, 255, 0.1);
}

.projects-grid.active {
    cursor: grabbing;
    cursor: -webkit-grabbing;
    scroll-snap-type: none; /* Disable snap while dragging for smoother feel */
    scroll-behavior: auto; /* Disable smooth scroll while dragging */
}

.projects-grid.active .project-image {
    cursor: grabbing;
    cursor: -webkit-grabbing;
}

.projects-grid::-webkit-scrollbar { 
    height: 6px;
    display: block;
}

.projects-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.projects-grid::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

.projects-grid::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

.project-card {
    background: var(--project-card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden; /* Keep this to clip the image zoom */
    transition: box-shadow 0.3s ease, border-color 0.3s ease; /* JS handles transform */
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 0 0 auto;
    scroll-snap-align: center;
    
    /* Sizing logic */
    width: 85%; /* Mobile: Show mostly one card */
    min-width: 280px;
}

body[data-theme="light"] .project-card {
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}

.project-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border-color: var(--accent-color);
}

.project-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--border-color);
    cursor: grab;
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover img {
    transform: scale(1.05);
}

.project-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: left; /* Ensure text aligns left inside the centered hero section */
}

.project-info h3 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.project-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    height: 4.8em; /* Force height to match 3 lines (3 * 1.6em) */
    overflow-y: auto;
    padding-right: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) rgba(255, 255, 255, 0.2);
}

/* Custom Scrollbar for Description */
.project-info p::-webkit-scrollbar {
    width: 6px;
}
.project-info p::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}
.project-info p::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 6px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    margin-top: auto;
}

.project-tags .tag {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.project-card:hover .project-tags .tag {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--accent-color);
    border-color: rgba(59, 130, 246, 0.2);
}

.project-links {
    display: flex;
    gap: 1rem;    
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.project-links a {
    font-size: 0.9rem;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

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

/* Project Focus Modal */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;    
    background-color: var(--modal-backdrop);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.project-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 10px 50px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.4s ease;
}

.project-modal.active .modal-content {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
    padding: 0;
    margin: 0;
    box-shadow: none;
}

.modal-close-btn:hover {
    color: var(--text-main);
    transform: scale(1.1) rotate(90deg);
    background: transparent;
}

.modal-image-container {
    width: 100%;
    height: 350px;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    overflow: hidden;
}

.modal-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-info {
    padding: 2rem;
    overflow-y: auto;
    text-align: left;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* Responsive Sizing for 2-column layout */
@media (min-width: 768px) {
    .project-card {
        /* Exact 50% width minus half the gap (1rem) so 2 fit perfectly */
        width: calc(50% - 1rem);
    }
}

@media (max-width: 768px) {
    .modal-content {
        flex-direction: column;
        max-height: 85vh;
    }
    .modal-image-container {
        height: 200px;
    }
    .modal-info {
        padding: 1.5rem;
    }
}

/* Clipboard Notification */
.clipboard-notification {
    position: fixed;
    /* Position is set by JS */
    transform: translate(-50%, -50%) translateY(10px); /* Center on cursor, start slightly down */
    background-color: var(--accent-color);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* Prevent interaction with the notification */
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.clipboard-notification.show {
    opacity: 1;
    visibility: visible;
    /* Move up to be above the cursor */
    transform: translate(-50%, -100%) translateY(-10px);
}

/* Confetti Canvas */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4000;
    pointer-events: none; /* Allows clicks to go through */
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--accent-color);
    color: var(--text-main);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100px);
    transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease, background-color 0.3s ease;
}

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

.back-to-top:hover {
    background-color: #2563eb; /* Darker accent */
}

@keyframes glitch-anim {
    0% { clip-path: inset(50% 0 50% 0); transform: skew(0); }
    94% { clip-path: inset(50% 0 50% 0); transform: skew(0); }
    95% { clip-path: inset(10% 0 85% 0); transform: skew(0.5deg); }
    96% { clip-path: inset(80% 0 5% 0); }
    97% { clip-path: inset(40% 0 20% 0); transform: skew(-0.5deg); }
    98% { clip-path: inset(90% 0 2% 0); }
    99% { clip-path: inset(25% 0 60% 0); transform: skew(0.2deg); }
    100% { clip-path: inset(50% 0 50% 0); transform: skew(0); }
}

@keyframes glitch-anim-2 {
    0% { clip-path: inset(50% 0 50% 0); }
    94% { clip-path: inset(50% 0 50% 0); }
    95% { clip-path: inset(85% 0 10% 0); }
    96% { clip-path: inset(5% 0 80% 0); }
    97% { clip-path: inset(60% 0 25% 0); }
    98% { clip-path: inset(2% 0 90% 0); }
    99% { clip-path: inset(70% 0 15% 0); }
    100% { clip-path: inset(50% 0 50% 0); }
}

/* Scroll Down Indicator */
.scroll-down-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background-image: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-down-indicator span {
    display: block;
    width: 20px;
    height: 20px;
    border-left: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(-45deg);
    animation: bounce 2.5s infinite;
    transition: border-color 0.3s ease;
}

.scroll-down-indicator:hover span {
    border-color: var(--accent-color);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) rotate(-45deg); }
    40% { transform: translateY(-15px) rotate(-45deg); }
    60% { transform: translateY(-8px) rotate(-45deg); }
}

.back-to-top svg {
    width: 24px;
    height: 24px;
}

/* Noise Overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998; /* Below progress bar/modals */
    opacity: 0.04;
    filter: url(#noiseFilter);
}

/* Mobile Overrides for Contact Form */
@media (max-width: 768px) {
    /* This block is now redundant or consolidated into the main media query */
}

/* Mobile Scroll Hint */
.mobile-scroll-hint {
    display: none;
}

@media (max-width: 768px) {
    #contact.hero {
        position: relative; /* Context for absolute hint */
    }

    .mobile-scroll-hint {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        position: absolute;
        bottom: 2rem;
        right: 2rem;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(4px);
        color: white;
        padding: 0.5rem 1rem;
        border-radius: 20px;
        font-size: 0.8rem;
        pointer-events: none;
        animation: pulse-hint 2s infinite;
        z-index: 10;
        border: 1px solid rgba(255, 255, 255, 0.1);
        transition: opacity 0.3s ease;
    }

    @keyframes pulse-hint {
        0%, 100% { transform: translateX(0); }
        50% { transform: translateX(5px); }
    }
}

/* Custom scrollbar for the contact section on mobile */
.contact-scroll-wrapper::-webkit-scrollbar { height: 6px; }
.contact-scroll-wrapper::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
.contact-scroll-wrapper::-webkit-scrollbar-thumb { background: var(--accent-color); border-radius: 3px; }
