/* ============================================================
   SEZIONE 1 — Firma piccola, centrata e nel flusso della pagina
   ============================================================ */
:host {
    display: block;
    width: 100%;
    box-sizing: border-box;
    color-scheme: light;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.stedif-shell,
.stedif-shell * {
    box-sizing: border-box;
}

.stedif-shell {
    display: flex;
    position: relative;
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* ============================================================
   SEZIONE 2 — Logo trasparente, senza card e senza bordo bianco
   ============================================================ */
.stedif-trigger {
    appearance: none;
    -webkit-appearance: none;
    display: block;
    position: relative;
    flex: none;
    width: min(var(--stedif-desktop, 116px), calc(100vw - 20px));
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    text-decoration: none;
    line-height: 0;
    outline: none;
    cursor: pointer;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 200ms ease, transform 200ms ease;
}

.stedif-trigger:hover {
    transform: translateY(-1px);
}

.stedif-trigger:focus-visible,
.stedif-contact:focus-visible {
    outline: 2px solid #3477bb;
    outline-offset: 5px;
}

.stedif-trigger-static {
    cursor: default;
}

.stedif-logo {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 2048 / 682;
    isolation: isolate;
    overflow: visible;
    filter: drop-shadow(0 1px 1px rgba(255,255,255,.48));
}

.stedif-word,
.stedif-arc {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    height: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.stedif-word {
    z-index: 2;
    width: 100%;
    object-fit: fill;
}

.stedif-arc {
    z-index: 1;
    width: 50.78125%;
    object-fit: fill;
    transform-origin: 51% 51%;
}

/* ============================================================
   SEZIONE 3 — Orbite indipendenti della scia blu e verde
   ============================================================ */
.stedif-trigger:hover .stedif-arc-upper,
.stedif-trigger:focus-visible .stedif-arc-upper {
    animation: stedif-orbit-clockwise 3.6s linear infinite;
}

.stedif-trigger:hover .stedif-arc-lower,
.stedif-trigger:focus-visible .stedif-arc-lower {
    animation: stedif-orbit-counterclockwise 4.2s linear infinite;
}

@keyframes stedif-orbit-clockwise {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes stedif-orbit-counterclockwise {
    from { transform: rotate(0deg); }
    to   { transform: rotate(-360deg); }
}

/* ============================================================
   SEZIONE 4 — Riflesso argentato automatico solo sulle lettere
   ============================================================ */
.stedif-shimmer {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background-image: linear-gradient(
        105deg,
        transparent 37%,
        rgba(208, 219, 232, .02) 44%,
        rgba(215, 225, 236, .34) 48%,
        rgba(255, 255, 255, .88) 50%,
        rgba(215, 225, 236, .34) 52%,
        rgba(208, 219, 232, .02) 57%,
        transparent 64%
    );
    background-size: 240% 100%;
    background-repeat: no-repeat;
    -webkit-mask: url("../img/logo-word.png") center / 100% 100% no-repeat;
    mask: url("../img/logo-word.png") center / 100% 100% no-repeat;
    animation: stedif-silver-pass 7s ease-in-out infinite;
}

@keyframes stedif-silver-pass {
    0%, 9% { background-position: 170% 0; }
    42%, 100% { background-position: -170% 0; }
}

/* ============================================================
   SEZIONE 5 — Contatti a comparsa senza spostare il layout
   ============================================================ */
.stedif-contact-panel {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0;
    padding: 0;
    transform: translateX(-50%);
    pointer-events: auto;
    animation: stedif-contact-appear 180ms ease-out both;
}

.stedif-contact-panel[hidden] {
    display: none !important;
}

.stedif-contact {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(214, 221, 230, .85);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 3px 12px rgba(12, 28, 48, .17);
    color: #11365b;
    text-decoration: none;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.stedif-contact svg {
    display: block;
    width: 21px;
    height: 21px;
}

.stedif-contact-whatsapp {
    background: #23bf61;
    border-color: #23bf61;
    color: #fff;
}

.stedif-contact:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(12, 28, 48, .22);
}

@keyframes stedif-contact-appear {
    from { opacity: 0; translate: 0 7px; }
    to   { opacity: 1; translate: 0 0; }
}

/* ============================================================
   SEZIONE 6 — Smartphone e accessibilità
   ============================================================ */
@media (max-width: 600px) {
    .stedif-trigger {
        width: min(var(--stedif-mobile, 96px), calc(100vw - 20px));
    }

    .stedif-contact {
        width: 40px;
        height: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stedif-trigger,
    .stedif-contact,
    .stedif-shimmer,
    .stedif-arc,
    .stedif-contact-panel {
        animation: none !important;
        transition: none !important;
    }
}
/* Fine SEZIONE 6. */
