/* ===================================
   Nabiel Portfolio - Complete Stylesheet
   =================================== */

/* CSS Variables */
:root {
    --font-display: 'Google Sans', 'Poppins', sans-serif;
    --font-body: 'Google Sans Text', 'Poppins', sans-serif;
    --bg-dark: #0f0f1a;
    --bg-darker: #0a0a12;
    --bg-light: #fafafa;
    --text-dark: #1a1a2e;
    --text-light: #ffffff;
    --text-muted: #6b7280;
    --text-muted-light: #9ca3af;
    --accent: #4f46e5;
    --accent-soft: #818cf8;
    --border-light: #e5e7eb;
    --border-dark: #1f2937;
    --container-max: 1200px;
    --section-padding: 30px 0;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    overflow-x: hidden;
    /* Prevent horizontal scroll/empty space */
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    /* Double ensure no horizontal scroll */
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

ul {
    list-style: none;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 32px;
}

.section {
    padding: var(--section-padding);
}

.dark-section {
    background: var(--bg-dark);
    color: var(--text-light);
}

/* Cursor Glow Effect */
.cursor-glow {
    position: fixed;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(66, 133, 244, 0.3) 0%, rgba(66, 133, 244, 0) 60%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    top: 0;
    left: 0;
    will-change: transform;
    /* mix-blend-mode removed */
}


/* Typewriter Cursor */
/* Typewriter Cursor */
.hero-intro::after {
    content: '|';
    color: var(--accent);
    animation: blink 1s infinite;
    font-weight: 300;
    margin-left: 4px;
}

.hero-intro {
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 8px;
    min-height: 1.5em;
    font-family: 'Google Sans Text', sans-serif;
    font-weight: 500;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* ===================================
   Navigation
   =================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    transition: all var(--transition-smooth);
}

/* Navbar dark mode (on dark sections) */
.navbar.navbar-dark {
    background: rgba(15, 15, 26, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar.navbar-dark .nav-logo {
    color: white;
}

.navbar.navbar-dark .nav-link {
    color: rgba(255, 255, 255, 0.8);
}

.navbar.navbar-dark .nav-link:hover {
    color: white;
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.nav-logo span {
    color: var(--accent);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color var(--transition-smooth);
}

.nav-link:hover {
    color: var(--text-dark);
}

.nav-cta {
    background: var(--accent);
    color: white !important;
    padding: 10px 24px;
    border-radius: 8px;
    transition: all var(--transition-smooth);
}

.nav-cta:hover {
    background: #4338ca;
    transform: translateY(-2px);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-dark);
    transition: all var(--transition-smooth);
}

/* ===================================
   Buttons
   =================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all var(--transition-smooth);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--text-dark);
    border: 1px solid var(--border-light);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ===================================
   Hero Section - Antigravity Style
   =================================== */
.hero {
    min-height: 100vh;
    padding: 80px 0 60px;
    display: flex;
    align-items: center;
    background: #ffffff;
    position: relative;
    overflow: hidden;
}

/* Particle Canvas */
#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Edge Glows */
.hero-glow {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.hero-glow-top {
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(79, 70, 229, 0.03), transparent);
}

.hero-glow-bottom {
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: radial-gradient(ellipse 80% 50% at 50% 100%, rgba(129, 140, 248, 0.02), transparent);
}

/* Animated Background */
.hero-bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.6;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(129, 140, 248, 0.12));
    top: -100px;
    right: -100px;
    animation: floatShape 20s ease-in-out infinite;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.1), rgba(79, 70, 229, 0.06));
    bottom: -50px;
    left: -50px;
    animation: floatShape 25s ease-in-out infinite reverse;
}

.shape-3 {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.06), rgba(129, 140, 248, 0.08));
    top: 50%;
    left: 10%;
    animation: floatShape 18s ease-in-out infinite;
    animation-delay: -5s;
}

.shape-4 {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.08), rgba(79, 70, 229, 0.1));
    top: 20%;
    right: 15%;
    animation: floatShape 22s ease-in-out infinite reverse;
    animation-delay: -10s;
}

.bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(79, 70, 229, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 70, 229, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridMove 30s linear infinite;
}

@keyframes floatShape {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(30px, -30px) rotate(5deg);
    }

    50% {
        transform: translate(0, -50px) rotate(0deg);
    }

    75% {
        transform: translate(-30px, -20px) rotate(-5deg);
    }
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(60px, 60px);
    }
}

.hero-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 900px;
    padding-top: 0;
}

