/* --- Variables & Theme --- */
:root {
    /* Base Colors - Deep Slate/Blue Theme */
    --bg-color: #020617;
    /* Slate 950 */
    --bg-secondary: #0f172a;
    /* Slate 900 */
    --card-bg: rgba(30, 41, 59, 0.4);
    /* Glassy Slate 800 */

    /* Text Colors */
    --text-primary: #f8fafc;
    /* Slate 50 */
    --text-secondary: #94a3b8;
    /* Slate 400 */
    --text-accent: #38bdf8;
    /* Sky 400 */

    /* Accent Colors - Electric Blue & Violet */
    --accent-primary: #3b82f6;
    /* Blue 500 */
    --accent-secondary: #8b5cf6;
    /* Violet 500 */
    --accent-glow: rgba(59, 130, 246, 0.5);
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;
    --spacing-xxl: 8rem;

    /* UI Elements */
    --border-radius-sm: 8px;
    --border-radius: 16px;
    --border-radius-lg: 24px;
    --nav-height: 80px;

    /* Animations */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Glassmorphism */
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    /* More subtle border */
    --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --glow-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

[data-theme="light"] {
    --bg-color: #f8fafc;
    --bg-secondary: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.6);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-accent: #0284c7;

    --accent-primary: #0284c7;
    --accent-secondary: #4f46e5;
    --accent-glow: rgba(2, 132, 199, 0.3);
    --accent-gradient: linear-gradient(135deg, #0284c7 0%, #4f46e5 100%);

    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.05);
    --glow-shadow: 0 0 20px rgba(2, 132, 199, 0.1);
}

/* --- Reset & Base Styles --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.03) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.03) 0%, transparent 20%);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.5s ease, color 0.5s ease;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(3rem, 6vw, 4.5rem);
    margin-bottom: var(--spacing-md);
}

h2 {
    font-size: clamp(2.25rem, 4vw, 3.5rem);
    margin-bottom: var(--spacing-lg);
}

p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    font-size: 1.05rem;
}

.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    /* Fixes gradient clipping sometimes */
}

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

/* --- Layout Utilities --- */
.container {
    width: 90%;
    max-width: 1280px;
    /* Slightly wider for modern feel */
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section {
    padding: var(--spacing-xxl) 0;
    position: relative;
}

/* Add extra top spacing for non-hero sections */
.section:not(.hero-section) {
    padding-top: calc(var(--nav-height) + var(--spacing-xl));
}

.section-title {
    text-align: center;
    position: relative;
    display: block;
    margin: 0 auto var(--spacing-xl);
    width: fit-content;
}

.section-title::after {
    content: '';
    display: block;
    margin: var(--spacing-sm) auto 0;
    width: 60px;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

/* --- Components --- */
/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.25rem;
    border-radius: 100px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: var(--font-heading);
    letter-spacing: 0.02em;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    /* Reverse gradient for hover */
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--accent-secondary);
    color: var(--text-primary);
    margin-left: var(--spacing-md);
    backdrop-filter: blur(4px);
}

.btn-secondary:hover {
    background: rgba(139, 92, 246, 0.1);
    transform: translateY(-2px);
    border-color: var(--accent-primary);
}

/* Glass Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--glass-shadow);
}

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.25rem 0;
    background: transparent;
    transition: all 0.4s ease;
}

.navbar.scrolled {
    padding: 1rem 0;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    gap: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem 1.5rem;
    border-radius: 100px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(8px);
}

.nav-links a {
    font-weight: 500;
    position: relative;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

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

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

.nav-links a:hover::after {
    transform: translateX(-50%) scaleX(1);
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
}

.theme-toggle:hover {
    background: var(--accent-gradient);
    border-color: transparent;
    color: #fff;
    transform: rotate(15deg);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* --- Hero Section --- */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: var(--nav-height);
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.greeting {
    display: inline-block;
    font-size: 1rem;
    color: var(--accent-primary);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: var(--spacing-md);
    background: rgba(59, 130, 246, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    backdrop-filter: blur(4px);
}

.hero-title {
    line-height: 1.1;
    margin-bottom: var(--spacing-md);
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-lg);
    max-width: 600px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
    margin-top: var(--spacing-lg);
}

/* Hero Visual (Background Blobs) */
.hero-visual {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    filter: blur(100px);
    opacity: 0.4;
    /* Increased opacity for dark mode */
    animation: blob-float 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
    mix-blend-mode: screen;
    /* Creates nicer blending in dark mode */
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: var(--accent-primary);
    top: -10%;
    right: -10%;
    animation-delay: 0s;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: var(--accent-secondary);
    bottom: -10%;
    left: -10%;
    animation-delay: -5s;
    animation-direction: alternate-reverse;
}

.blob-3 {
    width: 400px;
    height: 400px;
    background: #06b6d4;
    /* Cyan */
    bottom: 20%;
    right: 20%;
    animation: blob-float 25s infinite alternate-reverse;
    opacity: 0.3;
}

@keyframes blob-float {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }

    33% {
        transform: translate(30px, -50px) rotate(10deg) scale(1.1);
        border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%;
    }

    66% {
        transform: translate(-20px, 20px) rotate(-10deg) scale(0.9);
        border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%;
    }

    100% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }
}

