/* ============================================================
   GV SOFTWARE — Design system
   Direzione "editoriale grafite": Instrument Serif per i titoli,
   IBM Plex Sans per il testo, IBM Plex Mono per etichette e dati.
   Il grafite di fondo e' lo stesso bg-base dei token di Vynetic,
   cosi' sito e prodotti stanno sullo stesso terreno.
   ============================================================ */

/* ------------------------------------------------------------
   Font ospitati in locale (wwwroot/fonts), nessuna richiesta a
   server esterni. Solo i sottoinsiemi latin e latin-ext: coprono
   italiano, inglese e spagnolo. Licenza SIL Open Font License.
   IBM Plex Sans e' un font variabile: un file per 400-600.
   ------------------------------------------------------------ */
@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('../fonts/ibm-plex-sans-var-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('../fonts/ibm-plex-sans-var-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/ibm-plex-mono-400-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/ibm-plex-mono-400-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/ibm-plex-mono-500-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/ibm-plex-mono-500-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Instrument Serif';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/instrument-serif-400-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Instrument Serif';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/instrument-serif-400-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Instrument Serif';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/instrument-serif-400-italic-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Instrument Serif';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/instrument-serif-400-italic-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    /* Tipografia */
    --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
    --sans: 'IBM Plex Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    /* Brand — blu segnale */
    --blue: #4d8dff;
    --cyan: #8fb5ff;
    --grad: linear-gradient(120deg, #4d8dff 0%, #8fb5ff 100%);
    --grad-soft: linear-gradient(120deg, rgba(77, 141, 255, .14), rgba(143, 181, 255, .10));

    /* Accento attivo — lo sostituisce il prodotto selezionato nel banco */
    --pa: #4d8dff;
    --pa-soft: rgba(77, 141, 255, .14);
    --pa-line: rgba(77, 141, 255, .40);

    /* Superfici */
    --bg: #14171a;
    --bg-elev: #101315;
    --band: #0c0e10;
    --card: rgba(232, 238, 242, .035);
    --card-hover: rgba(232, 238, 242, .06);
    --border: rgba(232, 238, 242, .10);
    --border-strong: rgba(232, 238, 242, .18);

    /* Testo */
    --text: #f2f6f9;
    --text-2: #e2e8ed;
    --muted: #b1bac1;
    --faint: #8d979f;
    --heading-grad: none;
    --err: #ff9b9b;

    /* Effetti */
    --spot: rgba(255, 255, 255, .055);
    --card-glow: rgba(255, 255, 255, .05);
    --shadow: none;
    --ok: #6fd08c;

    --contact-grad: linear-gradient(123deg, #16202f 6%, #2a5bb8 40%, #4d8dff 100%);

    --maxw: 1240px;
    --radius: 4px;

    color-scheme: dark;
}

/* ------------------------------------------------------------
   LIGHT THEME  (data-theme="light" on <html>)
   ------------------------------------------------------------ */
:root[data-theme="light"] {
    --blue: #1f4fd8;
    --cyan: #4d7ae8;
    --grad: linear-gradient(120deg, #1f4fd8 0%, #4d7ae8 100%);
    --grad-soft: linear-gradient(120deg, rgba(31, 79, 216, .10), rgba(77, 122, 232, .08));

    --pa: #1f4fd8;
    --pa-soft: rgba(31, 79, 216, .09);
    --pa-line: rgba(31, 79, 216, .38);

    --bg: #f4f5f3;
    --bg-elev: #eceeea;
    --band: #14171a;
    --card: rgba(255, 255, 255, .72);
    --card-hover: #ffffff;
    --border: rgba(16, 19, 25, .13);
    --border-strong: rgba(16, 19, 25, .22);

    --text: #101319;
    --text-2: #1a1f27;
    --muted: #414852;
    --faint: #5b636c;
    --err: #b42318;

    --spot: rgba(16, 19, 25, .045);
    --card-glow: rgba(16, 19, 25, .05);
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 16px 34px -20px rgba(16, 24, 40, .32);
    --ok: #2f7d45;

    --contact-grad: linear-gradient(123deg, #1f4fd8 0%, #4d7ae8 100%);

    color-scheme: light;
}

:root[data-theme="light"] body::before {
    background:
        radial-gradient(70% 45% at 50% -5%, rgba(31, 79, 216, .10), transparent 60%);
}

:root[data-theme="light"] body::after {
    background-image:
        linear-gradient(rgba(16, 19, 25, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 19, 25, .045) 1px, transparent 1px);
}

:root[data-theme="light"] .nav.scrolled {
    background: rgba(244, 245, 243, .82);
}

:root[data-theme="light"] .tag,
:root[data-theme="light"] .field input,
:root[data-theme="light"] .field textarea {
    background: rgba(16, 19, 25, .03);
}

:root[data-theme="light"] .field input:focus,
:root[data-theme="light"] .field textarea:focus {
    background: rgba(31, 79, 216, .05);
}

:root[data-theme="light"] .service__num {
    color: rgba(16, 19, 25, .14);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text-2);
    font-family: var(--sans);
    /* 400, non 300: il Plex Light a 15px risultava troppo sottile da leggere */
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

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

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--pa);
    outline-offset: 3px;
    border-radius: 2px;
}

/* FocusOnNavigate (App.razor) porta il focus sul titolo a ogni cambio pagina,
   per i lettori di schermo. Il focus resta, ma senza il riquadro: il titolo
   non e' un controllo cliccabile. */
h1:focus,
h1:focus-visible {
    outline: none;
}

h1, h2, h3, h4 {
    font-family: var(--serif);
    font-weight: 400;
    letter-spacing: -.02em;
    color: var(--text);
    text-wrap: balance;
    margin: 0;
}

p {
    margin: 0;
    text-wrap: pretty;
}

.mono {
    font-family: var(--mono);
}

/* Etichetta monospace maiuscoletta: kicker, eyebrow, tag */
.eyebrow,
.kicker {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--muted);
}

::selection {
    background: var(--pa-soft);
    color: var(--text);
}

/* Alone ambientale ancorato in cima alla pagina */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(70% 45% at 50% -5%, rgba(77, 141, 255, .13), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Griglia tecnica appena accennata */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(232, 238, 242, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(232, 238, 242, .04) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 75%);
    pointer-events: none;
    z-index: 0;
}

/* Faretto che segue il cursore — riempito da animations.js */
.spotlight {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity .6s ease;
    background: radial-gradient(340px circle at var(--sx, 50%) var(--sy, 50%), var(--spot), transparent 72%);
}
/* ---------------- Loader ---------------- */
.app-loader {
    position: fixed;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 1.2rem;
    background: var(--bg);
    z-index: 999;
}

.app-loader__ring {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 3px solid var(--border);
    border-top-color: var(--cyan);
    animation: spin .9s linear infinite;
}

/* Logo sotto l'anello. La variante per tema la gestiscono le regole
   .brand-logo--dark / --light; il margin negativo compensa i ~25% di
   trasparenza sopra e sotto nella webp. */
.app-loader__logo {
    display: block;
    height: 84px;
    width: auto;
    max-width: calc(100vw - 32px);
    object-fit: contain;
    margin-block: -21px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   Layout helpers
   ============================================================ */
.wrap {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: clamp(1.1rem, 4vw, 2.5rem);
    position: relative;
    z-index: 1;
}

.section {
    position: relative;
    z-index: 1;
    padding-block: 6em;
}

/* Le etichette monospace sono definite una sola volta, in testa al file
   (.eyebrow, .kicker). Qui restano solo i titoli e il paragrafo guida. */
.section-heading {
    font-family: var(--serif);
    font-weight: 400;
    letter-spacing: -.018em;
    line-height: 1.04;
    font-size: clamp(2rem, 5.6vw, 4.4rem);
    color: var(--text);
    text-wrap: balance;
}

.lead {
    color: var(--muted);
    font-weight: 400;
    line-height: 1.7;
    font-size: clamp(1rem, 1.4vw, 1.18rem);
    max-width: 60ch;
}

/* ============================================================
   Reusable: ContactButton
   ============================================================ */
.btn-contact {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    border: none;
    cursor: pointer;
    border-radius: 999px;
    padding: .9rem 2.1rem;
    font-family: inherit;
    font-weight: 500;
    font-size: clamp(.8rem, 1vw, .95rem);
    text-transform: uppercase;
    letter-spacing: .18em;
    color: #fff;
    background: var(--contact-grad);
    box-shadow: 0 4px 14px rgba(34, 211, 238, .25),
        4px 4px 12px rgba(0, 87, 182, .45) inset;
    outline: 2px solid rgba(255, 255, 255, .85);
    outline-offset: -3px;
    transition: transform .3s ease, box-shadow .3s ease, filter .3s ease;
}

.btn-contact:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 8px 26px rgba(34, 211, 238, .4),
        4px 4px 12px rgba(0, 87, 182, .5) inset;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    border-radius: 999px;
    border: 2px solid var(--border-strong);
    padding: .7rem 1.7rem;
    font-family: inherit;
    font-weight: 500;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .18em;
    color: var(--text);
    background: transparent;
    cursor: pointer;
    transition: background .25s ease, border-color .25s ease;
}

.btn-ghost:hover {
    background: rgba(200, 216, 230, .08);
    border-color: var(--cyan);
}

/* ============================================================
   FadeIn utility (JS-driven via IntersectionObserver)
   ============================================================ */
[data-fade] {
    opacity: 0;
    transform: translate3d(var(--fx, 0), var(--fy, 30px), 0);
    transition: opacity .7s cubic-bezier(.25, .1, .25, 1),
        transform .7s cubic-bezier(.25, .1, .25, 1);
    transition-delay: var(--fd, 0s);
    will-change: opacity, transform;
}

[data-fade].is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
    [data-fade] {
        opacity: 1;
        transform: none;
    }
}