.hero-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #6b7280;
    margin-bottom: 20px;
}

.hero-name {
    font-family: var(--font-body);
    font-size: 3.5rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 24px;
    color: #1a1a2e;
}

.name-line {
    display: block;
}

.name-line.italic {
    font-style: italic;
    font-weight: 400;
}

.hero-divider {
    width: 60px;
    height: 3px;
    background: var(--accent);
    margin: 0 auto 24px auto;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.hero-tagline {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 auto 30px auto;
    max-width: 500px;
}

.hero-cta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 40px;
}

.hero-stats {
    display: flex;
    gap: 48px;
    justify-content: center;
}

/* Pill-Shaped Buttons */
.btn-pill {
    border-radius: 50px;
    padding: 16px 32px;
}

.btn-pill.btn-primary {
    background: #1a1a2e;
    color: white;
    border: none;
}

.btn-pill.btn-primary:hover {
    background: #0f0f1a;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.btn-pill.btn-outline {
    background: #f3f4f6;
    color: #1a1a2e;
    border: none;
}

.btn-pill.btn-outline:hover {
    background: #e5e7eb;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.image-frame {
    position: relative;
    width: 340px;
    height: auto;
    max-height: 480px;
    border-radius: 20px;
    overflow: hidden;
    z-index: 2;
    background: white;
    padding: 20px;
    padding-bottom: 0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.image-frame img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.image-frame::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, transparent 0%, var(--bg-light) 100%);
    pointer-events: none;
    z-index: 10;
}

.image-decoration {
    display: none;
}

.hero-scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.scroll-text {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--accent), transparent);
}

/* ===================================
   Section Headers
   =================================== */
.section-header {
    margin-bottom: 60px;
}

.section-header.light {
    color: var(--text-light);
}

.section-number {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 8px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* ===================================
   About Section
   =================================== */
.about-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 80px;
    align-items: start;
}

.about-grid-with-photo {
    display: grid;
    grid-template-columns: 1fr 0.6fr;
    gap: 40px;
    align-items: start;
}

.about-photo {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.about-photo .image-frame {
    width: 420px;
    max-height: 550px;
}

.about-lead {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
    line-height: 1.6;
    margin-bottom: 24px;
}

.about-content p {
    margin-bottom: 16px;
    color: var(--text-muted);
}

.education-card {
    background: white;
    padding: 40px;
    border-radius: 16px;
    border: 1px solid var(--border-light);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

.edu-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 16px;
}

.education-card h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.edu-degree {
    font-weight: 500;
    margin-bottom: 4px;
}

.edu-year {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.edu-gpa {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.gpa-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--accent);
}

.gpa-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ===================================
   Skills Section
   =================================== */
.skill-category-section {
    margin-bottom: 50px;
}

.skill-category-section:last-child {
    margin-bottom: 0;
}

.category-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-title i {
    font-size: 1rem;
    color: var(--accent-soft);
}

/* Tools Grid - 6 columns */
.tools-grid {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 12px !important;
    width: 100%;
}

.tool-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px;
    padding: 16px 10px;
    background: var(--bg-darker);
    border-radius: 12px;
    border: 1px solid var(--border-dark);
    transition: all var(--transition-smooth);
    cursor: default;
    text-align: center;
}

.tool-item:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    background: rgba(79, 70, 229, 0.15);
    box-shadow: 0 12px 30px rgba(79, 70, 229, 0.25);
}

.tool-item i {
    font-size: 2rem;
    transition: transform var(--transition-smooth);
}

.tool-item:hover i {
    transform: scale(1.2);
}

.tool-item span {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted-light);
    text-align: center;
}

.tool-item:hover span {
    color: var(--text-light);
}

/* ===================================
   Experience Section
   =================================== */
.experience-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.experience-item {
    background: white;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    transition: all var(--transition-smooth);
}

.experience-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.exp-header {
    margin-bottom: 8px;
}

.exp-header h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.exp-company {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    background: rgba(79, 70, 229, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

.exp-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.exp-details {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.exp-details li {
    padding-left: 16px;
    position: relative;
    margin-bottom: 6px;
}

.exp-details li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
}

.experience-category {
    margin-top: 40px;
    margin-bottom: 24px;
}

.experience-category:first-of-type {
    margin-top: 0;
}

.experience-category-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.exp-date {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ===================================
   Projects Section
   =================================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.project-card {
    background: var(--bg-darker);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--border-dark);
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-soft));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-smooth);
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-card:hover {
    transform: translateY(-4px);
}

