/* ---------------------------------------------------------
   1. FONTS & VARIABLES
--------------------------------------------------------- */
@font-face {
    font-family: 'Sequel Sans';
    src: url('fonts/SequelSans-Body.woff2') format('woff2');
    font-weight: 400;
}

:root {
    --black: #000000;
    --white: #ffffff;
    --grey-light: #e0e0e0;
    --grey-medium: #999999;
    --grey-text: #666666;
    --grey-dark: #444444;

    /* UPDATE THESE TO MATCH ADOBE FAMILY NAMES */
    /* Degular's Adobe family name is usually "degular-display" */
    --font-header: "degular-display", sans-serif;
    --font-body: 'Sequel Sans', sans-serif;

    --transition-smooth: 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    --transition-hover: 0.3s ease-out;
}

/* ---------------------------------------------------------
   2. GLOBAL STRUCTURE & SYMMETRY
--------------------------------------------------------- */
html {
    scroll-behavior: auto;
    /* Use dynamic viewport height to prevent mobile browser bars from cutting content */
}

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

body {
    background-color: var(--white);
    color: var(--black);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    /* REMOVE top padding from body, Navbar will handle it */
    padding: 0 2.5rem 2.5rem 2.5rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* Make sure this is 100vh, NOT 100dvh */
    overflow-y: auto !important;
    /* Force vertical scrolling to be allowed */
    display: block;
    /* Change from flex to block to allow natural height */
}


body:not(.homepage) {
    overflow-x: hidden;
}

/* --- 2. THE STICKY GLASS NAVBAR --- */
#navbar-sticky {
    position: -webkit-sticky;
    /* Support for Safari */
    position: sticky;
    top: 0;
    left: 0;
    width: calc(100% + 5rem);
    /* Offsets the body padding (2.5rem + 2.5rem) */
    margin-left: -2.5rem;
    /* Pulls navbar to the very edge of the screen */
    margin-right: -2.5rem;
    padding: 1.5rem 2.5rem 0.5rem 2.5rem;
    /* Restores internal padding for content */

    z-index: 1000;
    /* Higher than content */

    /* The Glass Effect */
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);

    /* Transition for a smooth color change if needed */
    transition: background-color 0.3s ease;
}

/* Ensure images and content have a lower z-index so they slide UNDER the navbar */
#content,
.reveal,
.project-gallery {
    position: relative;
    z-index: 1;
}

/* ---------------------------------------------------------
   3. HEADER & NAVIGATION (Active Page Logic)
--------------------------------------------------------- */
/* ---------------------------------------------------------
   STICKY GLASS NAVBAR
--------------------------------------------------------- */
#navbar-sticky {
    position: sticky;
    top: 0;
    left: 0;
    /* Breakthrough body padding */
    width: calc(100% + 5rem);
    margin-left: -2.5rem;
    margin-right: -2.5rem;

    /* Give the top of the navbar actual padding since body top-padding is 0 */
    padding: 1.5rem 2.5rem 2rem 2.5rem;

    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);

    /* The feather/fade mask */
    mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
    pointer-events: none;
}

#navbar-sticky .header-main,
#navbar-sticky .header-top {
    pointer-events: auto;
    /* Ensure links stay clickable */
}

/* Ensure images and content have a lower z-index so they slide UNDER the navbar */
#content,
.reveal,
.project-gallery {
    position: relative;
    z-index: 1;
}

.intro-text {
    font-family: var(--font-body);
    font-size: 0.95rem;
    max-width: 850px;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    width: 100%;
    margin-bottom: 2rem;
}

.logo,
.nav-link {
    font-family: var(--font-header);
    font-size: clamp(3rem, 8vw, 5.5rem);
    text-decoration: none;
    letter-spacing: -0.04em;
    line-height: 0.85;
    color: var(--grey-medium);
    transition: color var(--transition-hover);
}

.nav-link {
    margin-left: 1.5rem;
}

/* Interaction States */
.logo:hover,
.nav-link:hover {
    color: var(--black) !important;
}

#page-index .logo {
    color: var(--black) !important;
}

/* JS-injected classes for current page */
.nav-link.active-nav {
    color: var(--black) !important;
}

.logo.inactive-logo {
    color: var(--grey-medium) !important;
}

/* ---------------------------------------------------------
   4. GENERAL CONTENT WRAPPER
--------------------------------------------------------- */
#content {
    flex: 1;
    height: auto;
    display: flex;
    flex-direction: column;
}