/* ============================================================
   NAVBAR
   ============================================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    transition: background .3s ease, backdrop-filter .3s ease, border-color .3s ease;
    border-bottom: 1px solid transparent;
}

.nav.scrolled {
    background: rgba(5, 7, 11, .72);
    backdrop-filter: blur(14px);
    border-bottom-color: var(--border);
}

.nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: 1.1rem;
}

.nav__brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-weight: 700;
    letter-spacing: .04em;
}

/* Logo GV Software: variante "dark" (scritta chiara) per il tema scuro,
   "light" (scritta scura) per il tema chiaro. Le webp hanno ~25% di margine
   trasparente sopra e sotto: il margin-block negativo lo compensa, cosi' la
   parte visibile resta alta ~30px senza allargare navbar/footer. */
.brand-logo {
    display: block;
    height: 56px;
    width: auto;
    margin-block: -13px;
}

.brand-logo--light,
:root[data-theme="light"] .brand-logo--dark {
    display: none;
}

:root[data-theme="light"] .brand-logo--light {
    display: block;
}

/* Monogramma "GV": sostituisce il logo intero nella navbar su schermi stretti.
   Dark (175x150) e light (175x125) hanno margini trasparenti diversi: si
   dimensionano in larghezza (la parte visibile risulta simile) e ognuno ha
   il suo margin-block negativo per non allargare la navbar. */