.project-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.1);
    position: absolute;
    top: 20px;
    right: 30px;
}

.project-card h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
    line-height: 1.4;
}

.project-card p {
    font-size: 0.95rem;
    color: var(--text-muted-light);
    margin-bottom: 24px;
    line-height: 1.7;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-tags span {
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    padding: 6px 14px;
    border-radius: 20px;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-dark);
}

.project-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent-soft);
    transition: all var(--transition-smooth);
}

.project-link:hover {
    color: var(--text-light);
    transform: translateX(4px);
}

/* ===================================
   Publications Section
   =================================== */
.publications-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.pub-category-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.pub-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-light);
}

.pub-item:last-child {
    border-bottom: none;
}

.pub-item h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.5;
}

.pub-journal {
    font-size: 0.85rem;
    color: var(--accent);
    font-style: italic;
}

.pub-link {
    display: block;
    cursor: pointer;
}

.pub-link:hover .pub-journal {
    text-decoration: underline;
}

/* ===================================
   Contact Section
   =================================== */
.contact-intro {
    font-family: var(--font-display);
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 60px;
    font-style: italic;
}

.contact-grid {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 16px;
    max-width: 1100px;
    margin: 0 auto;
}

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 24px 16px;
    background: var(--bg-darker);
    border-radius: 16px;
    border: 1px solid var(--border-dark);
    transition: all var(--transition-smooth);
}

.contact-item:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.2);
}

.contact-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-soft));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-smooth);
}

.contact-item:hover .contact-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4);
}

.contact-icon i {
    font-size: 1.1rem;
    color: white;
}

.contact-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.contact-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted-light);
}

