/* ==========================================================================
   1. Design Tokens
   Una baia di mattina presto: fondo di foschia fredda, testo
   blu profondo, ocra in piccole dosi.
   ========================================================================== */

:root {
    --bg: #F4F7F8;
    --card: #FFFFFF;
    --ink: #0C2233;
    --ink-soft: #23405A;
    --slate: #5C7285;
    --muted: #4E6377;
    --line: #DBE2E8;
    --line-strong: #C5D0D8;
    --accent: #D9A036;
    --accent-ink: #96690D;
    --dark: #0C2233;

    /* Raggi: una famiglia, tre taglie. Controlli piccoli 12px, card 20px, oggetti-hero 28px. */
    --r-sm: 0.75rem;
    --r: 1.25rem;
    --r-lg: 1.75rem;
    --radius: var(--r);

    /* Ombre fredde, tinte d'inchiostro, larghe e leggere. --edge e' un velo di keyline
       che impedisce al bianco di sciogliersi nella foschia senza disegnare un bordo. */
    --edge: 0 0 0 1px rgba(12, 34, 51, 0.05);
    --shadow-rest: var(--edge), 0 1px 2px rgba(12, 34, 51, 0.04), 0 16px 40px -20px rgba(12, 34, 51, 0.16);
    --shadow-hover: var(--edge), 0 2px 4px rgba(12, 34, 51, 0.05), 0 28px 56px -24px rgba(12, 34, 51, 0.24);
    --shadow-float: var(--edge), 0 2px 6px rgba(12, 34, 51, 0.06), 0 44px 88px -36px rgba(12, 34, 51, 0.38);

    /* Movimento: breve, decelerato, mai elastico. */
    --ease: cubic-bezier(0.2, 0, 0, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --dur: 0.22s;
    --font-display: 'Bricolage Grotesque', 'Instrument Sans', system-ui, sans-serif;
    --font-body: 'Instrument Sans', system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

/* ==========================================================================
   2. Reset & Base
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
    padding: 0;
}

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

:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

[hidden] { display: none !important; }

section[id] { scroll-margin-top: 5rem; }

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

::selection {
    background-color: var(--accent);
    color: var(--ink);
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--slate); }

/* ==========================================================================
   3. Layout
   ========================================================================== */

.container {
    max-width: 72rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

@media (min-width: 1024px) {
    .container { padding-left: 2rem; padding-right: 2rem; }
}

.section {
    position: relative;
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
}

@media (min-width: 768px) {
    .section { padding-top: 8.5rem; padding-bottom: 8.5rem; }
}

/* ==========================================================================
   4. Typography
   ========================================================================== */

h1, h2, h3 {
    font-family: var(--font-display);
    line-height: 1.06;
    letter-spacing: -0.025em;
    font-weight: 700;
    text-wrap: balance;
}

h1 { line-height: 1; letter-spacing: -0.04em; }
h2 { line-height: 1.04; letter-spacing: -0.035em; }

.section-title {
    margin-bottom: 2.5rem;
    max-width: 26ch;
    font-size: clamp(2rem, 1.5rem + 2.2vw, 3.25rem);
    color: var(--ink);
}

@media (min-width: 768px) {
    .section-title { margin-bottom: 3.5rem; }
}

/* Etichetta di sezione: mono in tondo, tick ocra. Niente maiuscolo spaziato. */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--muted);
}

.section-label::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 2px;
    background-color: var(--accent);
    flex-shrink: 0;
}

/* ==========================================================================
   5. Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 3rem;
    border-radius: 9999px;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.btn svg { width: 1.2rem; height: 1.2rem; flex-shrink: 0; }

.btn--primary {
    background-color: var(--ink);
    color: var(--card);
}

.btn--primary:hover {
    background-color: var(--ink-soft);
    transform: translateY(-1px);
    box-shadow: 0 12px 28px -12px rgba(12, 34, 51, 0.4);
}

/* Secondario: superficie appena sollevata dal fondo, nessun contorno */
.btn--ghost {
    background-color: rgba(12, 34, 51, 0.07);
    color: var(--ink);
}

.btn--ghost:hover {
    background-color: rgba(12, 34, 51, 0.12);
}

/* ==========================================================================
   7. Header
   ========================================================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    transition: background-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.header--scrolled {
    background-color: rgba(244, 247, 248, 0.78);
    backdrop-filter: blur(20px) saturate(1.6);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    box-shadow: 0 1px 0 rgba(12, 34, 51, 0.06), 0 12px 32px -24px rgba(12, 34, 51, 0.18);
}

.header__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    max-width: 72rem;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .header__nav { padding-left: 2rem; padding-right: 2rem; }
}

.header__logo {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 750;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.header__desktop-nav {
    display: none;
    align-items: center;
    gap: 1.75rem;
}

@media (min-width: 768px) {
    .header__desktop-nav { display: flex; }
}

.header__nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--muted);
    transition: color var(--dur) var(--ease);
}

.header__nav-link:hover {
    color: var(--ink);
}

.header__cta-link {
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 9999px;
    padding: 0.5rem 1.15rem;
    background-color: var(--ink);
    color: var(--card);
    transition: background-color var(--dur) var(--ease);
}

.header__cta-link:hover {
    background-color: var(--ink-soft);
}

.header__lang-toggle {
    position: relative;
    border-radius: 9999px;
    padding: 0.3rem 0.75rem;
    background-color: rgba(12, 34, 51, 0.06);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted);
    transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.header__lang-toggle:hover {
    background-color: rgba(12, 34, 51, 0.11);
    color: var(--ink);
}

/* Area di tocco estesa (44px) per i controlli piccoli dell'header */
.header__lang-toggle::after,
.header__hamburger::after {
    content: "";
    position: absolute;
    inset: -0.65rem -0.3rem;
}

.header__hamburger::after { inset: -0.75rem; }

.header__mobile-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

@media (min-width: 768px) {
    .header__mobile-controls { display: none; }
}

