/* Base Reset & Variables */
:root {
    --bg-dark: #0A0F1C;
    --text-main: #F1F5F9;
    --text-muted: #94A3B8;

    /* Default Theme (Emerald) */
    --accent-primary: #10B981;
    /* Emerald */
    --accent-secondary: #06B6D4;
    /* Cyan */

    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.05);
    --font-main: 'Outfit', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Theme Switcher Widget */
.theme-switcher {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(10, 15, 28, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 50px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.theme-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}

.theme-btn:hover {
    transform: scale(1.2);
}

.theme-btn:focus,
.theme-btn.active {
    border-color: var(--text-main);
    transform: scale(1.2);
}

/* Themes */
[data-theme="blue"] {
    --accent-primary: #38BDF8;
    /* Sky Blue */
    --accent-secondary: #818CF8;
    /* Indigo */
}

[data-theme="emerald"] {
    --accent-primary: #10B981;
    /* Emerald */
    --accent-secondary: #06B6D4;
    /* Cyan */
}

/* ... other themes ... */

/* About Stats Styling */
.stats-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--text-main);
    transition: var(--transition);
}

.stat-item:hover {
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
}

.stat-item i {
    color: var(--accent-primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Contact Polish */
.contact-container {
    border: 1px solid var(--card-border);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
}

.contact-container:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 50px rgba(16, 185, 129, 0.1);
    /* Subtle Emerald glow hint */
}


[data-theme="sunset"] {
    --accent-primary: #F97316;
    /* Orange */
    --accent-secondary: #D946EF;
    /* Fuchsia */
}

[data-theme="berry"] {
    --accent-primary: #F43F5E;
    /* Rose */
    --accent-secondary: #A855F7;
    /* Purple */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    /* Performance Optimizations */
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* Background Glow Effects - Optimized */
.bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(80px);
    /* Reduced blur for perf */
    opacity: 0.12;
    z-index: -1;
    pointer-events: none;
    /* Hardware Acceleration */
    will-change: transform;
    animation: floatGlow 15s infinite alternate ease-in-out;
    /* Slower = less CPU */
}

.bg-glow-1 {
    top: -100px;
    left: -100px;
    background: radial-gradient(circle, var(--accent-primary), transparent 70%);
}

.bg-glow-2 {
    bottom: -100px;
    right: -100px;
    background: radial-gradient(circle, var(--accent-secondary), transparent 70%);
    animation-delay: -5s;
}

@keyframes floatGlow {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

/* Layout Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 6rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    text-align: center;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 0;
    z-index: 1000;
    background: rgba(10, 15, 28, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    justify-content: space-between;
    align-items: center;
}

/* Menu Toggle (Mobile) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.5rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.05em;
}

.logo .dot {
    color: var(--accent-primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-main);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    /* Subtle glow */
}

/* Navbar Button Specifics */
.navbar .btn-primary {
    background: rgba(255, 255, 255, 0.05);
    /* Transparent/Glass */
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
    font-weight: 600;
}

.navbar .btn-primary:hover {
    background: var(--accent-primary);
    color: var(--bg-dark);
    /* Dark text on hover */
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

/* Base Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.6rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #0A0F1C;
    /* Dark text for contrast */
    border: none;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.2);
    font-weight: 700;
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.3);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 4rem;
}

.hero-content {
    text-align: center;
    max-width: 800px;
}

.greeting {
    display: block;
    font-size: 1.25rem;
    color: var(--accent-blue);
    margin-bottom: 1rem;
    font-weight: 600;
}

.name {
    font-size: 5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.tagline {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.description {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 3rem;
}

.cta-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.7;
}

.mouse {
    width: 26px;
    height: 40px;
    border: 2px solid var(--text-muted);
    border-radius: 20px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--text-main);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 2s infinite;
}

@keyframes scrollWheel {
    0% {
        transform: translate(-50%, 0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, 20px);
        opacity: 0;
    }
}

/* Glass Cards */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2rem;
    transition: var(--transition);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

/* Typing Effect */
.typing-container {
    display: inline-block;
    color: var(--accent-blue);
    font-weight: 700;
    min-width: 200px;
    /* Prevent layout shift */
    text-align: left;
}

.cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background-color: var(--accent-blue);
    margin-left: 5px;
    animation: blink 1s infinite;
    vertical-align: middle;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Skills Marquee */
.marquee-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 1rem 0;
    /* Reduced padding for tighter rows */
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-content {
    display: flex;
    gap: 2rem;
    /* Consistent gap */
    width: max-content;
    will-change: transform;
    /* Hint for performance */
}

/* Specific Animations */
.scroll-left {
    animation: scrollLeft 35s linear infinite;
}

.scroll-right {
    animation: scrollRight 35s linear infinite;
}

.marquee-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    /* Slightly smaller for density */
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 50px;
    transition: var(--transition);
}

.marquee-item:hover {
    border-color: var(--accent-primary);
    color: var(--text-main);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
    /* Interactive pop */
}

