/* CSS Variables & Reset */
:root {
    /* Color Palette - Jules Studio Inspired */
    --bg-color: #F2F1E9;
    /* Warm Beige/Paper White */
    --text-main: #0E0E0E;
    /* Soft Black */
    --text-muted: #555555;
    --accent-warm: #C8B6A6;
    /* Subtle warm beige/brown for borders/accents */
    --white: #FFFFFF;

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;

    /* UI Elements */
    --border-radius-lg: 30px;
    --border-radius-pill: 100px;
    --btn-color: #0E0E0E;
    --btn-text: #FFFFFF;

    /* Spacing */
    --container-width: 1400px;
    /* Wider for studio feel */
    --section-padding: 8rem 0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 300;
    color: var(--text-main);
    background-color: var(--bg-color);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--text-main);
    line-height: 1.1;
    font-weight: 400;
    /* Sophisticated thin/regular weight */
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

ul {
    list-style: none;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 5vw;
}

/* Floating Navigation - Pill Shape */
.navbar {
    position: fixed;
    top: 2rem;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    pointer-events: none;
    /* Let clicks pass through outside the pill */
}

.nav-pill {
    pointer-events: auto;
    background-color: rgba(255, 255, 255, 0.85);
    /* Glassy default */
    backdrop-filter: blur(12px);
    padding: 0.75rem 0.75rem 0.75rem 2rem;
    border-radius: var(--border-radius-pill);
    display: flex;
    align-items: center;
    gap: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.nav-menu {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.6rem 1.2rem;
    border-radius: var(--border-radius-pill);
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-main);
}

.nav-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.nav-link.btn-cta {
    background-color: var(--btn-color);
    color: var(--btn-text);
}

.nav-link.btn-cta:hover {
    background-color: #2a2a2a;
    /* Slightly lighter black */
    transform: translateY(-2px);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    /* Hidden by default on desktop */
    pointer-events: auto;
    background: var(--white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* Detached Mobile Overlay - Hidden on Desktop */
.mobile-nav-overlay {
    display: none;
}

.bar {
    width: 20px;
    height: 2px;
    background-color: var(--text-main);
    transition: 0.3s;
}

/* Hero Section */
.hero {
    padding: 220px 0 100px;
    min-height: 100vh;
}

.hero-content {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    align-items: center;
}

.hero-text h1 {
    font-size: 5rem;
    margin-bottom: 2rem;
    letter-spacing: -0.03em;
}

.hero-text h1 .italic-accent {
    font-style: italic;
    font-weight: 300;
    color: var(--text-muted);
    font-size: 0.4em;
    /* Significantly smaller as requested */
    display: block;
    line-height: 1.2;
    margin-top: 1rem;
    /* More space */
    margin-bottom: 25px;
}

.hero-bio {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 500px;
    margin-bottom: 3rem;
    font-weight: 300;
}

.hero-image-wrapper {
    position: relative;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    height: 600px;
}

.hero-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-image-wrapper:hover img {
    transform: scale(1.05);
}

/* Expertise / Services - Cards */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 4rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 2rem;
}

.section-title {
    font-size: 3rem;
}

.section-subtitle {
    font-family: var(--font-body);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    margin-top: 3rem;
    display: block;
}

.expertise-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.expertise-card {
    background-color: var(--white);
    padding: 3rem 2rem;
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 350px;
    transition: all 0.4s ease;
}

.expertise-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

.expertise-icon {
    font-size: 2rem;
    color: var(--text-main);
    margin-bottom: 2rem;
}

.expertise-card h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.expertise-card p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Projects - Asymmetric Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4rem 3rem;
}

.project-item {
    group: project-hover;
}

.project-item:nth-child(even) {
    margin-top: 6rem;
    /* Staggered effect */
}

