:root {
    --background: #F5F6EE;
    --text: #111111;
    --accent2: #FFE77A;
    --accent: #f671ff;
    --transition: 0.35s ease;
}



body.dark {

    --background: #111111;

    --text: #F5F6EE;

    --accent: #f671ff;

    --accent2: #FFE77A;

}



* {

    margin: 0;

    padding: 0;

    box-sizing: border-box;

}



html {

    scroll-behavior: smooth;

}



body {

    background: var(--background);

    color: var(--text);

    font-family:

        "inter",

        sans-serif;

    transition:

        background-color var(--transition),

        color var(--transition);

    min-height: 100vh;

}



a {

    color: inherit;

    text-decoration: none;

}



h2 {

    font-size: 24px;

}



.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    padding: 0 60px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    z-index: 100;
    background: var(--background);
    opacity: 1;
    transition:
        opacity 0.4s ease,
        background-color 0.35s ease;
}



.navbar.nav-hidden {

    opacity: 0;

    pointer-events: none;

}



/* Everything inside the navbar can receive clicks */



.navbar a,

.theme-toggle {

    pointer-events: auto;

}



/* LEFT */

.nav-left {
    display: flex;
    gap: 28px;
    justify-self: start;
    transition:
        opacity 0.4s ease,
        transform 0.4s ease;
}



.nav-left a {
    font-size: 16px;
    position: relative;
    transition: font-weight 0.2s ease;
}



.nav-left a:hover {

    font-weight: 700;

    color: var(--accent);



}



/* CENTER */



.nav-name {
    justify-self: center;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    transition:
        opacity 0.4s ease,
        transform 0.4s ease;
}





/* RIGHT */



.theme-toggle {

    justify-self: end;

    width: 38px;

    height: 38px;

    border: 1px solid #828282;

    border-radius: 50%;

    background: transparent;

    color: var(--text);

    cursor: pointer;

    display: flex;

    align-items: center;

    justify-content: center;

    transition:

        background-color var(--transition),

        color var(--transition),

        border-color var(--transition),

        transform 0.2s ease;

}



.theme-toggle:hover {

    transform: rotate(10deg);

}



.theme-icon {

    font-size: 25px;

}



/*

  When the user scrolls down,

  the left navigation and name disappear.

*/



.navbar.nav-hidden .nav-left,

.navbar.nav-hidden .nav-name {

    opacity: 0;



    transform: translateY(-12px);



    pointer-events: none;

}





/* =================================

   HERO — 90% OF VIEWPORT

\================================= */





/* Pinned hero background */

.hero {

    position: fixed;

    inset: 0;

    z-index: 0;



    width: 100%;

    height: 100vh;

    height: 100svh;

    min-height: 0;



    padding: 60px 32px 40px;



    display: flex;

    align-items: center;

    justify-content: center;



    pointer-events: none;

}



/* Hero title */

.hero-title {

    width: 55vw;

    max-width: 900px;



    font-size: clamp(38px, 11vw, 70px);

    font-weight: 600;

    line-height: 0.9;

    text-align: center;



    opacity: 1;

    transform: translateY(0);

    will-change: opacity, transform;

}



.typing-wrapper {

    display: inline-flex;

    align-items: baseline;

}



.changing-word {

    display: inline;

    white-space: pre;

}



.typing-cursor {

    display: inline-block;

    width: 0.055em;

    height: 0.85em;

    margin-left: 0.08em;

    background: currentColor;

    animation: cursor-blink 0.9s steps(1) infinite;

}





/* Cursor blink */



@keyframes cursor-blink {



    0%,

    45% {

        opacity: 1;

    }



    46%,

    100% {

        opacity: 0;

    }

}



/* works */



/* Project section moves over the pinned hero */

.works {

    position: relative;

    z-index: 2;



    margin-top: 100vh;

    margin-top: 100svh;



    /* min-height: 200vh;  */

    /* JavaScript adjusts this */

    padding: 0;



    background: transparent;

    margin-bottom: 0px;

}



.works-stage {

    position: sticky;

    top: 0;



    width: 100%;

    height: 100vh;

    height: 100svh;



    display: flex;

    align-items: center;

    justify-content: center;



    overflow: hidden;

}



.heading {

    padding: 30px 32px 30px;

    display: flex;

    justify-content: center;

    margin-bottom: 30px;

}



.heading h2 {

    font-size: 24px;

    font-weight: 600;

    text-align: center;

}



.project-grid {

    display: grid;

    grid-template-columns: repeat(3, minmax(0, 1fr));

    width: 100%;

    max-width: 1500px;



}



/* Cards emerge from the background */