.brand-mark {
    display: none;
    width: 64px;
    height: auto;
}

@media (max-width: 480px) {
    .brand-logo {
        height: 46px;
        margin-block: -11px;
    }

    .nav__brand .brand-logo,
    :root[data-theme="light"] .nav__brand .brand-logo--light {
        display: none;
    }

    .nav__brand .brand-mark--dark {
        display: block;
        margin-block: -12px;
    }

    .nav__brand .brand-mark--light,
    :root[data-theme="light"] .nav__brand .brand-mark--dark {
        display: none;
    }

    :root[data-theme="light"] .nav__brand .brand-mark--light {
        display: block;
        margin-block: -8px;
    }
}

.nav__links {
    display: flex;
    gap: clamp(1.2rem, 3vw, 2.6rem);
    list-style: none;
}

.nav__links a {
    font-size: .8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .16em;
    color: var(--text);
    transition: opacity .2s ease;
}

.nav__actions {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.nav__lang {
    display: flex;
    align-items: center;
    gap: .2rem;
    margin-right: .3rem;
    padding-right: .5rem;
    border-right: 1px solid var(--border);
}

.nav__lang-item {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    padding: .3rem .45rem;
    border-radius: 6px;
    color: var(--muted);
    transition: color .2s ease, background .2s ease;
}

.nav__lang-item:hover {
    color: var(--text);
}

.nav__lang-item.active {
    color: var(--cyan);
    background: color-mix(in srgb, var(--cyan) 12%, transparent);
}

.nav__icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.nav__icon-btn:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}

