/* ==========================================================================
   Font
   ========================================================================== */

@font-face {
    font-family: "Codec Pro";
    src: url("codec-pro-regular.woff2") format("woff2"),
         url("codec-pro-regular.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Codec Pro";
    src: url("codec-pro-bold.woff2") format("woff2"),
         url("codec-pro-bold.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ==========================================================================
   Base
   ========================================================================== */

:root {
    --navy: #050d33;
    --navy-deep: #01061f;
    --blue: #005dd8;
    --orange: #ff8000;
    --orange-ink: #d96000;
    --field-line: #7a8295;
    --ink: #0a1235;
    --muted: #626b80;
    --line: #dfe3ec;
    --paper: #f4f5f9;
    --white: #ffffff;

    --font-body: "Codec Pro", "Helvetica Neue", Arial, sans-serif;
    --font-display: "Codec Pro", "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: auto;
}

body {
    margin: 0;
    overflow-x: clip;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img,
svg,
video {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

::selection {
    background: var(--orange);
    color: var(--navy-deep);
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100;
    padding: 12px 18px;
    transform: translateY(-160%);
    background: var(--orange);
    color: var(--navy-deep);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
    position: relative;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    background: var(--navy-deep);
    isolation: isolate;
}

.hero__media {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: var(--navy-deep);
}

.hero__bg {
    position: absolute;
    inset: 0;
    background-color: var(--blue);
    background-image: url("hero-bg.jpg");
    background-position: center;
    background-size: cover;
    background-blend-mode: multiply;
}

.hero__bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(2, 8, 40, 0.26);
}

.hero__bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(58% 48% at 72% 4%, rgba(0, 74, 214, 0.2), transparent 68%),
        linear-gradient(180deg, rgba(1, 6, 31, 0.18) 0%, transparent 38%, rgba(1, 6, 31, 0.16) 100%);
}

.hero__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: saturate(0.9) brightness(0.84) contrast(1.04);
    -webkit-mask-image: linear-gradient(
        to top,
        #000 0%,
        #000 34%,
        rgba(0, 0, 0, 0.8) 45%,
        rgba(0, 0, 0, 0.35) 56%,
        transparent 68%
    );
    mask-image: linear-gradient(
        to top,
        #000 0%,
        #000 34%,
        rgba(0, 0, 0, 0.8) 45%,
        rgba(0, 0, 0, 0.35) 56%,
        transparent 68%
    );
}

.hero__tint {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(1, 7, 35, 0.12) 0%, rgba(1, 7, 35, 0.05) 42%, rgba(1, 7, 35, 0.22) 100%),
        radial-gradient(120% 100% at 50% 42%, transparent 40%, rgba(1, 6, 30, 0.3) 100%);
    pointer-events: none;
}

.hero__shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(1, 6, 31, 0.4) 0%, rgba(1, 6, 31, 0.06) 26%, transparent 46%, transparent 72%, rgba(1, 6, 31, 0.2) 100%),
        linear-gradient(90deg, rgba(1, 6, 31, 0.42) 0%, transparent 30%, transparent 72%, rgba(1, 6, 31, 0.28) 100%);
}

.hero__inner {
    position: relative;
    z-index: 1;
    width: 65.1%;
    margin-left: 17.45%;
    padding-top: min(4.55vw, 8vh);
    padding-bottom: min(5vw, 9vh);
}

.hero__title {
    position: relative;
    z-index: 2;
    margin: 0;
    color: var(--orange);
    font-family: var(--font-display);
    font-size: min(5.156vw, 12vh);
    font-weight: 400;
    font-synthesis: none;
    letter-spacing: 0;
    line-height: 0.94;
    transform: translateY(2px);
}

.hero__title-line {
    display: block;
    width: max-content;
    transform: scaleX(1.212);
    transform-origin: left center;
    white-space: nowrap;
}

.hero__title-line--1 {
    margin-left: -0.16vw;
    transform: scaleX(1.245);
}

.hero__title-line--2 {
    margin-right: 0;
    margin-left: auto;
    transform-origin: right center;
    letter-spacing: 0.025em;
}

