/* --- RESET E VARIABILI --- */
:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --text-muted: #666666;
    --accent-color: #e11f1c;
    --grid-gap: 2.5rem;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --header-height: 80px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-stack);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    padding-top: var(--header-height);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- ACCESSIBILITÀ --- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 2000;
    background: var(--text-color);
    color: var(--bg-color);
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    font-weight: 500;
}

.skip-link:focus {
    top: 0;
}

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

/* --- TIPOGRAFIA --- */
.section-title {
    font-size: 2rem;
    letter-spacing: -0.5px;
}

.section-title--center {
    text-align: center;
}

.section-lead {
    color: var(--text-muted);
}

.section-lead--center {
    text-align: center;
    max-width: 600px;
    margin: 0.5rem auto 0;
}

.section-lead--portfolio {
    margin-bottom: 2.5rem;
}

.text-muted {
    color: var(--text-muted);
}

/* --- HEADER --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    z-index: 1000;
    border-bottom: 1px solid #eeeeee;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo-container img {
    height: 40px;
    width: auto;
    display: block;
}

nav {
    display: flex;
    align-items: center;
}

nav a {
    position: relative;
    color: var(--text-color);
    text-decoration: none;
    margin-left: 2rem;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.25s ease;
}

nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 2px;
    background-color: var(--accent-color);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.3s ease;
}

nav a:hover,
nav a:focus-visible {
    color: var(--accent-color);
}

nav a:hover::after,
nav a:focus-visible::after {
    transform: scaleX(1);
}

.hamburger {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    flex-direction: column;
    gap: 6px;
    z-index: 1010;
    padding: 0.5rem;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: var(--text-color);
    transition: all 0.3s ease;
}

/* --- HERO BANNER --- */
.hero-banner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc((100vh - var(--header-height)) * 0.65);
    min-height: calc((100dvh - var(--header-height)) * 0.65);
    overflow: hidden;
    border-bottom: 1px solid #eeeeee;
}

.hero-banner__bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        125deg,
        #ffffff 0%,
        #ffe8e8 25%,
        #f5f5f5 50%,
        #fff0f0 75%,
        #ffffff 100%
    );
    background-size: 300% 300%;
    animation: heroGradient 10s ease-in-out infinite;
}

.hero-banner__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    animation: heroOrbFloat 8s ease-in-out infinite;
}

.hero-banner__orb--1 {
    width: 220px;
    height: 220px;
    top: -10%;
    left: 8%;
    background: rgba(225, 31, 28, 0.35);
    opacity: 0.85;
}

.hero-banner__orb--2 {
    width: 200px;
    height: 200px;
    bottom: -15%;
    right: 5%;
    background: rgba(225, 31, 28, 0.2);
    opacity: 0.75;
    animation-delay: -4s;
}

.hero-banner__orb--3 {
    width: 160px;
    height: 160px;
    top: 40%;
    right: 30%;
    background: rgba(26, 26, 26, 0.08);
    opacity: 0.6;
    animation-delay: -2s;
    filter: blur(35px);
}

.hero-banner__content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 1.5rem;
    max-width: 1200px;
    width: 100%;
}

.hero-banner__lines--mobile {
    display: none;
}

.hero-banner__line {
    font-size: clamp(3rem, 9vw, 5.5rem);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.03em;
    color: var(--text-color);
    margin: 0;
    overflow: hidden;
    padding-bottom: 0.18em;
}

.hero-banner__line + .hero-banner__line {
    margin-top: 0.2rem;
}

.hero-banner__line .char {
    display: inline-block;
    vertical-align: bottom;
    opacity: 0;
    transform: translateY(110%);
    animation: heroCharRise 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: var(--delay, 0s);
}

.hero-banner__line .char--space {
    width: 0.3em;
}

@keyframes heroGradient {
    0%, 100% { background-position: 0% 40%; }
    33% { background-position: 100% 0%; }
    66% { background-position: 50% 100%; }
}

@keyframes heroOrbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.15); }
    66% { transform: translate(-20px, 15px) scale(0.9); }
}

