/* =========================================================================
   SAYARI BHATTACHARYA - PROFESSIONAL PORTFOLIO
   Theme: Cool Minimalist Aesthetic (Deep Blues & Crisp Whites)
   ========================================================================= */

:root {
    /* Color Palette - Cool & Minimalist */
    --bg-primary: #F8F9FA;
    --bg-secondary: #FFFFFF;

    --text-primary: #1E293B;
    --text-secondary: #64748B;

    /* Elegant Accents - Slate Blue & Soft Indigo */
    --accent-1: #3B82F6;
    --accent-2: #8B5CF6;

    /* Glassmorphism Variables */
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px rgba(30, 41, 59, 0.04);
    --glass-shadow-hover: 0 16px 40px rgba(30, 41, 59, 0.08);
}

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

body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6,
.logo {
    font-family: 'Lora', serif;
    color: var(--text-primary);
}

/* Reusable Containers */
.section {
    padding: 6rem 8%;
}

.alt-bg {
    background-color: var(--bg-secondary);
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    font-weight: 600;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* Glassmorphism Components */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    padding: 2.5rem;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--glass-shadow-hover);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.primary-btn {
    background: var(--text-primary);
    color: #FFFFFF;
    border: 1px solid var(--text-primary);
    box-shadow: 0 4px 15px rgba(30, 41, 59, 0.2);
}