.header__hamburger {
    position: relative;
    display: inline-flex;
    color: var(--ink);
}

.header__hamburger svg {
    width: 1.4rem;
    height: 1.4rem;
}

/* Mobile overlay */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 36;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgba(244, 247, 248, 0.97);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s;
}

@media (min-width: 768px) {
    .mobile-menu { display: none !important; }
}

.mobile-menu.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu__link {
    padding: 0.9rem;
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--ink);
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mobile-menu.is-open .mobile-menu__link {
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu.is-open .mobile-menu__link:nth-child(1) { transition-delay: 0ms; }
.mobile-menu.is-open .mobile-menu__link:nth-child(2) { transition-delay: 50ms; }
.mobile-menu.is-open .mobile-menu__link:nth-child(3) { transition-delay: 100ms; }
.mobile-menu.is-open .mobile-menu__link:nth-child(4) { transition-delay: 150ms; }
.mobile-menu.is-open .mobile-menu__link:nth-child(5) { transition-delay: 200ms; }

/* ==========================================================================
   12. Demo: chat WhatsApp e thread email
   ========================================================================== */

.demo {
    width: 100%;
}

.chat-mock {
    border-radius: var(--r-lg);
    background-color: #EFEAE2;
    overflow: hidden;
    box-shadow: var(--shadow-float);
}

.chat-mock__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1.15rem;
    background-color: #F0F2F5;
    box-shadow: 0 1px 0 rgba(12, 34, 51, 0.06);
    position: relative;
}

.chat-mock__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    background-color: var(--ink);
    color: #FFFFFF;
    font-size: 0.7rem;
    font-weight: 700;
}

.chat-mock__meta {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.chat-mock__name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
}

.chat-mock__status {
    font-size: 0.72rem;
    color: var(--muted);
}

.chat-mock__body {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 1.1rem 1rem 1.25rem;
}

.chat-bubble {
    max-width: 86%;
    border-radius: 1rem;
    padding: 0.6rem 0.85rem;
    font-size: 0.83rem;
    line-height: 1.5;
    color: var(--ink);
    box-shadow: 0 1px 1px rgba(12, 34, 51, 0.06);
}

.chat-bubble--in {
    align-self: flex-start;
    background-color: #FFFFFF;
    border-bottom-left-radius: 0.3rem;
}

.chat-bubble--out {
    align-self: flex-end;
    background-color: #D9FDD3;
    border-bottom-right-radius: 0.3rem;
}

/* Steps hidden until revealed */
.chat-step {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.chat-step.is-shown {
    opacity: 1;
    transform: translateY(0);
}

/* Typing indicator */
.chat-bubble__typing { display: none; gap: 0.25rem; align-items: center; height: 1.3em; }
.chat-bubble__typing i {
    width: 0.33rem;
    height: 0.33rem;
    border-radius: 50%;
    background-color: var(--slate);
    animation: typing-dot 1s ease-in-out infinite;
}
.chat-bubble__typing i:nth-child(2) { animation-delay: 0.15s; }
.chat-bubble__typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-dot {
    0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

.chat-bubble.is-typing .chat-bubble__typing { display: inline-flex; }
.chat-bubble.is-typing .chat-bubble__text { display: none; }


/* Confirmation tag */
.chat-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    align-self: flex-end;
    border-radius: 9999px;
    background-color: #FFFFFF;
    box-shadow: var(--edge), 0 1px 2px rgba(12, 34, 51, 0.08);
    padding: 0.35rem 0.8rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ink);
}

.chat-tag svg { width: 0.85rem; height: 0.85rem; color: var(--accent-ink); }

/* Interruttore di canale: vetro sopra la demo, la linguetta attiva e' una superficie sollevata */
.demo-switch {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.875rem;
    padding: 0.25rem;
    border-radius: 9999px;
    background-color: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(16px) saturate(1.5);
    -webkit-backdrop-filter: blur(16px) saturate(1.5);
    box-shadow: var(--edge), 0 1px 2px rgba(12, 34, 51, 0.03);
}

.demo-switch__tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.75rem;
    border-radius: 9999px;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.demo-switch__tab svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.demo-switch__tab:hover { color: var(--ink); }

.demo-switch__tab:focus-visible { outline-offset: -2px; }

.demo-switch__tab.is-active {
    background-color: var(--card);
    color: var(--ink);
    box-shadow: 0 1px 3px rgba(12, 34, 51, 0.12), 0 6px 14px -6px rgba(12, 34, 51, 0.16);
}

.demo-switch__tab.is-active svg { color: var(--accent-ink); }

/* Il pannello che entra scivola appena, come un messaggio */
.demo-panel {
    animation: demo-in 0.3s var(--ease-out);
}

@keyframes demo-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Email mockup (same card, second channel) */
.mail-mock {
    border-radius: var(--r-lg);
    background-color: var(--card);
    overflow: hidden;
    box-shadow: var(--shadow-float);
}

.mail-mock__header {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.9rem 1.15rem;
    background-color: #F0F2F5;
    box-shadow: 0 1px 0 rgba(12, 34, 51, 0.06);
    position: relative;
}

.mail-mock__box {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--muted);
}

.mail-mock__subject {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
}

.mail-mock__body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.1rem 1rem 1.25rem;
}

@media (min-width: 900px) {
    .chat-mock__body,
    .mail-mock__body { min-height: 17rem; }
}

.mail-msg {
    border-radius: var(--r-sm);
    background-color: var(--bg);
    padding: 0.7rem 0.85rem;
}

.mail-msg--out {
    margin-left: 0.9rem;
    background-color: #FDF7EC;
    box-shadow: 0 0 0 1px rgba(150, 105, 13, 0.22);
}

.mail-msg__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.mail-msg__who {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--ink);
}

.mail-msg__time {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--muted);
}

.mail-msg__text {
    font-size: 0.83rem;
    line-height: 1.5;
    color: var(--ink);
}