.hero__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    margin: -0.94em 0 0;
    padding: min(2.93vw, 6vh) 0.5vw min(1.61vw, 3.5vh) 1.78vw;
    border-left: 2px solid rgba(255, 255, 255, 0.88);
    background: linear-gradient(115deg, rgba(0, 20, 72, 0.16), rgba(0, 0, 0, 0.08));
    box-shadow: 0 1.5vw 2.7vw -0.9vw rgba(0, 0, 0, 0.58);
    color: var(--white);
    font-family: var(--font-display);
    font-size: min(2.995vw, 5.34vh);
    font-weight: 400;
    font-synthesis: none;
    letter-spacing: 0;
    line-height: 1.19;
}

.hero__panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 33.3%;
    height: 2px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0));
}

.hero__panel::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, #ffffff 0%, #ffffff 52%, #ffc18c 78%, var(--orange) 100%);
    opacity: 0.92;
}

.hero__panel span {
    display: block;
    width: max-content;
    transform: scaleX(1.228);
    transform-origin: left center;
    white-space: nowrap;
}

.hero__logo {
    position: relative;
    z-index: 2;
    width: 12.55vw;
    height: auto;
    margin: -1.87vw -15.75vw 0 auto;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.28));
}

/* ==========================================================================
   Contatti
   ========================================================================== */

.contact {
    position: relative;
    overflow: hidden;
    padding: clamp(72px, 8.5vw, 140px) 0 clamp(80px, 10vw, 160px);
    background:
        radial-gradient(900px 540px at 88% -4%, rgba(0, 93, 216, 0.08), transparent 66%),
        radial-gradient(760px 480px at 2% 102%, rgba(255, 128, 0, 0.07), transparent 64%),
        var(--paper);
}

.contact__inner {
    width: min(1200px, calc(100% - 48px));
    margin: 0 auto;
}

.contact__head {
    max-width: 1060px;
    margin-right: auto;
    margin-bottom: clamp(36px, 4.8vw, 64px);
    margin-left: auto;
}

.contact__title {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: clamp(2.05rem, 5.2vw, 6.25rem);
    font-weight: 400;
    font-synthesis: none;
    letter-spacing: -0.01em;
    line-height: 0.94;
    text-wrap: balance;
}

.contact__title .accent {
    color: var(--orange-ink);
}

/* ==========================================================================
   Form
   ========================================================================== */

.contact-form {
    width: 100%;
}

.form-card {
    position: relative;
    width: 100%;
    max-width: 1060px;
    margin: 0 auto;
    padding: clamp(24px, 3.6vw, 52px);
    border: 1px solid var(--line);
    background: var(--white);
    box-shadow: 0 32px 80px rgba(8, 17, 54, 0.07);
}

.form-card::before {
    content: "";
    position: absolute;
    top: -1px;
    right: -1px;
    left: -1px;
    height: 4px;
    background: linear-gradient(90deg, var(--orange) 0%, #ffb264 34%, var(--blue) 100%);
}

.form-alert {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    width: 100%;
    max-width: 1060px;
    margin: 0 auto 18px;
    padding: 16px 18px;
    border: 1px solid #f0c9cd;
    background: #fff6f7;
    color: #a81220;
    font-size: 14px;
    line-height: 1.45;
}

.form-alert svg {
    width: 20px;
    height: 20px;
    flex: none;
    margin-top: 1px;
}

.form-alert p {
    margin: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 28px;
}

.field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 8px;
}

.field--full {
    grid-column: 1 / -1;
}

.field label {
    display: flex;
    gap: 8px;
    align-items: baseline;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1.2;
    text-transform: uppercase;
}

.field input,
.field textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--field-line);
    border-radius: 0;
    outline: none;
    background: #f8f9fc;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.4;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.field input {
    height: 54px;
}

.field textarea {
    min-height: 138px;
    resize: vertical;
}

.field input:hover,
.field textarea:hover {
    border-color: #5f6779;
}

.field input:focus,
.field textarea:focus {
    border-color: var(--orange-ink);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(217, 96, 0, 0.16);
}

