@font-face {
    font-family: "ITC";
    src: url("Fonts/avantgarde_demi.ttf") format("truetype");
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Instrument";
    src: url("Fonts/INSTRUMENTSERIF-REGULAR.TTF")format("truetype");
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Literata";
    src: url("Fonts/Literata-VariableFont.ttf") format("truetype");
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Switzer";
    src: url("Fonts/Switzer-Variable.ttf") format("truetype");
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Satoshi";
    src: url("Fonts/Satoshi-Variable.ttf") format("truetype");
    font-style: normal;
    font-display: swap;
}

html::-webkit-scrollbar {
    display: none;
}

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

html, body {
    margin: 0;
    padding: 0;
    background-color: #0B0B0B;
}
/* 1. The Main Wrapper */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: #0B0B0B;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

/* 2. The Stacking Container */
.loading-content-wrapper {
    position: flex;
    flex-direction: column;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 3. The Grid */
#grid-container {
    display: grid !important;
    grid-template-columns: repeat(11, 30px);
    grid-template-rows: repeat(6, 30px);
    gap: 8px;
}

#loading-text {
    position: relative;
    left: -140px;
    color: #ffffff;
    font-family: "Instrument", sans-serif;
    font-size: 40px;
}

.square {
    width: 30px;
    height: 30px;
    background-color: #0B0B0B;
    border-radius: 2px;
}

#loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.desktop {
    background-color: #001A36;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 100vh;
    height: auto;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

.desktop.loaded {
    opacity: 1;
}

/* Background container with SVG image */
.background-container {
    position: absolute;
    width: 100vw;
    height: 22358px;
    padding: 500px 160px; 
    box-sizing: border-box;
    z-index: 1;
}

.background-image {
    scale: 1;
    width: 100%;
    object-fit: contain;
    object-position: center; 
}

.leftsidebar-container {
    position: absolute;
    text-align: center;
    left: 70px;
    top: 90px;
}

/* Left sidebar between page edge and SVG */
.left-sidebar {
    position: fixed;
    top: 90px; /* Aligned with leftsidebar-container top */
    left: 70px; /* Aligned with leftsidebar-container left */
    width: 61px;
    height: 658px;
    z-index: 5; /* ensure it sits above the background SVG */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 8px;
    opacity: 0;
    transform: translateY(-40px);
    transform-origin: center;
    will-change: transform;
    outline: none;
    border: none;
    /* Transition removed - now handled by Anime.js */
    background: none;
}
.sidebar-bg {
    position: absolute;
    width: 100%;
    height: 80%;
    border-radius: 45px;
    background: #0380F7;
    z-index: 0;
    box-shadow: none;
    /* Transition removed - now handled by Anime.js */
}
/* Hover effects now handled by Anime.js in script.js */