/* Firma automatica: la mail dichiara sempre di essere una risposta automatica */
.mail-msg__sig {
    margin-top: 0.55rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(150, 105, 13, 0.22);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    line-height: 1.45;
    color: var(--muted);
}

.mail-msg .chat-bubble__typing { display: none; }
.mail-msg.is-typing .chat-bubble__typing { display: inline-flex; }
.mail-msg.is-typing .mail-msg__text,
.mail-msg.is-typing .mail-msg__sig { display: none; }

/* ==========================================================================
   16. FAQ
   ========================================================================== */

.faq__inner { max-width: 52rem; }

/* Un elenco a filetti, non nove scatole: il bordo qui e' informazione (una riga per domanda) */
.faq__list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--line);
}

.faq-item {
    border-bottom: 1px solid var(--line);
}

.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.35rem 0;
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.4;
    color: var(--ink);
    cursor: pointer;
    list-style: none;
    transition: color var(--dur) var(--ease);
}

@media (min-width: 768px) {
    .faq-item summary { padding: 1.5rem 0; font-size: 1.125rem; }
}

.faq-item summary:hover { color: var(--ink-soft); }

.faq-item summary:focus-visible {
    outline-offset: 6px;
    border-radius: 0.5rem;
}

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

.faq-item summary::after {
    content: "+";
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 400;
    line-height: 1;
    color: var(--accent-ink);
    transition: transform var(--dur) var(--ease);
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item p {
    padding: 0 2.5rem 1.6rem 0;
    max-width: 62ch;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--muted);
}

/* ==========================================================================
   17. Contact
   ========================================================================== */

.contact {
    background-color: var(--card);
}


.contact__inner { position: relative; }

.contact__subtitle {
    margin-bottom: 3rem;
    max-width: 36rem;
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--muted);
    text-wrap: pretty;
}

.contact__grid {
    display: grid;
    gap: 2.5rem;
    align-items: start;
}

@media (min-width: 1024px) {
    .contact__grid { grid-template-columns: 1fr 0.62fr; gap: 6rem; }
}

.contact__aside {
    border-left: 3px solid var(--accent);
    padding-left: 1.5rem;
}

/* Sotto il desktop l'aside sale sopra il form: prima il motivo, poi i campi */
@media (max-width: 1023px) {
    .contact__aside {
        order: -1;
        border-left: none;
        border-radius: var(--r);
        background-color: var(--bg);
        padding: 1.25rem 1.375rem;
    }

    .contact__aside-address { display: none; }
}

.contact__aside-title {
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

.contact__aside-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--muted);
}

.contact__aside-list li::before {
    content: "\2192\0020";
    font-family: var(--font-mono);
    color: var(--accent-ink);
}

.contact__aside-address {
    margin-top: 2rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.7;
    color: var(--slate);
}

/* Honeypot: fuori dallo schermo, non display:none, che i bot riconoscono. */
.contact-form__hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.contact-form__consent {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--muted);
    cursor: pointer;
    max-width: 34rem;
}

.contact-form__consent input {
    width: 1.2rem;
    height: 1.2rem;
    margin-top: 0.1rem;
    accent-color: var(--ink);
    flex-shrink: 0;
}

.contact-form__consent a {
    display: inline-block;
    padding: 0.7rem 0.15rem;
    margin: -0.7rem -0.15rem;
    font-weight: 600;
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

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

.contact-form__row {
    display: grid;
    gap: 1.25rem;
}

@media (min-width: 640px) {
    .contact-form__row { grid-template-columns: 1fr 1fr; }
}

.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-strong);
    background-color: var(--card);
    padding: 0.8rem 1rem;
    font-size: 0.9375rem;
    font-family: var(--font-body);
    color: var(--ink);
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
    outline: none;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--slate);
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--ink);
    box-shadow: 0 0 0 4px rgba(12, 34, 51, 0.08);
}

.contact-form textarea { resize: none; }

/* La checkbox del consenso non e' un campo di testo: niente larghezza piena, niente padding.
   Specificita' alzata apposta per vincere sulle regole generiche degli input qui sopra. */
.contact-form .contact-form__consent {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--muted);
    margin-bottom: 0;
}

.contact-form .contact-form__consent input {
    width: 1.2rem;
    height: 1.2rem;
    min-height: 0;
    padding: 0;
    margin-top: 0.1rem;
    border-radius: 0.3rem;
    flex-shrink: 0;
}

/* Telefono: 16px evita lo zoom automatico di iOS, 48px di altezza per il dito */
@media (max-width: 767px) {
    .contact-form input:not([type="checkbox"]):not([type="hidden"]),
    .contact-form textarea {
        font-size: 1rem;
        min-height: 3rem;
    }
}

.contact-form__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 3rem;
    border-radius: 9999px;
    background-color: var(--ink);
    padding: 0.8rem 1.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--card);
    transition: background-color var(--dur) var(--ease);
    align-self: stretch;
}

@media (min-width: 640px) {
    .contact-form__submit { align-self: flex-start; }
}

.contact-form__submit:hover {
    background-color: var(--ink-soft);
}

.contact-form__submit svg {
    width: 1rem;
    height: 1rem;
    transition: transform var(--dur) var(--ease);
}

.contact-form__submit:hover svg { transform: translateX(4px); }

.contact-form__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.contact-form__feedback {
    padding: 0.75rem 1rem;
    border-radius: var(--r-sm);
    font-size: 0.875rem;
    font-weight: 500;
}

.contact-form__feedback--success {
    background-color: rgba(37, 211, 102, 0.12);
    border: 1px solid rgba(29, 168, 81, 0.4);
    color: #14683A;
}

.contact-form__feedback--error {
    background-color: rgba(200, 60, 40, 0.08);
    border: 1px solid rgba(200, 60, 40, 0.35);
    color: #9E2F1D;
}

.contact__note {
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--muted);
    max-width: 32rem;
}

.g-recaptcha {
    transform: scale(0.9);
    transform-origin: 0 0;
}

/* ==========================================================================
   18. Footer
   ========================================================================== */