/* ---------------------------------------------------------
   5. INDEX HERO
--------------------------------------------------------- */
.hero-container {
    width: 100%;
    height: 100%;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: var(--grey-light);
    filter: grayscale(100%);
    display: block;
}

/* ---------------------------------------------------------
   6. ABOUT PAGE LAYOUT
--------------------------------------------------------- */
.about-main-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: start;
    width: 100%;
    margin-top: 2rem;
}

.profile-img-container {
    width: 100%;
    height: 100%;
    max-height: 62vh;
    background-color: var(--grey-light);
    overflow: hidden;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
}

.info-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    text-align: left;
}

/* Ensure project rows are multi-column on desktop */
.row-split-right {
    grid-template-columns: 1fr 2fr;
}

.row-3-col {
    grid-template-columns: repeat(3, 1fr);
}

.row-2-col {
    grid-template-columns: 2fr 1fr;
}

.row-split-asym {
    grid-template-columns: 1fr 2fr;
}

.info-item {
    margin-bottom: 1.5rem;
}

.info-item p .role {
    color: var(--grey-dark);
    display: block;
    margin-top: 2px;
}

.info-item .date {
    font-size: 0.9rem;
    color: var(--grey-text);
}

.contact-footer {
    display: flex;
    gap: 4rem;
    padding-top: 1rem;
    margin-top: 0px;
    width: 100%;
}


.contact-group a {
    text-decoration: none;
    color: var(--black);
    display: flex;
    align-items: center;
    /* Centers icon with text */
    gap: 12px;
    /* Space between icon and text */
    font-family: var(--font-body);
    font-size: 1rem;
    transition: opacity 0.3s ease;
}

.contact-group a:hover {
    opacity: 0.5;
}

.footer-icon {
    width: 20px;
    height: 20px;
    /* stroke-width is controlled directly in the SVG HTML for precision */
    flex-shrink: 0;
}

/* ---------------------------------------------------------
   7. WORK GRID (Page 3) - Fluid Image Sizes
--------------------------------------------------------- */
.work-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    width: 100%;
    /* Aligns items to the top so different heights don't stretch boxes */
    align-items: start;
}

.project-card {
    text-decoration: none;
    color: var(--black);
    position: relative;
    display: block;
}

.project-box {
    position: relative;
    width: 100%;
    /* REMOVED aspect-ratio: 1/1 to allow natural image height */
    background-color: var(--grey-light);
    /* border: 1px solid var(--black); */
    overflow: hidden;
    line-height: 0;
    /* Removes tiny gap at bottom of images */
}

.project-image {
    width: 100%;
    height: auto;
    display: block;
    filter: grayscale(100%);
    /* Use the same luxury timing for color as the movement */
    transition: filter 1.2s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: filter;
}

.project-card:hover .project-image {
    filter: grayscale(0%);
}

/* Labels & Tags (Now pinned to natural image corners) */
.project-label {
    font-family: "degular-display", sans-serif !important;
    position: absolute !important;
    top: 1.5rem;
    left: 1.5rem;
    margin: 0;
    /* Clear any default margins */
    font-size: 2rem;
    font-weight: 400;
    line-height: 1;
    /* Reset line height for text */
    pointer-events: none;
}

.tag-row {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    display: flex;
    gap: 0.5rem;
    line-height: 1;
    /* Reset line height for pills */
}

.pill {
    font-family: "degular-display", sans-serif !important;
    font-size: 0.75rem;
    padding: 0.4rem 1.2rem;
    border: 1px solid var(--black);
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    /* Slight backing for legibility */
    backdrop-filter: blur(5px);
    /* Optional: glass effect over image */
    text-transform: uppercase;
}

/* Ensure the About page specifically isn't locked */
#page-about {
    height: auto !important;
    overflow: visible !important;
}

/* ---------------------------------------------------------
   PROJECT PAGE SPECIFIC LAYOUTS
--------------------------------------------------------- */

#page-project .logo {
    color: var(--grey-medium) !important;
}

#page-project .project-img {
    filter: grayscale(0%) !important;
    /* Forces original color */
}

#page-project .project-img:hover {
    filter: grayscale(0%) !important;
    cursor: default;
    /* Optional: removes the pointer finger */
}

.project-header {
    margin-bottom: 3rem;
}

.project-title {
    font-family: var(--font-header);
    font-size: clamp(3rem, 8vw, 5rem);
    letter-spacing: -0.04em;
    line-height: 0.9;
    margin-bottom: 0.5rem;
    font-weight: 400;
    /* This removes the bold effect */
}

