html {
    scroll-behavior: smooth;
}

@font-face {
    font-family: 'Integral';
    src: url('fonts/integral.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Integral Bold';
    src: url('fonts/integral-bold.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body {
    background-image: url(assets/bg.png);
    background-size: cover;
    background-repeat: no-repeat;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

nav {
    color: #fafafa;
    padding: 10px;
    text-align: center;
    font-family: 'Integral';
    font-size: 1.8vw;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgb(0, 0, 0);
    z-index: 9;

    ol {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 6vw;
        list-style: none;
        padding: 0;
        margin: 0;

        li {
            cursor: pointer;

            a {
                color: #fafafa;
                text-decoration: none;
            }
        }
    }

    #underline {
        position: absolute;
        height: 2px;
        background: #D45B16;
        width: 0;
        transition: all 0.3s ease-in-out;
    }
}

.hamburger {
    display: none;
    position: absolute;
    right: 24px;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    z-index: 10;
}

.hamburger span {
    display: block;
    height: 3px;
    background: #fafafa;
    border-radius: 2px;
    margin: 5px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

header {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    min-height: 100vh;
    padding: 20px;
    font-family: 'Integral';
    color: #fafafa;
    margin-top: 0;
    position: relative;

    h1 {
        font-family: 'Integral Bold';
        font-size: 12vh;
        text-shadow: 3px 2px 0px #D45B16;
        letter-spacing: 2px;
        margin: 0;
        transition: 0.5s;
        cursor: default;
    }

    h2 {
        font-size: 6vh;
        margin: 0;
        color: #D45B16;
        cursor: default;
    }

    .titles {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1.6vh;
        text-align: center;

        div {
            display: flex;
            flex-direction: row;
            justify-content: center;
            align-items: center;
            gap: 2vw;

            a {
                background-color: #D45B16;
                color: #fafafa;
                border: none;
                padding: 4px 14px 6px 14px;
                border-radius: 8px;
                cursor: pointer;
                font-family: 'Integral';
                font-size: 2vh;
                transition: 0.3s;
                text-decoration: none;
                display: flex;
                flex-direction: row;
                align-items: center;
                gap: 8px;
            }
        }
    }
}

.section-divider {
    position: absolute;
    left: 5vw;
    bottom: 8vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1.2vw;
    z-index: 5;
}

.tilted-text {
    font-family: 'Integral Bold';
    font-size: 3.5vh;
    color: #fafafa;
    transform: rotate(-8deg);
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(212, 91, 22, 0.25), 0 2px 0 rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    line-height: 0.9;
    animation: slideInLeft 1s ease-out;
    margin-right: 2vw;
}

.tilted-text span {
    display: block;
}

.tilted-text .highlight {
    color: #D45B16;
    font-size: 4vh;
    text-shadow: 0 0 18px rgba(212, 91, 22, 0.45), 2px 2px 0 rgba(0,0,0,0.5);
    transform: translateX(10px);
    position: relative;
}

.tilted-text .highlight::after {
    content: '';
    position: absolute;
    left: -4px;
    right: -6px;
    bottom: -6px;
    height: 3px;
    background: linear-gradient(90deg, rgba(212,91,22,0.2), rgba(212,91,22,0.9), rgba(212,91,22,0.2));
    border-radius: 2px;
    filter: blur(0.3px);
}

.tilted-text:hover .highlight {
    text-shadow: 0 0 24px rgba(212, 91, 22, 0.7), 2px 2px 0 rgba(0,0,0,0.5);
}


.jump {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    animation: slideInRight 1s ease-out 0.3s both;
}

.arrow {
    width: 18vw;
    height: auto;
    filter: drop-shadow(0px 2px 6px rgba(212, 91, 22, 0.25));
    animation: bounce 3s ease-in-out infinite;
    opacity: 0.9;
}

.arrow path {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    animation: draw 1.2s ease-out 0.2s forwards;
}

@keyframes draw {
    to { stroke-dashoffset: 0; }
}

@keyframes slideInLeft {
    0% {
        transform: translateX(-100px) rotate(-8deg);
        opacity: 0;
    }
    100% {
        transform: translateX(0) rotate(-8deg);
        opacity: 1;
    }
}

@keyframes slideInRight {
    0% {
        transform: translateX(100px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

.projects {
    width: 100%;
    color: #fafafa;
    font-family: system-ui,
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        Roboto,
        Oxygen,
        Ubuntu,
        Cantarell,
        'Open Sans',
        'Helvetica Neue',
        sans-serif;


    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8vh;
    margin-top: 0.5vh;
    margin-bottom: 1vh;

    .row {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 2vw;
        width: 65%;


        .image-container {
            position: relative;
            width: 45%;
            height: auto;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0px 4px 16px #d45c163d;
        }

        a {
            background-color: #D45B16;
            color: #fafafa;
            border: none;
            padding: 4px 14px 6px 14px;
            border-radius: 8px;
            cursor: pointer;
            font-family: 'Integral';
            font-size: 2vh;
            transition: 0.3s;
            text-decoration: none;
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 8px;
            position: absolute;
            bottom: 2vh;
            left: 1vw;

            &:hover {
                box-shadow: 0px 0px 10px 0px #D45B16;
            }
        }

        img {
            width: 100%;
            height: auto;
            border-radius: 8px;
        }

        transition: 0.5s;

        &:hover {
            transform: scale(1.03);
        }
    }

    .row.reverse {
        flex-direction: row-reverse;
        justify-content: center;
        align-items: center;
        a {
            position: absolute;
            bottom: 2vh;
            left: auto;
            right: 1vw;
        }
    }

    article {
        max-width: 30%;

        h3 {
            font-family: 'Integral Bold';
            font-size: 4vh;
            letter-spacing: 1px;
        }

        hr {
            border: 1px solid #D45B16;
            width: 100%;
        }

        p {
            font-size: 2.5vh;
            text-wrap: balance;
        }
    }
}

.technologies {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 6vw;
    margin-top: 8vw;

    h3 {
        font-family: 'Integral Bold';
        font-size: 4vh;
        letter-spacing: 1px;
        margin: 8px;
        cursor: default;
    }

    .stack h3 {
        background: rgb(212, 91, 22);
        background: linear-gradient(135deg, rgba(212, 91, 22, 1) 15%, rgba(217, 217, 217, 1) 96%);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .tools h3 {
        background: rgb(23, 39, 185);
        background: linear-gradient(135deg, rgba(23, 39, 185, 1) 15%, rgba(217, 217, 217, 1) 96%);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

        .tech-item {
            position: relative;
            display: flex;
            justify-content: center;
            align-items: center;
        }

    .tech-item img {
        width: 2.5vw;
        height: auto;
        cursor: pointer;
        transition: all 0.3s ease;
        max-width: 100%;
    }

    .tech-item img:hover {
        transform: scale(1.1);
        filter: brightness(1.2);
    }

        .tooltip {
            position: absolute;
            bottom: 120%;
            left: 50%;
            transform: translateX(-50%);
            background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
            color: #fafafa;
        padding: 8px 12px;
        border-radius: 8px;
        font-size: 12px;
        font-family: "Inter", sans-serif;
        font-weight: bold;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 10;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        border: 1px solid rgba(255, 255, 255, 0.1);
        pointer-events: none;
    }

    .tooltip::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        border: 6px solid transparent;
        border-top-color: #2a2a2a;
    }

    .tech-item:hover .tooltip {
        opacity: 1;
        visibility: visible;
    }

    .icons {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 2vw;
    }

    .stack,
    .tools {
        background-color: rgba(0, 0, 0, 0.5);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2vh;
        padding: 2.5vw;
        padding-top: 1.2vw;
        border-radius: 8px;
        transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    }

    .stack {
        border: 1px solid #D45B16;
        box-shadow: 4px 2px 10px #d45c163d;
    }

    .tools {
        border: 1px solid #1727b9;
        box-shadow: 4px 2px 10px #1727b950;
    }

    .stack:hover {
        box-shadow: 0 0 30px rgba(212, 91, 22, 0.6);
    }

    .tools:hover {
        box-shadow: 0 0 30px rgba(23, 39, 185, 0.6);
    }

}

.about-me {
    margin-top: 8vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    .javier {
        width: 16%;
        height: auto;
        border-radius: 50%;
        box-shadow: 0px 4px 16px #d45c163d;
    }

    .info {
        width: 50%;
        background-color: rgba(0, 0, 0);
        color: #fafafa;
        font-family: 'Fira Code', monospace;
        margin-top: -20px;
        margin-bottom: 4vw;
        font-size: 2.5vh;
        padding: 20px 2vw;
        border-radius: 8px;
        text-align: justify;
        box-shadow: 0px 4px 10px #d45c163d;

        span {
            font-weight: bold;
            color: #D45B16;
        }

        .social {
            display: flex;
            gap: 10px;
            justify-content: end;

            a {
                text-decoration: none;

                img {
                    width: 2.5vw;
                    height: auto;
                    text-decoration: none;
                    transition: 0.3s;

                    &:hover {
                        filter: brightness(1.5);
                    }
                }
            }
        }
    }
}

@media only screen and (max-width: 1200px) {
    nav {
        font-size: 3vw;
    }

    header h1 {
        font-size: 10vh;
    }

    header h2 {
        font-size: 5vh;
    }

    .section-divider {
        left: 4vw;
        bottom: 7vh;
    }

    .tilted-text {
        font-size: 3vh;
    }

    .tilted-text .highlight { font-size: 3.5vh; }

    .arrow { width: 22vw; height: auto; opacity: 0.9; }

    .projects .row {
        flex-direction: column;
        width: 80%;
    }

    .projects article {
        max-width: 100%;
    }

    .technologies img {
        width: 4vw;
    }

    .about-me .info {
        width: 80%;
    }

    .projects .row img {
        order: 1;
    }

    .projects .row article {
        order: 2;
    }

    .projects .row.reverse {
        flex-direction: column;
    }

    .technologies .icons {
        grid-template-columns: repeat(3, 1fr);
    }

    .social img {
        width: 12vw;
        height: auto;
    }
}

@media only screen and (max-width: 768px) {
    nav {
        font-size: 3.5vw;
        height: 56px;
        display: flex;
        align-items: center;
    }

    .hamburger { display: block; }

    nav { padding: 0 16px; }
    nav #underline { display: none; }

    nav ol#mobile-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        flex-direction: column;
        gap: 18px;
        background: rgba(0,0,0,0.92);
        padding: 12px 0 16px 0;
        transform-origin: top center;
        transform: translateY(-8px);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.24s ease, opacity 0.24s ease;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        backdrop-filter: blur(4px);
        z-index: 1000;
    }

    nav ol#mobile-menu.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    header { min-height: calc(100vh - 56px); padding-top: 56px; padding-bottom: 8vh; display: flex; align-items: center; justify-content: center; }
    header h1 { font-size: clamp(28px, 6.4vh, 48px); line-height: 1.08; letter-spacing: 0.5px; text-align: center; }
    header h2 { font-size: clamp(16px, 3.4vh, 28px); text-align: center; }
    header .titles { align-items: center; gap: 2.8vh; text-align: center; }
    header .titles > div { flex-direction: column; gap: 14px; }
    header .titles a { font-size: clamp(12px, 1.8vh, 16px); padding: 8px 16px; }

    .section-divider { position: absolute; left: 50%; bottom: 16vh; transform: translateX(-50%); flex-direction: column; align-items: center; gap: 0.8vh; }

    .tilted-text { font-size: 2.4vh; margin-right: 0; transform: none; text-align: center; }

    .tilted-text .highlight { font-size: 2.8vh; transform: none; }

    .arrow { width: clamp(40px, 8vh, 72px); height: auto; transform: none; opacity: 1; }
    .arrow-desktop { display: none; }
    .arrow-mobile { display: block; }

    .projects .row { width: 92%; gap: 3.5vh; }
    .projects .row .image-container { width: 100%; }
    .projects .row article { max-width: 100%; }
    .projects .row a { bottom: 1.6vh; left: 3vw; font-size: clamp(12px, 1.8vh, 16px); }

    .technologies .tech-item img { width: 52px; height: auto; }
    .technologies .icons { gap: 14px; grid-template-columns: repeat(2, 1fr); }
    .about-me .info {
        width: 90%;
    }

    

    .about-me .javier { width: 34%; }

    .projects article h3 { font-size: clamp(20px, 2.6vh, 24px); }
    .projects article p { font-size: clamp(15px, 2.2vh, 18px); line-height: 1.6; }

    #projects, #technologies, #about-me { scroll-margin-top: 64px; }
}

@media only screen and (max-width: 480px) {
    nav {
        font-size: 3.5vw;
    }

    header h1 {
        font-size: 6vh;
    }

    header h2 {
        font-size: 3vh;
    }

    .section-divider { left: 50%; bottom: 12vh; transform: translateX(-50%); }

    .tilted-text {
        font-size: 2vh;
    }

    .tilted-text .highlight {
        font-size: 2.5vh;
    }

    .arrow { width: clamp(34px, 7.5vh, 64px); height: auto; }
    .arrow-desktop { display: none; }
    .arrow-mobile { display: block; }

    .projects .row {
        width: 100%;
    }

    .technologies .tech-item img { width: 44px; }
    .technologies .icons { gap: 12px; grid-template-columns: repeat(2, 1fr); }

    .about-me .javier {
        width: 35%;
    }

    
}

#projects {
    scroll-margin-top: 12vh;
}

@supports (selector(:has(*))) {
    body:has(nav ol#mobile-menu.open) { overflow: hidden; }
}

@media (hover: none), (pointer: coarse) {
    .technologies .tech-item .tooltip { display: none !important; }
}

    @media (prefers-reduced-motion: reduce) {
        .arrow { animation: none; }
        .arrow path { animation: none; }
        .jump { animation: none; }
    }

@media only screen and (min-width: 769px) {
    .arrow-desktop { display: block; }
    .arrow-mobile { display: none; }
}