html,
body {
    margin: 0;
    padding: 0;
    font-family: monospace, Mulish, sans-serif;
    font-size: 16px;
    line-height: 28px;
    letter-spacing: .2px;
    word-wrap: break-word;
    font-weight: 400;
    background-color: #fff;
    color: #767676;
}

body.no-scroll {
    overflow: hidden;
}

h1,
h3 {
    font-size: 18px;
    line-height: 28px;
    letter-spacing: .2px;
    word-wrap: break-word;
    display: inline-block;
    margin-bottom: 16px;
    color: #5e9e9f;
    font-family: monospace, Poppins, Mulish, sans-serif;
    font-weight: 500;
}

h4 {
    font-family: monospace, Poppins, Mulish, sans-serif;
    color: #000;
    font-size: 45px;
    font-weight: 800;
    line-height: 1.4;
    text-transform: uppercase;
    margin: 0 0 25px 0;
}

#header {
    width: 100vw;
    height: 60px;
    /* significantly reduced to minimize gap */
    margin: 0;
    padding: 0 40px;
    /* tighter padding */
    /* add horizontal padding instead of using broad widths */
    box-sizing: border-box;
    display: flex;
    align-items: center;
    background-color: white;
}

/************* LOGO ***************/
/**********************************/
#logo {
    width: 250px;
    height: 50px;
    margin: 20px 0;
    padding: 20px 0 0 0;
    font-size: 30px;
    font-style: bold;
    float: left;
    text-align: left;
    color: #5e9e9f;

}

/************* NAV ***************/
/**********************************/
nav {
    width: 60vw;
    height: 58px;
    margin: 0;
    padding: 20px;
    float: right;

}

#nav-links {
    float: right;
}

#nav-links>li {
    display: inline-block;
    margin: 0 50px;
    font-size: 20px;
    text-decoration: none;
}

#nav-links>li>a {
    text-decoration: none;
    color: #5e9e9f;
    border-bottom: 0;
    display: inline-block;
    position: relative;
}

#nav-links>li>a:after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #5e9e9f;
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

#nav-links>li>a:hover:after {
    transform: scaleX(1);
    transform-origin: bottom left;
}


#nav-links>li>a:hover {
    color: black;

}



#wrapper {
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    background-color: #fff;
    overflow-x: hidden;
}

/************** HERO SECTION *********/
/*************************************/
#section-hero {
    width: 100vw;
    margin: 0;
    padding: 0;
    /* consistent padding to provide a tight but clean gap */
    background-color: #fff;
    display: flex;
    align-items: center;
    /* keep vertical center but it will be higher due to reduced min-height */
    box-sizing: border-box;
    overflow: hidden;
}

#section-hero-left {
    /*    border: 1px solid #000;*/
    width: 40vw;
    height: auto;
    /* removed 45vw which was forcing a massive gap */
    float: left;
    margin: 0 0 0 60px;
    padding: 20px 0;
}

#service-list {
    list-style-type: none;
    padding: 0;

}

#service-list>li {
    font-size: 17px;
    margin: 10px 0;
}

#stats {
    padding: 0;
}

#stats>li {
    display: inline-block;
    margin: 0;
    flex-wrap: wrap;
    width: 115px;
}

#stats>li:nth-child(4) {
    margin: 0 0 0 -55px;
}

#arrow-down {
    font-size: 50px;
}


#section-hero-right {
    /*    border: 1px solid #000;*/
    background-color: inherit;
    width: 40vw;
    height: auto;
    /* removed fixed vw height to fix spacing issue */
    float: right;
    padding: 20px 10px;
}

.spacer {
    width: 100%;
    height: 50px;
    margin: 0;
    padding: 0;

}


/* =========================================
   SPECTACULAR 3D ANIMATION
   ========================================= */

.spectacular-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

.prism-base {
    position: relative;
    width: 250px;
    height: 250px;
    transform-style: preserve-3d;
    animation: rotate-prism 10s infinite linear;
}

.prism-surface {
    position: absolute;
    width: 200px;
    height: 300px;
    /* Updated to match the dark/tech aesthetic of the GIFs */
    background: linear-gradient(135deg, rgba(16, 16, 16, 0.9), rgba(94, 158, 159, 0.3));
    border: 1px solid rgba(94, 158, 159, 0.8);
    /* vivid teal borders */
    backdrop-filter: blur(12px);
    box-shadow: 0 0 40px rgba(94, 158, 159, 0.25);
    border-radius: 8px;
}

.prism-surface.one {
    transform: rotateY(0deg) translateZ(100px);
}

.prism-surface.two {
    transform: rotateY(120deg) translateZ(100px);
}

.prism-surface.three {
    transform: rotateY(240deg) translateZ(100px);
}

