@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: url("../immagini/cursor.png") 12 12, auto;
}

:root,
html,
body {
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    cursor: url("../immagini/cursor.png") 12 12, auto;
}

body {
    font-family: "Space Mono", monospace;
    background: #EEEEEE;
    color: #000000;
    height: 100vh;
    overflow: hidden; /* no scroll */
    cursor: url("../immagini/cursor.png") 12 12, auto;
}

body.project-page {
    height: auto;
    min-height: 100vh;
    overflow: auto;
}

html {
    background: #EEEEEE;
}

/* Navbar */
.navbar {
    height: 54px;
    border-bottom: 1px solid #000000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(20px, 6vw, 64px);
    position: relative;
    text-transform: uppercase;
    font-weight: 700;
}

.logo {
    display: flex;
    align-items: center;
    height: 100%;
}

.logo img {
    height: 40px;
    width: auto;
    display: block;
    transition: transform 0.2s ease;
}

.logo:hover img {
    transform: scale(1.06);
}

.nav-links {
    list-style: none;
    display: flex;
    --nav-gap: clamp(140px, 18vw, 480px);
    gap: var(--nav-gap);
    font-size: 16px;
    letter-spacing: 1.9px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    height: 54px;
    align-items: center;
}

.nav-links a {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    height: 100%;
    cursor: url("../immagini/cursor.png") 12 12, auto;
}

