@media screen and (min-width: 425px) {
    .fixed-beam {
        transform: rotate(-40deg);
    }
}

/* HERO STYLES */
@media screen and (min-width: 600px) {
    .fixed-beam {
        transform: rotate(-50deg);
    }
}

@media screen and (min-width: 769px) {
    .fixed-beam {
        transform: rotate(-60deg);
    }
}

@media screen and (min-width: 600px) {
    .hero-text h1 {
        font-size: 6rem;
    }

    .hero-text p {
        font-size: 0.95rem;
    }

    .scroll > p {
        font-size: 0.85rem;
    }
    
    .scroll .arrow {
        font-size: 1.5rem;
    }
}



/* ABOUT STYLES */

@media screen and (min-width: 426px) {
    .c1, .c2 {
        width: 75%;
    }

    .c2 {
        top: 55%;
    }
}


@media (min-width: 500px) {

    /* container anchors */
    .about-card {
        position: relative;
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        grid-template-areas:
            "about"
            "desc";
        gap: 2rem;
        padding: 2rem;
        margin: 2rem;

        /* make sizing predictable */
        /* box-sizing: border-box; */
    }

    .about-title {
        grid-area: about;
    }

    .about-text {
        grid-area: desc;
        position: relative;
        /* anchor for absolute children */
        height: 80dvh;
        width: 100%;

        /* optional but recommended: prevent visual overflow */
        /* overflow: hidden; */
        /* box-sizing: border-box; */
    }

    /* === RESET mobile animation state (do NOT force transform:none !important) === */
    .c1,
    .c2 {
        position: absolute;
        width: 65%;
        height: 35%;
        opacity: 0;
        margin: 0;

        /* reset mobile animations only */
        animation: none;
        transform: none;

        /* ensure padding/border are included in width,
           and never exceed the parent's available width */
        box-sizing: border-box;
        max-width: 100%;
    }

    /* left-anchored card (grows rightwards) */
    .c1 {
        top: 15%;
        left: 0;
        right: auto;
        /* explicitly clear any earlier right */
    }

    /* right-anchored card (grows leftwards, guaranteed to stay inside) */
    .c2 {
        top: 60%;
        right: 0;
        left: auto;
        /* explicitly clear any earlier left that might cause shifting */
    }

    /* DESKTOP slide-in + float (unchanged behaviour) */
    .c1.visible {
        animation:
            card1slide 0.8s ease 1s forwards,
            card1float 3s cubic-bezier(0.4, 0, 0.6, 1) 1.8s infinite !important;
    }

    .c2.visible {
        animation:
            card2slide 0.8s ease 1.8s forwards,
            card2float 3s cubic-bezier(0.4, 0, 0.6, 1) 2.6s infinite !important;
    }

    @keyframes card1slide {
        0% {
            opacity: 0;
            transform: translateX(-100%) translateY(0);
        }

        100% {
            opacity: 1;
            transform: translateX(0) translateY(0);
        }
    }

    @keyframes card2slide {
        0% {
            opacity: 0;
            transform: translateX(100%) translateY(0);
        }

        100% {
            opacity: 1;
            transform: translateX(0) translateY(0);
        }
    }

    @keyframes card1float {
        0% {
            transform: translateX(0) translateY(0);
        }

        50% {
            transform: translateX(0) translateY(-10px);
        }

        100% {
            transform: translateX(0) translateY(0);
        }
    }

    @keyframes card2float {
        0% {
            transform: translateX(0) translateY(0);
        }

        50% {
            transform: translateX(0) translateY(-8px);
        }

        100% {
            transform: translateX(0) translateY(0);
        }
    }

    .c1::before {
        width: 7px;
        height: 7px;
    }

    .c2::after {
        width: 7px;
        height: 7px;
    }
}

@media screen and (min-width: 900px) {
    .c1, .c2 {
        width: 55%;
        height: 40%;
    }
}

@media screen and (min-width: 1000px) {
    .c1, .c2 {
        width: 50%;
    }
}

@media screen and (min-width: 1200px) {
    .c1, .c2 {
        width: 50%;
    }
}

