@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

/* Fallback if Google Sans Flex isn't installed locally. Outfit has a similar vibe, but we prioritize Google Sans Flex */
@font-face {
    font-family: 'Google Sans Flex';
    src: local('Google Sans Flex'), local('Google Sans'), local('Product Sans');
}

:root {
    --primary-color: #d32f2f; /* Red */
    --primary-light: #ff6659;
    --primary-dark: #9a0007;
    --text-main: #202124;
    --text-muted: #5f6368;
    --bg-color: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
    --font-stack: 'Google Sans Flex', 'Google Sans', 'Product Sans', 'Outfit', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-stack);
    color: var(--text-main);
    background-color: var(--bg-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background image as requested */
.background-image-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background-image: url('https://images.unsplash.com/photo-1557683311-eac922347aa1?q=80&w=2029&auto=format&fit=crop'); /* Subtle abstract red/whiteish or clean background */
    background-size: cover;
    background-position: center;
    opacity: 0.05; /* Keep it subtle so text is readable */
    pointer-events: none;
}

/* Typography */
h1, h2, h3, h4, strong {
    font-weight: 600;
    letter-spacing: -0.02em;
}

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

.text-heavy {
    font-size: 1.15rem;
    max-width: 800px;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--text-main);
}

/* Navbar */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: padding 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 1.5rem 0;
    display: flex;
    justify-content: center;
}

#navbar.scrolled {
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 90%;
    max-width: 1200px;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid transparent;
    background: transparent;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Scrolled state for navbar */
#navbar.scrolled .nav-container {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    padding: 0.5rem 2rem;
    max-width: 800px; /* Instead of fit-content for smooth transition */
    box-shadow: var(--shadow-sm);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    color: var(--text-main);
    overflow: hidden;
}

.logo-img {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.nav-brand-text {
    font-weight: 700;
    font-size: 1.2rem;
    white-space: nowrap;
    opacity: 1;
    transform: translateX(0);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

#navbar.scrolled .nav-brand-text {
    opacity: 1; /* Keep visible */
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    transition: gap 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    background-color: rgba(0,0,0,0.05); /* Shade, not red */
}

/* Sections */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 8rem 0;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Hero */
.hero {
    min-height: 100vh;
    padding-top: 12rem;
    position: relative;
    overflow: hidden;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 0.5rem;
}

.hero h2 {
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-weight: 400;
}

.hero-text {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: #444;
}

/* Marquee */
.marquee-container {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    width: 100%;
    padding: 2rem 0;
    display: flex;
}

.marquee {
    display: inline-flex;
    animation: scroll 30s linear infinite;
}

.marquee-container:hover .marquee {
    animation-play-state: paused;
}

.marquee-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0 2rem;
    font-size: 1.5rem;
    color: var(--text-main);
    font-weight: 500;
}