@keyframes scrollLeft {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes scrollRight {
    0% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(0%);
    }
}

/* Image Cards */
.project-card {
    height: 400px;
    /* Taller for images */
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.glass-card:hover .card-image {
    transform: scale(1.02);
}

/* Profile Image */
.profile-frame {
    position: relative;
    width: 400px;
    /* Increased size */
    height: 300px;
    /* Landscape Aspect Ratio */
    margin: 0 auto 2rem;
    /* Added spacing at bottom */
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 24px;
    /* Rounded Rectangle */
    border: 3px solid var(--card-border);

    position: relative;
    z-index: 2;
    transition: var(--transition);
    will-change: transform;
    /* Performance Hint */
}

.profile-frame::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 28px;
    /* Matching outer radius */
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    z-index: 1;
    opacity: 0.5;
    transition: var(--transition);
    /* Removed heavy spin animation, replaced with static glow */
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.profile-frame:hover .profile-img {
    transform: scale(0.98);
    border-color: transparent;
}

.profile-frame:hover::before {
    opacity: 1;
    inset: -6px;
    /* Expand glow slightly on hover */
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.4);
}

.profile-frame:hover::before {
    opacity: 1;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-header {
    margin-bottom: 1rem;
}

.badge {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 0.75rem;
}

.project-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.project-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.link-arrow {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.link-arrow:hover {
    color: var(--accent-primary);
    gap: 0.75rem;
}

.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    mix-blend-mode: overlay;
    transition: opacity 0.5s;
}

/* Skills & Timeline */
.skills-col {
    margin-bottom: 4rem;
    /* Spacing since grid gap is gone */
}

.skills-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 3px;
}

.timeline {
    position: relative;
    padding-left: 2rem;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.timeline-item {
    margin-bottom: 2rem;
    position: relative;
}

.timeline-dot {
    position: absolute;
    left: -2.6rem;
    top: 1.5rem;
    width: 1rem;
    height: 1rem;
    background: var(--bg-dark);
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
}

.timeline-content {
    position: relative;
}

.timeline-content .date {
    font-size: 0.875rem;
    color: var(--accent-primary);
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}

/* Contact */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.contact-links {
    margin-top: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.contact-item:hover {
    color: var(--accent-primary);
}

.social-row {
    display: flex;
    gap: 1.5rem;
}

.social-row a {
    color: var(--text-muted);
    transition: var(--transition);
}

.social-row a:hover {
    color: var(--text-main);
    transform: translateY(-3px);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-main);
    font-family: var(--font-main);
    resize: vertical;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.08);
}

.full-width {
    width: 100%;
}

/* Footer */
.footer {
    padding: 3rem 0;
    border-top: 1px solid var(--card-border);
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--text-main);
}

/* Animations */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

.slide-up {
    opacity: 0;
    transform: translateY(30px);
    animation: slideUp 0.8s ease forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 900px) {
    .section-title {
        font-size: 2rem;
    }

    .two-col-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .contact-container {
        grid-template-columns: 1fr;
    }

    .timeline {
        padding-left: 2.5rem;
        /* More space for dots */
        margin-left: 0.5rem;
        border-left: 2px solid rgba(255, 255, 255, 0.1);
    }

    .timeline-dot {
        left: -2.95rem;
        /* Re-aligned dot */
        width: 12px;
        height: 12px;
        top: 1.8rem;
    }

    .skills-col {
        width: 100vw;
        /* Force width constraint */
        margin-left: -1.5rem;
        /* Negative margin to counteract container padding */
        padding: 0 1rem;
        overflow: hidden;
        /* Hard clip */
    }

    .marquee-container {
        mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
        /* Stronger fade */
    }
}

@media (max-width: 768px) {
    .section {
        padding: 4rem 0;
        /* Reduced padding */
    }

    .hero-content .name {
        font-size: 3rem;
        /* Smaller hero text */
    }

    .nav-content {
        flex-direction: row;
        /* Keep logo and hamburger side-by-side */
        justify-content: space-between;
        align-items: center;
        padding-bottom: 0;
        position: relative;
    }

    .menu-toggle {
        display: block;
        /* Show hamburger on mobile */
    }

    .nav-links {
        display: none;
        /* Hide default */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        padding: 2rem 0;
        background: rgba(10, 15, 28, 0.95);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--card-border);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    .nav-links.active {
        display: flex;
        /* Show when toggled */
        animation: slideDown 0.3s ease-out forwards;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .navbar .btn-primary {
        width: 100%;
        /* Full width button */
        text-align: center;
        padding: 0.8rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .about-grid {
        display: flex;
        /* Ensure it stacks */
        flex-direction: column;
    }

    .profile-frame {
        width: 280px;
        height: 210px;
        /* Smaller mobile profile, maintain landscape ratio roughly */
    }

    .footer-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }

    /* Theme switcher position fix for mobile */
    .theme-switcher {
        bottom: 1rem;
        right: 1rem;
        padding: 0.5rem;
    }
}