/* RESET & VARIABLES */
:root {
    /* Light Theme (Technical/Drafting Paper) */
    --bg-color: #f0f2f5;
    --bg-secondary: #e1e4e8;
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --accent-color: #0984e3; /* Blueprint Blue */
    --accent-hover: #00cec9;
    --border-color: #b2bec3;
    --grid-color: rgba(0, 0, 0, 0.05);
    --card-bg: #ffffff;
    --shadow: 4px 4px 0px rgba(0, 0, 0, 0.1); /* Hard shadow for technical feel */
    
    --font-heading: "Rajdhani", sans-serif;
    --font-body: "Roboto Mono", monospace;
}

[data-theme="dark"] {
    /* Dark Theme (Blueprint Mode) */
    --bg-color: #0f172a; /* Deep Blue */
    --bg-secondary: #1e293b;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8; /* Cyan */
    --accent-hover: #22d3ee;
    --border-color: #334155;
    --grid-color: rgba(255, 255, 255, 0.05);
    --card-bg: #1e293b;
    --shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
}

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

html {
    scroll-behavior: smooth;
    overscroll-behavior: none; /* Prevent bounce effect globally */
    font-size: 95%; /* Slightly reduce base size to make UI more compact */
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden; /* Prevent horizontal scroll */
    overscroll-behavior: none; /* Prevent bounce effect globally */
    
    /* Technical Grid Background */
    background-image: 
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 40px 40px;
}

h1, h2, h3, .logo {
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

a {
    text-decoration: none;
    color: inherit;
    position: relative;
}

.container {
    max-width: 1400px; /* Increased width to accommodate 3 columns better */
    margin: 0 auto;
    padding: 0 20px;
    width: 100%; /* Ensure it takes full width up to max */
}

/* HEADER */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    background: var(--bg-color);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.8rem;
    color: var(--text-primary);
    border: 2px solid var(--text-primary);
    padding: 5px 10px;
    display: inline-block;
}

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

nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

nav a {
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s;
    font-size: 0.9rem;
}

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

nav a.active::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-color);
}

/* THEME TOGGLE */
#theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    cursor: pointer;
    color: var(--text-primary);
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#theme-toggle:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.sun-icon { display: none; }
.moon-icon { display: block; }

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }

/* Mobile Menu Toggle (Hidden on Desktop) */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.mobile-menu-toggle .bar {
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
}

/* HERO SECTION */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    position: relative;
    overflow: hidden;
}

/* Decorative Corner Markers for Hero */
.hero::before, .hero::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-color);
    transition: all 0.3s;
}
.hero::before { top: 20px; left: 20px; border-right: none; border-bottom: none; }
.hero::after { bottom: 20px; right: 20px; border-left: none; border-top: none; }

.hero-content {
    max-width: 600px;
    z-index: 2;
    border-left: 4px solid var(--accent-color);
    padding-left: 2rem;
}

.subtitle {
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: block;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    line-height: 1.1;
}

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

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.primary-cta, .cta-button {
    background-color: transparent;
    color: var(--accent-color);
    padding: 12px 24px;
    border: 2px solid var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.primary-cta:hover, .cta-button:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
    box-shadow: var(--shadow);
}

.cta-button.big {
    padding: 16px 32px;
    font-size: 1.1rem;
    letter-spacing: 2px;
    border-width: 2px;
}

.secondary-cta {
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 24px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: border-color 0.2s;
}

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

/* SECTIONS GENERAL */
section {
    padding: 80px 0;
    position: relative;
}

section h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

section h2::after {
    content: "";
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    margin: 10px auto 0;
}

/* SKILLS GRID */
.skills-section {
    padding: 100px 0; /* Increased padding to make section bigger */
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* Force 3 equal columns */
    gap: 2.5rem;
    max-width: 100%; /* Ensure it doesn't overflow */
    margin: 0 auto; /* Center the grid itself */
    justify-content: center; /* Center items horizontally */
}

