.modal-close:focus {
    outline: none;
    box-shadow: none;
}
html{
    font-family: arial, sans-serif;
    font-size: 16px;
    line-height: 24px;
    background: #FAFAFA;
}

header{
    width: 100%;
    padding: 18px 0;
    box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.1);
    position: fixed;
    z-index: 10;
    background: #FFFFFF;
}

.header_inner{
    width: 86%;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 0 auto;
    gap: 30px;
}

header nav{
    display: flex;
    justify-content: space-between;
    flex-wrap: nowrap;
    column-gap: 32px;
    flex-direction: row;
    align-items: center;
}

footer{
    width: 100%;
    padding: 18px 0;
    background: #000000;
}

.contact_footer{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.contact_footer img{
    width: 24px;
    height: 24px;
}

.copyright{
    color: #FFFFFF;
    padding-top: 4px;
}

.logo{
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    flex-wrap: nowrap;
    column-gap: 10px;
}

.logo div{
    padding-top: 4px;
}

.header_container{
    height: 750px;
    width: 100%;
    z-index: 0;
    position: relative;
}

.header_container_img{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* Overlay to darken the header image */
.header_container::before{
    content: "";
    position: absolute;
    inset: 0; 
    background: rgba(0, 0, 0, 0.45); 
    z-index: 1;
    pointer-events: none; 
}

.header_container section button{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    border: none;
    border-radius: 10px;
    background: #FFFFFF;
    color: #000000; 
    transition: background-color 200ms ease;
    cursor: pointer;
    width: 150px;
    height: 24px;
    padding: 22px 20px;
}

.header_container section button:hover{
    background: #F0F0F0; 
}

button img{
    width: 20px;
    height: auto;
}

.header_container section{
    position: absolute;
    z-index: 2; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    color: #FFFFFF;
    top: 53%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    gap: 30px;
}

.header_container section h1{
    text-align: center;
}

.header_container section p{
    text-align: center;
}

h2{
    padding: 80px 0 48px 0;
    width: 100%;
    text-align: center;
}

.cards_container{
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    padding: 0 53px 0 53px;
    gap: 32px;
}

.card{
    width: 405px;
    height: 230px;
    background: #FFFFFF;
    border-radius: 10px;
    box-shadow: 0 4px 4px 2px rgba(0, 0, 0, 0.05);
    transition: box-shadow 200ms ease;
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-content: center;
    padding: 32px;
}

.card:hover{
    box-shadow: 0 4px 4px 2px rgba(0, 0, 0, 0.1);
}

.card img{
    background: #000000;
    padding: 10px;
    border-radius: 10px;
    width: 48px;
    height: 48px;
}

.card p{
    color: #525252;
}

.projects_section nav {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    padding: 0 0 48px 0;
    width: 86%;
    align-items: center;
    gap: 32px;
    margin: 0 auto;
}

.projects_section nav div{
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.projects_section{
    padding: 80px 0;
    margin: 80px auto 0 auto;
    background: #F5F5F5;
    width: 100%;
}

.project_card{
    width: 624px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 4px 2px rgba(0, 0, 0, 0.05);
    transition: box-shadow 200ms ease, transform 200ms ease;
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-content: flex-start;
    align-content: center;
    background: #FFFFFF;
}

.project_card:hover{
    box-shadow: 0 4px 4px 2px rgba(0, 0, 0, 0.1);
    transform: translateY(-8px);
}

.project_card p{
    color: #525252;
    padding: 0 32px 32px 32px;
}

.project_card h3{
    padding: 16px 32px 0 32px;
}

.img_container{
    width: 100%;
    height: 256px;
}

.img_container img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
}

.projects_section h3{
    font-size: 20px;
}

.projects_section button{
    width: 90px;
    height: 48px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    background: #F5F5F5;
}

.projects_section button:hover{
    text-decoration: underline;
}

.projects_section button img{
    width: 16px;
    height: 16px;
}

.projects_section h4{
    color: #525252;
}

.contact_section{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 33px;
    padding: 80px 54px;
}

.contact_section button{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    border: none;
    border-radius: 10px;
    background: #000000;
    color: #FFFFFF;
    transition: background-color 200ms ease;
    cursor: pointer;
    width: 150px;
    height: 24px;
    padding: 22px 20px;
}

.contact_section h4{
    color: #525252;
    text-align: center;
}

.contact_section button:hover{
    background: #222222;
}

.about {
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 80px;
    width: 86%;
    flex-wrap: wrap;
    padding: 140px 0 80px 0;
}

@media (max-width: 571px){
    .about {
        padding: 200px 0 80px 0;
    }
}

.about img{
    border-radius: 10px;
    max-width: 400px;
    min-width: 300px;
}

.about article{
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 500px;
}

.about p{
    line-height: 1.6rem;
}

.skills_container{
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 64px;
    flex-wrap: wrap;
    margin: 0 auto;
    width: 100%;
    padding: 0 53px 80px 53px;
}

.skills_section{
    width: 100%;
    background: #F5F5F5;
}

.skill{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 16px;
    width: 269px;
}

.skill > div{
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000000;
    border: 2px solid #FFFFFF; 
    box-sizing: border-box;
}

.skill > div img{
    width: 50%;
    height: auto;
    object-fit: contain;
    display: block;
    max-width: 90%;
    max-height: 90%;
}

.skill p{
    color: #525252;
}

.portfolio_section{
    padding: 140px 0 60px 0;
    margin: 0 auto;
    width: 100%;
    text-align: center;
    background: #F5F5F5;
}

.portfolio_section h1{
    font-size: 24px;
    padding-bottom: 20px;
    width: 86%;
    margin: 0 auto;
}

.portfolio_section p{
    color: #525252;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5rem;
    width: 86%;
}

.portfolio_container{
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
    padding: 80px 53px 80px 53px;
}

.portfolio_card{
    width: 405px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 4px 2px rgba(0, 0, 0, 0.05);
    transition: transform 220ms ease, box-shadow 220ms ease;
    background: #FFFFFF;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 20px;
}

.portfolio_card:hover{
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.12);
}

.portfolio_card img{
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
}

.portfolio_card p{
    padding: 0 32px 32px 32px;
    width: 100%;
    text-align: left;
}

.portfolio_card h3{
    padding: 0 32px 0 32px;
    width: 100%;
    text-align: left;
    font-size: 18px;
}

.description_pr{
    color: #525252;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    width: 100%;
    padding: 0 32px 0 32px;
}

header nav a{
    color: var(--text);
    text-decoration: none;
    transition: color 150ms ease;
}

header nav a:hover{
    color: var(--c-dark);
}

header nav a.active{
    color: var(--c-dark);
}

/* global body text color */
body{
    color: var(--text);
}

.contact_container{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 16px;
}

.contact_card{
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.contact_card img{
    width: 40px;
    height: 40px;   
    background: #000000;
    padding: 8px;
    border-radius: 10px;
}

.footer_image{
    border-radius: 10px;
    max-width: 500px;
    min-width: 300px;
}

.contact_page_container{
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 80px;
    flex-wrap: wrap;
    margin: 0 auto;
    width: 86%;
    margin-bottom: 65px;
}

/* Modal styles: near-fullscreen and scrollable content */
.modal-overlay{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 24px;
}
.modal-overlay[aria-hidden="false"]{
    display: flex;
}
.project-modal{
    width: 96vw;
    max-width: 1200px;
    height: 92vh;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}
.modal-close{
    position: absolute;
    top: 14px;
    right: 14px;
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    z-index: 2;
}
.modal-content{
    display: flex;
    flex-direction: row;
    height: 100%;
}
.modal-image{
    flex: 0 0 46%;
    background: #000;
}
.modal-image img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.modal-body{
    flex: 1 1 54%;
    padding: 28px;
    overflow-y: auto;
}
.modal-body h2{
    margin-top: 4px;
}
.modal-meta{
    color: #7a7a7a;
    margin-bottom: 12px;
}

/* Lock body scroll when modal open */
body.modal-open{
    overflow: hidden;
}

@media (max-width: 800px){
    .modal-content{flex-direction: column;}
    .modal-image{flex: 0 0 40%; height: 36%;}
    .project-modal{height: 88vh; width: 96vw;}
}

/* Video wrapper: keeps a 16:9 ratio and fills the content width (respects .modal-body padding) */
.video-wrapper{
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    overflow: hidden;
}
.video-wrapper iframe{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Animations for modal open/close */
.modal-overlay{ transition: background 260ms ease; }
.project-modal{ transform: translateY(8%) scale(.99); opacity: 0; transition: transform 320ms cubic-bezier(.2,.9,.2,1), opacity 220ms ease; }
.project-modal.open{ transform: translateY(0) scale(1); opacity: 1; }
.project-modal.closing{ transform: translateY(6%) scale(.995); opacity: 0; }
.modal-image, .modal-body{ will-change: transform, opacity; }

/* Slight visual tweak for loading state */
#modal-project-content.loading{ opacity: 0.7; }

/* Spacing for modal content elements (video, headings, paragraphs, lists) */
.modal-body .video-wrapper{
    margin-top: 24px;
    margin-bottom: 24px;
    border-radius: 10px;
}

.modal-body p{
    margin: 20px 0;
    line-height: 1.4em;
}

.modal-body h4{
    font-size: 18px;
    margin-top: 28px;
    margin-bottom: 24px;
}

.modal-body img{
    border-radius: 10px;
}

.modal-body a{
    color: var(--c-dark);
    text-decoration: underline;
}