.nav__links a:hover {
    opacity: .65;
}

.nav__links a.active {
    color: var(--cyan);
    opacity: 1;
}

.nav__toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
}

@media (max-width: 760px) {
    .nav__links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: rgba(5, 7, 11, .96);
        backdrop-filter: blur(14px);
        border-bottom: 1px solid var(--border);
        max-height: 0;
        overflow: hidden;
        transition: max-height .35s ease;
    }

    .nav__links.open {
        max-height: 340px;
    }

    .nav__links a {
        padding: 1rem clamp(1.1rem, 4vw, 2.5rem);
        border-top: 1px solid var(--border);
    }

    .nav__toggle {
        display: inline-flex;
    }
}

/* ============================================================
   SEZIONI — impianto editoriale
   ============================================================ */
.section {
    position: relative;
    padding-block: clamp(64px, 9vw, 124px);
}

.section--alt {
    background: var(--bg-elev);
    border-block: 1px solid var(--border);
}

/* Intestazione di sezione: numero, filetto, etichetta */
.sechead {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: clamp(26px, 4vw, 46px);
}

.sechead__n {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .2em;
    color: var(--pa);
    transition: color .5s ease;
}

.sechead__rule {
    flex: 0 1 60px;
    height: 1px;
    background: var(--border-strong);
}

.section__title {
    font-size: clamp(28px, 4.4vw, 58px);
    line-height: 1.04;
    max-width: 22ch;
}

.section__intro {
    color: var(--muted);
    max-width: 64ch;
    margin-top: 14px;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
    position: relative;
    padding: clamp(56px, 9vw, 118px) 0 clamp(44px, 6vw, 76px);
    overflow: hidden;
}

.hero__glow {
    position: absolute;
    top: -24%;
    left: 14%;
    width: 66vw;
    max-width: 1000px;
    aspect-ratio: 1;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(26px);
    background: radial-gradient(circle, var(--pa-soft), transparent 66%);
    animation: heroDrift 24s ease-in-out infinite;
}

@keyframes heroDrift {
    0%, 100% { transform: translate3d(-3%, -2%, 0) scale(1); }
    50%      { transform: translate3d(4%, 3%, 0) scale(1.09); }
}

.hero__eyebrow {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: clamp(18px, 3.2vw, 34px);
}

.hero__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ok);
    flex: none;
    animation: heroPulse 2.6s ease-in-out infinite;
}

@keyframes heroPulse {
    0%, 100% { opacity: .35; transform: scale(1); }
    50%      { opacity: 1; transform: scale(1.45); }
}

.hero__name {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
    font-family: var(--mono);
    font-size: 12.5px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--text-2);
}

.hero__role {
    color: var(--faint);
}

.hero__title {
    font-size: clamp(40px, 8.4vw, 128px);
    line-height: .96;
}

.hero__title em {
    font-style: italic;
    color: var(--pa);
}