.project-image {
    width: 100%;
    height: 450px;
    /* Taller editorial aspect ratio */
    border-radius: var(--border-radius-lg);
    background-color: #E5E5E5;
    overflow: hidden;
    margin-bottom: 1.5rem;
    position: relative;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.project-item:hover .project-image img {
    transform: scale(1.05);
}

.project-info h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.project-meta {
    font-family: var(--font-body);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Certifications - Clean List */
.certifications-section {
    background-color: var(--white);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    /* Top rounded slightly */
    padding-top: 6rem;
    margin-top: 4rem;
}

.certifications-section .section-header {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.cert-list {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.cert-item {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    padding: 1.5rem 0;
    /* Reduced from 2.5rem for tighter centering */
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    align-items: center;
    transition: background-color 0.3s ease;
}

.cert-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
    padding-left: 1rem;
    /* Subtle indent */
    padding-right: 1rem;
}

.cert-year {
    font-weight: 500;
    color: var(--text-muted);
}

.cert-name {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    text-align: center;
    /* Center horizontally */
    display: block;
    /* Ensure text-align works */
}

.cert-org {
    text-align: right;
    color: var(--text-muted);
}

/* Contact */
.contact-section {
    background-color: var(--text-main);
    /* Dark footer section */
    color: var(--white);
    padding: 8rem 0 4rem;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    margin-top: -30px;
    /* Overlap effect */
    position: relative;
    z-index: 10;
}

.contact-container {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.contact-container h2 {
    color: var(--white);
    font-size: 4rem;
    margin-bottom: 2rem;
}

.contact-container p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 3rem;
}

.btn-white {
    background-color: var(--white);
    color: var(--text-main);
    padding: 1rem 3rem;
    border-radius: var(--border-radius-pill);
    font-weight: 500;
    display: inline-block;
    transition: transform 0.3s ease;
}

.btn-white:hover {
    transform: scale(1.05);
}

footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 6rem;
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    opacity: 0.5;
    font-size: 0.9rem;
}

/* Animations from Script */
.fade-in-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 1024px) {
    :root {
        --container-width: 100%;
        --section-padding: 6rem 0;
    }

    .hero h1 {
        font-size: 3.5rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .project-item:nth-child(even) {
        margin-top: 0;
    }

    .expertise-grid {
        grid-template-columns: 1fr;
    }

    .cert-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: center;
    }

    .cert-org {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .navbar {
        top: 1rem;
        justify-content: space-between;
        padding: 0 1.5rem;
    }

    .nav-pill {
        padding: 0.5rem 1rem;
        gap: 0;
    }

    /* Hide desktop menu completely on mobile */
    .nav-menu {
        display: none !important;
    }

    /* Full Screen Overlay */
    .mobile-nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: var(--bg-color);
        /* Match site bg */
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 2000;
        /* Extremely high z-index */
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .mobile-nav-overlay.active {
        display: flex;
        opacity: 1;
    }

    .mobile-nav-overlay ul {
        text-align: center;
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .mobile-nav-overlay li {
        opacity: 0;
        transform: translateY(20px);
        animation: slideUp 0.5s ease forwards;
    }

    .mobile-nav-overlay li:nth-child(1) {
        animation-delay: 0.1s;
    }

    .mobile-nav-overlay li:nth-child(2) {
        animation-delay: 0.2s;
    }

    .mobile-nav-overlay li:nth-child(3) {
        animation-delay: 0.3s;
    }

    .mobile-nav-overlay li:nth-child(4) {
        animation-delay: 0.4s;
    }

    .mobile-link {
        font-family: var(--font-heading);
        font-size: 2.5rem;
        color: var(--text-main);
    }

    @keyframes slideUp {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .menu-toggle {
        display: flex;
        position: fixed;
        /* Fix button to screen */
        top: 2rem;
        right: 1.5rem;
        z-index: 2001;
        /* Above the overlay */
        background: none;
        border: none;
        cursor: pointer;
        pointer-events: auto;
        /* Ensure it catches clicks outside navbar */
    }

    /* Animate Hamburger to X */
    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-image-wrapper {
        height: 400px;
    }

    .hero-text h1 {
        font-size: 3rem;
    }
}

/* Experience Section (List/Timeline) */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.job-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.job-item:last-child {
    border-bottom: none;
}

.job-date {
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.95rem;
    padding-top: 0.5rem;
    /* Align with title */
}

.job-details h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.job-company {
    display: block;
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.job-details p {
    font-size: 1.05rem;
    color: var(--text-main);
    max-width: 800px;
}

/* Responsive Experience */
@media (max-width: 768px) {
    .job-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .job-date {
        font-size: 0.85rem;
        color: var(--accent-warm);
        margin-bottom: 0.5rem;
    }
}