@media (max-width: 1024px) {
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

.skill-category {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(5px);
    padding: 3rem;
    border: 1px solid var(--border-color);
    position: relative;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 4px;
    overflow: hidden;
}

[data-theme='dark'] .skill-category {
    background: rgba(15, 23, 42, 0.3);
    border-color: var(--border-color);
}

.skill-category:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

[data-theme='dark'] .skill-category:hover {
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    background: rgba(15, 23, 42, 0.5);
}

/* "Screw" decorations for Cards */
.project-card::before, .project-card::after,
.skill-category::before, .skill-category::after {
    content: "+";
    position: absolute;
    color: var(--border-color);
    font-family: monospace;
    font-weight: bold;
    transition: all 0.4s ease;
    font-size: 1.2rem;
    z-index: 3;
}
.skill-category::before { top: 10px; left: 10px; }
.skill-category::after { bottom: 10px; right: 10px; }

.skill-category:hover::before, .skill-category:hover::after {
    color: var(--accent-color);
    transform: rotate(90deg);
}

.skill-category h3 {
    margin-bottom: 2rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    font-weight: 700;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    font-size: 1.5rem;
    position: relative;
}

.skill-category h3::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.4s ease;
}

.skill-category:hover h3::after {
    width: 100%;
}

.skill-category h3 i {
    color: var(--accent-color);
}

.skill-category ul {
    list-style: none;
    padding-top: 1rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* Sub-cards (Skill Items) - Paper Card Look */
.skill-category li {
    background: var(--card-bg); /* Solid paper background */
    border: none; /* No border for paper look */
    padding: 1.5rem 1rem;
    position: relative;
    color: var(--text-primary);
    font-size: 1rem;
    /* Springy transition for "lightweight" feel */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    border-radius: 4px; /* Slightly rounded corners */
    overflow: hidden;
    /* Paper shadow */
    box-shadow: 0 2px 5px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.1);
    transform-origin: center bottom;
}

/* Top colored strip (like a file folder label) */
.skill-category li::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--border-color);
    transition: background 0.3s ease;
    display: block;
    opacity: 0.5;
}

.skill-category li:hover {
    /* Lift up and slight rotation for "floating paper" effect */
    transform: translateY(-8px) rotate(1deg) scale(1.02);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15), 0 5px 15px rgba(0,0,0,0.1);
    z-index: 10;
}

.skill-category li:hover::before {
    background: var(--accent-color);
    opacity: 1;
}

.skill-category li i {
    color: var(--text-secondary);
    font-size: 2.2rem;
    transition: all 0.4s ease;
}

.skill-category li:hover i {
    color: var(--accent-color);
    transform: scale(1.1) rotate(5deg);
}

/* Skill Tags */
.skill-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 8px;
    border-radius: 2px;
    background: rgba(0,0,0,0.05);
    color: var(--text-secondary);
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: auto;
}

.skill-category li:hover .skill-tag {
    background: var(--accent-color);
    color: #fff;
}

[data-theme='dark'] .skill-category li {
    background: rgba(255, 255, 255, 0.03);
}

/* Remove old bullet overrides */
.skill-category li::after {
    display: none;
}
/* Tag Variants - Colors */