.footer {
    background-color: var(--card);
    padding: 0 0 5rem;
}

@media (min-width: 768px) {
    .footer { padding-bottom: 2.5rem; }
}

.footer__inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 2rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--muted);
}

/* Filetto largo quanto il contenuto, non quanto il contenitore col suo padding */
.footer__inner::before {
    content: "";
    position: absolute;
    top: 0;
    left: 1.5rem;
    right: 1.5rem;
    height: 1px;
    background-color: var(--line);
}

@media (min-width: 1024px) {
    .footer__inner::before { left: 2rem; right: 2rem; }
}

.footer__legal { opacity: 0.8; }

.footer__legal a {
    display: inline-block;
    padding: 0.9rem 0.3rem;
    margin: -0.9rem -0.3rem;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.footer__marks {
    margin-top: 1rem;
    font-size: 0.7rem;
    color: var(--slate);
    text-align: center;
}

@media (min-width: 640px) {
    .footer__marks { text-align: left; }
}

@media (min-width: 640px) {
    .footer__inner { flex-direction: row; text-align: left; }
}

/* Legal / privacy page */
.legal__header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--line);
}

.legal__body {
    max-width: 46rem;
    padding-top: 3rem;
    padding-bottom: 4rem;
}

.legal__body h1 {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    margin-bottom: 0.75rem;
}

.legal__updated {
    font-size: 0.85rem;
    color: var(--slate);
    margin-bottom: 2rem;
}

.legal__body h2 {
    font-size: 1.2rem;
    margin: 2rem 0 0.6rem;
}

.legal__body h3 {
    font-size: 1rem;
    margin: 1.25rem 0 0.4rem;
}

.legal__body p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--muted);
}

.legal__back { margin-top: 3rem; }

.legal__back a {
    font-weight: 600;
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

/* ==========================================================================
   19. Mobile sticky CTA
   ========================================================================== */

/* Vetro scuro sopra il contenuto che scorre */
.mobile-cta {
    position: fixed;
    left: 50%;
    bottom: max(1rem, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
    z-index: 35;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 3rem;
    border-radius: 9999px;
    background-color: rgba(12, 34, 51, 0.84);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    color: var(--card);
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(12, 34, 51, 0.12), 0 20px 44px -16px rgba(12, 34, 51, 0.5);
    white-space: nowrap;
}

.mobile-cta svg { width: 1.1rem; height: 1.1rem; }

.mobile-cta.is-hidden {
    transform: translateX(-50%) translateY(150%);
    opacity: 0;
    pointer-events: none;
}

@media (min-width: 768px) {
    .mobile-cta { display: none; }
}

/* ==========================================================================
   22. Carta e inchiostro
   Il sito e' una carta nautica della baia: carta con la grana, isobate che si
   disegnano a penna, vignette incise che si tingono da CSS (mask). Tutto cio'
   che si muove e' lento, si ferma con meno movimento, e non nasconde mai il testo.
   ========================================================================== */

:root {
    --paper: #F6F5F0;
    --paper-deep: #EEEDE5;
    --sky-top: #EEF3F4;
    --sky-low: #F6F5F0;
    --pen: linear(0, 0.058 2%, 0.15 6%, 0.318 14%, 0.558 28%, 0.745 44%, 0.861 60%, 0.932 74%, 0.973 86%, 1);
    --grain: url('/images/baia/grana.png');
}

body { background-color: var(--paper); background-image: var(--grain); }

/* Il tratto a penna: un trattino lungo quanto il path, col vuoto lungo il doppio */
.penna { stroke-dasharray: 1 2; }

/* ==========================================================================
   23. Header: vetro che compare scorrendo
   ========================================================================== */

.header__logo { display: inline-flex; align-items: center; gap: 0.5rem; }
.header__mark { width: 1.6rem; height: 1.6rem; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.header--scrolled {
    background-color: rgba(246, 245, 240, 0.74);
    box-shadow: 0 1px 0 rgba(12, 34, 51, 0.06);
}

.header__nav-link { position: relative; padding: 0.35rem 0; }

.header__nav-link::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -0.1rem;
    width: 0.3rem;
    height: 0.3rem;
    border-radius: 50%;
    background-color: var(--accent);
    transform: translateX(-50%) scale(0);
    transition: transform var(--dur) var(--ease);
}

.header__nav-link[aria-current]::after { transform: translateX(-50%) scale(1); }
.header__nav-link[aria-current] { color: var(--ink); }

/* Il posto del bottone resta tenuto: quando compare il menu non salta */
.header__cta-link { transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), background-color var(--dur) var(--ease), visibility 0.3s; }
.header__cta-link.is-waiting { opacity: 0; visibility: hidden; transform: translateY(-4px) scale(0.96); }

/* ==========================================================================
   8. Hero
   ========================================================================== */

.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    --bay-h: 8.5rem;
    padding-top: 6.5rem;
    padding-bottom: calc(var(--bay-h) + 1.5rem);
    background: var(--grain), linear-gradient(to bottom, var(--sky-top), var(--sky-low) 62%);
}

@media (min-width: 1024px) {
    .hero { --bay-h: min(20vw, 32svh); min-height: 100svh; padding-top: 5.5rem; padding-bottom: calc(var(--bay-h) + 0.5rem); }
}