.field--invalid input,
.field--invalid textarea,
.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
    border-color: #cc2231;
    background: #fff8f8;
}

.field__error {
    margin: 0;
    color: #c01827;
    font-size: 12.5px;
    line-height: 1.35;
}

.field__error[hidden] {
    display: none;
}

.field__error--shared {
    margin-top: -8px;
}

.form-actions {
    display: flex;
    gap: 28px;
    align-items: center;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 26px;
    border-top: 1px solid #eceef4;
}

.form-privacy {
    max-width: 520px;
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.5;
}

.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.btn {
    display: inline-flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 0;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.13em;
    line-height: 1;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.18s ease;
}

.btn--primary {
    min-height: 54px;
    padding: 0 28px;
    flex: none;
    background: var(--navy);
    color: var(--white);
}

.btn--primary:hover {
    background: var(--orange);
    color: var(--navy-deep);
}

.btn--primary:hover svg {
    transform: translateX(4px);
}

.btn--primary:disabled {
    cursor: wait;
    opacity: 0.65;
    transform: none;
}

.btn--outline {
    min-height: 52px;
    padding: 0 26px;
    border-color: var(--navy);
    background: transparent;
    color: var(--navy);
}

.btn--outline:hover {
    border-color: var(--orange);
    background: var(--orange);
    color: var(--navy-deep);
}

.btn:focus-visible,
.field input:focus-visible,
.field textarea:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

.site-footer__url:focus-visible,
.site-legal a:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 3px;
}

/* Successo */

.form-card--success {
    padding: clamp(46px, 6vw, 78px) clamp(24px, 4vw, 52px);
    text-align: center;
}

.success-icon {
    display: flex;
    width: 64px;
    height: 64px;
    align-items: center;
    justify-content: center;
    margin: 0 auto 26px;
    border-radius: 50%;
    background: var(--orange);
    color: var(--navy-deep);
}

.success-icon svg {
    width: 30px;
    height: 30px;
}

.form-card--success h3 {
    margin: 0 0 12px;
    color: var(--navy);
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.6vw, 3rem);
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1;
}

