@font-face {
    font-family: 'CMM Coda';
    src: url('fonts/CMMCoda-Proportional.woff2') format('woff2'),
         url('fonts/CMMCoda-Proportional.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Custom Text Selection Highlight */
::selection {
    background-color: #000000;
    color: #ffffff;
}

::-moz-selection {
    background-color: #000000;
    color: #ffffff;
}

/* Core Styling & Custom Cursor Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    cursor: none !important;
}

body {
    font-family: 'CMM Coda', sans-serif;
    font-size: 30px;
    line-height: 1.3;
    letter-spacing: -2.5%;
    background-color: #ffffff;
    color: #000000;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

#custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 25px;
    height: 25px;
    background-color: #000000;
    border-radius: 50%;
    pointer-events: none;
    translate: var(--mouse-x, 0px) var(--mouse-y, 0px);
    will-change: translate, transform;
    transform: translate(-50%, -50%) scale(1);
    transition: transform 0.15s ease-out;
    z-index: 9999;
}

/* Persistent Grey Nav Buttons */
.nav-btn {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 30px;
    line-height: 1.3;
    letter-spacing: -2.5%;
    color: #dddddd;
    user-select: none;
    text-decoration: none;
    padding: 0;
    display: inline-block;
    white-space: nowrap;
    position: relative;
    z-index: 300;
}

/* Landing Page Footer Legal Button (Desktop) */
/* Landing Page Footer Legal Button (Desktop) */
#btn-legal {
    position: fixed;
    bottom: 10px;
    left: 10px;
    z-index: 300;
}

/* Keyboard Accessibility Focus State */
.nav-btn:focus-visible,
.footer-btn:focus-visible,
.project-row:focus-visible,
a:focus-visible {
    outline: 2.5px solid #dddddd;
    outline-offset: 6px;
    border-radius: 2px;
}

body.gallery-active #btn-close:focus-visible {
    outline: 2px solid #ffffff;
}
    
/* Mobile Legal Default Hidden */
#mobile-legal-section {
    display: none;
}

/* Sticky Header Groups Layout (Desktop) */
.header-group {
    position: absolute;
    top: 5px;
    display: flex;
    align-items: flex-start;
    gap: 50px;
    z-index: 200;
}

.about-group {
    left: 10px;
    width: auto !important;
    max-width: 45vw !important;
}

.contact-group {
    left: clamp(350px, calc(100vw - 420px), 52vw);
    width: auto !important;
    white-space: nowrap; 
}

.legal-group {
    left: 10px;
    width: auto !important;
    max-width: calc(100vw - 40px) !important;
    pointer-events: none;
    padding-bottom: 10vh;

}

.legal-group .content-block {
    pointer-events: none;
}

#text-legal {
    white-space: normal;
    pointer-events: auto;
}

#text-contact {
    white-space: nowrap;
}

.work-btn {
    position: absolute;
    top: 5px;
    right: 10px;
    z-index: 300;
}

/* Content Columns & Typography */
.content-block {
    display: flex;
    flex-direction: column;
}

.header-title {
    font-size: 30px;
    line-height: 1.3;
    letter-spacing: -2.5%;
    color: #000000;
    white-space: nowrap;
    margin-bottom: 0;
}

.dropdown-content {
    color: #000000;
    margin-left: -50px;
}

.dropdown-content p {
    margin-top: 0;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

#text-about p:last-child,
#text-legal p:last-child,
#text-legal-mobile p:last-child {
    margin-bottom: 0;
    line-height: 1.3;
}

#text-contact p {
    margin-bottom: 0;
    line-height: 1.3;
}

#text-contact a {
    color: inherit;
    text-decoration: none;
}

/* Footer Section */
.footer-links {
    position: fixed;
    bottom: 10px;
    left: 10px;
    display: flex;
    gap: 20px;
    z-index: 200;
}

.footer-btn {
    font-size: 12px;
    color: #cccccc;
    text-decoration: none;
}

/* Utility Class */
.hidden {
    display: none !important;
}

/* Work Page Layout (Desktop) */
#work-page {
    display: none;
    padding-top: 20vh;
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: 40vh;
}

#work-page.active {
    display: block;
}

.project-row {
    display: flex;
    align-items: baseline;
    padding: 14px 0;
    margin-bottom: 0; 
    cursor: none;
    color: #000000;
}

.project-meta {
    flex: 0 0 calc(52vw - 10px);
    font-size: 30px;
}

.project-name {
    display: block;
}

.project-type {
    display: block;
}

.project-description {
    flex: 1;
    max-width: 750px;
    font-size: 20px;
    line-height: 1.3;
    padding-right: 20px;
}

#hover-image {
    position: fixed;
    top: 0;
    left: 0;
    max-width: 420px;
    max-height: 420px;
    width: auto;
    height: auto;
    object-fit: contain;
    pointer-events: none;
    opacity: 0;
    z-index: 150;
    translate: var(--mouse-x, 0px) var(--mouse-y, 0px);
    will-change: translate, opacity;
    transform: translate(20px, 20px);
}

/* Image Gallery Modal */
#image-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000000;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    -webkit-user-select: none;
}

#gallery-image {
    height: 100vh;
    width: auto;
    object-fit: contain;
}

/* Image Page Active States */
body.gallery-active {
    overflow: hidden;
}

body.gallery-active .header-group,
body.gallery-active .work-btn,
body.gallery-active .header-title,
body.gallery-active .nav-btn,
body.gallery-active #btn-close,
body.gallery-active #btn-legal {
    color: #ffffff;
    mix-blend-mode: difference;
}

body.gallery-active .header-group {
    position: fixed !important;
    top: 5px !important;
}

body.gallery-active #custom-cursor {
    font-size: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    mix-blend-mode: difference;
    transition: none;
}