.hero__sea {
    position: absolute;
    inset: -1.5rem;
    z-index: -2;
    color: var(--ink);
    opacity: 0.13;
    -webkit-mask-image: linear-gradient(to bottom, transparent 8%, #000 55%);
    mask-image: linear-gradient(to bottom, transparent 8%, #000 55%);
    will-change: transform;
}

.isobate { width: 100%; height: 100%; }
.isobate path { stroke: currentColor; stroke-width: 1; }

@media (prefers-reduced-motion: no-preference) {
    .js .hero__sea .penna { animation: penna-disegna 3.2s var(--pen) both; animation-delay: calc(var(--i) * 110ms); }
    .hero__sea .isobate { animation: marea 26s ease-in-out infinite alternate; }
}

@keyframes penna-disegna { from { stroke-dashoffset: 1.05; } to { stroke-dashoffset: 0; } }
@keyframes marea { from { transform: translateY(-7px) scale(1.012); } to { transform: translateY(9px) scale(1); } }

/* La baia: vettoriale piatto a tutta larghezza in fondo alla hero */
.hero__bay { position: absolute; left: 0; right: 0; bottom: 0; z-index: -1; height: var(--bay-h); }
.baia { display: block; width: 100%; height: 100%; }
.baia { overflow: visible; }
/* Sole e luna: stesso arco, da una collina all'altra. Parcheggiati dietro le colline quando tocca all'altro. */
.baia__sun, .baia__moon { offset-path: path('M120 310Q800 -130 1480 310'); offset-rotate: 0deg; }
.baia__sun { fill: var(--accent); offset-distance: 50%; }
.baia__moon { fill: #8FA9B7; offset-distance: 0%; }

@media (prefers-reduced-motion: no-preference) {
    .baia__sun { animation: sole-giro 240s linear var(--ciclo-delay, 0s) infinite; }
    .baia__moon { animation: luna-giro 240s linear var(--ciclo-delay, 0s) infinite; }
}

@keyframes sole-giro { 0% { offset-distance: 0%; } 50%, 100% { offset-distance: 100%; } }
@keyframes luna-giro { 0%, 50% { offset-distance: 0%; } 100% { offset-distance: 100%; } }

@media (prefers-reduced-motion: no-preference) {
    .baia__boat { animation: dondola var(--t) ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center bottom; }
    .baia__wave--1 { animation: marea-onda 48s linear infinite; }
    .baia__wave--2 { animation: marea-onda 70s linear infinite reverse; }
    .baia__wave--3 { animation: marea-onda 100s linear infinite; }
}

@keyframes marea-onda { to { transform: translateX(400px); } }

@keyframes dondola { from { transform: rotate(-3deg) translateY(2px); } to { transform: rotate(3deg) translateY(-3px); } }

.hero__grid { display: grid; align-items: start; gap: 2.75rem; width: 100%; }

@media (min-width: 1024px) {
    .hero__grid { grid-template-columns: minmax(0, 1fr) 25rem; gap: 4.5rem; }
    .hero__content { padding-top: 1.5rem; }
}

.hero__where {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
}

.hero__where time { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }

.hero__pulse { position: relative; width: 0.45rem; height: 0.45rem; border-radius: 50%; background-color: var(--accent); }

@media (prefers-reduced-motion: no-preference) {
    .hero__pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background-color: var(--accent); animation: polso 3.4s var(--ease-out) infinite; }
}

@keyframes polso { from { transform: scale(1); opacity: 0.55; } 60%, to { transform: scale(3.4); opacity: 0; } }

.hero__headline { font-size: clamp(2.6rem, 1.9rem + 2.7vw, 4.25rem); letter-spacing: -0.042em; line-height: 0.98; font-weight: 720; }
.hero__headline span { display: block; }

.hero__headline-accent {
    position: relative;
    display: inline-block !important;
    margin-top: 0.9rem;
    font-size: 0.47em;
    letter-spacing: -0.025em;
    line-height: 1.12;
    font-weight: 600;
    color: var(--ink-soft);
}

.hero__headline-accent em { font-style: normal; text-decoration: none; }

.hero__stroke { position: absolute; left: 0; right: 0; bottom: -0.55rem; width: 100%; height: 0.6rem; overflow: visible; }
.hero__stroke path { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }

@media (prefers-reduced-motion: no-preference) {
    .js .hero__stroke .penna { animation: penna-disegna 1.5s var(--pen) 0.6s both; }
}

.hero__subtitle { max-width: 33rem; margin-top: 1.9rem; font-size: 1.0625rem; line-height: 1.55; color: var(--muted); text-wrap: pretty; }
@media (min-width: 768px) { .hero__subtitle { font-size: 1.1875rem; } }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.1rem; }
.hero__demo { width: 100%; max-width: 25rem; justify-self: center; position: relative; }
@media (min-width: 1024px) { .hero__demo { justify-self: end; } }

/* Niente testo invisibile in attesa dell'entrata: sale e basta. */
.hero__entrance { opacity: 1; animation: hero-rise 0.7s var(--ease-out) both; }
@keyframes hero-rise { from { transform: translateY(14px); } to { transform: translateY(0); } }
.hero__entrance--1 { animation-delay: 0.02s; }
.hero__entrance--2 { animation-delay: 0.08s; }
.hero__entrance--3 { animation-delay: 0.14s; }
.hero__entrance--4 { animation-delay: 0.2s; }

/* ==========================================================================
   12b. Demo: la chat e' viva, e dietro compare il gestionale
   ========================================================================== */

/* Senza JavaScript: il ramo principale, tutto leggibile */
.chat-step { opacity: 1; transform: none; }
.demo:not(.is-live) [data-choice],
.demo:not(.is-live) [data-seq="later"],
.demo:not(.is-live) [data-seq="yes12"] { display: none; }

.demo.is-live .chat-step:not(.is-shown) { display: none; }

@media (prefers-reduced-motion: no-preference) {
    .demo.is-live .chat-step.is-shown { animation: bolla 0.34s var(--ease-out) both; }
}

@keyframes bolla { from { opacity: 0; transform: translateY(8px) scale(0.985); } to { opacity: 1; transform: none; } }

.chat-mock__body {
    height: 16.5rem;
    overflow-y: auto;
    scrollbar-width: none;
    outline: none;
    background-color: #EFEAE2;
    background-image: var(--grain);
}
.chat-mock__body::-webkit-scrollbar { display: none; }
.chat-mock__body > :first-child { margin-top: auto; }
.demo:not(.is-live) .chat-mock__body { height: auto; }
.chat-bubble { flex-shrink: 0; }

.chat-choices { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 0.4rem; flex-shrink: 0; }
.demo.is-live .chat-choices:not(.is-shown) { display: none; }

.chat-choice {
    min-height: 2.25rem;
    padding: 0.4rem 0.85rem;
    border-radius: 9999px;
    background-color: var(--ink);
    color: var(--card);
    font-size: 0.8rem;
    font-weight: 600;
    transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.chat-choice:nth-child(2) { background-color: var(--card); color: var(--ink); box-shadow: var(--edge); }
.chat-choice:hover { transform: translateY(-1px); }
.chat-choice:active { transform: scale(0.97); }

.chat-pay {
    display: block;
    margin-top: 0.5rem;
    padding: 0.4rem 0.7rem;
    border-radius: 0.6rem;
    background-color: rgba(255, 255, 255, 0.7);
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: #0B7A5C;
}
.chat-bubble.is-typing .chat-pay { display: none; }

.backstage {
    display: grid;
    grid-template-rows: 0fr;
    margin-top: 0.75rem;
    border-radius: var(--r);
    background-color: rgba(255, 255, 255, 0.76);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    backdrop-filter: blur(16px) saturate(1.3);
    box-shadow: var(--shadow-rest);
    padding: 0 1rem;
    opacity: 0;
    visibility: hidden;
    transition: grid-template-rows 0.5s var(--ease-out), opacity 0.4s var(--ease), padding 0.5s var(--ease-out), visibility 0.4s;
}
.backstage > * { min-height: 0; }
.backstage { grid-template-rows: auto auto auto; }
.backstage:not(.is-on) { max-height: 0; }
.backstage.is-on { opacity: 1; visibility: visible; padding: 0.8rem 1rem; }

.backstage__title { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }
.backstage__list { list-style: none; display: grid; margin-top: 0.3rem; }
.backstage__row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    font-size: 0.82rem;
    font-weight: 550;
    color: var(--ink);
    transition: max-height 0.4s var(--ease-out), opacity 0.4s var(--ease), transform 0.4s var(--ease-out);
    transform: translateX(-6px);
}
.backstage__row svg { width: 0.95rem; height: 0.95rem; color: #0B7A5C; flex-shrink: 0; }
.backstage__row.is-on { max-height: 2.6rem; opacity: 1; transform: none; padding: 0.14rem 0; }

.backstage__again {
    justify-self: start;
    margin-top: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}
.backstage__again:hover { color: var(--ink); }

/* ==========================================================================
   11. Cosa facciamo: tre capitoli con la scena che resta ferma mentre si legge
   ========================================================================== */

.offers { position: relative; padding-top: 4rem; }
@media (min-width: 768px) { .offers { padding-top: 7rem; } }

.offers__head { margin-bottom: 1rem; }
.offers__head .section-label { margin-bottom: 1rem; }
.offers__head .section-title { margin-bottom: 1.25rem; max-width: 22ch; font-size: clamp(2.1rem, 1.5rem + 2.8vw, 3.75rem); }

.chapter { display: grid; gap: 2rem; padding-top: 3.5rem; padding-bottom: 2rem; }

@media (min-width: 1024px) {
    .chapter { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 5.5rem; padding-top: 6rem; padding-bottom: 5rem; align-items: center; }
    .chapter--flip .chapter__text { order: 2; }
}

.chapter__title { font-size: clamp(1.75rem, 1.35rem + 1.7vw, 2.65rem); margin-bottom: 1.1rem; color: var(--ink); }
.chapter__lead { font-family: var(--font-display); font-size: clamp(1.15rem, 1.05rem + 0.45vw, 1.4rem); font-weight: 550; line-height: 1.28; letter-spacing: -0.015em; color: var(--ink-soft); text-wrap: pretty; }
.chapter__what { margin-top: 1rem; max-width: 34rem; font-size: 1rem; line-height: 1.62; color: var(--muted); text-wrap: pretty; }


.chapter__now { margin-top: 1.5rem; padding-left: 1.1rem; border-left: 2px solid var(--accent); max-width: 34rem; font-size: 0.95rem; line-height: 1.6; color: var(--ink-soft); text-wrap: pretty; }

/* --- Le scene --- */
.scene { position: relative; margin: 0; width: 100%; max-width: 31rem; margin-inline: auto; }

/* Quadrante delle 24 ore */
.scene--dial svg { width: 100%; height: auto; overflow: visible; }
.dial__ring { stroke: var(--line-strong); stroke-width: 1.2; }
.dial__open { stroke: var(--accent); stroke-width: 7; stroke-linecap: round; }
.dial__labels text { fill: var(--muted); font-family: var(--font-mono); font-size: 13px; }
.dial__msg { fill: var(--ink); stroke: var(--paper); stroke-width: 3; }
.dial__hand { transform-origin: 240px 240px; transform-box: view-box; transition: transform 1.2s var(--ease-out); }
.dial__hand circle { fill: var(--paper); stroke: var(--ink); stroke-width: 3; }

@media (prefers-reduced-motion: no-preference) {
    .js .scroll-reveal:not(.is-visible) .dial__open { stroke-dashoffset: 1.05; }
    .js .dial__open { transition: stroke-dashoffset 2s var(--pen) 0.2s; }
    .js .dial__msg { transform-box: fill-box; transform-origin: center; animation: messaggio 7s var(--ease-out) infinite both; animation-delay: calc(var(--i) * 620ms); animation-play-state: paused; }
    .js .is-visible .dial__msg { animation-play-state: running; }
}

@keyframes messaggio {
    0% { opacity: 0; scale: 0.2; }
    5% { opacity: 1; scale: 1.25; }
    9%, 74% { opacity: 1; scale: 1; }
    86%, 100% { opacity: 0.22; scale: 1; }
}

.dial__now { position: absolute; left: 0; right: 0; top: 0; aspect-ratio: 1; display: grid; place-items: center; font-family: var(--font-display); font-size: clamp(2.6rem, 2rem + 2.4vw, 4rem); font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--ink); pointer-events: none; }

.scene__legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem 1.1rem; margin-top: 1rem; font-size: 0.8rem; color: var(--muted); }
.scene__legend > span { display: inline-flex; align-items: center; gap: 0.4rem; }
.key { display: inline-block; flex-shrink: 0; }
.key--open { width: 1rem; height: 0.28rem; border-radius: 1rem; background-color: var(--accent); }
.key--msg { width: 0.55rem; height: 0.55rem; border-radius: 50%; background-color: var(--ink); }