.prism-ring {
    position: absolute;
    width: 320px;
    height: 320px;
    border: 3px dashed #5e9e9f;
    border-radius: 50%;
    transform: rotateX(75deg);
    top: -35px;
    left: -60px;
    animation: rotate-ring 6s infinite reverse linear;
    box-shadow: 0 0 20px rgba(94, 158, 159, 0.5);
}

.prism-glow {
    position: absolute;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(94, 158, 159, 0.6) 0%, transparent 70%);
    top: 50px;
    left: 25px;
    filter: blur(40px);
    animation: pulse-glow 3s infinite ease-in-out;
}

@keyframes rotate-prism {
    from {
        transform: rotateY(0deg) rotateX(10deg);
    }

    to {
        transform: rotateY(360deg) rotateX(10deg);
    }
}

@keyframes rotate-ring {
    from {
        transform: rotateX(75deg) rotateZ(0deg);
    }

    to {
        transform: rotateX(75deg) rotateZ(360deg);
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.4);
        opacity: 0.8;
    }
}


/*********** SECTION MEDIA****************/
/*******************************************/
#section-media {
    width: 86vw;
    height: auto;
    margin: 120px auto;
    /* doubled margin from 60px approx */
    padding: 20px 60px;
    background-color: #fff;
    /* Stack heading on top, carousel row below */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Heading block sits above the carousel */
#media-header {
    margin-bottom: 10px;
}

/* Carousel track: nowrap horizontal scroll row */
#media-track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 60px;
    /* significantly increased for lots of space between images */
    overflow-x: auto;
    padding-bottom: 20px;
}

.pic {
    width: 360px;
    height: 410px;
    flex: 0 0 360px;
    background-color: transparent;
    /* better to have transparent if the image is contained */
    border-radius: 10px;
    display: block;
    overflow: hidden;
    /* clip the images to the rounded corners */
}

.pic img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* ensures whole image is visible without being cut */
}

#arrows {
    font-size: 50px;
    text-align: right;
    margin-top: 10px;
}


/*********** SECTION CODING LANGUAGES ****************/
/*******************************************/
#section-languages {
    width: 100%;
    height: auto;
    margin: 120px 0;
    padding: 0;
    background-color: #000;
    color: #fff;
    box-sizing: border-box;
}

#section-languages-header-row {
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    align-items: center;
}

#section-languages-left {
    width: 50%;
    padding: 80px 80px 40px 80px;
    box-sizing: border-box;
}

#languages-h4 {
    color: #fff;
}

#section-languages-fullwidth-bars {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 80px 80px 80px;
    box-sizing: border-box;
}

.language-row {
    margin-bottom: 35px;
}

.language {
    /* width: auto; */
    /* height: auto; */
    /* margin: 20px 40px 0 0; */
    /* color: #aaa; */
    font-weight: 700;
    letter-spacing: 1px;
    color: #5e9e9f;
}

.language + span {
    float: right;
    color: #888;
}

.progress-bar {
    width: 100%;
    height: 8px;
    margin: 10px 0 0 0;
    background-color: #222;
    border-radius: 4px;
    overflow: hidden;
    /* box-sizing: border-box; */
}

#fill-1,
#fill-2,
#fill-4 {
    height: 100%;
    /* width: 20%; */
    /* margin: 0; */
    background-color: #5e9e9f;
    box-shadow: 0 0 10px rgba(94, 158, 159, 0.5);
}

#fill-1 {
    width: 20%;
}

#fill-2 {
    width: 75%;
}

#fill-4 {
    width: 5%;
}

#section-languages-right {
    width: 50%;
    /* margin: 0; */
    padding: 40px;
    /* background-color: black; */
    /* flex-shrink: 0; */
    box-sizing: border-box;
    /* display: flex; */
    /* align-items: flex-start; */
    /* justify-content: center; */
}

#photo {
    width: 100%;
    max-width: 436px;
    height: 100%;
    max-height: 520px;
    background-color: #5e9e9f;
    background-image: url('assets/media/open-source-amico.png');
    background-repeat: no-repeat;
    background-position: bottom center;
    background-attachment: scroll;
    background-size: contain;
    border-radius: 12px; /* Added border radius */
}



/*********** SECTION FEATURES ****************/
/*******************************************/
#section-features {
    width: 100vw;
    height: auto;
    margin: 120px 0 0 0;
    /* doubled spacing */
    background-color: whitesmoke;
    padding: 80px 0;
    /* add internal whitespace */
}

#features-left {
    width: 40vw;
    height: 600px;
    padding: 100px 60px 100px 80px;
    float: left;
}

#features-right {
    width: 40vw;
    height: 600px;
    margin: 40px 0;
    padding: 50px 70px;
    float: left;
}