a {
    text-decoration: none;
    color: inherit;
}

.mobile-project-image {
    display: none;
}

#btn-close {
    position: fixed;
    top: 5px;
    right: 10px;
    z-index: 300;
}

/* Lock the text blocks to the top of their grid/flex cells */
#text-about,
#text-contact {
    align-self: start !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Strip default top margins from the first line of text */
#text-about p:first-child,
#text-contact p:first-child {
    margin-top: 0 !important;
}

/* Ensure the header container itself enforces top alignment */
#site-header {
    align-items: start !important;
}

/* ==========================================
   TABLET STYLES (Intermediate Breakpoint)
   ========================================== */
@media (max-width: 1150px) and (min-width: 769px) {
    .header-group {
        position: relative !important;
        top: 5px !important;
        margin-bottom: 40px;
    }
    .about-group {
        left: 10px !important;
        max-width: calc(100vw - 120px) !important;
    }
    .contact-group {
        left: 10px !important;
        max-width: calc(100vw - 120px) !important;
    }
    .legal-group {
        position: absolute !important;
        top: 5px !important;
        left: 10px !important;
        max-width: calc(100vw - 40px) !important;
    }

    body.work-active .header-group,
    body.legal-active .header-group {
        position: absolute !important;
        top: 5px !important;
        margin-bottom: 0;
    }
    body.work-active .about-group,
    body.legal-active .about-group {
        max-width: 45vw !important;
    }
    body.work-active .contact-group,
    body.legal-active .contact-group {
        left: clamp(280px, 48vw, 52vw) !important;
        max-width: 45vw !important;
    }
}

/* Hide on desktop screens */
#mobile-legal-section {
    display: none;
}
/* ==========================================
   MOBILE STYLES (Screen width <= 768px)
   ========================================== */
@media (max-width: 768px) {
    * {
        cursor: auto !important;
    }

    body {
        -webkit-text-stroke: 0.3px currentColor;
    }

    #custom-cursor,
    #hover-image,
    #image-page {
        display: none !important;
    }

    body {
        position: relative;
        overflow-x: hidden;
        overflow-y: auto;
    }

    /* 1. Mobile Typography Sizes */
    body,
    .nav-btn,
    .header-title,
    #site-title,
    #contact-title,
    #legal-title,
    #mobile-legal-title,
    #text-about,
    #text-contact,
    #text-legal,
    #text-legal-mobile,
    .project-name,
    .project-type {
        font-size: clamp(14px, min(5.5svw, 2.8svh), 22px) !important;
        line-height: 1.35;
        letter-spacing: -2.5%;
        -webkit-font-smoothing: subpixel-antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    .project-description {
        font-size: clamp(12px, min(4svw, 2.2svh), 16px) !important;
        line-height: 1.4;
        margin-top: 6px;
        cursor: pointer;
    }

    /* 2. Header Structure */
    #site-header {
        position: relative;
        width: 100%;
        padding-top: 10px;
    }

    .header-group {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        display: block !important;
        margin-bottom: 24px;
    }

    .about-group,
    .contact-group {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        white-space: normal;
        width: 100% !important;
        max-width: 100% !important;
    }

    .legal-group {
        display: none !important;
    }
    #btn-legal {
        display: none !important;
    }

    #text-contact {
        white-space: normal;
    }
    #text-legal {
        white-space: normal;
    }

    .content-block,
    #text-about,
    #text-contact,
    #text-legal,
    #contact-title,
    #legal-title {
        display: block !important;
        width: 100% !important; 
        max-width: 100% !important;
    }

    .dropdown-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 3. Indent Alignment System */
    /* 10px Indent: Body Paragraphs & Project Descriptions */
    #text-about,
    #text-contact,
    #text-legal,
    #text-legal-mobile,
    .project-name,
    .project-description {
        padding-left: 10px !important;
        padding-right: 15px !important;
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* 35px Indent: Navigation Buttons & Section Titles */
    .nav-btn,
    #site-title,
    #contact-title,
    #legal-title,
    #mobile-legal-title,
    .project-type {
        padding-left: 35px !important;
        padding-right: 15px !important;
        margin-left: 0 !important;
    }

    #btn-work {
        display: block !important;
        position: absolute !important;
        top: calc(100svh - 40px) !important;
        left: 35px !important;
        padding-left: 0 !important;
        z-index: 300;
        text-align: left !important;
    }

    /* 4. Photos */
    .mobile-project-image {
        display: block;
        width: 100%;
        height: auto;
        margin-bottom: 12px;
        padding: 0 !important;
    }

    /* 5. Work Page Layout */
    #work-page {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        padding: 0 0 0px 0 !important;
        position: relative;
    }

    .project-row {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 40px;
        gap: 4px;
        padding: 0 !important;
    }

    .project-meta {
        flex: none;
        width: 100%;
        padding-left: 0 !important;
        cursor: pointer;
    }

    .project-name,
    .project-type {
        display: block;
    }

    .project-description {
        display: none;
    }

    .project-row.description-active .project-description {
        display: block;
    }

    /* 6. Mobile Legal Section */
    #mobile-legal-section {
        display: block;
        width: 100%;
        margin-top: 60px;
        padding-bottom: 40px;
    }

    #btn-legal-mobile {
        display: block;
        padding-left: 35px !important;
        background: none;
        border: none;
        cursor: pointer;
        margin: 0;
    }

    #mobile-legal-content.hidden {
        display: none !important;
    }

    #mobile-legal-content {
        display: block;
        margin: 0;
    }

    #mobile-legal-title {
        padding-left: 35px !important;
        margin: 0;
        color: #000000;
    }

    #text-legal-mobile p:first-child {
        margin-top: 0;
    }
}