.project-description.pill {
    display: inline-block;
    /* Shrinks the box to fit the text */
    font-size: 0.75rem;
    padding: 0.5rem 1.2rem;
    /* Vertical and Horizontal padding */
    border: 1px solid var(--black);
    border-radius: 30px;
    /* Creates the rounded pill ends */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 1.5rem;
    /* Space between the Title and the Pill */
    color: var(--black);
    line-height: 1;
}

/* Gallery Container */
.project-gallery {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    /* Spacing between rows */
    width: 100%;
    padding-bottom: 1rem;
}

.gallery-row {
    display: grid;
    gap: 1.5rem;
    width: 100%;
}

.project-img {
    width: 100%;
    height: auto;
    display: block;
    /* border: 1px solid var(--black); */
    filter: grayscale(100%);
    transition: filter 0.6s ease;
}

.project-img:hover {
    filter: grayscale(0%);
}

.caption {
    font-size: 0.8rem;
    color: var(--black);
    line-height: 1.4;
    max-width: none;
}

/* ROW TYPES BASED ON PDF */

/* 1/3 Empty Left, 2/3 Image Right */
.row-split-right {
    grid-template-columns: 1fr 2fr;
}

/* Equal 3 columns */
.row-3-col {
    grid-template-columns: repeat(3, 1fr);
}

/* 2/3 Image Left, 1/3 Caption Right */
.row-2-col {
    grid-template-columns: 2fr 1fr;
}

/* Asymmetric: Vertical vs Horizontal */
.row-split-asym {
    grid-template-columns: 1fr 2fr;
    align-items: stretch;
    /* Change from start to stretch */
}

.row-split-asym .gallery-item {
    display: flex;
}

.row-split-asym .project-img {
    height: 100%;
    /* Forces image to fill the grid height */
    object-fit: cover;
    /* Ensures the landscape image fills the height without stretching */
}

.gallery-item.tall img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

/* Full Width (1 Column) */
.row-full-width {
    grid-template-columns: 1fr;
}

/* Temporary styles for a placeholder box if image is missing */
.row-full-width .gallery-item {
    width: 100%;
}

/* ---------------------------------------------------------
   RESPONSIVE
--------------------------------------------------------- */
/* ---------------------------------------------------------
   8. RESPONSIVE POLISH (MOBILE)
--------------------------------------------------------- */
@media (max-width: 768px) {
    body {
        padding: 0 1.5rem 1.5rem 1.5rem;
    }

    /* FIX: Force EVERY project row to be 1 column only */
    .gallery-row,
    .row-split-right,
    .row-3-col,
    .row-2-col,
    .row-split-asym {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem;
    }

    /* FIX: About Page - Force 1 column and align strictly LEFT */
    .about-main-grid,
    .info-columns {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        text-align: left !important;
        gap: 2rem;
    }

    .experience-list,
    .education-list {
        width: 100%;
        text-align: left !important;
    }

    .info-item {
        text-align: left !important;
        width: 100% !important;
        margin-bottom: 2rem;
    }

    /* Navigation sizing */
    .logo,
    .nav-link {
        font-size: 2.8rem;
    }

    #navbar-sticky {
        width: calc(100% + 3rem);
        margin-left: -1.5rem;
        margin-right: -1.5rem;
        padding: 1rem 1.5rem 1.5rem 1.5rem;
    }

    /* Homepage Bottom Alignment */
    body.homepage {
        height: 100dvh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    body.homepage #content {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
    }

    .hero-container {
        width: 100%;
    }

    .hero-image {
        max-height: 50dvh;
        object-fit: contain;
    }

    .intro-text {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
}

/* Prevent text overlapping on About/Work pages */
/* --- ABOUT PAGE DESKTOP RESET --- */
.about-main-grid {
    display: grid !important;
    /* Force grid back on desktop */
    grid-template-columns: 1fr 1.5fr;
    /* Left image, Right text */
    gap: 4rem;
    align-items: start;
    width: 100%;
    margin-top: 2rem;
}

.profile-column {
    width: 100%;
}