/* Tag Variants */
.tag-certified { background: rgba(16, 185, 129, 0.1); color: #10b981; border-color: rgba(16, 185, 129, 0.2); }
.tag-expert { background: rgba(14, 165, 233, 0.1); color: #0ea5e9; border-color: rgba(14, 165, 233, 0.2); }
.tag-advanced { background: rgba(99, 102, 241, 0.1); color: #6366f1; border-color: rgba(99, 102, 241, 0.2); }
.tag-intermediate { background: rgba(245, 158, 11, 0.1); color: #f59e0b; border-color: rgba(245, 158, 11, 0.2); }
.tag-learning { background: rgba(236, 72, 153, 0.1); color: #ec4899; border-color: rgba(236, 72, 153, 0.2); }
.tag-basic { background: rgba(107, 114, 128, 0.1); color: #9ca3af; border-color: rgba(107, 114, 128, 0.2); }

/* Dark Theme Tag Adjustments */
[data-theme='dark'] .tag-certified { background: rgba(16, 185, 129, 0.2); }
[data-theme='dark'] .tag-expert { background: rgba(14, 165, 233, 0.2); }
[data-theme='dark'] .tag-advanced { background: rgba(99, 102, 241, 0.2); }
[data-theme='dark'] .tag-intermediate { background: rgba(245, 158, 11, 0.2); }
[data-theme='dark'] .tag-learning { background: rgba(236, 72, 153, 0.2); }
[data-theme='dark'] .tag-basic { background: rgba(107, 114, 128, 0.2); }

/* PROJECTS */
.project-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.filter-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    cursor: pointer;
    color: var(--text-secondary);
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    border-color: var(--accent-color);
    box-shadow: var(--shadow);
}

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

.project-card {
    background: transparent; /* Transparent background */
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease;
    position: relative;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: var(--shadow);
    background: transparent; /* Keep transparent on hover */
}

.project-card::before { top: 5px; left: 5px; }
.project-card::after { bottom: 5px; right: 5px; }

.card-image {
    height: 200px;
    background-color: var(--bg-secondary);
    position: relative;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

/* Technical overlay on images */
.card-image::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(45deg, transparent 49%, var(--border-color) 49%, var(--border-color) 51%, transparent 51%) 0 0 / 10px 10px;
    opacity: 0.1;
}

/* Placeholders for demo */
.placeholder-mech { background: linear-gradient(45deg, #2c3e50, #3498db); }
.placeholder-code { background: linear-gradient(45deg, #2c3e50, #e74c3c); }
.placeholder-hybrid { background: linear-gradient(45deg, #16a085, #f39c12); }

.card-content {
    padding: 1.5rem;
}

.tag {
    font-size: 0.7rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    padding: 2px 6px;
    border: 1px solid var(--border-color);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.project-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

.project-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.project-link {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-link:hover {
    text-decoration: underline;
}

/* CONTACT */
.contact-section {
    padding: 4rem 0;
    background-color: transparent; /* Removed solid bg */
    border-top: none;
}

.contact-card {
    background: transparent; /* Transparent background */
    backdrop-filter: none;
    padding: 4rem 2rem;
    border: 1px solid var(--border-color);
    position: relative;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

[data-theme='dark'] .contact-card {
    background: transparent;
    border-color: var(--border-color);
}

.contact-card:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow);
    background: transparent;
}

[data-theme='dark'] .contact-card:hover {
    background: transparent;
}

/* Screw accents for contact card */
.contact-card::before, .contact-card::after {
    content: "+";
    position: absolute;
    color: var(--border-color);
    font-family: monospace;
    font-weight: bold;
    transition: color 0.3s;
    font-size: 1.2rem;
}
.contact-card::before { top: 10px; left: 10px; }
.contact-card::after { bottom: 10px; right: 10px; }

.contact-card:hover::before, .contact-card:hover::after {
    color: var(--accent-color);
}

.contact-card h2 {
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
}

.contact-card p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

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

.social-links a {
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
    font-size: 0.9rem;
    background: rgba(0,0,0,0.02);
}

.social-links a:hover {
    color: var(--bg-color);
    background: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 4px 4px 0 rgba(0,0,0,0.1);
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    background: transparent;
    position: relative;
}

/* Footer technical accent */
footer::before {
    content: "";
    display: block;
    width: 100px;
    height: 2px;
    background: var(--accent-color);
    margin: 0 auto 1rem auto;
}

/* RESPONSIVE - Moved to bottom of file */

/* 3D Visual Container */
.hero-visual {
    width: 50%;
    height: 500px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-visual canvas {
    width: 100% !important;
    height: 100% !important;
    outline: none;
}

/* Old Hero Responsive Block Removed */


/* --- Global Scroll Animations --- */

/* Base transition for all animated elements */
.scroll-animate {
    opacity: 0;
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1); /* Smooth mechanical ease */
    will-change: transform, opacity;
}

/* Slide from Left */
.slide-left {
    transform: translateX(-100px);
}

/* Slide from Right */
.slide-right {
    transform: translateX(100px);
}

/* Fade Up */
.fade-up {
    transform: translateY(50px);
}

/* Scale In */
.scale-in {
    transform: scale(0.8);
}

/* Active State (Triggered by JS) */
.scroll-animate.active {
    opacity: 1;
    transform: translate(0) scale(1);
}

/* Specific Section Targets */

/* About Section */
.about-text {
    /* Will be assigned .scroll-animate .slide-left via JS or HTML, 
       but we can force initial state here if we want pure CSS fallback, 
       but JS observer is better for control. */
}

/* Projects: Alternating Left/Right */
.project-card:nth-child(odd) {
    /* We will add the class via JS to keep it clean, 
       or we can hardcode the behavior here if we add a common class to all cards */
}


/* Hero Slideshow Container */
.hero-slideshow {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Hero GIF Styling (Slideshow) */
.hero-visual img.hero-gif {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: auto;
    max-width: 800px;
    object-fit: contain;
    border-radius: 8px;
    
    /* Visibility Fix: Dark background for light theme */
    background-color: #1e293b; /* Dark Slate */
    padding: 10px;
    
    /* Transition for slideshow */
    opacity: 0;
    transition: opacity 1s ease-in-out;
    
    /* Remove shadow as requested */
    filter: none !important;
    box-shadow: none !important;
}

/* Active Slide */
.hero-visual img.hero-gif.active {
    opacity: 1;
    z-index: 10;
}

/* Dark Theme Adjustment */
[data-theme='dark'] .hero-visual img.hero-gif {
    background-color: rgba(255, 255, 255, 0.05);
    opacity: 0; 
}

[data-theme='dark'] .hero-visual img.hero-gif.active {
    opacity: 1;
}

/* About Grid Layout */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 0.8fr; /* Balanced columns */
    gap: 4rem; /* Space between text and image */
    align-items: center; /* Vertically center align */
    justify-content: center;
    max-width: 1000px; /* Constrain width to keep them visually together */
    margin: 0 auto; /* Center the entire grid in the section */
}

.about-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    /* Clean, minimal text container */
    padding: 1rem;
    position: relative;
}

/* Remove old decorations for cleaner look */
.about-content-wrapper::before {
    display: none;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
    text-align: left; /* Keep text left-aligned for readability */
}

.about-text p:last-child {
    margin-bottom: 0;
}

/* Stats - Minimalist */
.about-stats {
    display: flex;
    gap: 3rem;
    margin-top: 1rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.stat-item .number {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1;
}

.stat-item .label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-secondary);
    font-weight: 500;
}

.about-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.profile-pic-container {
    position: relative;
    width: 280px; /* Elegant portrait width */
    height: 360px;
    z-index: 1;
}

/* Elegant Offset Frame */
.profile-pic-container::before {
    content: "";
    position: absolute;
    top: 20px;
    left: 20px;
    width: 100%;
    height: 100%;
    border: 1px solid var(--accent-color);
    opacity: 0.4;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: -1;
}

/* Corner Accent */
.profile-pic-container::after {
    content: "";
    position: absolute;
    bottom: -10px;
    right: -10px;
    width: 60px;
    height: 60px;
    border-bottom: 2px solid var(--accent-color);
    border-right: 2px solid var(--accent-color);
    transition: all 0.5s ease;
    z-index: 2;
}

.profile-pic {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
    filter: grayscale(100%) contrast(1.05);
    transition: all 0.5s ease;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.2);
}

.profile-pic-container:hover .profile-pic {
    filter: grayscale(0%) contrast(1);
    transform: translate(-5px, -5px);
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.3);
}

.profile-pic-container:hover::before {
    transform: translate(10px, 10px);
    opacity: 0.8;
}

.profile-pic-container:hover::after {
    width: 30px;
    height: 30px;
    bottom: 10px;
    right: 10px;
    opacity: 0; /* Fade out corner on hover for cleaner look */
}

/* Old About Grid Responsive Block Removed */

/* Section Visuals (GIFs) */
.section-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem 0;
}

.section-visual img {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 8px;
    filter: drop-shadow(0 0 15px rgba(9, 132, 227, 0.2));
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    padding: 10px; /* Frame effect */
}

[data-theme='dark'] .section-visual img {
    filter: drop-shadow(0 0 15px rgba(56, 189, 248, 0.3));
}







/* Hero Slider Container */
.hero-slider-container {
    position: relative;
    width: 100%;
    max-width: 100%; /* Full width */
    aspect-ratio: 16 / 9; /* Enforce 16:9 aspect ratio */
    height: auto; /* Allow height to scale with width */
    display: flex;
    align-items: center;
    justify-content: center;
    /* Remove box styling */
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible; /* Allow buttons outside */
}

.hero-slider-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Slider Images */
.hero-visual img.hero-gif {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: auto;
    max-height: 90%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    
    /* Styling */
    background-color: #1e293b;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.hero-visual img.hero-gif.active {
    opacity: 1;
    z-index: 2;
}

/* Slider Buttons - Simple & Elegant */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    color: var(--accent-color);
    border: none;
    cursor: pointer;
    z-index: 10;
    font-size: 2.5rem; /* Larger, elegant size */
    font-weight: 100; /* Thin look */
    padding: 0;
    transition: all 0.3s ease;
    opacity: 0.6;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    border-radius: 0;
}

.slider-btn:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
    background: transparent;
    text-shadow: 0 0 10px var(--accent-color);
}

.prev-btn { left: -60px; }
.next-btn { right: -60px; }

.slider-btn.hidden {
    opacity: 0;
    pointer-events: none;
    cursor: default;
}

/* Dark Theme Adjustment */
[data-theme='dark'] .hero-visual img.hero-gif {
    background-color: rgba(255, 255, 255, 0.05);
    opacity: 0;
}

[data-theme='dark'] .hero-visual img.hero-gif.active {
    opacity: 1;
}


/* Hero Grid Container */
.hero-grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr); /* Force 2 rows */
    gap: 10px; /* Reduced gap */
    width: 100%;
    height: 100%; /* Fill the slide */
    max-width: 100%; /* Remove width restriction inside slider */
    padding: 0; /* Remove padding */
    background: transparent; /* Remove bg */
    border: none; /* Remove border */
    backdrop-filter: none;
    box-sizing: border-box;
    border-radius: 0;
    position: relative;
}

/* Remove corner accents */
.hero-grid-container::before, .hero-grid-container::after {
    display: none;
}

.hero-grid-item {
    position: relative;
    overflow: hidden;
    background: rgba(30, 41, 59, 0.85); /* Darker background for better contrast */
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    /* Remove fixed aspect ratio to let grid control size */
    width: 100%;
    height: 100%; 
    transition: all 0.3s ease;
    /* Sharp corners */
    border-radius: 0;
}

.hero-grid-item:hover {
    border-color: var(--accent-color);
    z-index: 2;
    box-shadow: 0 0 15px rgba(9, 132, 227, 0.15);
    background: rgba(30, 41, 59, 0.95);
}

.hero-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Fill the cell completely */
    /* Ensure visibility */
    filter: drop-shadow(0 0 5px rgba(9, 132, 227, 0.2));
}

/* Dark Theme Adjustments */
[data-theme='dark'] .hero-grid-container {
    background: transparent;
}

[data-theme='dark'] .hero-grid-item {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme='dark'] .hero-grid-item img {
    filter: drop-shadow(0 0 5px rgba(56, 189, 248, 0.3));
}

/* Old Hero Grid Responsive Block Removed */


/* Hero Grid Slider Styles */
.hero-slider-track {
    width: 100%;
    height: 100%;
    position: relative;
}

.hero-grid-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    pointer-events: none;
    transform: translateX(20px);
}

.hero-grid-slide.active {
    opacity: 1;
    pointer-events: all;
    transform: translateX(0);
    z-index: 1;
}

/* Adjust container for slider */
.hero-slider-container .hero-grid-container {
    height: 100%;
    border: none;
    background: transparent;
    backdrop-filter: none;
}


/* =========================================
   RESPONSIVE DESIGN
   ========================================= */

@media (max-width: 1024px) {
    .hero h1 { font-size: 3rem; }
    .hero-slider-container { max-width: 100%; }
}

@media (max-width: 768px) {
    /* HEADER & NAV */
    .site-header {
        padding: 1rem 5%;
        /* Ensure logo and burger are on the same line */
        flex-direction: row; 
        justify-content: space-between;
        align-items: center;
    }
    
    .mobile-menu-toggle {
        display: flex; /* Show hamburger icon */
    }

    .nav-links {
        position: absolute;
        top: 100%; /* Directly below header */
        left: 0;
        width: 100%;
        background-color: var(--bg-color);
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
        gap: 1.5rem;
        border-bottom: 2px solid var(--border-color);
        
        /* Hidden state */
        display: none; 
        opacity: 0;
        transform: translateY(-20px);
        transition: opacity 0.3s ease, transform 0.3s ease;
        z-index: 99;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

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

    .nav-links a { 
        font-size: 1.1rem;
        width: 100%;
        text-align: center;
        padding: 10px 0;
    }

    /* HERO SECTION */
    .hero {
        flex-direction: column;
        padding-top: 100px; /* Space for header */
        text-align: center;
        justify-content: center;
    }

    .hero-content {
        max-width: 100%;
        border-left: none;
        border-top: 4px solid var(--accent-color);
        padding-left: 0;
        padding-top: 2rem;
        margin-bottom: 3rem;
    }

    .hero h1 { font-size: 2.5rem; }
    
    .hero p {
        margin-left: auto;
        margin-right: auto;
    }

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

    /* HERO SLIDER - Tablet Vertical Stack */
    .hero-visual {
        width: 100%;
        height: auto;
        margin: 0;
        padding: 0;
    }

    .hero-slider-container {
        width: 100%;
        height: auto;
        aspect-ratio: auto;
        margin-bottom: 2rem;
        overflow: visible;
        padding: 0;
    }

    .hero-slider-track { height: auto; }

    .hero-grid-slide {
        position: relative;
        display: none;
        width: 100%;
        height: auto;
        opacity: 1;
        transform: none;
    }

    .hero-grid-slide.active { display: block; }

    .hero-grid-container {
        display: flex;
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    .hero-grid-item {
        width: 100%;
        aspect-ratio: 16/9;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        margin-bottom: 0;
    }

    .slider-btn {
        display: block;
        background: rgba(0,0,0,0.6);
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
        z-index: 10;
        border-radius: 50%;
        top: 50%;
        transform: translateY(-50%);
    }
    .prev-btn { left: 10px; }
    .next-btn { right: 10px; }

    /* SECTIONS */
    section { padding: 40px 0; }
    
    section h2 { font-size: 2rem; }

    /* SKILLS & PROJECTS */
    .skills-grid, .project-grid {
        grid-template-columns: 1fr; /* Stack single column */
        gap: 1.5rem;
    }

    .skill-category, .project-card {
        padding: 1.5rem;
    }

    /* ABOUT SECTION */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center; /* Center align text on mobile */
    }

    .profile-pic-container {
        width: 250px;
        height: 250px;
        margin: 0 auto;
    }
    
    .about-grid .about-visual {
        order: -1; /* Image on top */
    }

    /* CONTACT */
    .contact-card {
        padding: 2rem 1rem;
    }
    
    .contact-card h2 { font-size: 1.8rem; }
    
    .social-links {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    .hero {
        padding-left: 0;
        padding-right: 0;
        overflow-x: hidden;
        width: 100%;
        padding-bottom: 2rem;
    }

    .hero-content {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
        margin-bottom: 1.5rem; /* Small gap to prevent overlap */
    }

    .hero-visual {
        width: 85%; /* Further reduced width to ensure fit */
        height: auto;
        margin: 0 auto;
        padding: 0;
        position: relative; /* Ensure relative positioning for children */
    }

    .hero {
        padding-bottom: 2rem; /* Add space at bottom of hero */
    }

    .hero h1 { font-size: 2rem; }
    
    .hero-slider-container {
        width: 100%; 
        margin: 0;
        height: auto;
        aspect-ratio: 8 / 9; /* 2 items of 16:9 stacked = 16:18 = 8:9 */
        max-height: none;
        overflow: visible;
        padding: 0;
    }

    .hero-slider-track {
        display: block;
        width: 100%;
        height: 100%;
        position: relative;
    }
    
    .hero-slider-track::-webkit-scrollbar {
        display: none;
    }

    /* Restore JS-controlled slider behavior with SMOOTH FADE */
    .hero-grid-slide {
        display: block !important; /* Always block to allow fade */
        position: absolute !important; /* Stack on top of each other */
        top: 0;
        left: 0;
        width: 100% !important;
        height: 100%;
        opacity: 0;
        transition: opacity 0.8s ease-in-out; /* Smooth fade transition */
        z-index: 0;
        transform: none !important; /* No movement on mobile */
        margin: 0 !important;
    }

    .hero-grid-slide.active {
        opacity: 1;
        z-index: 1;
        animation: none; /* Use transition instead */
    }
    
    /* Force 1 column for hero grid items on very small screens */
    .hero-grid-container {
        display: flex;
        flex-direction: column; /* Stack vertically */
        height: 100%;
        overflow: visible; /* No internal scroll */
    }
    
    .hero-grid-container::-webkit-scrollbar {
        display: none; 
    }

    .hero-grid-item {
        width: 100%;
        height: 50%; /* Each item takes half height */
        aspect-ratio: auto; /* Let height control it */
        border: 1px solid var(--border-color); /* Full border on all sides */
        margin-bottom: -1px; /* Collapse borders between stacked items */
    }

    /* Only show the first 2 items on mobile */
    .hero-grid-item:nth-child(n+3) {
        display: none;
    }

    /* Simple Arrows at the edges */
    .slider-btn {
        display: flex;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 40px;
        height: 40px;
        background: transparent; /* No background for simple look */
        color: var(--text-primary);
        border: none;
        font-size: 2rem; /* Large simple arrow */
        z-index: 20;
        justify-content: center;
        align-items: center;
        padding: 0;
    }
    
    /* Position outside the container (in the margins) */
    .prev-btn { left: -35px; }
    .next-btn { right: -35px; }
}