.left-sidebar .sidebar-icon {
    position: relative;
    z-index: 1;
    top: 10px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Show desktop icon by default, hide mobile icon */
.left-sidebar .sidebar-icon-mobile {
    display: none;
    opacity: 0;
}

.left-sidebar .sidebar-icon-desktop {
    display: block;
    opacity: 1;
}

/* Rotated sideways text box inside the left sidebar */
.left-sidebar .sidebar-text {
    position: absolute;
    top: calc(35% + var(--sidebar-text-offset-y, 0px));
    left: calc(50% + var(--sidebar-text-offset-x, 0px));
    transform: translate(-50%, -50%) rotate(90deg);
    padding: 6px 10px;
    color: #ffffff;
    font-family: "Instrument";
    font-size: 50px;
    letter-spacing: 2px;
    border-radius: 6px;
    white-space: nowrap;
}

.lower-left-sidebar {
    position: fixed;
    border-radius: 45px;
    top: 400px;
    width: 61px; 
    height: 300px;
    background: #ffffff;
    z-index: 4; /* ensure it sits above the background SVG */
    box-sizing: border-box;
    opacity: 0;

}

.desktop .div {
    background-color: #002C5B;
    width: 100%;
    max-width: 1200px;
    top: 2.5rem;
    padding: 6rem 1.5rem 4rem;
    margin: 0 auto;
    z-index: 2;
    box-sizing: border-box;
    position: relative;
}

.hero {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    
}

/* Navigation - positioned in top-right corner */
.desktop .menu-container,
.desktop .menu {
    position: fixed;
    max-width: calc(100vw - 50px);
    height: auto;
    top: 5vh;
    z-index: 10;
    right: 200px;
    left: auto;
    opacity: 1;
    transform: translateX(0);
    /* Transition removed - now handled by Anime.js */
}

.desktop .menu-group,
.desktop .overlap-group {
    position: relative;
    width: 100%;
    height: fit-content;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 9px;
    padding: 16px 20px;
    border-radius: 10px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 200px;
}

/* Right-side SVG menu that replaces the menu-group after scroll */

.right-menu-icon {
    width: 78px;
    height: auto;
    display: block;
}

.menu-visible { 
    opacity: 1; 
    transform: translateX(0); 
    pointer-events: auto; 
    transition: opacity 250ms ease, transform 250ms ease; /* Fallback transition */
}
.menu-hidden { 
    opacity: 0; 
    transform: translateX(6px); 
    pointer-events: none; 
    transition: opacity 250ms ease, transform 250ms ease; /* Fallback transition */
}

/* Increase specificity so state classes override base styles */
.desktop .group.menu-visible { 
    opacity: 1; 
    transform: translateX(0); 
    pointer-events: auto; 
    transition: opacity 250ms ease, transform 250ms ease; /* Fallback transition */
}
.desktop .group.menu-hidden { 
    opacity: 0; 
    transform: translateX(6px); 
    pointer-events: none; 
    transition: opacity 250ms ease, transform 250ms ease; /* Fallback transition */
}
.desktop .right-menu.menu-visible { 
    opacity: 1; 
    transform: translateX(0); 
    pointer-events: auto; 
    transition: opacity 250ms ease, transform 250ms ease; /* Fallback transition */
}
.desktop .right-menu.menu-hidden { 
    opacity: 0; 
    transform: translateX(6px); 
    pointer-events: none; 
    transition: opacity 250ms ease, transform 250ms ease; /* Fallback transition */
}

.desktop .text-wrapper-2,
.desktop .text-wrapper-3,
.desktop .text-wrapper-4,
.desktop .text-wrapper-5 {
    margin: 0;
    font-family: "Switzer";
    color: #ffffff;
    font-size: 16px;
    font-weight: 400;
    text-align: left;
    letter-spacing: 0.5px;
    line-height: 1.5;
    white-space: nowrap;
    position: relative;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    background-color: transparent;
}

.desktop .text-wrapper-2:hover,
.desktop .text-wrapper-3:hover,
.desktop .text-wrapper-4:hover,
.desktop .text-wrapper-5:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}


.title-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 32rem;
}

.video-container {
    width: 100%;
    max-width: 600px;
    height: auto;
    min-height: 300px;
    display: block;
    z-index: 3;
}

.video-background {
    max-height: 75vh;
    object-fit: contain;
    display: block;
    background-color: transparent;
    opacity: 1;
}

/* Main heading - positioned on the left side */
.desktop .title-wrapper {
    margin: 0;
    font-weight: normal;
    font-family: "Instrument";
    color: #ffffff;
    font-size: clamp(3rem, 6vw, 4rem);
    display: block;
    margin: 0;
}

.title-appeared {
    opacity: 1 !important;
}

/* Subtitle text - below the main heading */
.desktop .lowertitle {
    margin: 0;
    font-family: "Switzer";
    font-weight: 300;
    color: #ffffff;
    font-size: clamp(0.95rem, 2.4vw, 1.1rem);
    letter-spacing: 1px;
    line-height: 1.6;
}

/* Contact info - at the bottom of the text block */
.desktop .detailtitle {
    margin: 0;
    width: 200px;
    font-family: "Switzer";
    font-weight: 300;
    color: #ffffff;
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.desktop .About-container {
    position: relative;
    width: 100%;
    margin-top: 15rem;
    margin-bottom: 15rem;
    padding: 0 1.5rem;
    display: flex;
    justify-content: center;
    box-sizing: border-box;
}

.desktop .About {
    display: block;
    place-items: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}


.desktop .Topilogical-background {
    width: 100%;
    height: auto;
    display: block;
}

.desktop .Portrait-and-about-text-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #002C5B;
    padding: 2rem;
}

.desktop .Portrait-and-about-text-container > * {
    grid-area: 1/1;
}

.desktop .Portrait {
    width: 100%;
    display: block;
}

.desktop .Name {
    margin: 0;
    font-weight: normal;
    font-family: "Instrument";
    font-size: 3.2rem;
    display: block;
    color: #ffffff;
    text-align: center;
    justify-self: start;
    z-index: 2;
}

.desktop .Divider {
    width: 100%;
    height: 8px;
    background-color: #ffffff;
    margin: 0.3rem 0;
    display: block;
}