.profile-img-container {
    width: 100%;
    max-height: 70vh;
    /* Prevents image from being too tall */
    overflow: hidden;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.info-columns {
    display: grid !important;
    /* Force 2 columns for Exp/Edu */
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    text-align: left;
}

/* ---------------------------------------------------------
   8. ANIMATIONS & RESPONSIVE
--------------------------------------------------------- */
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1024px) {
    .work-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .about-main-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    /* --- 1. HOMEPAGE STRUCTURE --- */
    body.homepage {
        display: flex;
        flex-direction: column;
        height: 100dvh;
        /* Fill the screen */
    }

    body.homepage #content {
        flex: 1;
        /* Take up all available space between navbar and bottom */
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        /* Pushes content to the bottom */
    }

    /* --- 2. HERO CONTAINER (Not Flushed) --- */
    .hero-container {
        width: 100%;
        /* Stays inside the body padding */
        margin-bottom: 0;
        /* Respects the body's bottom padding */
        line-height: 0;
        /* Removes any tiny text-gap at the bottom */
    }

    .hero-image {
        width: 100%;
        height: auto;
        /* Limits height so it doesn't overlap the navbar on short screens */
        max-height: 60dvh;
        object-fit: contain;
        /* Ensures the whole image is visible without cropping */
    }

    .header-main {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-link {
        margin-left: 0;
        margin-right: 1.5rem;
    }

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

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

    .contact-footer {
        display: flex !important;
        flex-direction: column !important; /* This forces the one-column layout */
        gap: 1.5rem !important;            /* Reduces the gap for mobile */
        padding: 2rem 0 !important;        /* Adjusts spacing */
        align-items: flex-start;
        width: 100%;
    }

    /* Prevents long links (like LinkedIn) from pushing the page width out */
    .contact-group a {
        word-break: break-all; 
        font-size: 0.9rem; /* Slightly smaller text helps on small screens */
    }

    /* Fix potential overflow from the navbar calculation */
    #navbar-sticky {
        max-width: 100vw;
        overflow-x: hidden;
    }
}



/* ---------------------------------------------------------
   9. LINK PILL STYLING
--------------------------------------------------------- */

.link-pill {
    display: inline-block;
    text-decoration: none;
    font-family: var(--font-header);
    /* Matches your other pills */
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--black);

    /* The "Outline" state */
    padding: 0.4rem 1.2rem;
    border: 1px solid var(--black);
    border-radius: 30px;
    background-color: transparent;

    /* Smooth transition for the hover effect */
    transition: background-color 0.3s ease, color 0.3s ease;
    margin-left: 5px;
    /* Adds space between text and pill */
    line-height: 1;
    vertical-align: middle;
}

/* The "Hover" state */
.link-pill:hover {
    background-color: var(--black);
    color: var(--white) !important;
    /* Forces text to white */
}



/* ---------------------------------------------------------
   10. ANIMATION
--------------------------------------------------------- */
html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}


/* ---------------------------------------------------------
   11. REFINED SCROLL REVEAL (ENTRANCE)
--------------------------------------------------------- */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1), 
                transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.reveal.active {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Staggered Entrance for Work Grid */
.work-grid .project-card.reveal:nth-child(3n+1) { transition-delay: 0.1s; }
.work-grid .project-card.reveal:nth-child(3n+2) { transition-delay: 0.2s; }
.work-grid .project-card.reveal:nth-child(3n+3) { transition-delay: 0.3s; }


/* ---------------------------------------------------------
   12. DYNAMIC FLOATING & LUXURY HOVER
--------------------------------------------------------- */

/* Keyframe for the slow drift */
@keyframes ambientFloat {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
    100% {
        transform: translateY(0px);
    }
}

#page-work .project-box {
    transition: transform 1.2s cubic-bezier(0.19, 1, 0.22, 1), 
                box-shadow 1.2s cubic-bezier(0.19, 1, 0.22, 1);
    position: relative;
    will-change: transform, box-shadow;
    backface-visibility: hidden;
}

/* GROWING and LIFTING effect */
#page-work .project-card:hover .project-box {
    transform: scale(1.05) translateY(-20px) !important;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.12), 
                0 20px 40px rgba(0, 0, 0, 0.05) !important;
    z-index: 10;
}

/* Sync the color fade with the growth */
#page-work .project-card:hover .project-image {
    filter: grayscale(0%) !important;
    transition: filter 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Ensure hovered card is on top */
#page-work .project-card:hover {
    z-index: 100;
}

/* ---------------------------------------------------------
   13. AURA & OTHER FIXES
--------------------------------------------------------- */

#cursor-aura {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--aura-color, rgba(0, 0, 0, 0.08)) 0%, rgba(0, 0, 0, 0) 70%) !important;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%);
    filter: blur(20px);
    display: block !important;
}