/* Modern Executive Theme - Navy Green & White */
:root {
    --primary-color: #0F172A;
    /* Deep Navy / Slate 900 - Executive & Professional */
    --secondary-color: #1E293B;
    /* Slate 800 */
    --accent-color: #2563EB;
    /* Royal Blue - Trustworthy & Modern */
    --background-color: #FFFFFF;
    /* Pure White */
    --surface-color: #F8FAFC;
    /* Very Light Gray/White */
    --text-primary: #111827;
    /* Near Black */
    --text-secondary: #374151;
    /* Dark Gray */
    --text-inverse: #FFFFFF;
    /* White text for dark backgrounds */

    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;

    --border-radius: 4px;
    --spacing-unit: 1rem;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 1.125rem;
    /* Increased from default (usually 16px to 18px) */
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

ul {
    list-style: none;
}

/* Layout Utilities */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 5rem 0;
}

/* Header & Navigation */
header {
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    /* Fixed invalid 'vh' unit */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    height: 80px;
    /* Fixed height for alignment */
    display: flex;
    /* Flex to center content */
    align-items: center;
}

/* Scroll Progress Bar */
.scroll-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 1001;
}

.scroll-progress-bar {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    transition: width 0.1s;
}

header .container {
    width: 100%;
}

nav {
    display: flex;
    justify-content: center;
    /* Center all items (which is just .nav-links now) */
    align-items: center;
    width: 100%;
}

.nav-profile-img {
    width: 65px;
    /* Increased size */
    height: 65px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-color);
    /* Thicker border */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.nav-profile-img:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* Mobile Navigation */
.hamburger {
    display: none;
    cursor: pointer;
    z-index: 1002;
    background: none;
    border: none;
    padding: 10px;
}

.hamburger i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

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

/* Mobile Menu Styles */
@media (max-width: 768px) {
    .hamburger {
        display: block;
        position: absolute;
        right: 20px;
        top: 20px;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 70%;
        background-color: white;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease-in-out;
        z-index: 1000;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a.nav-item {
        font-size: 1.2rem;
        margin: 1rem 0;
    }
}

.nav-links a.nav-item {
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a.nav-item:hover::after {
    width: 100%;
}

/* Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.5rem;
    background-color: var(--primary-color);
    color: white !important;
    font-weight: 600;
    border-radius: var(--border-radius);
    letter-spacing: 0.02em;
    font-size: 0.95rem;
    border: 1px solid var(--primary-color);
}

.btn:hover {
    background-color: var(--secondary-color);
    color: white !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.hero .btn {
    background-color: white;
    color: var(--primary-color) !important;
    border-color: white;
}

.hero .btn:hover {
    background-color: #F0F9FF;
}

/* Hero Section */
.hero {
    background: linear-gradient(-45deg, #0F172A, #1E3A8A, #0F172A, #2e1065);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: white;
    padding: 6rem 0 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Animated Gradient Keyframes */
@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Typing Effect Cursor */
.typing-cursor::after {
    content: '|';
    animation: blink 1s step-start infinite;
    color: var(--accent-color);
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.hero h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
}

.hero-image {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.hero-image:hover {
    transform: scale(1.02);
    border-color: rgba(255, 255, 255, 0.8);
}

.hero p {
    font-size: 1.35rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
    max-width: 900px;
    margin: 0 auto 2.5rem;
    line-height: 1.5;
}

.hero a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.2s;
}

.hero a:hover {
    color: white;
}

/* Section Titles */
.section-title {
    font-size: 2.5rem;
    margin-bottom: 3.5rem;
    text-align: center;
    position: relative;
    color: var(--primary-color);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
    margin: 1rem auto 0;
}

/* Cards */
.card {
    background: white;
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid #E5E7EB;
    /* 3D Tilt settings managed by JS, but adding perspective here helps */
    transform-style: preserve-3d;
    transform: perspective(1000px);
}

/* Experience */
.timeline {
    position: relative;
    max-width: 850px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* Continuous Vertical Line */
.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    /* Aligned with coordinate of bullets */
    height: 100%;
    width: 2px;
    background: #E5E7EB;
    z-index: 0;
}

/* Drawing Line (Progress) */
.timeline-line-progress {
    position: absolute;
    top: 0;
    left: 20px;
    width: 2px;
    background: var(--accent-color);
    height: 0%;
    /* Will be set by JS */
    z-index: 1;
    transition: height 0.1s linear;
}

/* Map Wrapper (Experience + Education) */
#map-wrapper {
    background-image: url('assets/images/world-map.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 120%;
    /* Start slightly zoomed in */
    background-attachment: fixed;
    position: relative;
    /* Use a longer, smoother transition */
    transition: background-position 2s ease-in-out, background-size 2s ease-in-out;
}

/* iOS Safari Fix for background-attachment: fixed */
@supports (-webkit-touch-callout: none) {
    #map-wrapper {
        background-attachment: scroll;
    }
}

@media (max-width: 768px) {
    #map-wrapper {
        background-attachment: scroll;
        /* Disable fixed bg on mobile generally for performance */
    }
}

#map-wrapper.view-chicago {
    background-position: 20% 20% !important;
    /* Adjust coordinates for North America - Shifted North */
    background-size: 220%;
    /* Significant zoom */
}

#map-wrapper.view-india {
    background-position: 68% 35% !important;
    /* Adjust coordinates for India/Asia */
    background-size: 220%;
    /* Significant zoom */
}