.contact-value {
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ===================================
   Footer
   =================================== */
.footer {
    background: var(--bg-light);
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid var(--border-light);
}

.footer p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ===================================
   Animations
   =================================== */
[data-animate] {
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-image[data-animate] {
    opacity: 1 !important;
    transform: none !important;
}

[data-animate="fade-up"] {
    transform: translateY(40px);
}

[data-animate="fade-right"] {
    transform: translateX(-40px);
}

[data-animate="fade-left"] {
    transform: translateX(40px);
}

[data-animate].visible {
    opacity: 1;
    transform: translate(0);
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 1024px) {
    .hero-name {
        font-size: 3rem;
    }

    .btn {
        padding: 12px 20px;
        font-size: 0.85rem;
    }

    .image-frame {
        width: 280px;
        height: 350px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .experience-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .publications-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .tools-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 25px 0;
    }

    .container {
        padding: 0 20px;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: var(--bg-light);
        /* DEFAULT: Light Background */
        flex-direction: column;
        justify-content: center;
        padding: 40px;
        gap: 24px;
        transition: right var(--transition-smooth), background-color 0.3s ease;
        box-shadow: -20px 0 60px rgba(0, 0, 0, 0.1);
    }

    /* ADAPTIVE: Switch to Dark Background when Navbar is Dark */
    .navbar.navbar-dark .nav-menu {
        background: var(--bg-dark);
    }

    /* ADAPTIVE TEXT: Default Dark Text (on Light Menu) */
    .nav-menu .nav-link {
        color: var(--text-primary) !important;
        font-size: 1.1rem;
    }

    /* EXCEPTION: Contact Button (.nav-cta) must ALWAYS be White (since it has purple bg) */
    .nav-menu .nav-link.nav-cta {
        color: #ffffff !important;
    }

    /* ADAPTIVE TEXT: White Text (on Dark Menu) */
    .navbar.navbar-dark .nav-menu .nav-link {
        color: #ffffff !important;
    }

    .nav-menu .nav-link::after {
        background: var(--accent);
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-toggle {
        display: flex;
        z-index: 1001;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* Force hamburger lines to be white on dark sections */
    .navbar.navbar-dark .nav-toggle span {
        background-color: #ffffff !important;
    }

    /* X Button Logic: */
    /* 1. Default (Light Menu) -> X is Dark */
    .nav-toggle.active span {
        background-color: #333333;
    }

    /* 2. Dark Mode (Dark Menu) -> X is White */
    .navbar.navbar-dark .nav-toggle.active span {
        background-color: #ffffff !important;
    }

    .experience-grid {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .hero-container {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .hero-content {
        padding-top: 80px;
    }

    .hero-name {
        font-size: 2rem;
    }

    .image-frame {
        width: 160px;
        height: 240px;
    }

    .image-frame img {
        height: 100%;
        object-fit: cover;
        object-position: center 5%;
        /* Fine-tuned 5% sweet spot */
    }

    .hero-cta {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .tools-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 12px !important;
    }

    .tool-item {
        padding: 14px 10px;
    }

    .tool-item i {
        font-size: 1.75rem;
    }

    .tool-item span {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .contact-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .hero-container {
        grid-template-columns: 1fr 1fr;
        gap: 0;
    }

    .hero-content {
        padding-top: 40px;
    }

    .hero-name {
        font-size: 1.6rem;
    }

    .image-frame {
        width: 140px;
        height: 200px;
    }

    .image-frame img {
        height: 100%;
        object-fit: cover;
        object-position: center 5%;
        /* Fine-tuned 5% */
    }

    .hero-subtitle {
        font-size: 0.75rem;
    }

    .tools-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
    }

    .tool-item {
        padding: 12px 8px;
        gap: 8px;
    }

    .tool-item i {
        font-size: 1.5rem;
    }

    .tool-item span {
        font-size: 0.65rem;
    }

    .contact-item {
        padding: 16px 12px;
    }

    .contact-icon {
        width: 40px;
        height: 40px;
    }

    .contact-icon i {
        font-size: 0.9rem;
    }

    .contact-value {
        font-size: 0.7rem;
    }
}

/* ===================================
   Footer
   =================================== */
footer.footer {
    background: var(--bg-darker);
    color: var(--text-muted);
    padding: 40px 0;
    text-align: center;
}

footer.footer p {
    margin: 0;
    font-size: 0.9rem;
}

.visitor-stats {
    margin-top: 10px !important;
    font-size: 0.8rem !important;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.visitor-stats i {
    color: var(--accent);
}

/* ===================================
   Visual Enhancements & Animations
   =================================== */

/* Floating Animation for Hero Image */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

.image-frame {
    animation: float 6s ease-in-out infinite;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-frame:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.25);
}

/* Hero Stats Hover Effects */
.stat-item {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 10px;
    border-radius: 8px;
    cursor: default;
}

.stat-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
}

.stat-number {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-soft) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: all 0.3s ease;
}

.stat-item:hover .stat-number {
    transform: scale(1.1);
    display: inline-block;
}

/* Button Shine Effect */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    transition: 0.5s;
}

.btn:hover::after {
    left: 100%;
}


/* ===================================
   Scroll Reveal Animations - Enhanced
   =================================== */

/* Base state for animated elements */
[data-animate] {
    opacity: 0;
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

/* Revealed state - smooth entrance */
[data-animate].revealed {
    opacity: 1;
    transform: translate(0, 0) scale(1) !important;
}

/* Animation directions with scale for depth */
[data-animate="fade-up"] {
    transform: translateY(60px) scale(0.95);
}

[data-animate="fade-down"] {
    transform: translateY(-60px) scale(0.95);
}

[data-animate="fade-left"] {
    transform: translateX(60px) scale(0.98);
}

[data-animate="fade-right"] {
    transform: translateX(-60px) scale(0.98);
}

[data-animate="zoom-in"] {
    transform: scale(0.85);
}

[data-animate="scale-up"] {
    transform: scale(0.85) translateY(30px);
}

[data-animate="blur-in"] {
    transform: translateY(30px) scale(0.95);
}

[data-animate="slide-rotate"] {
    transform: translateX(-40px) rotate(-3deg);
}

/* Cards get special 3D-like treatment */
.project-card[data-animate],
.experience-item[data-animate],
.skill-item[data-animate] {
    transform: translateY(40px) scale(0.95);
}

/* Section headers get elegant entrance */
.section-header[data-animate] {
    transform: translateY(40px) scale(0.97);
}

/* Staggered delays for cascade effect */
.delay-100,
[data-delay="100"] {
    transition-delay: 100ms;
}

.delay-150,
[data-delay="150"] {
    transition-delay: 150ms;
}

.delay-200,
[data-delay="200"] {
    transition-delay: 200ms;
}

.delay-250,
[data-delay="250"] {
    transition-delay: 250ms;
}

.delay-300,
[data-delay="300"] {
    transition-delay: 300ms;
}

.delay-350,
[data-delay="350"] {
    transition-delay: 350ms;
}

.delay-400,
[data-delay="400"] {
    transition-delay: 400ms;
}

.delay-450,
[data-delay="450"] {
    transition-delay: 450ms;
}

.delay-500,
[data-delay="500"] {
    transition-delay: 500ms;
}

.delay-550,
[data-delay="550"] {
    transition-delay: 550ms;
}