.primary-btn:hover {
    background: var(--accent-1);
    border-color: var(--accent-1);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.secondary-btn {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid #CBD5E1;
}

.secondary-btn:hover {
    border-color: var(--text-primary);
    background: var(--bg-secondary);
    transform: translateY(-2px);
}

/* ── Navigation ── */
.glass-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(248, 249, 250, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(203, 213, 225, 0.4);
    padding: 0 8%;
    height: 68px;
    display: flex;
    align-items: center;
    transition: background 0.35s ease, box-shadow 0.35s ease, height 0.35s ease;
}

.glass-nav.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 4px 24px rgba(0, 0, 0, 0.04);
    height: 58px;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Logo */
.logo {
    font-size: 1.15rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: -0.02em;
    color: var(--text-primary) !important;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.logo svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

/* Desktop nav links */
.nav-links {
    list-style: none;
    display: flex;
    gap: 0.25rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-links li a {
    position: relative;
    display: inline-block;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    letter-spacing: 0.01em;
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    transition: color 0.25s ease, background 0.25s ease;
}

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

.nav-links li a:hover {
    color: var(--text-primary);
    background: rgba(59, 130, 246, 0.06);
}

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

.nav-links li a.active {
    color: var(--accent-1);
    background: rgba(59, 130, 246, 0.06);
}

/* ── Hamburger Button ── */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    z-index: 1100;
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.hamburger:hover {
    background: rgba(59, 130, 246, 0.08);
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: var(--text-primary);
    transform-origin: center;
    transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1),
        opacity 0.25s ease,
        width 0.25s ease;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    width: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile menu panel (outside nav, avoids backdrop-filter containing block) ── */
.mobile-menu-panel {
    display: none;
    /* hidden on desktop */
}

/* ── Mobile nav backdrop ── */
.nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.nav-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    padding: 8rem 8% 4rem;
    max-width: 1400px;
    margin: 0 auto;
    overflow: hidden;
}

.hero-title {
    font-size: 4.5rem;
    margin-bottom: 0px;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-image-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image {
    width: 100%;
    max-width: 420px;
    border-radius: 24px;
    position: relative;
    z-index: 2;
    box-shadow: var(--glass-shadow-hover);
    animation: heroFloat 6s ease-in-out infinite alternate;
    transform-style: preserve-3d;
}

@keyframes heroFloat {
    0% {
        transform: translateY(0) rotate(-1deg);
        box-shadow: 0 16px 40px rgba(30, 41, 59, 0.08);
    }

    100% {
        transform: translateY(-15px) rotate(1deg);
        box-shadow: 0 25px 50px rgba(30, 41, 59, 0.12);
    }
}

/* Abstract Blobs */
.blob-1,
.blob-2 {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    z-index: 1;
    opacity: 0.4;
    animation: orbitalFloat 12s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

.blob-1 {
    width: 350px;
    height: 350px;
    background: var(--accent-1);
    top: -50px;
    right: -50px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: var(--accent-2);
    bottom: -50px;
    left: -50px;
    animation-direction: alternate-reverse;
}

@keyframes orbitalFloat {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    33% {
        transform: translate(40px, -40px) scale(1.1) rotate(10deg);
    }

    66% {
        transform: translate(-20px, 30px) scale(0.9) rotate(-10deg);
    }

    100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }
}

/* Utilities */
.mt-1 {
    margin-top: 0.25rem !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.mt-5 {
    margin-top: 4rem !important;
}

.mb-1 {
    margin-bottom: 0.25rem !important;
}

.mb-2 {
    margin-bottom: 0.5rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 2rem !important;
}

.mb-5 {
    margin-bottom: 4rem !important;
}

/* Grids */
.about-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.idp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.idp-grid+.idp-grid {
    margin-top: 6rem;
}

/* Scientific plot/image styling */
.idp-image {
    width: 100%;
    height: auto;
    background: #FFFFFF;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: var(--glass-shadow);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    padding: 2.5rem;
}

.theme-desc {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.theme-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 1rem 0;
}

.theme-keywords {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.project-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

/* Timeline */
.timeline {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
    padding-left: 10px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 21px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--glass-border);
}

.timeline-item {
    margin-left: 45px;
    position: relative;
    padding: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -32px;
    top: 35px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 3px solid var(--accent-1);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.timeline-date {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-1);
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.awards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    text-align: center;
}

.award-card {
    padding: 2rem;
}

.award-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Gallery & Hobbies */
.image-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.gallery-item {
    padding: 1rem;
    text-align: center;
}

.gallery-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1rem;
    cursor: zoom-in;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.02);
}

.gallery-item p {
    font-family: 'Lora', serif;
    font-style: italic;
    color: var(--text-secondary);
    margin: 0;
}

.hobbies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.hobby-card {
    text-align: center;
    padding: 2.5rem;
}

.hobby-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Contact */
.contact-container {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    padding: 4rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    border-radius: 30px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.contact-btn svg {
    width: 20px;
    height: 20px;
    color: var(--accent-1);
}

.contact-btn:hover {
    background: var(--text-primary);
    color: #FFFFFF;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.contact-btn:hover svg {
    color: #FFFFFF;
}

/* Lightbox Constraints */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(248, 249, 250, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#lightbox.active {
    opacity: 1;
    pointer-events: auto;
    cursor: zoom-out;
}

#lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

#lightbox.active img {
    transform: scale(1);
}

.zoomable {
    cursor: zoom-in;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

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

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

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

.education-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: flex-start;
    max-width: 1300px;
    margin: 0 auto;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .about-grid {
        grid-template-columns: 1fr;
    }

    .hero-section {
        gap: 2rem;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .education-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 4rem 5%;
    }

    .hamburger {
        display: flex;
    }

    /* Hide desktop nav links on mobile */
    .nav-links {
        display: none;
    }

    .nav-backdrop {
        display: block;
    }

    /* The separate mobile panel */
    .mobile-menu-panel {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(300px, 80vw);
        background: #ffffff;
        padding: 90px 2rem 2.5rem;
        gap: 0.25rem;
        box-shadow: -8px 0 40px rgba(0, 0, 0, 0.08);
        z-index: 1060;
        transform: translateX(100%);
        transition: transform 0.38s cubic-bezier(0.23, 1, 0.32, 1);
        overflow-y: auto;
    }

    .mobile-menu-panel.active {
        transform: translateX(0);
    }

    .mobile-menu-panel a {
        display: block;
        width: 100%;
        font-family: 'Roboto', sans-serif;
        font-size: 1rem;
        font-weight: 500;
        color: var(--text-secondary);
        text-decoration: none;
        padding: 0.75rem 1rem;
        border-radius: 10px;
        transition: background 0.2s ease, color 0.2s ease;
    }

    .mobile-menu-panel a:hover,
    .mobile-menu-panel a.active {
        color: var(--accent-1);
        background: rgba(59, 130, 246, 0.07);
    }

    .hero-section {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 120px;
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-image {
        max-width: 320px;
    }

    .idp-grid {
        grid-template-columns: 1fr;
    }

    .timeline::before {
        left: 15px;
    }

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

    .timeline-item::before {
        left: -27px;
    }

    .contact-container {
        padding: 2rem 1rem;
    }
}