#map-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.75);
    /* More visible map (less white) */
    z-index: 1;
    /* Overlay on top of background but below content */
}

#map-wrapper .container {
    position: relative;
    z-index: 10;
    /* Ensure content sits well above the overlay */
}

/* Ensure sections inside are transparent */
#experience,
#education {
    background-color: transparent;
    position: relative;
}

.timeline-item {
    margin-bottom: 4rem;
    /* Removed flex/gap as logo is moving inside */
    padding-left: 3.5rem;
    /* Increased to visual separation */
    border-left: none;
    /* Removing per-item border for continuous line */
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 15px;
    /* Centered on the 2px line at left:20px (20 - 5 = 15) */
    top: 2rem;
    /* Aligned with top of content roughly */
    width: 12px;
    height: 12px;
    background: white;
    border: 2px solid #E5E7EB;
    border-radius: 50%;
    z-index: 2;
    transition: all 0.3s ease;
}

.timeline-item.active::before {
    background: var(--accent-color);
    border-color: var(--accent-color);
    transform: scale(1.3);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.timeline-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 2rem;
    /* Increased padding */
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.company-logo {
    width: 100px;
    /* Increased from 85px */
    height: 100px;
    object-fit: contain;
    background: white;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.timeline-item:hover .timeline-content {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

.timeline-title-group {
    flex: 1;
}

.job-title {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    color: var(--primary-color);
    line-height: 1.2;
}

.company {
    font-family: var(--font-body);
    text-transform: uppercase;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    display: block;
    /* Stacked */
}

.date {
    font-size: 0.95rem;
    color: #6B7280;
    font-style: italic;
    display: block;
    margin-top: 0.25rem;
}

.timeline-item ul {
    list-style: disc;
    padding-left: 1.25rem;
}

.timeline-item li {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* Skills */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    /* Default auto-fit */
    gap: 1.5rem;
    max-width: 1200px;
    /* Increased max-width to fit 3 columns */
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .skills-grid {
        grid-template-columns: repeat(3, 1fr);
        /* Force 3 columns on large screens */
    }
}

.skill-category.wide {
    grid-column: 1 / -1;
}

@media (min-width: 769px) {
    .skill-category.wide {
        grid-column: span 2;
    }
}

.skill-category h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #E5E7EB;
    padding-bottom: 0.75rem;
    color: var(--primary-color);
    text-align: center;
    /* Center headers */
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    /* Center tags within card */
    gap: 0.75rem;
}

.tag {
    background-color: #ECFDF5;
    color: var(--primary-color);
    padding: 0.6rem 1.1rem;
    /* Slightly larger padding */
    border-radius: 4px;
    font-size: 0.9rem;
    /* Slightly larger font */
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid #D1FAE5;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.tag i {
    font-size: 1.1em;
    /* Make icons larger relative to text */
    color: var(--secondary-color);
    /* Slightly distinguishable color */
}

.tag:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    /* Pop out effect */
    box-shadow: var(--shadow-sm);
}

.tag:hover i {
    color: var(--accent-color);
    /* Icon turns gold on hover */
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: white;
    padding: 4rem 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* Mobile Default (Centered) */
.footer-left,
.footer-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

.contact-links {
    display: flex;
    gap: 1.5rem;
    font-size: 1.5rem;
}

.contact-links a:hover {
    color: var(--accent-color);
    transform: translateY(-2px);
}

.resume-download-card {
    background: white;
    padding: 10px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.qr-wrapper img {
    width: 120px;
    height: 120px;
    display: block;
}

/* Desktop: Left/Right Split */
@media (min-width: 769px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        /* Align tops of columns */
    }

    .footer-left {
        align-items: flex-start;
        /* Left align text */
        text-align: left;
        max-width: 45%;
    }

    .footer-right {
        align-items: flex-end;
        /* Right align text and items */
        text-align: right;
        max-width: 45%;
    }

    .resume-download-card {
        align-items: flex-end;
        /* Keep internal items right aligned or centered? QR usually looks best centered in its box, but box aligned right */
        background: transparent;
        /* Remove white box container for cleaner look, just show QR */
        padding: 0;
    }

    .qr-wrapper {
        background: white;
        padding: 10px;
        border-radius: 8px;
        margin-bottom: 10px;
    }
}


/* Mobile Responsive */
@media (max-width: 768px) {
    /* .nav-links is now handled above in Mobile Navigation section */

    .hero h1 {
        font-size: 2.75rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .timeline-item {
        padding-left: 1.5rem;
    }

    .hero p {
        padding: 0 1rem;
    }
}

/* --- Dynamic Animations --- */

/* Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

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

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    70% {
        transform: scale(1.05);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Utility Classes */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Specific Element Tweaks */
.section-title.animate-on-scroll {
    transition-delay: 0.1s;
}

/* Hero Animations (On Load) */
.hero-animate {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.hero-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered Skills */
.skill-tags .tag {
    opacity: 0;
    /* Hidden initially */
}

.skill-tags .tag.pop-in {
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Accessibility Helper for ATS Optimization */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}