.marquee-item i {
    font-size: 2rem;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Projects & Work (Text Heavy) */
.project-entry, .work-entry {
    margin-bottom: 3rem;
    border-left: 3px solid var(--primary-color);
    padding-left: 1.5rem;
}

.project-entry h3, .work-entry h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.project-desc, .work-desc {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.work-status {
    font-style: italic;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.project-link, .work-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    transition: opacity 0.2s;
}

.project-link:hover, .work-link:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* Contact Section */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-text a {
    color: var(--primary-color);
    text-decoration: none;
}

.contact-text a:hover {
    text-decoration: underline;
}

/* Social Cards */
.social-cards {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.social-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    border-radius: 16px;
    text-decoration: none !important;
    color: var(--text-main);
    min-width: 150px;
    transition: background-color 0.3s ease;
}

.social-card i, .social-card svg {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.social-card span {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.social-card strong {
    font-size: 1rem;
    margin-top: 0.2rem;
}

.social-card:hover {
    background-color: rgba(0,0,0,0.02);
}

.section-divider {
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 0 auto;
    border: none;
    border-radius: 2px;
    opacity: 0.5;
}

/* Contact Form */
.contact-form {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-stack);
    font-size: 1rem;
    background: white;
    transition: border-color 0.3s ease;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.submit-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px; /* pill shape */
    cursor: pointer;
    width: 100%;
    font-family: var(--font-stack);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.submit-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

footer {
    text-align: center;
    padding: 3rem 0;
    color: var(--text-muted);
}

/* Animations */
.fade-in-section {
    opacity: 0;
    transform: translateY(60px) scale(0.95);
    visibility: hidden;
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 1s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform, visibility;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
}

/* Hero Stagger Animations */
.slide-up-stagger {
    opacity: 0;
    transform: translateY(30px);
    animation: slideUpFade 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.3s; }
.stagger-3 { animation-delay: 0.5s; }
.stagger-4 { animation-delay: 0.7s; }
.stagger-5 { animation-delay: 0.9s; }

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Float Animation for logos or elements */
.float-anim {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* Make Project/Work cards scale gently on hover */
.project-entry, .work-entry {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s;
    border-radius: 12px;
    padding: 1.5rem;
    border-left: 4px solid var(--primary-color);
    background: transparent;
}


/* Responsive */
@media (max-width: 768px) {
    .contact-container {
        grid-template-columns: 1fr;
    }
    .hero h1 {
        font-size: 3rem;
    }
    .nav-links {
        display: none; /* simple mobile fix */
    }
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --text-main: #e8eaed;
    --text-muted: #9aa0a6;
    --bg-color: #000000;
    --bg-glass: rgba(0, 0, 0, 0.85);
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
}

/* Theme Switch Styling */
.theme-switch-wrapper {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    z-index: 1001;
}
.theme-switch {
    display: inline-block;
    height: 28px;
    position: relative;
    width: 54px;
}
.theme-switch input {
    display: none;
}
.slider {
    background-color: var(--border-color);
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    border: 1px solid var(--border-color);
}
.slider:before {
    background-color: var(--primary-color);
    bottom: 3px;
    content: "";
    height: 20px;
    left: 2px;
    position: absolute;
    transition: .4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    width: 20px;
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
input:checked + .slider {
    background-color: rgba(0, 0, 0, 0.4);
}
input:checked + .slider:before {
    transform: translateX(30px);
    background-color: var(--primary-light);
}
.sun-icon, .moon-icon {
    color: var(--text-muted);
    z-index: 1;
    transition: color 0.3s;
}
[data-theme="dark"] .moon-icon {
    color: #fff;
}
[data-theme="light"] .sun-icon {
    color: #fff; /* Wait, the toggle circle is primary color. If light mode, the circle is on the left. Wait, left is sun. So sun icon will be covered? */
}

/* Base adjustments for dark mode readability */
[data-theme="dark"] .form-group input, 
[data-theme="dark"] .form-group textarea {
    background: #1e1e1e;
    color: var(--text-main);
}


[data-theme="dark"] .hero-text {
    color: #bbb;
}



/* Make links slightly magnetic or pop on hover (subtle scale) */
a, button, .project-entry, .work-entry {
    cursor: pointer;
}

/* Enhanced Hover Interactions */
a, button {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s;
}
a:active, button:active {
    transform: scale(0.95);
}


[data-theme="dark"] .background-image-container {
    display: none;
}




/* Home Page CTA Buttons */
.home-btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    background: var(--primary-color);
    color: #ffffff;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3);
    text-align: center;
}
.home-btn:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 6px 20px rgba(211, 47, 47, 0.4); }
[data-theme="dark"] .home-btn {
    box-shadow: 0 4px 15px rgba(255, 102, 89, 0.2);
}
[data-theme="dark"] .home-btn:hover {
    box-shadow: 0 6px 20px rgba(255, 102, 89, 0.4);
}


/* Pill Theme Toggler */
.theme-switch-wrapper {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    z-index: 1001;
}
.theme-switch {
    display: inline-block;
    height: 28px;
    position: relative;
    width: 54px;
}
.theme-switch input {
    display: none;
}
.slider {
    background-color: var(--border-color);
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    border: 1px solid var(--border-color);
}
.slider:before {
    background-color: rgba(128, 128, 128, 0.25);
    bottom: 3px;
    content: "";
    height: 20px;
    left: 2px;
    position: absolute;
    transition: .4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    width: 20px;
    border-radius: 50%;
    z-index: 1;
}
input:checked + .slider {
    background-color: rgba(0, 0, 0, 0.4);
}
input:checked + .slider:before {
    transform: translateX(30px);
    background-color: rgba(255, 255, 255, 0.15);
}
.sun-icon, .moon-icon {
    color: var(--text-muted);
    transition: color 0.3s;
}
[data-theme="dark"] .moon-icon {
    color: #fff;
}
body:not([data-theme="dark"]) .sun-icon {
    color: #222;
}




/* Alternating Timeline Layout */
#dynamic-projects, #dynamic-work {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    margin-top: 3rem;
}
.project-entry, .work-entry {
    width: 45%;
    position: relative;
    /* Optional: add a card look if they don't have one */
    background: var(--bg-glass);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}
.project-entry:nth-child(odd), .work-entry:nth-child(odd) {
    align-self: flex-start;
}
.project-entry:nth-child(even), .work-entry:nth-child(even) {
    align-self: flex-end;
}

/* Arrows */


.project-entry:nth-child(even)::before,
.work-entry:nth-child(even)::before {
    content: '';
    position: absolute;
    top: -1rem; 
    left: -35%; 
    width: 32%; 
    height: 6rem; 
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none' stroke='%23888' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M 10,0 C 10,60 50,80 90,80' /%3E%3Cpolyline points='75,65 90,80 75,95' /%3E%3C/svg%3E") no-repeat center/100% 100%;
    opacity: 0.5;
    pointer-events: none;
}
.project-entry:nth-child(odd):nth-child(n+2)::before,
.work-entry:nth-child(odd):nth-child(n+2)::before {
    content: '';
    position: absolute;
    top: -1rem; 
    right: -35%; 
    width: 32%; 
    height: 6rem; 
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none' stroke='%23888' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M 90,0 C 90,60 50,80 10,80' /%3E%3Cpolyline points='25,65 10,80 25,95' /%3E%3C/svg%3E") no-repeat center/100% 100%;
    opacity: 0.5;
    pointer-events: none;
}

/* Responsive Timeline Layout */
@media (max-width: 768px) {
    #dynamic-projects, #dynamic-work {
        gap: 3rem; /* slightly tighter on mobile */
    }
    
    .project-entry, .work-entry {
        width: 100%;
    }
    
    .project-entry:nth-child(odd), .work-entry:nth-child(odd),
    .project-entry:nth-child(even), .work-entry:nth-child(even) {
        align-self: center;
    }
    
    /* Hide the desktop zigzag arrows */
    .project-entry::before,
    .work-entry::before {
        display: none !important;
    }
    
    /* Add a clean vertical downward arrow for mobile */
    .project-entry:not(:last-child)::after,
    .work-entry:not(:last-child)::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        width: 2rem;
        height: 3rem;
        background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='4' x2='12' y2='20'/%3E%3Cpolyline points='18 14 12 20 6 14'/%3E%3C/svg%3E") no-repeat center/contain;
        opacity: 0.4;
        pointer-events: none;
    }
}

@media (max-width: 768px) {
    main {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    .page-header {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* Shimmer Skeleton */
.skeleton {
    background: #e0e0e0;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
[data-theme='dark'] .skeleton {
    background: #2a2a35;
    background: linear-gradient(90deg, #2a2a35 25%, #3a3a4a 50%, #2a2a35 75%);
    background-size: 200% 100%;
}
.skeleton-title { width: 60%; height: 24px; margin-bottom: 10px; }
.skeleton-text { width: 100%; height: 16px; margin-bottom: 8px; }
.skeleton-text.short { width: 80%; }
.skeleton-image { width: 100%; height: 200px; border-radius: 16px; margin-bottom: 15px; }