/* Lo schema dell'automazione */
.flow-tabs {
    display: inline-flex;
    gap: 0.15rem;
    margin-bottom: 1.25rem;
    padding: 0.2rem;
    border-radius: 9999px;
    background-color: rgba(12, 34, 51, 0.07);
}
.flow-tab { min-height: 2.25rem; padding: 0.3rem 0.95rem; border-radius: 9999px; font-size: 0.84rem; font-weight: 550; color: var(--muted); transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.flow-tab:hover { color: var(--ink); }
.flow-tab.is-active { background-color: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(12, 34, 51, 0.12); }

.flow { position: relative; list-style: none; display: grid; gap: 0.7rem; padding-left: 1.75rem; }

/* Il filo su cui corre il messaggio */
.flow::before { content: ""; position: absolute; left: 0.45rem; top: 1.5rem; bottom: 1.5rem; width: 0; border-left: 1.5px dashed var(--line-strong); }

.flow::after {
    content: "";
    position: absolute;
    left: 0.45rem;
    top: 1.5rem;
    width: 0.65rem;
    height: 0.65rem;
    margin-left: -0.28rem;
    border-radius: 50%;
    background-color: var(--accent);
    box-shadow: 0 0 0 0.25rem rgba(217, 160, 54, 0.22);
}

@media (prefers-reduced-motion: no-preference) {
    .flow::after { animation: corre 6s cubic-bezier(0.45, 0, 0.3, 1) infinite; }
    .flow__node { animation: passo 0.5s var(--ease-out) both; animation-delay: calc(var(--i) * 70ms); }
}

@keyframes corre {
    0% { top: 1.5rem; opacity: 0; }
    6% { opacity: 1; }
    25% { top: 1.5rem; }
    40% { top: 33%; }
    55% { top: 33%; }
    70% { top: 62%; }
    85% { top: calc(100% - 1.9rem); opacity: 1; }
    100% { top: calc(100% - 1.9rem); opacity: 0; }
}

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

.flow__node {
    padding: 0.85rem 1.15rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.012em;
    color: var(--ink);
    border-radius: var(--r);
    background-color: var(--card);
    box-shadow: var(--shadow-rest);
}

.scene__note { margin-top: 1rem; font-size: 0.8rem; line-height: 1.45; color: var(--muted); max-width: 26rem; }


/* La matassa */
.scene--tangle svg { width: 100%; height: auto; overflow: visible; }
.tangle__old { fill: var(--ink); opacity: calc(1 - var(--p, 0) * 0.55); }
.tangle__threads path { stroke: var(--ink); stroke-width: 1.1; stroke-linecap: round; opacity: 0.72; }
.tangle__boxes rect { fill: var(--accent); opacity: calc(var(--p, 0) * 1.5 - 0.5); transform-box: fill-box; transform-origin: center; }
.scene__legend--tangle { justify-content: space-between; font-family: var(--font-mono); font-size: 0.8rem; }
.scene__legend--tangle > :first-child { color: var(--muted); }
.scene__legend--tangle > :last-child { color: var(--accent-ink); }

/* Le altre due cose */
.also { padding-top: 1.5rem; padding-bottom: 2rem; }

.also__item { display: block; padding: 1.1rem 1.5rem; border-radius: var(--r); background-color: rgba(12, 34, 51, 0.05); font-size: 1rem; font-weight: 550; color: var(--ink-soft); transition: background-color var(--dur) var(--ease); }
.also__item:hover { background-color: rgba(12, 34, 51, 0.09); }

/* --- Il tratto di rotta tra le sezioni --- */
.rotta { max-width: 72rem; margin: 1rem auto 0; padding: 0 1.5rem; color: var(--ink); }
.rotta svg { width: 100%; height: auto; overflow: visible; }
.rotta__line { stroke: var(--line-strong); stroke-width: 1.5; stroke-dasharray: 2 7; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.rotta__boat { offset-path: path('M0 58C120 30 210 74 340 56 470 38 540 18 690 44 820 66 930 70 1060 40 1110 28 1160 30 1200 34'); offset-rotate: auto; offset-distance: 22%; }
.rotta__boat path { fill: var(--ink); }

@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .rotta__boat { animation: rotta-corsa linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; }
    }
}