.desktop .About-text {
    margin: 0;
    font-weight: lighter;
    font-family: "Literata";
    font-size: 1.2rem;
    display: block;
    color: #ffffff;
    text-align: center;
    justify-self: start;
    z-index: 2;
}

.project-container-wrapper {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 6rem auto 0;
    padding: 0 1.5rem 6rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 6rem;
    box-sizing: border-box;
}

.project-container {
    position: relative;
    display: block;
}

.desktop .project-information {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    grid-template-areas:
        "img1 img1"
        "title desc"
        "subtitle desc"
        "img2 img2";
    column-gap: 32px;
    row-gap: 40px;
    align-items: start;
}

.desktop .project-image-1 {
    display: block;
    grid-area: img1;
    width: 100%;
    opacity: 1; /* Changed from 0 - flicker animation disabled */
}

.desktop .project-title-text {
    margin: 0;
    font-weight: normal;
    text-decoration: underline;
    display: block;
    font-family: "Instrument";
    font-size: clamp(2.3rem, 5vw, 4.3rem);
    color: #ffffff;
    grid-area: title;
    opacity: 1; /* Changed from 0 - flicker animation disabled */
}

.desktop .project-sub-title {
    margin: 0;
    font-weight: normal;
    display: block;
    font-family: "Instrument";
    font-size: clamp(1.2rem, 3vw, 2.2rem);
    color: #ffffff;
    grid-area: subtitle;
    opacity: 1; /* Changed from 0 - flicker animation disabled */
}

.desktop .project-description {
    margin: 0;
    display: block;
    font-family: "Switzer";
    font-size: 1.3rem;
    color: #ffffff;
    grid-area: desc;
    max-width: 100%;
    line-height: 1.5;
    opacity: 1; /* Changed from 0 - flicker animation disabled */
}

.desktop .project-image-2 {
    display: block;
    grid-area: img2;
    width: 100%;
    opacity: 1; /* Changed from 0 - flicker animation disabled */
}

/* Sidebar animations now handled by Anime.js - keeping classes for compatibility */
.sidebar-appeared {
    opacity: 1 !important;
}

.lower-left-sidebar-appeared {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

/* Right menu button & dropdown */
.right-menu {
    position: fixed;
    top: 90px; /* Aligned with leftsidebar-container top */
    right: 48px;
    z-index: 11;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    opacity: 0;
    transform: translateX(6px);
    pointer-events: none;
    visibility: hidden;
}

.right-menu[aria-hidden="false"] {
    visibility: visible;
    pointer-events: auto;
}

.right-menu-button {
    appearance: none;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    line-height: 0;
}

.right-menu-dropdown {
    position: absolute;
    top: calc(100% + 16px);
    right: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 16px 20px;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    transform-origin: top right;
    /* Transition removed - now handled by Anime.js */
    pointer-events: none;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Dropdown animation now handled by Anime.js - keeping class for state management */
.right-menu.open .right-menu-dropdown {
    pointer-events: auto;
}

/* Ensure cloned menu-group fits dropdown */
.right-menu-dropdown .menu-group,
.right-menu-dropdown .overlap-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0;
    background: transparent;
    border: none;
    min-width: auto;
}

.right-menu-dropdown .text-wrapper-2,
.right-menu-dropdown .text-wrapper-3,
.right-menu-dropdown .text-wrapper-4,
.right-menu-dropdown .text-wrapper-5 {
    font-family: "Switzer";
    color: #ffffff;
    font-size: 16px;
    font-weight: 400;
    text-align: left;
    letter-spacing: 0.5px;
    line-height: 1.5;
    white-space: nowrap;
    position: relative;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    background-color: transparent;
}

.right-menu-dropdown .text-wrapper-2:hover,
.right-menu-dropdown .text-wrapper-3:hover,
.right-menu-dropdown .text-wrapper-4:hover,
.right-menu-dropdown .text-wrapper-5:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
}

/* ==========================
   REORDERED MEDIA QUERIES
   ========================== */

/* 1. Desktop Tweaks (Largest) */
@media (min-width: 1200px) {
    .desktop .div {
        padding-top: 10rem;
    }

    .project-container-wrapper {
        margin-top: 8rem;
    }
}