@keyframes heroCharRise {
    from {
        opacity: 0;
        transform: translateY(110%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 767px) {
    .hero-banner {
        justify-content: flex-start;
        align-items: stretch;
    }

    .hero-banner__content {
        text-align: left;
        padding: 1.75rem 1.5rem;
        max-width: none;
    }

    .hero-banner__lines--desktop {
        display: none;
    }

    .hero-banner__lines--mobile {
        display: block;
    }

    .hero-banner__line {
        font-size: clamp(2.7rem, 13vw, 3.7rem);
        line-height: 1.32;
        padding-bottom: 0.2em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-banner__bg,
    .hero-banner__orb,
    .hero-banner__line .char {
        animation: none;
    }

    .hero-banner__line .char {
        opacity: 1;
        transform: none;
    }
}

/* --- LAYOUT --- */
section {
    padding: 5rem 0;
    border-bottom: 1px solid #eeeeee;
}

.section--no-border {
    border-bottom: none;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--grid-gap);
    align-items: center;
}

.grid-2--flush {
    border: none;
    padding: 0;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

/* --- HERO --- */
.hero .subtitle {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.hero h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

@media (min-width: 768px) {
    .hero h1 {
        font-size: 3.3rem;
    }
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.hero-media {
    margin: 0;
}

.hero-media img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    object-fit: cover;
    aspect-ratio: 4 / 5;
}

.section-media {
    margin: 0;
}

.section-media img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    object-fit: cover;
    aspect-ratio: 16 / 10;
}

/* --- PULSANTI --- */
.btn {
    display: inline-block;
    background-color: var(--text-color);
    color: var(--bg-color);
    padding: 0.8rem 1.8rem;
    text-decoration: none;
    font-weight: 500;
    border-radius: 4px;
    transition: background 0.2s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
}

.btn:hover,
.btn:focus-visible {
    background-color: var(--accent-color);
}

/* --- IMMAGINI --- */
.placeholder-img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    background-color: #f7f7f7;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999999;
    font-size: 0.9rem;
    border: 1px dashed #cccccc;
    border-radius: 4px;
    text-align: center;
    padding: 1rem;
}

/* --- SERVIZI --- */
.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 3rem;
}

@media (min-width: 768px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.service-card {
    padding: 2.5rem 2rem;
    background-color: #fcfcfc;
    border: 1px solid #eeeeee;
    border-radius: 4px;
}

.service-card h3 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- PORTFOLIO --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.portfolio-item {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.portfolio-cover {
    margin: 0;
    overflow: hidden;
    border-radius: 4px;
    background-color: #f7f7f7;
}

.portfolio-cover img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 16 / 10;
    transition: transform 0.3s ease;
}

.portfolio-item:hover .portfolio-cover img,
.portfolio-item:focus-within .portfolio-cover img {
    transform: scale(1.02);
}

.portfolio-item h3 {
    margin: 0.5rem 0 0.15rem;
    font-size: 1.25rem;
    transition: color 0.2s ease;
}

.portfolio-item:hover h3,
.portfolio-item:focus-within h3 {
    color: var(--accent-color);
}

.portfolio-item p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- CASE STUDY --- */
.case-study-details {
    background-color: #f9f9f9;
    padding: 3rem 2rem;
    border-radius: 6px;
    margin-top: 2rem;
    border: 1px solid #eeeeee;
}

.case-study-label {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.case-study-title {
    font-size: 1.75rem;
    margin: 0.5rem 0 1rem;
    letter-spacing: -0.5px;
}

.case-study-categories {
    margin-bottom: 1rem;
}

.case-study-intro {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 2rem;
    max-width: 720px;
}

.case-study-list {
    margin: 0.75rem 0 1.5rem;
    padding-left: 1.25rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.case-study-list li {
    margin-bottom: 0.75rem;
}

.case-study-list li:last-child {
    margin-bottom: 0;
}

.case-study-cover {
    margin: 0 0 1.5rem;
    border-radius: 4px;
    overflow: hidden;
}

.case-study-cover img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 16 / 9;
}

.case-study-subtitle {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.case-study-text {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.case-study-text:last-child {
    margin-bottom: 0;
}

.case-study-link {
    margin-top: 0.5rem;
    margin-right: 0.75rem;
}

.case-study-link--outline {
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid var(--text-color);
}

.case-study-link--outline:hover,
.case-study-link--outline:focus-visible {
    background-color: var(--text-color);
    color: var(--bg-color);
}

.project-back {
    padding: 2rem 0 0;
}

.project-back a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.project-back a:hover,
.project-back a:focus-visible {
    color: var(--accent-color);
}

.case-study-page {
    margin-bottom: 3rem;
}

.case-study-phase {
    font-size: 1.05rem;
    margin: 1.5rem 0 0.75rem;
    letter-spacing: -0.2px;
}

.tech-tag {
    display: inline-block;
    background-color: #e0e0e0;
    color: var(--text-color);
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 3px;
    margin-right: 0.5rem;
    margin-top: 0.5rem;
}

.tech-tags {
    margin-bottom: 1.5rem;
}

/* --- COLLABORAZIONI --- */
.other-collaborations {
    background-color: #fcfcfc;
    border-top: 1px solid #eeeeee;
    padding: 3rem 2rem;
    margin-top: 4rem;
    border-radius: 4px;
}

.other-collaborations h3 {
    font-size: 1.4rem;
    letter-spacing: -0.3px;
}

.other-collaborations > p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.5rem;
    margin-bottom: 2rem;
}

.collabs-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 0;
    list-style: none;
}

@media (min-width: 600px) {
    .collabs-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .collabs-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

.collabs-list li {
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.collabs-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--text-color);
    font-weight: bold;
}

.collabs-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.collabs-link:hover,
.collabs-link:focus-visible {
    color: var(--accent-color);
}

/* --- FAQ --- */
.faq-list {
    margin-top: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    border: 1px solid #eeeeee;
    border-radius: 4px;
    background-color: #fcfcfc;
}

.faq-item summary {
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "+";
    float: right;
    font-weight: 400;
    color: var(--text-muted);
}

.faq-item[open] summary::after {
    content: "−";
}

.faq-item p {
    padding: 0 1.5rem 1.25rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- CONTATTI --- */
.contact-studio {
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.contact-studio span {
    font-size: 0.95rem;
    font-weight: normal;
    color: var(--text-muted);
}

.contact-info p {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.contact-link {
    color: var(--text-color);
    text-decoration: underline;
    transition: color 0.2s ease;
}

.contact-link:hover,
.contact-link:focus-visible {
    color: var(--accent-color);
}

.contact-vat {
    font-size: 0.85rem;
    color: #999999;
    border-top: 1px solid #eeeeee;
    padding-top: 1rem;
    margin-top: 1rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

form input,
form select,
form textarea {
    padding: 0.8rem;
    border: 1px solid #cccccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    width: 100%;
}

form input:focus,
form select:focus,
form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.form-feedback {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    display: none;
}

.form-feedback--success {
    display: block;
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.form-feedback--error {
    display: block;
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* --- FOOTER --- */
footer {
    padding: 3rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid #eeeeee;
}

footer a {
    color: var(--text-muted);
    text-decoration: underline;
}

footer a:hover,
footer a:focus-visible {
    color: var(--accent-color);
}

/* --- PAGINE SECONDARIE --- */
.page-header {
    padding: 3rem 0 2rem;
    border-bottom: 1px solid #eeeeee;
}

.page-header--center {
    text-align: center;
}

.page-content {
    padding: 3rem 0 5rem;
}

.page-content h2 {
    font-size: 1.4rem;
    margin: 2rem 0 1rem;
}

.page-content p,
.page-content li {
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.page-content ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

/* --- MOBILE MENU --- */
@media (max-width: 767px) {
    .hamburger {
        display: flex;
    }

    nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background-color: var(--bg-color);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 3rem;
        gap: 2rem;
        transition: transform 0.3s ease-in-out;
        transform: translateX(100%);
        border-top: 1px solid #eeeeee;
    }

    nav.active {
        transform: translateX(0);
    }

    nav a {
        margin-left: 0;
        font-size: 1.3rem;
    }

    .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(-44deg);
    }
}