.hero__caret {
    display: inline-block;
    width: .055em;
    height: .68em;
    margin-left: .1em;
    background: var(--pa);
    vertical-align: -.02em;
    animation: heroCaret 1.15s steps(1) infinite;
}

@keyframes heroCaret {
    0%, 49%   { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.hero__foot {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(22px, 5vw, 64px);
    align-items: flex-end;
    margin-top: clamp(28px, 4.6vw, 54px);
}

.hero__blurb {
    max-width: 48ch;
    color: var(--muted);
}

.hero__actions {
    display: flex;
    gap: 11px;
    flex-wrap: wrap;
}

/* ============================================================
   MARQUEE (stack tecnologico)
   ============================================================ */
.marquee {
    border-block: 1px solid var(--border);
    background: var(--band);
    padding: 14px 0;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.marquee__track {
    display: flex;
    width: max-content;
    animation: marqueeSlide 42s linear infinite;
}

.marquee__item {
    display: inline-flex;
    align-items: center;
    gap: 40px;
    padding-right: 40px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .2em;
    text-transform: uppercase;
    /* La fascia (--band) resta scura anche nel tema chiaro: colori fissi
       chiari, non i token di testo che nel tema chiaro diventano scuri. */
    color: #c9d1d8;
    white-space: nowrap;
}

.marquee__dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #6f9fff;
    flex: none;
}

@keyframes marqueeSlide {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ============================================================
   CHI SONO + NUMERI
   ============================================================ */
.about {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: clamp(28px, 5vw, 72px);
    align-items: start;
}

@media (max-width: 860px) {
    .about { grid-template-columns: 1fr; }
}

.about__title {
    font-size: clamp(28px, 4.2vw, 56px);
    line-height: 1.06;
    margin-bottom: 22px;
}

.about__body p {
    color: var(--muted);
    max-width: 60ch;
}

.about__body p + p {
    margin-top: 16px;
}

.facts {
    display: grid;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
}

.fact {
    background: var(--bg);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fact__n {
    font-family: var(--serif);
    font-size: 32px;
    line-height: 1;
    color: var(--pa);
    font-variant-numeric: tabular-nums;
}

.fact__label {
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ============================================================
   STACK — colonne per superficie
   ============================================================ */
.cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
    gap: clamp(20px, 3vw, 38px);
}

.col {
    padding-top: 15px;
    border-top: 1px solid var(--border-strong);
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.col h4 {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--pa);
    margin-bottom: 4px;
}

.col span {
    font-size: 15px;
    color: var(--muted);
}

/* ============================================================
   SERVIZI — griglia di carte
   ============================================================ */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: clamp(14px, 1.8vw, 22px);
}

/* La griglia allunga il wrapper FadeIn, non la carta: senza questo le carte
   con meno testo restano più basse delle altre sulla stessa riga. */
.cards > [data-fade] > .card {
    height: 100%;
}

.card {
    position: relative;
    padding: 26px 24px 28px;
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: border-color .3s ease, transform .3s cubic-bezier(.2, .8, .2, 1);
}

/* Schiarita locale che segue il cursore dentro la carta */
.card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity .35s ease;
    background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), var(--card-glow), transparent 70%);
}

.card:hover {
    border-color: var(--pa-line);
    transform: translateY(-2px);
}

.card:hover::before {
    opacity: 1;
}

.card__kicker {
    display: block;
    margin-bottom: 13px;
    color: var(--pa);
}

.card h4 {
    font-size: 24px;
    line-height: 1.12;
    margin-bottom: 9px;
}

.card p {
    color: var(--muted);
    font-size: 15px;
}

/* ============================================================
   IL BANCO DEI PRODOTTI
   Ogni prodotto porta il proprio accento: la sezione lo adotta
   quando viene selezionato. I valori vengono dai file di design
   dei rispettivi progetti.
   ============================================================ */
.bench__grid {
    display: grid;
    grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
    gap: clamp(22px, 3.4vw, 52px);
    align-items: start;
}