.project-card {
    position: relative;
    min-width: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 1;
}



.project-card.visible {
    opacity: 1;
    transform: scale(1);
}



.project-card.hidden-project {
    display: none;
}



.project-image {
    position: relative;
    width: 100%;
    overflow: hidden;
}



.project-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;

    filter: brightness(1);
    transform: scale(1);

    transition:
        filter 0.55s ease,
        transform 0.8s cubic-bezier(0.2, 0.65, 0.3, 1);
}

/* Dark translucent layer + project text */

.project-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 24px;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.project-info {
    width: 100%;
    color: var(--accent);
    transform: translateY(12px);
    opacity: 0;
    transition:
        opacity 0.4s ease,
        transform 0.4s ease;
}

.project-info h3 {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: clamp(18px, 2vw, 26px);
    line-height: 1.1;
    font-weight: 600;
}

.project-info p {
    max-width: 360px;
    margin: 0;
    color: var(--accent);
    font-size: clamp(13px, 1.2vw, 16px);
    line-height: 1.45;
}

.project-view {
    display: inline-block;
    margin-top: 18px;
    color: var(--accent);
    font-size: 16px;
}

/* Hover and keyboard focus */
.project-card:hover .project-image img,
.project-card:focus-visible .project-image img {
    filter: brightness(0.45);
    transform: scale(1.05);
}

.project-card:hover .project-overlay,
.project-card:focus-visible .project-overlay {
    opacity: 1;
}

.project-card:hover .project-info,
.project-card:focus-visible .project-info {
    opacity: 1;
    transform: translateY(0);
}

/* MODAL OVERLAY */

.project-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .3s ease, visibility .3s ease;
}



.project-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.read-more {
    display: inline-block;
    margin-top: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;

}

/* MAIN PANEL */
.modal-panel {
    width: 100%;
    height: 100%;
    max-width: 1800px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--text);
    background: var(--background);
}

.modal-close {
    position: fixed;
    top: 12px;
    right: -12px;
    z-index: 10001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: var(--background);
    color: var(--text);
    cursor: pointer;
    margin-right: 30px;

}



.modal-close span {
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
}

.modal-close:hover {
    color: var(--accent)
}

/* SCROLLABLE CONTENT */
.modal-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
    padding: 0 0 60px;

}

/* LARGE FIRST IMAGE — 60PX SIDE MARGINS */
.modal-hero {
    width: 100%;
    height: 70vh;
    overflow: hidden;
}

.modal-hero .project-media {
    display: block;
    width: 100%;
    height: 70vh;
    object-fit: cover;
    object-position: center;
}

/* TITLE AND PROJECT INFORMATION */
.modal-intro {
    margin: 0 auto 80px;
    text-align: center;
}


#modalTitle {
    margin: 0;
    margin-top: -20px;
    font-size: clamp(36px, 5.5vw, 76px);
    font-weight: 600;
    line-height: .98;
}


.modal-heading-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
    font-size: 16px;
    line-height: 1.5;
    opacity: .65;

}

.modal-meta-separator {
    opacity: .7;
}



.project-description {
    max-width: 680px;
    margin: 28px auto 0;
    font-size: 24px;
    font-weight: 400;
    line-height: 1.6;
    text-align: center;

}

/* REMAINING MEDIA — CENTERED WITH LEFT-ALIGNED TEXT */
.modal-gallery {
    width: calc(100% - 240px);
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 60px;

}



.project-media-item {
    width: 100%;
    min-width: 0;
    margin: 0;

}



.project-media {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;

}



video.project-media {
    aspect-ratio: 16 / 9;
    background: #e8e8e8;
    object-fit: cover;
}



.project-media-description {
    max-width: 760px;
    margin: 60px 0;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    text-align: left;

}



/* BOTTOM NAVIGATION */

.modal-footer {
    min-height: 64px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 32px;
    color: var(--text);
    background: var(--background);

}



.modal-footer button {

    width: 44px;

    height: 44px;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    padding: 0;

    border: 0;

    background: transparent;

    color: inherit;

    font-size: 28px;

    cursor: pointer;

}



.modal-footer button:hover {

    color: var(--accent)
}



.modal-close:focus-visible,

.modal-footer button:focus-visible {

    outline: 1px solid var(--accent);

}









/* Load more */

.load-more {

    /* display: block;

    margin: 50px auto 0;

    padding: 14px 28px;

    border: 1px solid var(--accent);

    border-radius: 100px;

    background: transparent;

    color: var(--accent);

    font-family: inherit;

    font-size: 14px;

    cursor: pointer;

    transition:

        background-color 0.3s ease,

        color 0.3s ease; */

    font-size: 0.1px;

    z-index: -99;

}