@keyframes rotta-corsa { from { offset-distance: 3%; } to { offset-distance: 97%; } }

/* ==========================================================================
   14. Prodotti: anteprime subito visibili, il sito scorre al passaggio del mouse
   ========================================================================== */

.proof { padding-top: 2rem; }
.proof .section-label { display: flex; margin-bottom: 1rem; }

.vetrina { list-style: none; display: grid; gap: 2rem 1.5rem; }
@media (min-width: 640px) { .vetrina { grid-template-columns: repeat(2, 1fr); gap: 2.75rem 2rem; } }

.vetrina__card { display: block; }
.vetrina__frame { display: block; overflow: hidden; aspect-ratio: 8 / 5; border-radius: var(--r); background-color: var(--card); box-shadow: var(--shadow-rest); transition: box-shadow 0.35s var(--ease), translate 0.35s var(--ease); }
.vetrina__frame img { display: block; width: 100%; height: auto; transition: transform 2.8s cubic-bezier(0.4, 0, 0.2, 1); }

@media (hover: hover) {
    .vetrina__card:hover .vetrina__frame, .vetrina__card:focus-visible .vetrina__frame { box-shadow: var(--shadow-hover); translate: 0 -3px; }
    .vetrina__card:hover img, .vetrina__card:focus-visible img { transform: translateY(calc(-100% + 62.5cqw)); }
}
.vetrina__frame { container-type: inline-size; }