@media screen and (min-width: 1300px) {
    .c1, .c2 {
        width: 45%;
    }

    .c1 {
        top: 10%;
        left: 2.5%;
        right: auto;
        /* explicitly clear any earlier right */
    }

    /* right-anchored card (grows leftwards, guaranteed to stay inside) */
    .c2 {
        top: 55%;
        right: 2.5%;
        left: auto;
        /* explicitly clear any earlier left that might cause shifting */
    }

    .c1::before {
        width: 10px;
        height: 10px;
    }

    .c2::after {
        width: 10px;
        height: 10px;
    }
}


/* PROJECT STYLES */

@media screen and (min-width: 375px) {
    .folder-content {
        margin-top: 5rem;
    }
    .folder-wrapper>.face-folder {
        height: 425px;
    }

    .info-label {
        font-size: 1rem;
    }

    .info-value {
        font-size: 1rem;
    }

    .info-description {
        font-size: 1.20rem;
    }
}

@media screen and (max-width: 600px) {
    .text-editor, .nautilus {
        display: none;
    }

    .section-title {
        display: none;
    }
}


@media screen and (min-width: 601px) {
    .project {
        display: flex;
        flex-direction: column;
        padding: 0;
        height: 100dvh;
        margin-top: 5rem;
        margin-bottom: 5rem;
    }

    .section-title {
        color: white;
        font-family: 'Archivo Black', sans-serif;
        font-size: clamp(2.5rem, 5vw, 3.5rem);
        text-transform: uppercase;
        margin-bottom: 2rem;
        width: 90vw;
        letter-spacing: 1rem;
        text-align: right;
        opacity: 0;
        transform: translateY(2rem);
    }

    .section-title.visible {
        animation: letterup 0.5s ease forwards, expand-letters 1s ease forwards;
        animation-delay: 0.5s, 0.8s;
    }

    @keyframes expand-letters {
        from {
            letter-spacing: 1rem;
        }

        to {
            letter-spacing: -0.25rem;
        }
    }

    .project-card {
        display: none;
    }

    .project .nautilus * {
        box-sizing: border-box;
        font-family: 'Ubuntu', sans-serif;
    }

    .project .nautilus {
        width: 90vw;
        height: 80vh;
        display: flex;
        opacity: 0;
        border: 1px solid rgba(255, 255, 255, 0.5);
        border-radius: 12px;
    }

    .nautilus.visible {
        animation: fade-in 1s ease forwards;
        animation-delay: 1.5s;
    }

    @keyframes fade-in {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

    @keyframes letterup {
        from {
            transform: translateY(2rem);
            opacity: 0;
        }

        to {
            transform: translateY(0rem);
            opacity: 1;
        }
    }

    .left {
        width: 25%;
        height: 100%;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(15px);
        border-right: 1px solid rgba(255, 255, 255, 0.2);
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
        border-radius: 12px 0 0 12px;
        color: white;
    }

    .top-bar {
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
        padding: 1rem;
        font-weight: bold;
        background: rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 12px 0 0 0;
    }

    .item {
        display: flex;
        padding: 0.7rem;
        margin: 0.5rem;
        align-items: center;
        font-size: clamp(0.75rem, 1.2vw, 1rem);
        text-decoration: none;
        border-radius: 7px;
        background: rgba(255, 255, 255, 0.01);
        backdrop-filter: blur(8px);
        color: white;
    }

    .item:hover {
        background: rgba(255, 255, 255, 0.15);
    }

    .item i {
        margin-right: clamp(0.25rem, 0.8vw, 0.75rem);
    }

    .item.active {
        background: rgba(255, 255, 255, 0.2);
    }

    .item-sub {
        margin-left: clamp(0.75rem, 2vw, 2.5rem);
        background-color: rgba(255, 255, 255, 0.01);
    }

    .right {
        width: 100%;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(20px);
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 0 12px 12px 0;
        display: flex;
        flex-direction: column;
    }

    .status-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(10px);
        padding: 1rem;
        border-radius: 0 12px 0 0;
    }

    .l {
        display: flex;
        font-weight: bold;
    }

    .l i {
        margin-right: 0.5rem;
    }

    .r i {
        color: #777777 !important;
    }

    .slash {
        margin: 0 1rem;
    }

    .now {
        color: white;
    }

    .available {
        color: rgba(255, 255, 255, 0.5);
    }

    .root:hover {
        cursor: pointer;
    }

    .folder-area {
        height: 100%;
        display: flex;
        justify-content: flex-start;
        align-items: flex-start;
        flex-wrap: wrap;
        align-content: flex-start;
    }

    .pair {
        margin: 1.2rem;
        width: fit-content;
        padding: 0.4rem;
        padding-bottom: 1.2rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        border-radius: 12px;
    }
    .pair:hover {
        background: rgba(255, 255, 255, 0.05);
    }
    .pair:active {
        background: rgba(255, 255, 255, 0.15);
    }
    .f {
        width: 100px;
        height: 100px;
        background: #A4CAED;
        clip-path: url(#folderClip);
        -webkit-clip-path: url(#folderClip);
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .f i {
        color: #4A89D4 !important;
        font-size: 1.5rem;
        z-index: 1;
        margin-top: 0.5rem;
    }

    .fname {
        cursor: default;
        color: white;
        user-select: none;
    }

    .md-icon {
        width: 100px;
        height: 100px;
    }

    /* VIEWER */
    .project .text-editor {
        width: 80vw;
        height: 90vh;
        position: absolute;
        border-radius: 12px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        opacity: 0;
        animation: fade-in 1s ease forwards;
        border: 1px solid rgba(255, 255, 255, 0.5);
    }

    .project .text-editor * {
        font-family: 'Ubuntu', sans-serif;
    }

    .single-tab {
        height: 8%;
        background-color: #122B41;
        border-radius: 12px 12px 0 0;
        display: flex;
        align-items: center;
        flex: 0 0 auto;
        position: relative;
        z-index: 2;
        color: white;
    }

    .single-tab p:nth-child(1) {
        position: absolute;
        left: 0;
        margin-left: 1rem;
    }
    .single-tab p:nth-child(2) {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .btns {
        position: absolute;
        display: flex;
        right: 0;
        font-size: 1.25rem;
        margin-right: 1rem;
        align-items: center;
    }

    .btns .info {
        width: 20px;
        height: 20px;
        line-height: 20px;
        text-align: center;
        border-radius: 50%;
        padding: 0.1rem;
        background-color: rgba(41, 63, 83, 0.5);
        margin-right: 1rem;
        font-size: 1rem;
    }

    .btns i {
        border-radius: 50%;
        padding: 0.1rem;
        background-color: rgba(41, 63, 83, 0.5);
    }

    .btns .info:hover, .btns i:hover {
        background-color: rgba(41, 63, 83, 1);
        cursor: pointer;
    }

    .content-area {
        border-radius: 0 0 12px 12px;
        padding: 2rem;
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        overflow-y: auto;
        overflow-x: hidden;
        background: linear-gradient(rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.95)), url(assets/1.png) no-repeat center/cover;
        color: white;
        /* Firefox scrollbar styling */
        scrollbar-width: thin;
        scrollbar-color: #888 #2a2a2a;
        /* Ensure scrollbar appears on top */
        position: relative;
        z-index: 15;
    }

    /* Webkit scrollbar styling for .content-area */
    .content-area::-webkit-scrollbar {
        width: 14px;
        background: transparent;
        z-index: 9999 !important;
        position: relative;
    }

    .content-area::-webkit-scrollbar-track {
        background: #2a2a2a;
        border-radius: 8px;
        margin: 4px;
        z-index: 9999 !important;
        position: relative;
    }

    .content-area::-webkit-scrollbar-thumb {
        background-color: #888;
        border-radius: 8px;
        border: 2px solid #2a2a2a;
        min-height: 30px;
        z-index: 10000 !important;
        position: relative;
    }

    .content-area::-webkit-scrollbar-thumb:hover {
        background-color: #aaa;
    }

    .content-area::-webkit-scrollbar-thumb:active {
        background-color: #bbb;
    }

    .content-area>* {
        position: relative;
        z-index: 10;
    }

    .content-area .head {
        font-family: 'Bodoni Moda', serif;
        font-size: clamp(3rem, 10vw, 8rem);
    }

    .content-area .body * {
        font-family: 'Inter', sans-serif;
    }

    .content-area .sub-tag {
        font-family: 'Inter', sans-serif;
        font-size: clamp(1rem, 2.5vw, 1.5rem);
        margin-top: 2rem;
        line-height: 1.25;
    }

    .sub-tag span {
        font-size: clamp(1.5rem, 3.5vw, 2rem);
    }

    .sub-button {
        text-decoration: none;
        margin-top: 1.5rem;
        width: fit-content;
        padding: 0.5rem;
        border-radius: 20px;
        display: flex;
        align-items: center;
        border: 2px solid #007bff;
        transition: background-color 0.3s ease, transform 0.3s ease;
        color: white;
    }

    .sub-button span {
        margin-left: 0.25rem;
    }

    .sub-button:hover {
        background-color: #007bff;
        color: white;
        box-shadow: 0 0 12px rgba(0, 123, 255, 0.7);
        transform: scale(1.05);
    }

    .body .sub-head {
        font-family: 'Bodoni Moda', serif;
        font-size: clamp(2rem, 5vw, 4rem);
    }

    .divider {
        width: 100%;
        border: 1px solid yellow;
        position: relative;
        margin-top: 2rem;
        margin-bottom: 3rem;
    }

    .body .sub-text {
        margin-top: 2rem;
    }

    .body .sub-text h3 {
        font-family: 'Inter', sans-serif;
        font-size: clamp(1rem, 2.5vw, 1.5rem);
        font-weight: bold;
    }

    .sub-text-content {
        margin-top: 1rem;
    }

    .body .sub-text p {
        line-height: 1.75;
        margin-bottom: 0.95rem;
        font-size: clamp(1rem, 2vw, 1.2rem);
    }


    .file-info {
        z-index: 2;
        width: 40%;
        height: 100%;
        max-width: 350px;
        position: absolute;
        top: 8%;
        right: 0;
        background-color: #000D1A;
        border: 1px solid rgba(255, 255, 255, 0.1);

        transform: translateX(100%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    }

    .file-info.open {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
        z-index: 10000;
    }

    .info-card {
        margin: 1rem;
        margin-top: 2rem;
        background-color: #14202C;
        border-radius: 15px;
        padding: 1rem;
        overflow-y: visible;
    }

    .info-title {
        color: white;
        text-align: center;
        font-size: 1.2rem;
    }

    .info-head {
        color: rgba(255, 255, 255, 0.5);
        font-size: 0.95rem;
    }

    .info-data {
        color: white;
        margin-top: 0.7rem;
        border-bottom: 2px solid black;
        padding-bottom: 0.8rem;
    }


    .bookranker {
        background: linear-gradient(rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.95)), url(assets/2.png) no-repeat center/cover;
    }

    .xbank-py {
        background: linear-gradient(rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.95)), url(assets/3.png) no-repeat center/cover;
    }

    .sriram-pf {
        background: linear-gradient(rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.95)), url(assets/4.png) no-repeat center/cover;
    }

    .italic {
        font-style: italic;
    }

    /* CONTACT STYLES */

    .contact-header {
        font-size: clamp(2.4rem, calc(1.6rem + 2.2vw), 4rem);
    }

    .form-content label {
        font-size: clamp(1.15rem, calc(0.93rem + 0.6vw), 1.6rem);
    }

    .alt-contact {
        font-size: clamp(1rem, calc(0.85rem + 0.8vw), 1.3rem);
    }

    .form-group input, .form-group textarea {
        font-size: clamp(1.05rem, 0.9rem + 0.6vw, 1.25rem);
    }
}

@media screen and (min-width: 900px) {
    .form-content {
        max-width: 800px;
    }
}