@media (max-width: 900px) {
    .bench__grid { grid-template-columns: 1fr; }
}

.rail {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rail__marker {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 0;
    pointer-events: none;
    border-left: 2px solid var(--pa);
    background: var(--pa-soft);
    transition: transform .52s cubic-bezier(.19, 1, .22, 1),
                height .52s cubic-bezier(.19, 1, .22, 1),
                background .45s ease, border-color .45s ease;
}

.rail__btn {
    position: relative;
    display: flex;
    align-items: baseline;
    gap: 12px;
    width: 100%;
    padding: 15px 16px;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--border);
    text-align: left;
    cursor: pointer;
}

.rail__btn:last-child {
    border-bottom: 0;
}

.rail__n {
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: .14em;
    color: var(--faint);
    transition: color .3s ease;
}

.rail__nm {
    font-family: var(--serif);
    font-size: 23px;
    line-height: 1.1;
    color: var(--muted);
    transition: color .3s ease;
}

.rail__tag {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--faint);
    white-space: nowrap;
}

.rail__btn:hover .rail__nm {
    color: var(--text-2);
}

.rail__btn.is-active .rail__nm {
    color: var(--text);
}

.rail__btn.is-active .rail__n {
    color: var(--pa);
}

@media (max-width: 900px) {
    .rail {
        flex-direction: row;
        gap: 0;
        overflow-x: auto;
        border-bottom: 1px solid var(--border);
        scrollbar-width: thin;
    }

    .rail__btn {
        width: auto;
        flex: none;
        border-bottom: 0;
        padding: 12px 16px;
    }

    .rail__nm { font-size: 19px; }
    .rail__tag { display: none; }

    .rail__marker {
        border-left: 0;
        border-bottom: 2px solid var(--pa);
    }
}

.panel {
    position: relative;
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: var(--shadow);
    padding: clamp(22px, 3vw, 38px);
    animation: panelIn .5s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes panelIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

.panel__top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.panel__tag {
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--pa);
}

.panel__sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--faint);
}

.panel__who {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}

.panel h3 {
    font-size: clamp(30px, 3.6vw, 48px);
    line-height: 1.04;
    margin-bottom: 12px;
}

.panel__lead {
    color: var(--text-2);
    font-size: 16px;
    max-width: 62ch;
    margin-bottom: 22px;
}

.flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    padding: 12px 14px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    background: var(--bg);
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    overflow-x: auto;
}

.flow__step {
    color: var(--text-2);
    white-space: nowrap;
}

.flow__arrow {
    color: var(--pa);
}

.points {
    display: grid;
    gap: 11px;
    margin-bottom: 24px;
}

.point {
    display: flex;
    gap: 12px;
    align-items: baseline;
}

.point::before {
    content: "";
    flex: none;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--pa);
    transform: translateY(-2px);
}

.point span {
    color: var(--muted);
    font-size: 15px;
    max-width: 66ch;
}

.point b {
    color: var(--text-2);
    font-weight: 500;
}

.panel__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 22px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

/* Prodotto non ancora online: al posto del link, uno stato "in sviluppo". */
.panel__wip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0 16px;
    min-height: 44px;
    border: 1px dashed var(--pa-line);
    border-radius: 999px;
    background: var(--pa-soft);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--pa);
}

.panel__wip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pa);
    flex: none;
    animation: heroPulse 2.6s ease-in-out infinite;
}

.tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tech span {
    padding: 4px 10px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
    .hero__glow,
    .hero__dot,
    .panel__wip-dot,
    .hero__caret,
    .marquee__track {
        animation: none;
    }

    .panel {
        animation: none;
    }

    .rail__marker {
        transition: none;
    }
}

/* ============================================================
   CONTATTI
   ============================================================ */
.contact {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.6rem;
}