/* .load-more:hover {

    background: var(--accent);

    color: var(--background);

} */



/* about */

.about {

    position: relative;

    margin-bottom: 20px;

}



.about-hero {

    height: 90vh;

    min-height: 600px;

    position: relative;

    overflow: hidden;

    display: flex;

    align-items: center;

    justify-content: center;

    z-index: 1;

}



.about-image {

    position: absolute;

    inset: 0;

    width: 100%;

    height: 100%;

    object-fit: cover;

    object-position: center;

}



.about-overlay {

    position: absolute;

    inset: 0;

    background: rgba(0, 0, 0, 0.18);

    pointer-events: none;

}



.about-typewriter {

    position: relative;

    z-index: 2;

    color: white;

    text-align: center;

    font-size: clamp(38px, 7vw, 90px);

    line-height: 0.95;

    font-weight: 500;

    padding: 0 24px;

}



/* SECTION HEADING */

.about-text {

    font-size: 32px;

    color: var(--text);

    margin-bottom: 120px;

}



.about-text p {

    margin: 0 0 28px;

}



/* ABOUT */

.about-block {

    width: 100%;

    margin: 0 auto;

    margin-bottom: 90px;

    box-sizing: border-box;

}



.about-wrapper {

    min-height: 100vh;

    padding: 0 5% 5% 5%;

    box-sizing: border-box;

}



.cv-content {

    border-radius: 2px;

}



.cv-section {

    margin-bottom: 120px;

}



.cv-grid {

    display: grid;

    grid-template-columns: 2fr 2fr;

    column-gap: 140px;

}



.cv-grid h1 {

    font-size: 24px;

    font-weight: 600;

    margin-bottom: 30px;

}



.cv-left h2 {

    font-size: 32px;

    margin-bottom: 5px;

}



.cv-left h3 {

    font-size: 16px;

    font-weight: 400;

    inline-size: 1.6;

    margin-bottom: 15px;



}



.cv-right h2 {

    font-size: 32px;

    margin-bottom: 5px;

}



.cv-right h3 {

    font-size: 16px;

    font-weight: 400;

    inline-size: 1.6;

    margin-bottom: 15px;



}



/* HOVER ITEMS */

.cv-hover-item {

    position: relative;

    isolation: isolate;

    margin-bottom: 18px;

    cursor: default;

}



.cv-hover-item h2,

.cv-hover-item h3 {

    position: relative;

    z-index: 2;

    transition: opacity 0.25s ease;

}



/* FLOATING IMAGE COLLAGE */

.cv-hover-preview {

    position: absolute;

    z-index: 5;

    top: 50%;

    left: 50%;

    width: 330px;

    height: 200px;

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transform: translate(-50%, -45%) scale(0.94);

    transition: opacity 0.3s ease, transform 0.4s ease, visibility 0.3s ease;

}



.cv-hover-preview img {

    position: absolute;

    width: 125px;

    height: 155px;

    object-fit: cover;

    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);

    transition: transform 0.4s ease;

    border-radius: 3px;

}



/* COLLAGE ARRANGEMENT */

.cv-hover-preview img:nth-child(1) {

    left: 0;

    top: 22px;

    transform: rotate(-12deg);

}



.cv-hover-preview img:nth-child(2) {

    left: 100px;

    top: 0;

    transform: rotate(4deg);

}



.cv-hover-preview img:nth-child(3) {

    left: 200px;

    top: 25px;

    transform: rotate(12deg);

}



/* REVEAL ON HOVER AND KEYBOARD FOCUS */

.cv-hover-item:hover .cv-hover-preview,

.cv-hover-item:focus-visible .cv-hover-preview {

    opacity: 1;

    visibility: visible;

    transform: translate(-50%, -50%) scale(1);

}



.cv-hover-item:hover h2,

.cv-hover-item:hover h3,

.cv-hover-item:focus-visible h2,

.cv-hover-item:focus-visible h3 {

    color: var(--accent)
}



/* SUBTLE IMAGE MOVEMENT */

.cv-hover-item:hover .cv-hover-preview img:nth-child(1),

.cv-hover-item:focus-visible .cv-hover-preview img:nth-child(1) {

    transform: rotate(-16deg) translateY(-5px);

}



.cv-hover-item:hover .cv-hover-preview img:nth-child(2),

.cv-hover-item:focus-visible .cv-hover-preview img:nth-child(2) {

    transform: rotate(2deg) translateY(-10px);

}



.cv-hover-item:hover .cv-hover-preview img:nth-child(3),