/* --- About Section --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: start;
    margin-top: var(--spacing-lg);
}

.profile-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--glass-shadow), var(--glow-shadow);
    border-color: rgba(255, 255, 255, 0.15);
}

.profile-icon {
    font-size: 3.5rem;
    color: var(--accent-primary);
    margin-bottom: var(--spacing-md);
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.skills-wrapper {
    margin-top: var(--spacing-lg);
}

.skills-wrapper h3 {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    opacity: 0.9;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    justify-content: center;
}

.skill-tag {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.9rem;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
    color: var(--text-secondary);
}

.skill-tag:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

/* --- Education Section --- */
.about-visual {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.education-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    border-left: 3px solid var(--accent-primary);
    transition: var(--transition);
}

.education-card:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: var(--glass-shadow);
}

.edu-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-xs);
    font-size: 0.85rem;
    color: var(--text-accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.edu-grade {
    color: var(--accent-secondary);
}

.education-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.education-card h4 {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: var(--spacing-md);
}

.edu-skills {
    font-size: 0.9rem;
    color: var(--text-secondary);
    opacity: 0.8;
    line-height: 1.5;
}

/* --- Projects Section --- */
.carousel-wrapper {
    position: relative;
    width: 100%;
    margin-top: var(--spacing-lg);
}

.projects-grid {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg) var(--spacing-xs);
    /* Padding for hover space */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.projects-grid::-webkit-scrollbar {
    display: none;
}

.project-card {
    flex: 0 0 calc((100% - (2 * var(--spacing-lg))) / 3);
    min-width: 0;
    /* Allow shrinking if needed */
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(12px);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4);
    border-color: rgba(139, 92, 246, 0.3);
}

.project-image {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.project-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(2, 6, 23, 0.6) 100%);
}

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

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

/* Gradients for placeholders */
.gradient-1 {
    background: linear-gradient(135deg, #FF6B6B 0%, #556270 100%);
}

.gradient-2 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.gradient-3 {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.project-content {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: var(--spacing-md);
}

.project-content h3 {
    font-size: 1.4rem;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.project-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: auto;
    /* Push content down */
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: var(--spacing-sm);
    min-height: 60px;
    /* Ensure consistency for "same level" alignment */
    align-content: flex-start;
    /* Align tags to top so first rows match */
}

.project-tags span {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.project-links {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
}

.link-icon {
    font-size: 0.9rem;
    color: var(--text-accent);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}

.link-icon:hover {
    color: var(--accent-secondary);
    transform: translateX(2px);
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.carousel-wrapper:hover .scroll-btn {
    opacity: 1;
    pointer-events: auto;
}

.scroll-btn:hover {
    background: var(--accent-primary);
    border-color: transparent;
    transform: translateY(-50%) scale(1.1);
}

.left-btn {
    left: -24px;
}

.right-btn {
    right: -24px;
}

/* --- Achievements Section (Cards) --- */
.achievements-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.achievement-card {
    display: grid;
    grid-template-columns: 280px 1fr;
    /* Fixed image width */
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    overflow: hidden;
    backdrop-filter: blur(12px);
    transition: var(--transition);
}

.achievement-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--glass-shadow);
    border-color: rgba(255, 255, 255, 0.1);
}

.achievement-card .project-image {
    height: 100%;
    /* Fill full height */
    min-height: 220px;
    position: relative;
}

.achievement-card .project-image img,
.achievement-card .project-image .placeholder-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-cert {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.9);
}

.cert-nptel {
    background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
}

.cert-intel {
    background: linear-gradient(135deg, #059669 0%, #34d399 100%);
}

.achievement-card .project-content {
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* --- Contact Section --- */
.contact-section {
    position: relative;
    overflow: hidden;
}

.contact-wrapper {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl);
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

.contact-wrapper p {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-lg);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.social-links a {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.4rem;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--accent-gradient);
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 10px 20px -5px var(--accent-glow);
    border-color: transparent;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: var(--spacing-lg) 0;
    border-top: 1px solid var(--glass-border);
    margin-top: 0;
    /* Removing spacing since safe to act as part of contact section essentially */
    color: var(--text-secondary);
    background: var(--bg-color);
    position: relative;
    z-index: 10;
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .achievement-card {
        grid-template-columns: 240px 1fr;
    }
}

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

    .project-card {
        flex: 0 0 280px;
        /* Smaller width on mobile */
    }

    .achievement-card {
        grid-template-columns: 1fr;
        grid-template-rows: 220px auto;
    }

    .projects-grid {
        padding-left: var(--spacing-md);
        padding-right: var(--spacing-md);
        scroll-snap-type: x mandatory;
    }

    .project-card {
        scroll-snap-align: center;
    }

    .scroll-btn {
        display: none;
    }

    .nav-links {
        display: none;
        /* Add mobile menu later if requested */
    }
}

/* --- Animations --- */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

/* --- Certificate Modal (PiP Style) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background: transparent;
    max-width: 90%;
    max-height: 85vh;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    object-fit: contain;
}

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

.close-modal {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2001;
    line-height: 1;
    padding-bottom: 4px;
    /* Optical adjustment for &times; */
}

.close-modal:hover {
    color: #fff;
    background: var(--accent-primary);
    transform: rotate(90deg) scale(1.1);
    border-color: transparent;
}
/* --- Mobile Navigation --- */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
}

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

    .nav-links {
        display: flex; /* Override previous none */
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 70%;
        max-width: 300px;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: var(--spacing-lg);
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1000;
        border-left: 1px solid var(--glass-border);
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    }

    .nav-links.active {
        transform: translateX(0);
    }
    
    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links a {
        display: block;
        font-size: 1.25rem;
        padding: var(--spacing-sm);
    }
}

