html,
body {
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
    height: 100%;
    font-family: Arial, sans-serif;
    color: #333;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: url('../media/Circuit_Primary_2.svg') no-repeat center center / cover;
    z-index: -1;
    pointer-events: none;
}

.up-icon,
.down-icon {
    color: #fff;
    position: absolute;
    right: 1.5rem;
    z-index: 2;
    font-size: 2.5rem;
    text-decoration: none;
}

.up-icon {
    top: 1.5rem;
}

.down-icon {
    bottom: 1.5rem;
}

.container {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    height: 100dvh;
    scroll-behavior: smooth;
    scroll-snap-stop: always;
    -webkit-overflow-scrolling: touch;
    scroll-padding-top: 1px;
}

.section {
    overflow-x: hidden;
    scroll-snap-align: start;
    min-height: 100dvh;
    padding: 2rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

#header {
    background: url('../media/Circuit_Primary.svg') no-repeat center center / cover;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

header h1 {
    font-size: 6rem;
    margin-bottom: 0.5rem;
    text-shadow: #222 2px 2px 4px;
}

header p {
    font-size: 2rem;
    margin-top: 0;
}

/* header down icon */
#header .down-icon {
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    animation: openCloseDown 2.2s ease-in-out infinite;
}

/*------icon animations---------*/
/* .up-icon {
    animation: openCloseUp 2.2s ease-in-out infinite;
}

.down-icon {
    animation: openCloseDown 2.2s ease-in-out infinite;
} */

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

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

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

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

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

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

.section hr {
    border: none;
    border-top: 2px solid #3a53c3c2;
    margin: 0.5rem 0;
    width: 60px;
}

.profile-images {
    display: flex;
    gap: 7rem;
    margin-top: 5rem;
    animation: fadeIn 1s ease forwards;
    opacity: 0;
    animation-delay: 0.8s;
}

.profile-images img {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
}

p {
    text-shadow: #222 1px 1px 2px;
    margin-bottom: 2rem;
    text-align: center;
}

/*-------------------about me------------*/
#about {
    min-height: 100vh;
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 6rem 3rem 4rem 3rem;
    box-sizing: border-box;
}

#about h3,
#about p {
    width: 65%;
    text-align: left;
}


#about h3 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #fff;
    letter-spacing: 0.5px;
    text-align: left;
    text-shadow: #222 2px 2px 4px;
}

.cv-link {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1.2rem;
    background: #232d72;
    color: #fff;
    text-shadow: #222 1px 1px 2px;
    border-radius: 2px;
    text-decoration: none;
    font-weight: 800;
    transition: background 0.18s;
}

section p {
    font-size: 1.2rem;
    line-height: 1.6;
    color: #c6f4ff;
    letter-spacing: 0.5px;
}

/*--------skills--------*/
#skills {
    min-height: 100vh;
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 6rem 3rem 4rem 3rem;
    box-sizing: border-box;
}

#skills h4,
#skills p {
    width: 65%;
    text-align: left;
}

#skills h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #fff;
    letter-spacing: 0.5px;
    text-align: left;
    text-shadow: #222 2px 2px 4px;
}

#skills,
#about,
#projects {
    h2 {
        color: #fff;
        font-size: 3rem;
        text-shadow: #222 2px 2px 4px;
        margin-bottom: 0%;
    }

    p {
        font-size: large;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

header.section h1 {
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
    animation-delay: 0.1s;
}

header.section p {
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
    animation-delay: 0.2s;
}

header.section h1,
header.section p,
.profile-images {
    will-change: opacity, transform;
}

.section.fade-in {
    opacity: 1;
}

.scroll-icon {
    font-size: 2.5rem;
    margin-top: 2rem;
    text-decoration: none;
    z-index: 10;
}

/*------projects-------*/
#projects {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0.5rem 1rem;
    background: radial-gradient(circle at center, rgba(40, 50, 120, .45), rgba(10, 10, 30, .95));
    /* background: url('../media/Circuit Primary_projects.svg') no-repeat center center / cover; */
}

#projects h2,
#projects>p,
#projects hr {
    text-align: center;
}

/* ---carrousel--- */
.projects-carousel {
    width: 100%;
    max-width: 1400px;
    margin-top: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.carousel-track {
    width: 100%;
}

.carousel-btn {
    background: none;
    border: none;
    color: white;
    font-size: 4rem;
    cursor: pointer;
    transition: transform .2s ease;
}

.carousel-btn:hover {
    transform: scale(1.15);
}

/*------project card--------*/
.project-card {
    display: none;
    width: 100%;
    min-height: 65vh;
    padding: 2rem;
    box-sizing: border-box;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(115, 136, 255, .18), rgba(115, 136, 255, .08));
    border: 1px solid rgba(255, 255, 255, .1);
    backdrop-filter: blur(10px);
    gap: 2rem;
}

.project-card.active {
    display: flex;
}

/*-------gallery-------*/
.project-gallery {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-main-img {
    width: 100%;
    border-radius: 12px;
    cursor: pointer;
    object-fit: fill;
    aspect-ratio: 16 / 9;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, .1);
}

.project-thumbs {
    display: flex;
    gap: 1rem;
}

.project-thumbs img {
    width: 50%;
    border-radius: 10px;
    cursor: pointer;
    object-fit: fill;
    aspect-ratio: 16 / 9;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, .1);
}