/* 2. Tablet / Wide Mobile */
@media (min-width: 768px) {
    .hero {
        flex-direction: row;
        align-items: center;
        justify-content: center;
    }

    .title-container,
    .video-container {
        flex: 1 1 0;
    }

    .desktop .About {
        grid-template-columns: auto minmax(300px, 1fr);
        grid-template-areas:
            "Arch1 Arch1"
            "LPortrait Atext"
            "Arch2 Arch2";
    }

    .desktop .About-text {
        justify-self: start;
        text-align: left;
    }
}

/* 3. Medium Screen Layouts */
@media (max-width: 1460px) {
    .leftsidebar-container {
        left: 16px;
        top: 16px;
    }

    .left-sidebar {
        top: 16px; 
        left: 16px; 
        width: clamp(40px, 10vw, 56px);
        height: clamp(40px, 10vw, 56px);
        border-radius: 50%;
        padding-top: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar-bg {
        height: 100%;
        border-radius: 50%;
    }

    .left-sidebar .sidebar-text {
        display: none;
    }

    .lower-left-sidebar {
        display: none;
    }

    .left-sidebar .sidebar-icon-desktop {
        display: none;
        opacity: 0;
    }
    
    .left-sidebar .sidebar-icon-mobile {
        display: block;
        opacity: 1;
        top: 0;
        left: 5px;
        width: clamp(60px, 10vw, 80px);
        object-fit: contain;
        position: absolute;
        z-index: 1;
    }
    
    .desktop .Portrait-and-about-text-container {
        width: 50%;
    }
    
    .left-sidebar .sidebar-bg {
        display: none;
    }

    .desktop .menu-container,
    .desktop .menu {
        right: 60px;
        top: 2.5vh;
        max-width: calc(100vw - 140px);
    }

    .desktop .menu-group,
    .desktop .overlap-group {
        padding: 10px 14px;
        min-width: 160px;
        gap: 6px;
    }

    .desktop .text-wrapper-2,
    .desktop .text-wrapper-3,
    .desktop .text-wrapper-4,
    .desktop .text-wrapper-5 {
        font-size: 14px;
        padding: 8px 12px;
    }

    .right-menu {
        top: 16px; 
        right: 16px;
    }

    .right-menu-icon {
        width: clamp(60px, 10vw, 80px);
    }

    .right-menu-dropdown {
        right: 0;
        top: calc(100% + 12px);
        min-width: 160px;
        padding: 10px 14px;
    }

    .right-menu-dropdown .text-wrapper-2,
    .right-menu-dropdown .text-wrapper-3,
    .right-menu-dropdown .text-wrapper-4,
    .right-menu-dropdown .text-wrapper-5 {
        font-size: 14px;
        padding: 8px 12px;
    }
}

/* 4. Background Adjustment */
@media (max-width: 1267px) {
    .desktop {
        background-color: #002C5B;
    }
}

/* 5. Mobile Layout (Standard) */
@media (max-width: 768px) {

    .desktop {
        background-color: #002C5B;
    }

    .desktop .menu-container,
    .desktop .menu {
        right: 10px;
        top: 3vh;
        max-width: calc(100vw - 200px);
    }

    .desktop .menu-group,
    .desktop .overlap-group {
        padding: 8px 12px;
        min-width: 200px;
        gap: 4px;
    }

    .desktop .About-text,
    .desktop .Portrait-and-about-text-container {
        width: 100%;
    }

    .desktop .text-wrapper-2,
    .desktop .text-wrapper-3,
    .desktop .text-wrapper-4,
    .desktop .text-wrapper-5 {
        font-size: 13px;
        padding: 6px 10px;
        letter-spacing: 0.3px;
    }

    .right-menu {
        top: 16px; 
        right: 20px;
    }

    .right-menu-dropdown {
        right: 20px;
        top: calc(100% + 10px);
        min-width: 140px;
        padding: 8px 12px;
    }

    .right-menu-dropdown .text-wrapper-2,
    .right-menu-dropdown .text-wrapper-3,
    .right-menu-dropdown .text-wrapper-4,
    .right-menu-dropdown .text-wrapper-5 {
        font-size: 13px;
        padding: 10px 0px;
        letter-spacing: 0.3px;
    }
}

/* 6. Small Phone Adjustments */
@media (max-width: 767px) {
    .video-container {
        display: none;
    }

    .title-container {
        max-width: 100%;
        width: 100%;
    }

    .desktop .title-wrapper {
        width: 100%;
        margin: 0;
    }

    .desktop .project-information {
        grid-template-columns: 1fr;
        grid-template-areas:
            "img1"
            "title"
            "subtitle"
            "img2";
    }

    .desktop .project-description {
        display: none;
    }
}