.vetrina__caption { display: block; margin-top: 0.9rem; font-size: 0.975rem; color: var(--muted); }
.vetrina__caption strong { display: block; font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; letter-spacing: -0.025em; color: var(--ink); }

.rete { display: grid; gap: 1.25rem 3rem; align-items: center; margin-top: 2.75rem; padding: 2rem; border-radius: var(--r-lg); background-color: var(--ink); color: var(--card); }
@media (min-width: 768px) { .rete { grid-template-columns: auto minmax(0, 1fr); padding: 2.5rem 3rem; } }
.rete__num strong { display: block; font-family: var(--font-display); font-size: clamp(3.5rem, 2.5rem + 4vw, 5.5rem); font-weight: 700; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.rete__num span { display: block; margin-top: 0.35rem; font-size: 0.9rem; color: #B6C7D3; }
.rete__text h3 { font-size: 1.35rem; color: var(--card); }
.rete__text p { margin-top: 0.5rem; max-width: 36rem; font-size: 1rem; line-height: 1.55; color: #D5E0E4; text-wrap: pretty; }

/* ==========================================================================
   13. Settori: una riga per settore, il dettaglio si apre quando serve
   ========================================================================== */

.sectors { padding-top: 2rem; }
.sectors__inner { display: grid; gap: 1rem; }
@media (min-width: 1024px) { .sectors__inner { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); gap: 5rem; } }
.sectors .section-label { display: flex; margin-bottom: 1rem; }

.sectors__list { border-top: 1px solid var(--line); }
.sector { border-bottom: 1px solid var(--line); interpolate-size: allow-keywords; }
.sector summary { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 2rem 1.15rem 0; cursor: pointer; list-style: none; font-family: var(--font-display); font-size: 1.2rem; font-weight: 650; letter-spacing: -0.02em; color: var(--ink); }
.sector summary::-webkit-details-marker { display: none; }
.sector summary::after { content: "+"; position: absolute; right: 0.2rem; font-family: var(--font-body); font-weight: 400; font-size: 1.4rem; color: var(--accent-ink); transition: rotate 0.3s var(--ease); }
.sector[open] summary::after { rotate: 45deg; }
.sector__body { padding-bottom: 1.25rem; max-width: 36rem; font-size: 0.975rem; line-height: 1.55; color: var(--muted); }
.sector::details-content { block-size: 0; overflow: hidden; transition: block-size 0.4s var(--ease-out), content-visibility 0.4s allow-discrete; }
.sector[open]::details-content { block-size: auto; }
.faq-item { interpolate-size: allow-keywords; }
.faq-item::details-content { block-size: 0; overflow: hidden; transition: block-size 0.4s var(--ease-out), content-visibility 0.4s allow-discrete; }
.faq-item[open]::details-content { block-size: auto; }

/* ==========================================================================
   15. Chi siamo
   ========================================================================== */

.about { padding-bottom: 1.5rem; }
.about .section-label { display: flex; margin-bottom: 1rem; }
.about .section-title { margin-bottom: 1.25rem; max-width: 20ch; }
.about__text { font-size: 1.125rem; color: var(--ink-soft); }
.about__nums { display: flex; flex-wrap: wrap; gap: 1.5rem 3.5rem; margin-top: 2rem; }
.about__nums strong { display: block; font-family: var(--font-display); font-size: clamp(2.25rem, 1.8rem + 1.6vw, 3.25rem); font-weight: 700; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }
.about__nums span { display: block; margin-top: 0.4rem; font-size: 0.875rem; color: var(--muted); }
.creds { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 2.5rem; margin-top: 2rem; }
.cred { display: inline-flex; align-items: center; gap: 0.7rem; font-size: 0.9rem; font-weight: 600; color: var(--ink); }
.cred img { display: block; width: auto; }
.cred--meta img { height: 1.5rem; }
.cred--ckad img { height: 4.25rem; }

/* ==========================================================================
   17b. Contatti: il tema scelto suggerisce cosa scrivere
   ========================================================================== */

.topic { border: 0; padding: 0; min-width: 0; }
.topic legend { display: block; margin-bottom: 0.45rem; padding: 0; font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.topic__list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.topic__chip { min-height: 2.5rem; padding: 0.35rem 0.95rem; border-radius: 9999px; background-color: rgba(12, 34, 51, 0.06); font-size: 0.86rem; font-weight: 550; color: var(--ink-soft); transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.topic__chip:hover { background-color: rgba(12, 34, 51, 0.11); }
.topic__chip:active { transform: scale(0.97); }
.topic__chip[aria-pressed="true"] { background-color: var(--ink); color: var(--card); }

/* ==========================================================================
   18b. Piede: la carta si chiude
   ========================================================================== */

.footer { position: relative; isolation: isolate; overflow: hidden; background-color: var(--paper-deep); padding-top: 3rem; }
.footer__sea { position: absolute; inset: 0; z-index: -1; color: var(--ink); opacity: 0.1; }

/* ==========================================================================
   20. Scroll reveal: si sposta e basta, sempre opaco.
   Un elemento in attesa si legge come gli altri, e senza JavaScript non resta niente nascosto.
   ========================================================================== */

.scroll-reveal { transition: transform 0.7s var(--ease-out); transition-delay: var(--delay, 0ms); }
.js .scroll-reveal:not(.is-visible) { transform: translateY(18px); }
.js .scroll-reveal--sm:not(.is-visible) { transform: translateY(8px); }
.scroll-reveal.is-visible { transform: none; }
@media (max-width: 639.98px) { .scroll-reveal { transition-delay: 0ms; } }

/* ==========================================================================
   21. Meno movimento: tutto fermo e tutto al suo posto
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
    .scroll-reveal, .js .scroll-reveal:not(.is-visible) { transform: none; }
}