.cv-hover-item:focus-visible .cv-hover-preview img:nth-child(3) {

    transform: rotate(16deg) translateY(-3px);

}



/* KEYBOARD ACCESSIBILITY */

.cv-hover-item:focus-visible {

    outline: 1px solid var(--accent);

    outline-offset: 4px;

}


.place {
    margin-bottom: -10px;
    color: var(--accent);
    align-items: center;
    text-align: center;
}




/* FOOTER */

.footer {

    background-color: var(--text);

    color: var(--accent);

    padding: 32px;



    display: flex;

    flex-direction: column;

    align-items: center;

    text-align: center;

    gap: 40px;

}



.footer h2 {

    font-size: clamp(38px, 7vw, 90px);

    font-weight: 600;

    margin: 0;

}



.footer-links {

    display: flex;

    flex-direction: column;

    gap: 5px;

}



.footer-links a {
    transition: opacity 0.2s ease;
    font-weight: 600;

}

.footer-note {
    font-size: 14px;
    opacity: 0.5;
    margin: 0;

}

@media (max-width: 900px) {
    h2 {
        font-size: 21px;
    }

    .navbar {
        height: 64px;
        padding: 0 16px;
        grid-template-columns: 1fr auto 1fr;

    }

    .nav-left {
        gap: 12px;
    }

    .nav-left a {
        font-size: 14px;
    }

    .nav-name {
        font-size: 14px;
        white-space: nowrap;
    }

    .theme-toggle {
        width: 32px;
        height: 32px;
    }

    .theme-icon {
        font-size: 21px;
    }

    /* HERO */
    .hero {
        padding: 64px 16px 24px;
    }

    .hero-title {
        width: 100%;
        max-width: 100%;
        font-size: clamp(34px, 10vw, 54px);
        line-height: 0.95;
        overflow-wrap: anywhere;
    }

    /* WORKS / PROJECTS */
    .works {
        margin-top: 100svh;
    }

    .works-stage {
        height: 100svh;
    }

    .heading {
        padding: 24px 16px;
        margin-bottom: 16px;
    }

    .heading h2 {
        font-size: 21px;
    }

    .project-grid {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .project-card {
        width: 100%;
    }

    .project-image {
        width: 100%;
    }

    .project-image img {
        width: 100%;
        height: auto;

    }

    /* Make project information accessible without hover */
    .project-overlay {
        padding: 16px;
        opacity: 1;
        background: linear-gradient(to top,
                rgba(0, 0, 0, 0.75),
                rgba(0, 0, 0, 0.05));

    }

    .project-info {
        opacity: 1;
        transform: none;
    }

    .project-info h3 {
        font-size: 21px;
        margin-bottom: 6px;
    }

    .project-info p {
        font-size: 16px;
        line-height: 1.6;
    }

    .project-view {
        margin-top: 10px;
        font-size: 16px;
    }

    .project-card:hover .project-image img,

    .project-card:focus-visible .project-image img {
        transform: none;
    }

    /* Project title */

    .modal-intro {
        margin-bottom: 1rem;
    }

    .modal-intro h2 {
        margin: 0;
    }

    /* First row: media 60%, information 40% */
    .project-first-row {
        display: grid;
        grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
        gap: 2rem;
        align-items: start;
        margin-bottom: 3rem;
    }

    .project-first-media,

    .project-meta {
        min-width: 0;
    }

    /* All media */
    .project-media-item {
        width: 100%;
    }

    .project-media {
        display: block;
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    /* Introductory information */
    .project-meta p {
        margin-top: 0;
        margin-bottom: 1rem;
    }

    /* Paragraph under each image or video */
    .project-media-description {
        margin: 1rem 0 0;
        max-width: 100%;
        font: inherit;
        line-height: 130%;
    }

    .modal-hero {
        display: block;
        width: 100%;
        height: 40vh;
        padding: 0;

    }


    /* ABOUT HERO */
    .about {
        margin-bottom: 16px;
    }

    .about-hero {
        height: 75svh;
        min-height: 420px;
    }

    .about-image {
        object-position: center;
    }

    .about-typewriter {
        padding: 0 16px;
        font-size: clamp(32px, 9vw, 52px);
        line-height: 1;
        overflow-wrap: anywhere;
    }

    /* ABOUT TEXT */
    .about-text {
        font-size: clamp(20px, 5.5vw, 26px);
        line-height: 1.35;
        margin-bottom: 64px;
    }

    .about-text p {
        margin-bottom: 20px;
    }

    .about-block {
        width: 100%;
        margin-bottom: 48px;
    }

    .about-wrapper {
        min-height: auto;
        padding: 0 16px 32px;
    }

    /* CV / EXPERIENCE */
    .cv-content {
        width: 100%;
    }

    .cv-section {
        margin-bottom: 56px;
    }

    .cv-grid {
        grid-template-columns: 1fr;
        column-gap: 0;
        row-gap: 40px;
    }

    .cv-grid h1 {
        font-size: 21px;
        margin-bottom: 22px;
    }

    .cv-left h2,

    .cv-right h2 {
        font-size: 21px;
        line-height: 1.15;
        margin-bottom: 6px;
    }

    .cv-left h3,

    .cv-right h3 {
        font-size: 16px;
        line-height: 1.45;
        margin-bottom: 12px;
    }

    .cv-hover-item {
        margin-bottom: 20px;
    }

    .cv-hover-item.is-pressing .cv-hover-preview {
        display: flex;
        position: fixed;
        z-index: 9998;
        inset: 50% auto auto 50%;
        transform: translate(-50%, -50%);
        width: min(90vw, 500px);
        max-height: 75dvh;
        overflow-y: auto;
        padding: 12px;
        gap: 10px;
        flex-wrap: wrap;
        align-items: flex-start;
        justify-content: center;
        background: white;
        box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
        pointer-events: none;
    }

    .cv-hover-item.is-pressing .cv-hover-preview img {
        display: block;
        width: 100%;
        max-height: 60dvh;
        object-fit: contain;
    }

    .cv-hover-item.is-pressing h2,
    .cv-hover-item.is-pressing h3 {
        color: inherit;
    }

    /* FOOTER */
    .footer {
        padding: 32px 16px 24px;
        gap: 28px;
    }

    .footer h2 {
        font-size: clamp(34px, 10vw, 52px);
        line-height: 1;
        overflow-wrap: anywhere;
    }



    .footer-links {
        gap: 10px;
    }

    .footer-links a {
        font-size: 16px;
    }

    .footer-note {
        font-size: 13px;
        line-height: 1.5;
    }
}


/* TABLET AND MOBILE */

@media (max-width: 800px) {
    .modal-close {
        top: 10px;
        right: 10px;
    }

    .modal-hero {
        margin: 0 20px 32px;
    }

    .modal-hero .project-media {
        height: 50vh;
        object-fit: cover;
        object-position: center;
    }

    .modal-intro {
        margin: 0 20px 48px;
    }

    #modalTitle {
        font-size: clamp(34px, 9vw, 52px);
    }

    .modal-heading-meta {
        font-size: 16px;
    }

    .project-description {
        font-size: 16px;
        text-align: left;
        line-height: 130%;
        margin-bottom: 20px;
    }



    .modal-gallery {
        width: calc(100% - 40px);
        gap: 56px;
    }



    .project-media-description {
        font-size: 14px;
    }

    .modal-footer {
        padding: 8px 16px;
    }

}



@media (prefers-reduced-motion: reduce) {
    .project-modal {
        transition: none;
    }

}



/* =========================================================
   CONSISTENT PAGE GUTTERS
   Desktop: 60px from each viewport edge.
   Smaller screens: reduced gutters to preserve usable space.
   Internal text spacing and component-specific spacing remain
   intentionally independent of the outer page alignment.
========================================================= */

:root {
    --page-gutter: 60px;
}

.navbar {
    padding-inline: var(--page-gutter);
}

.hero {
    padding-inline: var(--page-gutter);
}

.heading {
    padding-inline: var(--page-gutter);
}

.project-grid {
    width: 100%;
    max-width: none;
}

.modal-content {
    padding-inline: 0;
}

.modal-hero {
    margin: 0 auto 60px;
}

.modal-intro {
    margin-inline: auto;
}

.modal-gallery {
    max-width: 1200px;
}

.modal-footer {
    padding-inline: var(--page-gutter);
}

.about-wrapper {
    padding-inline: var(--page-gutter);
}

.footer {
    padding-inline: var(--page-gutter);
}

/* Keep the close control aligned with the same right gutter. */
.modal-close {
    right: var(--page-gutter);
    margin-right: 0;
}

@media (max-width: 900px) {
    :root {
        --page-gutter: 16px;
    }

    .navbar,
    .hero,
    .heading,
    .modal-footer,
    .about-wrapper,
    .footer {
        padding-inline: var(--page-gutter);
    }

    /* 
    .modal-hero {
        width: calc(100% - (2 * var(--page-gutter)));
        margin: 0 auto 32px;
    } */

    .modal-intro {
        width: calc(100% - (2 * var(--page-gutter)));
        margin-inline: auto;
    }

    .modal-close {
        right: 10px;
    }
}