.contact__mail {
    font-weight: 800;
    font-size: clamp(1.6rem, 5vw, 3.4rem);
    letter-spacing: -.01em;
    background: var(--heading-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    transition: opacity .2s ease;
}

.contact__mail:hover {
    opacity: .8;
}

.contact__socials {
    display: flex;
    gap: 1rem;
    margin-top: .5rem;
}

.contact__socials a {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    display: grid;
    place-content: center;
    color: var(--muted);
    transition: color .25s ease, border-color .25s ease, transform .25s ease;
}

.contact__socials a:hover {
    color: var(--cyan);
    border-color: var(--cyan);
    transform: translateY(-3px);
}

/* ============================================================
   CONTACT FORM
   ============================================================ */
.contact__layout {
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    gap: 3em;
    align-items: start;
    text-align: left;
    margin-top: 3em;
}

@media (max-width: 820px) {
    .contact__layout {
        grid-template-columns: 1fr;
    }
}

.cform {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: var(--radius);
    padding: clamp(1.5rem, 3vw, 2.4rem);
}

.cform__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 520px) {
    .cform__row {
        grid-template-columns: 1fr;
    }
}

.field {
    display: flex;
    flex-direction: column;
    gap: .45rem;
}

.field label {
    font-size: .76rem;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}

.field input,
.field textarea {
    width: 100%;
    font-family: inherit;
    font-size: .95rem;
    color: var(--text);
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .8rem 1rem;
    transition: border-color .2s ease, background .2s ease;
    resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
    color: #566575;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--cyan);
    background: rgba(34, 211, 238, .05);
}

.field .validation-message {
    color: var(--err);
    font-size: .8rem;
}

.cform__honeypot {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}

.cform__submit {
    align-self: flex-start;
    margin-top: .4rem;
}

.cform__privacy {
    font-size: .85rem;
    color: var(--muted);
}

.cform__privacy a {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cform__privacy a:hover {
    color: var(--cyan);
}

.cform__submit[disabled] {
    opacity: .6;
    cursor: not-allowed;
}

.cform__status {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .9rem;
    padding: .8rem 1rem;
    border-radius: 12px;
}

.cform__status.ok {
    color: var(--ok);
    background: rgba(56, 224, 138, .1);
    border: 1px solid rgba(56, 224, 138, .3);
}

.cform__status.err {
    color: var(--err);
    background: rgba(255, 90, 90, .08);
    border: 1px solid rgba(255, 90, 90, .3);
}

.contact__aside {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.contact__info {
    display: flex;
    align-items: center;
    gap: .9rem;
    color: var(--muted);
}

.contact__info .ci-ico {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-content: center;
    border: 1px solid var(--border);
    background: var(--grad-soft);
    color: var(--cyan);
    flex-shrink: 0;
}

.contact__info b {
    color: var(--text);
    font-weight: 600;
    display: block;
    font-size: .95rem;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .3);
    border-top-color: #fff;
    animation: spin .8s linear infinite;
    display: inline-block;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    border-top: 1px solid var(--border);
    padding-block: 2.2rem;
    color: var(--muted);
    font-size: .88rem;
}

.footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer__top {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 2rem;
    padding-bottom: 2rem;
    margin-bottom: 1.6rem;
    border-bottom: 1px solid var(--border);
}

@media (max-width: 720px) {
    .footer__top {
        grid-template-columns: 1fr;
        gap: 1.6rem;
    }
}

.footer__tag {
    margin-top: .9rem;
    max-width: 34ch;
    line-height: 1.6;
}

.footer__col h4 {
    color: var(--text);
    font-size: .74rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.footer__col a {
    display: block;
    padding: .3rem 0;
    color: var(--muted);
    transition: color .2s ease;
}

.footer__col a:hover {
    color: var(--cyan);
}

/* ============================================================
   CV PAGE
   ============================================================ */
.cv {
    padding-top: 7rem;
    padding-bottom: 4rem;
}

.cv__top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.cv__id h1 {
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -.02em;
    font-size: clamp(2.2rem, 6vw, 4rem);
    line-height: 1;
}

.cv__id .cv__role {
    color: var(--cyan);
    letter-spacing: .2em;
    text-transform: uppercase;
    font-size: .8rem;
    margin-top: .6rem;
}

.cv__id .cv__contacts {
    color: var(--muted);
    margin-top: .8rem;
    font-size: .9rem;
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.cv__grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: clamp(2rem, 5vw, 3.5rem);
    align-items: start;
}

@media (max-width: 820px) {
    .cv__grid {
        grid-template-columns: 1fr;
    }
}

.cv__block {
    margin-bottom: 2.4rem;
}

.cv__block h2 {
    font-size: .78rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--cyan);
    padding-bottom: .7rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.4rem;
}

.cv__summary {
    color: var(--muted);
    font-weight: 400;
    line-height: 1.7;
}

.tl {
    position: relative;
    padding-left: 1.4rem;
    border-left: 1px solid var(--border);
}

.tl__item {
    position: relative;
    padding-bottom: 1.6rem;
}

.tl__item:last-child {
    padding-bottom: 0;
}

.tl__item::before {
    content: "";
    position: absolute;
    left: calc(-1.4rem - 5px);
    top: 5px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, .15);
}