.features {
    width: 100%;
    max-width: 420px;
    height: auto;
    /* was 50px — caused overflow clipping */
    padding: 20px 30px;
    margin: 20px auto;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 20px rgb(0 0 0 / 10%);
    transition: all .3s ease;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.features-icon {
    width: 20px;
    height: 20px;
    margin: 5px 10px;
    float: left;
}

.tick {
    float: right;
    font-size: 30px;
}





/*********** SECTION CONTACT ****************/
/*******************************************/
#section-contact {
    width: 100vw;
    height: auto;
    background-color: #fff;
    padding-top: 120px;
    /* doubled spacing */
}

#contact-left {
    width: 40%;
    height: auto;
    padding: 60px 40px 60px 80px;
    float: left;
    box-sizing: border-box;
}

#contact {
    width: 60%;
    height: auto;
    padding: 0;
    float: right;
    box-sizing: border-box;
}

.container {
    width: 90%;
    height: auto;
    border-radius: 5px;
    padding: 40px 40px 40px 40px;
    margin: 40px auto;
    box-sizing: border-box;
}

input[type=text],
select,
textarea {
    width: 80%;
    padding: 12px;
    border: 1px solid lightgrey;
    box-sizing: border-box;
    margin-top: 6px;
    margin-bottom: 16px;
    resize: vertical;
}

input[type=submit] {
    width: 80%;
    background-color: #5e9e9f;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

input[type=submit]:hover {
    background-color: #000;
}




/*********** SECTION FOOTER ****************/
/*******************************************/
footer {
    width: 92%;
    height: 50px;
    margin: 0;
    padding: 1% 4%;
    background-color: black;
    color: #fff;
}


.clearfix::after {
    content: "";
    clear: both;
    display: table;
}

/* =========================================
   MOBILE NAVIGATION (WOW FACTOR)
   ========================================= */

.menu-toggle {
    display: none;
    /* Hidden on desktop */
    cursor: pointer;
    float: right;
    margin: 60px 20px 0 0;
    z-index: 1000;
    position: relative;
}

.menu-toggle .bar {
    display: block;
    width: 30px;
    height: 3px;
    margin: 6px auto;
    transition: all 0.3s ease-in-out;
    background-color: #5e9e9f;
}

/* Hamburger to X Animation */
.menu-toggle.is-active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.is-active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.is-active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    /* Semi-transparent dark */
    backdrop-filter: blur(10px);
    /* Glassmorphism blur */
    -webkit-backdrop-filter: blur(10px);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease-in-out;
}

.mobile-nav-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-links {
    list-style: none;
    text-align: center;
    padding: 0;
    margin: 0;
}

.mobile-nav-links li {
    margin: 20px 0;
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.4s ease-in-out;
}

.mobile-nav-overlay.is-active .mobile-nav-links li {
    transform: translateY(0);
    opacity: 1;
}

/* Stagger the link animations */
.mobile-nav-overlay.is-active .mobile-nav-links li:nth-child(1) {
    transition-delay: 0.1s;
}

.mobile-nav-overlay.is-active .mobile-nav-links li:nth-child(2) {
    transition-delay: 0.2s;
}

.mobile-nav-overlay.is-active .mobile-nav-links li:nth-child(3) {
    transition-delay: 0.3s;
}

.mobile-nav-overlay.is-active .mobile-nav-links li:nth-child(4) {
    transition-delay: 0.4s;
}

.mobile-link {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    padding: 10px;
    display: inline-block;
}

.mobile-link::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 3px;
    bottom: 0;
    left: 0;
    background-color: #5e9e9f;
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

.mobile-link:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.mobile-link:hover {
    color: #5e9e9f;
}

/* =========================================
   MEDIA QUERIES (RESPONSIVE)
   ========================================= */

@media (max-width: 1280px) {

    /* Prevent 100vw sections from causing horizontal scroll */
    #section-hero,
    #section-skills,
    #section-features,
    #section-contact {
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    /* Hero boxes: scale down so they fit the right column */
    #box-1,
    #box-2 {
        width: 240px;
        height: 360px;
    }

    #box-2 {
        margin: 0 0 0 -130px;
    }

    /* Skills: convert fixed px widths to percentages */
    #section-languages-left {
        width: 45%;
        padding: 60px 40px;
        box-sizing: border-box;
        height: auto;
    }

    #section-languages-right {
        width: 55%;
        padding: 40px;
        box-sizing: border-box;
        height: auto;
    }

    .progress-bar {
        width: 100%;
        box-sizing: border-box;
    }

    /* Features cards: fit inside their column */
    .features {
        width: 100%;
        max-width: 380px;
        box-sizing: border-box;
        margin: 20px auto;
    }

    #features-left,
    #features-right {
        padding: 60px 40px;
        box-sizing: border-box;
    }

    /* Contact */
    #contact-left {
        padding: 60px 40px;
        box-sizing: border-box;
    }

    .container {
        padding: 40px 20px;
    }

    /* Media section */
    #section-media {
        padding: 20px 40px;
        box-sizing: border-box;
        width: 100%;
        height: auto;
    }

    .pic {
        width: 300px;
        height: 340px;
        flex: 0 0 300px;
        /* keep in horizontal track */
    }
}