/*-----content-------*/
.project-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-content h3 {
    color: white;
    font-size: 2rem;
    margin-bottom: .5rem;
}

.project-content h4 {
    color: #7be8ff;
    margin-bottom: 1rem;
}

.project-content p {
    text-align: left;
    margin-bottom: 1rem;
}

.project-content ul {
    color: white;
    padding-left: 1.2rem;
    margin-bottom: 2rem;
}

.project-content li {
    margin-bottom: .5rem;
}

.project-link {
    margin-top: auto;
    display: inline-block;
    width: fit-content;
    padding: .8rem 1.4rem;
    background: #232d72;
    color: white;
    text-decoration: none;
    border-radius: 8px;
}

.project-link:hover {
    background: #48a4ad;
}

/*----contact-----*/
.contact-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.contact-content {
    margin-top: -5rem;
    width: 90%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
}

.contact-content h2 {
    color: #fff;
    font-size: 3rem;
    text-shadow: #222 2px 2px 4px;
    width: 65%;
    margin-top: 0px;
    text-align: left;
}

.contact-content a {
    color: #5ad5d5;
    text-decoration: underline;
    transition: color 0.18s;
}

.contact-content a:hover,
.contact-content a:focus {
    color: #fff;
}

.contact-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 1.2rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    background: radial-gradient(circle at center, rgba(40, 50, 120, 0.25), rgba(10, 10, 30, 0.75));
    backdrop-filter: blur(5px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
}

.contact-footer h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: #5ad5d5;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.footer-links a:hover {
    color: #fff;
}

.footer-copy {
    font-size: 0.85rem;
    opacity: 0.7;
    margin: 0;
}

/*----lightbox-----*/
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    cursor: zoom-out;
}

.lightbox.active {
    display: flex;
}

/* ---mobile responsive--- */
@media (max-width: 768px) {

    * {
        box-sizing: border-box;
    }

    html,
    body {
        font-size: 90%;
        overflow: hidden;
    }

    body::before {
        background: url('../media/Circuit_Primary_mobile.svg') no-repeat center center / cover;
    }

    #header {
        background: url('../media/Circuit_Primary_mobile_header.svg') no-repeat center center / cover;
    }

    /* --------section--------- */

    .section {
        padding: 4rem 1.5rem;
        min-height: 100dvh;
    }

    .container {
        height: 100dvh;
    }

    /* ----header------- */

    header h1 {
        font-size: 2.7rem;
        text-align: center;
        line-height: 1.1;
    }

    header p {
        font-size: 1.2rem;
        text-align: center;
    }

    .profile-images {
        margin-top: 2rem;
    }

    .profile-images img {
        width: 220px;
        height: 220px;
    }

    /* -----about------ */

    #about,
    #skills,
    #contact {
        padding: 4rem 1.5rem;
        align-items: flex-start;
    }

    #about h2,
    #skills h2,
    #projects h2,
    .contact-content h2 {
        font-size: 2.2rem;
    }

    #about h3 {
        font-size: 1.7rem;
        width: 100%;
    }

    #about h3,
    #about p,
    #skills h4,
    #skills p {
        width: 100%;
        text-align: left;
    }

    /* -----skills------ */

    #skills h4 {
        font-size: 1.1rem;
    }

    /* ----projects------ */

    #projects {
        padding: 4rem 1rem;
    }

    .projects-carousel {
        width: 100%;
        gap: .5rem;
        margin-top: 1rem;
    }

    .carousel-btn {
        font-size: 2.5rem;
        flex-shrink: 0;
    }

    .project-card {
        flex-direction: column;
        min-height: auto;
        padding: 1rem;
        gap: 1rem;
    }

    .project-gallery,
    .project-content {
        width: 100%;
    }

    .project-main-img {
        width: 100%;
    }

    .project-thumbs {
        gap: .5rem;
    }

    .project-thumbs img {
        width: calc(50% - .25rem);
    }

    .project-content h3 {
        font-size: 1.6rem;
    }

    .project-content h4 {
        font-size: 1rem;
    }

    .project-content p,
    .project-content li {
        font-size: .95rem;
    }

    .project-link {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    /* -----contact------- */

    .contact-content {
        width: 100%;
        margin-top: 0;
        padding: 0;
        align-items: center;
    }

    .contact-content h2 {
        width: 100%;
        text-align: center;
    }

    .contact-content p {
        width: 100%;
        text-align: center;
        font-size: 1rem;
    }

    #contact {
        display: flex;
        flex-direction: column;
        min-height: 100dvh;
        justify-content: space-between;
    }

    /* ----footer------- */

    .contact-footer {
        position: relative;
        width: 100%;
        margin-top: auto;
        padding: 1.2rem 2rem;
        box-sizing: border-box;
    }

    .contact-footer h3 {
        font-size: 1rem;
        text-align: center;
    }

    .footer-links {
        gap: .8rem;
    }

    .footer-links a {
        font-size: .85rem;
    }

    .footer-copy {
        text-align: center;
        font-size: .75rem;
    }

    /* ------scroll-icons------- */

    .scroll-icon {
        font-size: 2rem;
    }

    .up-icon,
    .down-icon {
        font-size: 2rem;
        right: 1rem;
    }
}