.tl__when {
    font-size: .74rem;
    letter-spacing: .08em;
    color: var(--muted);
    text-transform: uppercase;
}

.tl__role {
    font-weight: 600;
    font-size: 1.05rem;
    margin-top: .2rem;
}

.tl__org {
    color: var(--text);
    font-weight: 400;
}

.tl__org .sep { color: var(--muted); }

.tl__desc {
    color: var(--muted);
    font-weight: 400;
    line-height: 1.55;
    font-size: .9rem;
    margin-top: .35rem;
}

.cv__skill {
    margin-bottom: 1rem;
}

.cv__skill-head {
    display: flex;
    justify-content: space-between;
    font-size: .85rem;
    margin-bottom: .35rem;
}

.cv__skill-head span:last-child { color: var(--muted); }

.cv__bar {
    height: 6px;
    border-radius: 4px;
    background: var(--border);
    overflow: hidden;
}

.cv__bar i {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: var(--grad);
}

.cv__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .9rem;
}

.cv__list li b {
    font-weight: 600;
}

.cv__list li span {
    display: block;
    color: var(--muted);
    font-size: .85rem;
    font-weight: 400;
}

.cv__actions {
    display: flex;
    gap: .8rem;
    flex-wrap: wrap;
}

.cv__print-note {
    color: var(--muted);
    font-size: .8rem;
    margin-top: .6rem;
}

/* ---- Print: clean A4, ink-friendly ---- */
@media print {
    .nav, .footer, .cv__actions, .cv__print-note, .hero__scroll, #blazor-error-ui {
        display: none !important;
    }

    body::before { display: none; }

    html, body {
        background: #fff !important;
        color: #111 !important;
    }

    .cv {
        padding: 0 !important;
    }

    .cv__id h1, .tl__role, .tl__org, .cv__list li b { color: #111 !important; }
    .cv__summary, .tl__desc, .tl__when, .cv__list li span, .cv__id .cv__contacts { color: #444 !important; }
    .cv__block h2, .cv__id .cv__role { color: #0a6ea8 !important; }
    .grad-text { -webkit-text-fill-color: #111 !important; color: #111 !important; }

    .cv__bar { background: #e5e9ef !important; }
    .cv__bar i { background: #0a6ea8 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .tl__item::before { background: #0a6ea8 !important; box-shadow: none !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

    .cv__grid { grid-template-columns: 1.6fr 1fr !important; gap: 2rem !important; }
    .tl__item { break-inside: avoid; }

    @page { margin: 14mm; }
}

/* ============================================================
   Blazor error UI
   ============================================================ */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #12070a;
    color: #ffb4b4;
    border-top: 1px solid #5a1d24;
    padding: .9rem 1.4rem;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, .5);
}

#blazor-error-ui .reload {
    color: var(--cyan);
    text-decoration: underline;
    margin-left: .5rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    float: right;
}