.nav-links li {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-links li::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10px;
    height: 2px;
    background: #000000;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}

.nav-links li:hover::before {
    transform: scaleX(1);
}

.nav-links li:not(:last-child)::after {
    content: '';
    position: absolute;
    right: calc(var(--nav-gap) / -2);
    top: 0;
    height: 100%;
    width: 1px;
    background: #000000;
}

/* Hero */
.hero {
    min-height: calc(100vh - 54px);
    height: auto;
    display: flex;
    align-items: center;
    padding-left: clamp(20px, 10vw, 128px);
}

.hero-content {
    max-width: 900px;
}

h1 {
    font-size: clamp(32px, 8vw, 83px);
    line-height: 1.05;
    font-weight: 300;
}

h1 span {
    color: #bfbfbf;
    font-size: 150px;
}

.subtitle {
    margin-top: 48px;
    max-width: 820px;
    font-size: clamp(14px, 2.6vw, 26px);
    line-height: 1.6;
}

.buttons {
    margin-top: 64px;
    display: flex;
    gap: 32px;
}

.primary,
.secondary {
    font-family: "Space Mono", monospace;
    font-weight: 700;
    cursor: url("../immagini/cursor.png") 12 12, auto;
    transition: transform 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.primary {
    background: #000;
    color: #EEEEEE;
    border: none;
    padding: 16px 32px;
    font-size: 16px;
}

.secondary {
    background: transparent;
    border: 1px solid #000;
    padding: 14px 26px;
    font-size: 14px;
    color: #000000;
}

.primary:hover,
.secondary:hover {
    transform: scale(1.04);
}

.corner-code {
    position: absolute;
    right: 48px;
    bottom: 26px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    letter-spacing: 1.9px;
    text-transform: uppercase;
}

.corner-code .footer-svg-1 {
    display: block;
    height: 16px;
    width: auto;
}

.corner-code .footer-svg-1._1 {
    height: 19px;
}

/* Projects */
.projects {
    height: calc(100vh - 54px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
}

.projects-grid {
    display: flex;
    gap: 60px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.project-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    gap: 10px;
}

.project-card img {
    width: 260px;
    height: 160px;
    object-fit: cover;
    border: 1px solid #000000;
}

.project-card span {
    font-size: 13px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-weight: 700;
    border-bottom: 2px solid transparent;
    padding-bottom: 2px;
}

.project-card:hover span {
    border-bottom-color: #000000;
}

/* Project detail */
.project-detail {
    padding: 56px 48px 56px;
    text-align: left;
}

.project-header {
    width: 100%;
    padding-bottom: 16px;
}

.project-header h1 {
    font-size: 42px;
    line-height: 1.1;
    font-weight: 700;
    text-transform: none;
    display: inline-block;
    border-bottom: 1px solid #000000;
    padding-bottom: 10px;
}

.project-body {
    width: 100%;
    max-width: none;
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 26px;
    font-size: 13px;
    line-height: 1.6;
    letter-spacing: 0.6px;
    text-transform: none;
    text-align: left;
}

.project-body .service-link {
    color: #1b4cff;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    padding-bottom: 1px;
}

.project-body .service-link:hover {
    opacity: 0.75;
}

.project-body .image-link {
    display: inline-block;
    text-decoration: none;
    color: inherit;
    cursor: zoom-in;
}

.project-body .note-small {
    font-size: 12px;
    line-height: 1.5;
    font-style: italic;
    letter-spacing: 0.4px;
}

.project-body .example-title {
    font-size: 18px;
    letter-spacing: 0.8px;
}

.project-body ul {
    list-style-position: inside;
    padding-left: 0;
}

.project-body .repo-link {
    margin-top: 36px;
}

.project-body p {
    max-width: 100%;
    width: 100%;
}

.project-gallery {
    display: grid;
    gap: 18px;
    justify-items: start;
}

.project-gallery.two {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    justify-content: flex-start;
}

.project-gallery.single {
    grid-template-columns: minmax(0, 1fr);
}

.project-gallery img {
    width: auto;
    max-width: 100%;
    height: 220px;
    object-fit: contain;
    background: #EEEEEE;
    justify-self: start;
}

@media (max-width: 1200px) {
    .nav-links {
        --nav-gap: clamp(60px, 12vw, 200px);
        font-size: 14px;
    }
}

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

.nav-toggle {
    display: none;
    width: 40px;
    height: 32px;
    border: 1px solid #000000;
    background: transparent;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-direction: column;
}

.nav-toggle-line {
    width: 18px;
    height: 2px;
    background: #000000;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

body.nav-open .nav-toggle-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

body.nav-open .nav-toggle-line:nth-child(2) {
    opacity: 0;
}

body.nav-open .nav-toggle-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 900px) {
    body {
        height: auto;
        min-height: 100vh;
        overflow: auto;
    }

    .navbar {
        padding: 0 20px;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: absolute;
        left: 0;
        right: 0;
        top: 54px;
        height: auto;
        padding: 16px 20px 20px;
        flex-direction: column;
        gap: 12px;
        background: #EEEEEE;
        border-bottom: 1px solid #000000;
        transform: translateY(-8px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

    .nav-links.is-open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .nav-links li {
        height: auto;
    }

    .nav-links li::before {
        bottom: -4px;
    }

    .nav-links li:not(:last-child)::after {
        display: none;
    }

    .projects {
        height: auto;
        padding: 32px 20px 60px;
    }

    .projects-grid {
        flex-direction: column;
        gap: 24px;
    }

    .project-card img {
        width: 100%;
        max-width: 320px;
        height: 180px;
        object-fit: cover;
    }

    .project-detail {
        padding: 32px 20px 60px;
    }

    .project-header h1 {
        font-size: 30px;
    }

    .project-body {
        font-size: 14px;
    }

    .project-gallery.two {
        flex-direction: column;
    }

    .project-gallery img {
        height: auto;
        max-height: 260px;
    }
}

/* Lightbox */
.image-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 999;
}

.image-lightbox.open {
    opacity: 1;
    visibility: visible;
}

.image-lightbox-inner {
    max-width: min(92vw, 1200px);
    max-height: 90vh;
}

.image-lightbox-inner img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
    background: #EEEEEE;
}

body.lightbox-open {
    overflow: hidden;
}

.project-gallery img.img-2 {
    height: 440px;
}

.project-gallery img.img-4 {
    height: 110px;
}

.project-gallery img.example-image {
    height: 440px;
}

@media (max-width: 860px) {
    .project-detail {
        padding: 36px 24px 56px;
    }

    .project-header h1 {
        font-size: 42px;
    }

    .project-gallery.two {
        grid-template-columns: minmax(0, 1fr);
    }
}
