@font-face {
    font-family: 'Sk-Modernist';
    src: url('assets/fonts/Sk-Modernist-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'FogtwoNo5';
    src: url('assets/fonts/FogtwoNo5.otf') format('opentype'),
         url('assets/fonts/FogtwoNo5.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

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

html {
    scroll-behavior: auto;
    height: 100%;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: auto;
    }
}

body {
    font-family: 'Sk-Modernist', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: #fff;
    color: #000;
    overflow-x: hidden;
    height: 100%;
}

body.no-scroll {
    overflow: hidden !important;
    height: 100vh;
    position: fixed;
    width: 100%;
}

.works-page.active {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Hide default scrollbar */
::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

body {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Custom scroll indicator */
.scroll-indicator {
    position: fixed;
    top: 0;
    right: 0;
    width: 8px;
    background: #000;
    height: 0;
    z-index: 9999;
    transition: height 0.1s ease;
}

body.no-scroll .scroll-indicator {
    display: none;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: transparent;
    padding: 2rem 3rem;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.nav-links {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1rem;
}

.nav-item {
    font-family: 'FogtwoNo5', serif;
    text-decoration: none;
    color: #000;
    font-size: 1.5rem;
    line-height: 1;
    transition: font-size 1.2s cubic-bezier(0.85, 0, 0.15, 1), line-height 1.2s cubic-bezier(0.85, 0, 0.15, 1), letter-spacing 1.2s cubic-bezier(0.85, 0, 0.15, 1), opacity 0.1s ease;
    white-space: nowrap;
    display: inline-block;
    opacity: 0.3;
}

.nav-item:hover,
.nav-item.active {
    opacity: 1;
}

.nav-item.active {
    font-size: 12rem;
    line-height: 0.85;
    letter-spacing: -0.03em;
}

.email-link {
    font-family: 'FogtwoNo5', serif;
    font-size: 1.5rem;
    text-decoration: none;
    color: #000;
    margin-top: 0.5rem;
    opacity: 0;
    pointer-events: none;
    display: inline-block;
}

.email-link.visible {
    opacity: 1 !important;
    pointer-events: auto;
}

.email-link:hover {
    opacity: 0.6 !important;
}

.page-container {
    position: relative;
    margin-top: 150px;
    height: 100%;
}

body.no-scroll .page-container {
    margin-top: 0;
    height: 100vh;
    display: block !important;
    visibility: visible !important;
}

.page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: none;
    visibility: hidden;
}

.page.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    position: relative;
}

.about-page.active,
.contact-page.active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
}

.page.slide-out-right {
    opacity: 1;
    pointer-events: none;
    transition: none;
}

/* Slide animations for FX grid */
.page.slide-out-right .fx-image-item.active {
    animation: slideOutDown 0.5s ease forwards;
}

.page.slide-out-right .fx-image-item:not(.active) {
    opacity: 0 !important;
    visibility: hidden !important;
}

.page.slide-out-right .fx-arrow {
    animation: slideOutDown 0.5s ease forwards;
}

.page.slide-out-right .fx-description {
    animation: slideOutDown 0.5s ease forwards;
    animation-delay: 0.1s;
}

.page.slide-out-right .fx-left-item:nth-child(1) {
    animation: slideOutRight 0.4s ease forwards;
    animation-delay: 0.5s;
}

.page.slide-out-right .fx-left-item:nth-child(2) {
    animation: slideOutRight 0.5s ease forwards;
    animation-delay: 0.55s;
}

.page.slide-out-right .fx-left-item:nth-child(3) {
    animation: slideOutRight 0.6s ease forwards;
    animation-delay: 0.6s;
}

.page.slide-out-right .fx-left-item:nth-child(4) {
    animation: slideOutRight 0.7s ease forwards;
    animation-delay: 0.65s;
}

.page.slide-out-right .fx-left-item:nth-child(5) {
    animation: slideOutRight 0.8s ease forwards;
    animation-delay: 0.7s;
}

.page.slide-out-right .fx-right-item:nth-child(1) {
    animation: slideOutRight 0.4s ease forwards;
    animation-delay: 0.5s;
}

.page.slide-out-right .fx-right-item:nth-child(2) {
    animation: slideOutRight 0.5s ease forwards;
    animation-delay: 0.55s;
}

.page.slide-out-right .fx-right-item:nth-child(3) {
    animation: slideOutRight 0.6s ease forwards;
    animation-delay: 0.6s;
}

.page.slide-out-right .fx-right-item:nth-child(4) {
    animation: slideOutRight 0.7s ease forwards;
    animation-delay: 0.65s;
}

.page.slide-out-right .fx-right-item:nth-child(5) {
    animation: slideOutRight 0.8s ease forwards;
    animation-delay: 0.7s;
}

.page.slide-out-right .fx-progress-wrapper {
    animation: slideOutDown 0.4s ease forwards;
    animation-delay: 0.3s;
}

@keyframes slideOutRight {
    0% {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
    }
    99% {
        transform: translateX(150px);
        opacity: 0;
        visibility: visible;
    }
    100% {
        transform: translateX(150px);
        opacity: 0;
        visibility: hidden;
    }
}

@keyframes slideOutDown {
    0% {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    99% {
        transform: translateY(100px);
        opacity: 0;
        visibility: visible;
    }
    100% {
        transform: translateY(100px);
        opacity: 0;
        visibility: hidden;
    }
}

/* Slide in from right animations for FX grid */
.page.slide-in-from-right .fx-left-item,
.page.slide-in-from-right .fx-right-item {
    animation-fill-mode: both;
}

.page.slide-in-from-right .fx-left-item:nth-child(1) {
    animation: slideInFromRight 0.8s ease both;
    animation-delay: 1.3s;
}

.page.slide-in-from-right .fx-left-item:nth-child(2) {
    animation: slideInFromRight 0.7s ease both;
    animation-delay: 1.25s;
}

.page.slide-in-from-right .fx-left-item:nth-child(3) {
    animation: slideInFromRight 0.6s ease both;
    animation-delay: 1.2s;
}

.page.slide-in-from-right .fx-left-item:nth-child(4) {
    animation: slideInFromRight 0.5s ease both;
    animation-delay: 1.15s;
}

.page.slide-in-from-right .fx-left-item:nth-child(5) {
    animation: slideInFromRight 0.4s ease both;
    animation-delay: 1.1s;
}

.page.slide-in-from-right .fx-right-item:nth-child(1) {
    animation: slideInFromRight 0.8s ease both;
    animation-delay: 1.3s;
}

.page.slide-in-from-right .fx-right-item:nth-child(2) {
    animation: slideInFromRight 0.7s ease both;
    animation-delay: 1.25s;
}

.page.slide-in-from-right .fx-right-item:nth-child(3) {
    animation: slideInFromRight 0.6s ease both;
    animation-delay: 1.2s;
}

.page.slide-in-from-right .fx-right-item:nth-child(4) {
    animation: slideInFromRight 0.5s ease both;
    animation-delay: 1.15s;
}

.page.slide-in-from-right .fx-right-item:nth-child(5) {
    animation: slideInFromRight 0.4s ease both;
    animation-delay: 1.1s;
}

.page.slide-in-from-right .fx-image-item.active {
    animation: slideInFromBottom 0.5s ease both;
    animation-delay: 1.1s;
}

.page.slide-in-from-right .fx-image-item:not(.active) {
    opacity: 0 !important;
    visibility: hidden !important;
}

.page.slide-in-from-right .fx-arrow {
    animation: slideInFromBottom 0.5s ease both;
    animation-delay: 1.1s;
}

.page.slide-in-from-right .fx-description {
    animation: slideInFromBottom 0.5s ease both;
    animation-delay: 1.2s;
}

.page.slide-in-from-right .fx-progress-wrapper {
    animation: slideInFromBottom 0.4s ease both;
    animation-delay: 1.3s;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(150px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInFromBottom {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.works-page {
    position: relative;
}

/* About page styling */
.about-page {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100vh !important;
    position: relative !important;
}

.about-page.animate-in .about-name {
    animation: slideUpFromLine 1s ease-out forwards !important;
}

.about-page.animate-in .bio-line:nth-child(1) {
    animation: slideUpFromLine 1s ease-out forwards !important;
    animation-delay: 0.2s !important;
}

.about-page.animate-in .bio-line:nth-child(2) {
    animation: slideUpFromLine 1s ease-out forwards !important;
    animation-delay: 0.35s !important;
}

.about-page.animate-in .bio-line:nth-child(3) {
    animation: slideUpFromLine 1s ease-out forwards !important;
    animation-delay: 0.5s !important;
}

.about-page.animate-in .social-links {
    animation: slideUpFromLine 1s ease-out forwards !important;
    animation-delay: 0.65s !important;
}

.about-page.animate-in .copyright-text {
    animation: slideUpFromLine 1s ease-out forwards !important;
    animation-delay: 0.8s !important;
}

.about-content {
    max-width: 600px !important;
    text-align: left !important;
    padding: 2rem !important;
    z-index: 10000 !important;
    position: relative !important;
}

.about-content .about-name {
    font-family: 'FogtwoNo5', serif;
    font-size: 1.2rem;
    font-weight: 400;
    color: #000;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(2em);
}

.about-content .bio-text {
    font-size: 1rem;
    line-height: 1.6;
    color: #000;
    font-weight: 500;
    display: block;
}

.about-content .bio-line {
    display: block;
    opacity: 0;
    transform: translateY(2em);
}

.social-links {
    display: flex;
    gap: 2rem;
    margin-top: 2.5rem;
    opacity: 0;
    transform: translateY(2em);
}

.social-link {
    font-size: 1rem;
    color: #000;
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: opacity 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.social-link::after {
    content: '↗';
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.social-link:hover {
    opacity: 0.6;
}

.social-link:hover::after {
    transform: translate(3px, -3px);
}

.about-footer {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    z-index: 10000;
}

.copyright-text {
    display: inline-block;
    font-size: 1rem;
    color: #000;
    font-weight: 500;
    opacity: 0;
    transform: translateY(2em);
}

@keyframes slideUpFromLine {
    0% {
        opacity: 0;
        transform: translateY(2em);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDownToLine {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(2em);
    }
}

.about-page.animate-out {
    z-index: 10000 !important;
}

.about-page.animate-out .about-name,
.about-page.animate-out .bio-line,
.about-page.animate-out .social-links,
.about-page.animate-out .copyright-text {
    opacity: 1;
    transform: translateY(0);
}

.about-page.animate-out .about-name {
    animation: slideDownToLine 0.6s ease-in forwards !important;
    animation-delay: 0.3s !important;
}

.about-page.animate-out .bio-line:nth-child(1) {
    animation: slideDownToLine 0.6s ease-in forwards !important;
}

.about-page.animate-out .bio-line:nth-child(2) {
    animation: slideDownToLine 0.6s ease-in forwards !important;
    animation-delay: 0.05s !important;
}

.about-page.animate-out .bio-line:nth-child(3) {
    animation: slideDownToLine 0.6s ease-in forwards !important;
    animation-delay: 0.1s !important;
}

.about-page.animate-out .social-links {
    animation: slideDownToLine 0.6s ease-in forwards !important;
    animation-delay: 0.15s !important;
}

.about-page.animate-out .copyright-text {
    animation: slideDownToLine 0.6s ease-in forwards !important;
    animation-delay: 0.2s !important;
}

/* Contact page styling */
.contact-page {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100vh !important;
    position: relative !important;
}

.about-page.active,
.contact-page.active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
}

.contact-page.animate-in .contact-email {
    animation: slideUpFromLine 1s ease-out forwards !important;
}

.contact-page.animate-in .contact-copyright {
    animation: slideUpFromLine 1s ease-out forwards !important;
    animation-delay: 0.5s !important;
}

.contact-page.animate-out {
    z-index: 10000 !important;
}

.contact-page.animate-out .contact-email,
.contact-page.animate-out .contact-copyright {
    opacity: 1;
    transform: translateY(0);
}

.contact-page.animate-out .contact-email {
    animation: slideDownToLine 0.6s ease-in forwards !important;
}

.contact-page.animate-out .contact-copyright {
    animation: slideDownToLine 0.6s ease-in forwards !important;
    animation-delay: 0.15s !important;
}

.contact-content {
    max-width: 600px !important;
    text-align: left !important;
    padding: 2rem !important;
    z-index: 10000 !important;
    position: relative !important;
}

.contact-content .contact-email {
    font-size: 1rem;
    line-height: 1.6;
    color: #000;
    font-weight: 500;
    display: block;
    opacity: 0;
    transform: translateY(2em);
}

.contact-footer {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    z-index: 10000;
}

.contact-copyright {
    display: inline-block;
    font-size: 1rem;
    color: #000;
    font-weight: 500;
    opacity: 0;
    transform: translateY(2em);
}

.project-menu {
    position: fixed;
    top: 55%;
    left: calc(30% + 100px);
    transform: translate(-50%, -50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 3rem;
    background: transparent;
    backdrop-filter: none;
    pointer-events: auto;
}

.menu-wrapper {
    position: relative;
    display: flex;
    align-items: flex-start;
}

.arrow-indicator {
    position: absolute;
    right: 0;
    top: 0;
    font-size: 0.8rem;
    color: #000;
    transform: translateY(0);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.project-list {
    list-style: none;
    width: 100%;
    position: relative;
}

.project-item {
    cursor: pointer;
    transition: all 0.1s ease;
    margin-bottom: 0.3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-right: 2rem;
}

.project-item span {
    display: inline-block;
    font-size: 1rem;
    font-weight: 575;
    color: #d0d0d0;
    transition: color 0.1s ease, font-weight 0.1s ease;
    letter-spacing: 0.02em;
}

.project-item.active span,
.project-item:hover span {
    color: #000;
    font-weight: 575;
}

.creator-name {
    font-size: 1rem;
    color: #000;
    margin-top: 2rem;
}

.projects-scroll-container {
    position: relative;
    z-index: 1;
}

.project-section {
    min-height: 100vh;
    padding: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-gallery {
    display: flex;
    gap: 3rem;
    width: 100%;
    max-width: 100%;
    padding: 0 3rem;
    justify-content: flex-start;
    align-items: flex-start;
    flex-wrap: nowrap;
    margin-top: -5vh;
    will-change: transform;
}

.gallery-item {
    flex-shrink: 0;
}

/* First image/video - larger on left */
.gallery-item:nth-child(1) {
    width: 450px;
    height: auto;
}

/* Second image - mobile, smaller */
.gallery-item:nth-child(2) {
    width: 180px;
    height: auto;
}

/* Cathexis bike picker video - make it larger */
.project-section[data-project="3"] .gallery-item:nth-child(2) {
    width: 280px;
}

/* Right side images */
.gallery-item:nth-child(3) {
    width: 280px;
    height: auto;
}

.gallery-item:nth-child(4) {
    width: 280px;
    height: auto;
}

.gallery-item:nth-child(5) {
    width: 280px;
    height: auto;
}

.gallery-item:nth-child(6) {
    width: 280px;
    height: auto;
}

/* First image on left side with gap for menu */
.gallery-item:first-child {
    margin-right: 18vw;
}


/* Keep menu area clear */
.project-section {
    min-height: 100vh;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 22vh;
    position: relative;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.project-description {
    position: absolute;
    width: 500px;
    right: 16.5rem;
    top: calc(22vh + 120px);
    font-family: 'Sk-Modernist', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #000;
    font-weight: 500;
    z-index: 10;
    background: transparent;
    padding: 1rem;
}

/* Only use absolute positioning at wide desktop - otherwise use mobile */
@media (min-width: 1700px) and (max-width: 1919px) {
    .project-description {
        right: 10rem;
    }
}


.visit-site-btn {
    display: inline-block;
    margin-top: 1.5rem;
    font-family: 'Sk-Modernist', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: #000;
    text-decoration: none;
    position: relative;
    transition: transform 0.3s ease;
}

.visit-site-btn::after {
    content: '↗';
    margin-left: 0.5rem;
    display: inline-block;
    transition: transform 0.3s ease;
}

.visit-site-btn:hover::after {
    transform: translate(4px, -4px);
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
    will-change: transform;
}

.gallery-item img:hover,
.gallery-item video:hover {
    transform: scale(1.03);
}

.placeholder-image {
    width: 100%;
    height: 100%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.placeholder-image:hover {
    background: #eee;
}


/* Responsive Design - use mobile layout for tablets and phones */
@media (max-width: 1024px) {
    /* Header and Navigation */
    header {
        padding: 1.5rem;
    }

    .nav-item {
        font-size: 1rem;
    }

    .nav-item.active {
        font-size: 3rem;
    }

    /* Project Section */
    .project-section {
        padding: 8rem 0 2rem 0;
        min-height: 100vh;
        display: flex;
        justify-content: flex-start;
        align-items: flex-start;
    }

    /* Gallery - VERTICAL STACK on FAR LEFT */
    .image-gallery {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        padding: 0;
        padding-left: 1rem;
        margin: 0;
        margin-right: auto;
        width: 50%;
        max-width: 200px;
    }

    .gallery-item {
        scroll-snap-align: none;
    }

    .gallery-item:first-child {
        margin-right: 0;
    }

    .gallery-item:nth-child(1),
    .gallery-item:nth-child(2),
    .gallery-item:nth-child(3),
    .gallery-item:nth-child(4),
    .gallery-item:nth-child(5),
    .gallery-item:nth-child(6) {
        width: 100% !important;
        max-width: 100%;
    }

    .project-section[data-project="3"] .gallery-item:nth-child(2) {
        width: 100% !important;
    }

    /* Project Menu - LOCKED FAR RIGHT */
    .project-menu {
        position: fixed;
        top: 50%;
        right: 0.5rem;
        transform: translateY(-50%);
        padding: 0;
        background: transparent;
        z-index: 100;
    }

    .menu-wrapper {
        flex-direction: column;
        align-items: flex-end;
    }

    .arrow-indicator {
        display: none;
    }

    .project-list {
        display: flex;
        flex-direction: column;
        gap: 0 !important;
        align-items: flex-end;
    }

    .project-item {
        padding: 0 !important;
        margin: 0 !important;
        margin-bottom: 0 !important;
        line-height: 1.2;
        text-align: right;
    }

    .project-item span {
        font-size: 0.75rem;
        font-weight: 575;
        text-transform: uppercase;
    }

    .project-item.active span {
        color: #000;
    }

    /* Project Description - Hide on mobile */
    .project-description {
        display: none;
    }

    /* About Page */
    .about-content {
        padding: 1.5rem !important;
        max-width: 90% !important;
    }

    .about-content .about-name {
        font-size: 1rem;
    }

    .about-content .bio-text {
        font-size: 0.9rem;
    }

    .about-footer {
        bottom: 1rem;
        right: 1rem;
    }

    .copyright-text {
        font-size: 0.85rem;
    }

    /* Contact Page */
    .contact-content {
        padding: 1.5rem !important;
        max-width: 90% !important;
    }

    .contact-content .contact-email {
        font-size: 0.9rem;
    }

    .contact-footer {
        bottom: 1rem;
        right: 1rem;
    }

    .contact-copyright {
        font-size: 0.85rem;
    }

    /* Scroll Indicator */
    .scroll-indicator {
        width: 4px;
    }

    /* Visit Site Button */
    .visit-site-btn {
        font-size: 0.85rem;
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .nav-item {
        font-size: 0.9rem;
    }

    .nav-item.active {
        font-size: 2.5rem;
    }

    .project-menu {
        padding: 1rem;
        bottom: 1rem;
    }

    .project-item span {
        font-size: 0.75rem;
    }

    .about-content .bio-text,
    .contact-content .contact-email {
        font-size: 0.85rem;
    }
}
/* v2 */

/* ==========================================================================
   RESPONSIVE IMPROVEMENTS - Fluid & Accessible Design
   ========================================================================== */

/* Fluid Design Tokens */
:root {
  /* Fluid typography - scales smoothly without breakpoints */
  --text-fluid-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
  --text-fluid-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
  --text-fluid-lg: clamp(1.125rem, 1rem + 0.625vw, 1.5rem);
  --text-fluid-nav: clamp(3rem, 2rem + 5vw, 12rem);

  /* Fluid spacing - prevents layout jumps */
  --space-fluid-sm: clamp(0.5rem, 0.4rem + 0.5vw, 1rem);
  --space-fluid-md: clamp(1rem, 0.75rem + 1.25vw, 2rem);
  --space-fluid-lg: clamp(1.5rem, 1rem + 2vw, 3rem);
  --space-fluid-xl: clamp(2rem, 1.5rem + 2.5vw, 4rem);

  /* Safe area for notched devices */
  --safe-bottom: max(2rem, env(safe-area-inset-bottom));
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* Fluid navigation scaling */
.nav-item.active {
    font-size: var(--text-fluid-nav);
    line-height: 0.85;
    letter-spacing: -0.03em;
}



/* Better image handling */
.gallery-item img,
.gallery-item video {
    width: 100%;
    height: auto;
    display: block;
    image-rendering: -webkit-optimize-contrast;
}

/* Touch target enforcement */
.nav-item,
.project-item,
.visit-site-btn {
    min-height: 44px;
    min-width: 44px;
}

/* Focus states for accessibility */
:where(a, button, [role="button"]):focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
    transition: outline-offset 0.2s ease;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Overflow protection */
body {
    overflow-x: hidden;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Fluid project section spacing */
@media (max-width: 1399px) {
    .project-section {
        padding: var(--space-fluid-md) 0;
        padding-top: clamp(6rem, 10vh, 8rem);
        gap: var(--space-fluid-lg);
    }
}

/* Fluid gallery spacing */
@media (max-width: 1399px) {
    .image-gallery {
        gap: var(--space-fluid-md);
        padding: 0 var(--space-fluid-md);
    }
}

/* Fluid menu spacing */
@media (max-width: 1399px) {
    .project-item span {
        font-size: clamp(0.75rem, 0.7rem + 0.25vw, 0.85rem);
    }

    .project-menu {
        padding: var(--space-fluid-md);
    }
}

/* Short viewport optimization */
@media (max-height: 600px) {
    .page-container {
        margin-top: clamp(8rem, 15vh, 12rem);
    }

    .project-section {
        padding-top: 6rem;
    }
}

/* Ultra-wide viewport constraint */
@media (min-width: 2560px) {
    .page-container,
    .projects-scroll-container {
        max-width: 1920px;
        margin-inline: auto;
    }
}

/* Fluid typography on mobile */
@media (max-width: 1399px) {
    .about-content .about-name {
        font-size: clamp(1rem, 0.9rem + 0.5vw, 1.2rem);
    }

    .about-content .bio-text {
        font-size: clamp(0.9rem, 0.85rem + 0.25vw, 1rem);
    }

    .contact-content .contact-email {
        font-size: clamp(0.9rem, 0.85rem + 0.25vw, 1rem);
    }
}

/* Container query support */
@supports (container-type: inline-size) {
    .projects-scroll-container {
        container-type: inline-size;
        container-name: gallery;
    }

    @container gallery (max-width: 1399px) {
        .project-section {
            flex-direction: column;
            align-items: center;
        }
    }
}

/* Fluid nav gaps */
.nav-links {
    gap: clamp(0.5rem, 0.5rem + 0.5vw, 1rem);
}

/* Responsive scroll indicator */
@media (max-width: 1399px) {
    .scroll-indicator {
        width: 4px;
    }
}

/* ============================================ */
/* MASTER RESPONSIVE DESIGN - ALL PAGES */
/* ============================================ */

/* Navigation - Desktop Large (1920px+) - Keep original positioning */
@media (min-width: 1920px) {
    header {
        /* No changes - keep original top left positioning */
    }
}

/* Navigation - Standard Desktop (1440px - 1919px) */
@media (max-width: 1919px) and (min-width: 1440px) {
    header {
        padding: 1.8rem 2.5rem;
    }

    .nav-item {
        font-size: 1.4rem;
    }

    .nav-item.active {
        font-size: 11rem;
    }
}

/* Navigation - Laptop (1024px - 1439px) */
@media (max-width: 1439px) and (min-width: 1025px) {
    header {
        padding: 1.5rem 2rem;
    }

    .nav-item {
        font-size: 1.3rem;
    }

    .nav-item.active {
        font-size: 9rem;
    }

    .page-container {
        margin-top: 120px;
    }
}

/* Navigation - Tablet (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 768px) {
    header {
        padding: 1.2rem 1.5rem;
    }

    .nav-item {
        font-size: 1.1rem;
    }

    .nav-item.active {
        font-size: 6rem;
        line-height: 0.9;
    }

    .page-container {
        margin-top: 100px;
    }

    body.no-scroll .page-container {
        margin-top: 0;
    }
}

/* Navigation - Mobile Landscape (481px - 767px) */
@media (max-width: 767px) and (min-width: 481px) {
    header {
        padding: 1rem 1.2rem;
    }

    .nav-links {
        gap: 0.8rem;
    }

    .nav-item {
        font-size: 0.95rem;
    }

    .nav-item.active {
        font-size: 4rem;
        line-height: 0.95;
    }

    .page-container {
        margin-top: 80px;
    }

    body.no-scroll .page-container {
        margin-top: 0;
    }
}

/* Navigation - Mobile Portrait (320px - 480px) */
@media (max-width: 480px) {
    header {
        padding: 0.8rem 1rem;
    }

    .nav-links {
        gap: 0.6rem;
        flex-wrap: wrap;
    }

    .nav-item {
        font-size: 0.85rem;
    }

    .nav-item.active {
        font-size: 3rem;
        line-height: 1;
        letter-spacing: -0.02em;
    }

    .page-container {
        margin-top: 70px;
    }

    body.no-scroll .page-container {
        margin-top: 0;
    }
}

/* About Page - Tablet (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 768px) {
    .about-content {
        max-width: 550px !important;
        padding: 1.5rem !important;
    }

    .about-content .about-name {
        font-size: 1.1rem;
        margin-bottom: 1.2rem;
    }

    .about-content .bio-text {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .about-footer {
        bottom: 1.5rem;
        right: 1.5rem;
    }

    .copyright-text {
        font-size: 0.95rem;
    }
}

/* About Page - Mobile (481px - 767px) */
@media (max-width: 767px) and (min-width: 481px) {
    .about-content {
        max-width: 90% !important;
        padding: 1.2rem !important;
    }

    .about-content .about-name {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .about-content .bio-text {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .about-footer {
        bottom: 1.2rem;
        right: 1.2rem;
    }

    .copyright-text {
        font-size: 0.9rem;
    }
}

/* About Page - Small Mobile (320px - 480px) */
@media (max-width: 480px) {
    .about-content {
        max-width: 95% !important;
        padding: 1rem !important;
    }

    .about-content .about-name {
        font-size: 0.95rem;
        margin-bottom: 0.8rem;
    }

    .about-content .bio-text {
        font-size: 0.85rem;
        line-height: 1.4;
    }

    .about-footer {
        bottom: 1rem;
        right: 1rem;
    }

    .copyright-text {
        font-size: 0.85rem;
    }
}

/* Contact Page - Tablet (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 768px) {
    .contact-content {
        max-width: 550px !important;
        padding: 1.5rem !important;
    }

    .contact-content .contact-email {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .contact-footer {
        bottom: 1.5rem;
        right: 1.5rem;
    }

    .contact-copyright {
        font-size: 0.95rem;
    }
}

/* Contact Page - Mobile (481px - 767px) */
@media (max-width: 767px) and (min-width: 481px) {
    .contact-content {
        max-width: 90% !important;
        padding: 1.2rem !important;
    }

    .contact-content .contact-email {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .contact-footer {
        bottom: 1.2rem;
        right: 1.2rem;
    }

    .contact-copyright {
        font-size: 0.9rem;
    }
}

/* Contact Page - Small Mobile (320px - 480px) */
@media (max-width: 480px) {
    .contact-content {
        max-width: 95% !important;
        padding: 1rem !important;
    }

    .contact-content .contact-email {
        font-size: 0.85rem;
        line-height: 1.4;
    }

    .contact-footer {
        bottom: 1rem;
        right: 1rem;
    }

    .contact-copyright {
        font-size: 0.85rem;
    }
}

/* Extra Small Devices (< 320px) */
@media (max-width: 319px) {
    header {
        padding: 0.6rem 0.8rem;
    }

    .nav-item {
        font-size: 0.75rem;
    }

    .nav-item.active {
        font-size: 2.5rem;
    }

    .about-content .about-name,
    .contact-content .contact-email {
        font-size: 0.8rem;
    }

    .about-content .bio-text {
        font-size: 0.8rem;
    }

    .copyright-text,
    .contact-copyright {
        font-size: 0.8rem;
    }
}

/* Touch-friendly adjustments for mobile */
@media (hover: none) and (pointer: coarse) {
    .nav-item,
    .fx-left-item,
    .fx-right-item {
        padding: 0.5rem;
        margin: -0.5rem;
    }

    .nav-item.active {
        padding: 0;
        margin: 0;
    }
}

/* High DPI screen optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .fx-image-item img,
    .fx-image-item video {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .fx-scroll-sections {
        top: 10vh;
    }

    .fx-grid {
        padding-top: 0.5vh;
    }

    .fx-progress-wrapper {
        bottom: 1vh;
    }

    header {
        padding: 0.8rem 1rem;
    }

    .nav-item.active {
        font-size: 2.5rem;
    }
}