@media (max-width: 1024px) {
    #nav-links>li {
        margin: 0 16px;
        font-size: 15px;
    }

    h4 {
        font-size: 32px;
    }

    #section-hero-left {
        margin: 0 0 0 40px;
    }

    #section-hero {
        min-height: 100vh;
        background-attachment: scroll;
        /* ensure no parallax effect */
    }

    /* Scaling the spectacular 3D prism for tablet */
    .spectacular-container {
        transform: scale(0.8);
    }

    #section-languages-left {
        width: 50%;
        padding: 40px 30px;
    }

    #section-languages-right {
        width: 50%;
        padding: 30px;
    }

    #photo {
        width: 100%;
        height: 380px;
        background-attachment: scroll;
    }
}

@media (max-width: 900px) {

    /* Header: switch from float to flexbox for proper alignment */
    #header {
        width: 100%;
        height: auto;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        padding: 16px 20px;
        box-sizing: border-box;
    }

    nav {
        display: none;
    }

    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        float: none;
        /* Push to far right regardless of other hidden flex siblings */
        margin: 0 0 0 auto;
        position: static;
    }

    #logo {
        float: none;
        width: auto;
        height: auto;
        margin: 0;
        padding: 0;
    }

    /* Hide the clearfix div inside the flex header */
    #header>.clearfix {
        display: none;
    }

    /* Hero Section */
    #section-hero {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    #section-hero-left,
    #section-hero-right {
        width: 100%;
        height: auto;
        float: none;
        box-sizing: border-box;
    }

    #section-hero-left {
        margin: 0;
        padding: 20px 10px;
        text-align: center;
    }

    #stats {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 8px 20px;
    }

    #stats>li {
        width: auto;
        text-align: center;
    }

    #stats>li:nth-child(4) {
        margin: 0;
    }

    #arrow-down {
        display: none;
    }

    /* Hero right: animation container scaling for mobile */
    #section-hero-right {
        padding: 40px 20px 60px;
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 300px;
        width: 100%;
        box-sizing: border-box;
    }

    .spectacular-container {
        transform: scale(0.65);
    }

    /* Media Section */
    #section-media {
        width: 100%;
        height: auto;
        padding: 30px 20px;
        box-sizing: border-box;
    }

    #media-track {
        gap: 14px;
    }

    .pic {
        width: 260px;
        height: 300px;
        flex: 0 0 260px;
    }

    #arrows {
        text-align: center;
        margin-top: 16px;
    }

    /* Coding Languages Section: stack vertically on mobile */
    #section-languages {
        padding: 40px 0;
    }

    #section-languages-header-row {
        flex-direction: column;
    }

    #section-languages-left,
    #section-languages-right {
        width: 100%;
        padding: 20px;
        box-sizing: border-box;
    }

    #section-languages-fullwidth-bars {
        padding: 20px;
    }

    #section-languages-right {
        justify-content: center;
        width: 100%;
        padding: 40px 0;
    }

    #photo {
        width: 95%; /* Stretch across tablet viewport */
        max-width: none;
        height: 400px;
        margin: 0 auto;
        background-position: center;
        background-size: contain;
    }

    /* Features Section */
    #section-features {
        display: flex;
        flex-direction: column;
    }

    #features-left,
    #features-right {
        width: 100%;
        height: auto;
        float: none;
        padding: 40px 20px;
        margin: 0;
        box-sizing: border-box;
    }

    .features {
        width: 100%;
        max-width: 450px;
        margin: 20px auto;
        box-sizing: border-box;
    }

    /* Contact Section */
    #section-contact {
        display: flex;
        flex-direction: column;
    }

    #contact-left,
    #contact {
        width: 100%;
        height: auto;
        float: none;
        padding: 40px 20px;
        box-sizing: border-box;
    }

    .container {
        width: 100%;
        padding: 20px;
        margin: 0;
        box-sizing: border-box;
    }

    input[type=text],
    select,
    textarea,
    input[type=submit] {
        width: 100%;
    }
}

@media (max-width: 480px) {
    h4 {
        font-size: 30px;
        line-height: 1.2;
    }

    /* Keep cards from overflowing on very small screens */
    #box-1,
    #box-2 {
        width: 110px;
        height: 190px;
    }

    #logo {
        font-size: 24px;
        width: auto;
    }
}