.form-card--success p {
    margin: 0 auto 28px;
    max-width: 480px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.page-footer {
    background: var(--navy-deep);
}

.site-legal {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    padding: 16px 24px 18px;
    background: var(--navy-deep);
    color: #aab2c4;
    font-family: var(--font-body);
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
    flex-wrap: wrap;
}

.site-legal a {
    color: var(--white);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.site-legal a:hover {
    color: var(--orange);
}

.site-legal span {
    color: #6f788d;
}

.site-footer {
    position: relative;
    height: 24vw;
    min-height: 240px;
    overflow: hidden;
    isolation: isolate;
    background-color: var(--blue);
    background-image: url("hero-bg.jpg");
    background-position: center;
    background-size: cover;
    background-blend-mode: multiply;
    line-height: 1;
}

.site-footer__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(46% 48% at 43% 48%, rgba(0, 80, 220, 0.26), transparent 64%),
        linear-gradient(180deg, rgba(0, 6, 30, 0.16) 0%, transparent 26%, rgba(0, 6, 30, 0.14) 100%);
}

.site-footer__ghost {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.site-footer__inner {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.site-footer__logo {
    position: absolute;
    top: 28%;
    left: 30.26%;
    width: 39.43%;
    height: auto;
}

.site-footer__url {
    position: absolute;
    top: 74%;
    left: 41.22%;
    display: inline-flex;
    width: auto;
    min-width: 18.5%;
    height: clamp(28px, 1.75vw, 34px);
    gap: 0.55em;
    align-items: center;
    justify-content: center;
    padding: 0 0.6em;
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: 999px;
    color: var(--white);
    font-family: var(--font-body);
    font-size: clamp(12px, 1.12vw, 21px);
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.site-footer__url svg {
    width: 0.95em;
    height: 0.95em;
    flex: none;
}

.site-footer__url:hover {
    background: rgba(255, 255, 255, 0.14);
    color: var(--orange);
}

/* ==========================================================================
   Tablet / mobile
   ========================================================================== */

@media (max-width: 1024px) {
    .hero__inner {
        width: auto;
        margin: 0;
        padding: clamp(84px, 13vw, 124px) clamp(22px, 6vw, 56px) clamp(46px, 8vw, 76px);
    }

    .hero__title {
        font-size: clamp(1.9rem, 9.2vw, 5.2rem);
    }

    .hero__title-line {
        width: auto;
        margin-right: 0;
        margin-left: 0;
        transform: none;
        white-space: nowrap;
    }

    .hero__title-line--1 {
        margin-left: 0;
        transform: none;
    }

    .hero__title-line--2 {
        margin-left: auto;
        letter-spacing: 0.025em;
        text-align: right;
        transform: none;
    }

    .hero__panel {
        margin-top: 14px;
        padding: clamp(20px, 4.6vw, 30px) clamp(18px, 4.8vw, 32px) clamp(22px, 4.8vw, 32px);
        font-size: clamp(1.05rem, 4.1vw, 1.65rem);
        letter-spacing: 0;
    }

    .hero__panel span {
        width: auto;
        transform: none;
        white-space: normal;
    }

    .hero__logo {
        width: min(52vw, 300px);
        margin: clamp(20px, 4.6vw, 32px) 0 0 auto;
    }

    .hero__video {
        -webkit-mask-image: linear-gradient(
            to top,
            #000 0%,
            #000 40%,
            rgba(0, 0, 0, 0.7) 54%,
            rgba(0, 0, 0, 0.25) 66%,
            transparent 78%
        );
        mask-image: linear-gradient(
            to top,
            #000 0%,
            #000 40%,
            rgba(0, 0, 0, 0.7) 54%,
            rgba(0, 0, 0, 0.25) 66%,
            transparent 78%
        );
    }

    .contact__inner {
        width: min(1200px, calc(100% - 40px));
    }
}

@media (max-width: 720px) {
    .contact {
        padding-top: 68px;
        padding-bottom: 84px;
    }

    .contact__inner {
        width: calc(100% - 32px);
    }

    .contact__head {
        margin-bottom: 30px;
    }

    .contact__title {
        font-size: clamp(2rem, 9.4vw, 3.6rem);
        line-height: 0.96;
    }

    .form-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .field--full {
        grid-column: auto;
    }

    .form-actions {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
        margin-top: 26px;
        padding-top: 22px;
    }

    .form-privacy {
        max-width: none;
        text-align: center;
    }

    .btn--primary {
        width: 100%;
    }

    .site-footer {
        height: clamp(220px, 44vw, 320px);
        min-height: 220px;
    }

    .site-footer__logo {
        top: 22%;
        left: 50%;
        width: min(68vw, 380px);
        transform: translateX(-50%);
    }

    .site-footer__url {
        top: auto;
        bottom: 13%;
        left: 50%;
        min-width: 0;
        height: 44px;
        gap: 8px;
        padding: 0 20px;
        font-size: 14px;
        transform: translateX(-50%);
    }

    .site-footer__url svg {
        width: 17px;
        height: 17px;
    }
}

@media (max-width: 420px) {
    .hero__inner {
        padding-inline: 20px;
    }

    .hero__panel {
        padding: 18px 16px 20px;
        font-size: 1rem;
    }

    .success-icon {
        width: 56px;
        height: 56px;
    }
}

/* Schermi bassi: l'hero resta esattamente alto quanto lo schermo */
@media (max-width: 1024px) and (max-height: 600px) {
    .hero__inner {
        width: min(92%, 1100px);
        margin: 0 auto;
        padding: clamp(18px, 3vh, 34px) clamp(18px, 4vw, 48px) clamp(14px, 2.5vh, 24px);
    }

    .hero__title {
        font-size: clamp(1.7rem, min(7vw, 9vh), 3.2rem);
    }

    .hero__panel {
        margin-top: 8px;
        padding: 12px 16px 14px;
        font-size: clamp(0.95rem, min(3vw, 3.8vh), 1.2rem);
        line-height: 1.18;
    }

    .hero__logo {
        width: min(38vw, 220px);
        margin: 12px 0 0 auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
