/* =====================================================================
   lavori.css - pagina provvisoria "Work in progress" (index.php)
   ---------------------------------------------------------------------
   File autonomo: la pagina non carica style.css ne' bootstrap.
   Palette, pillole e font presi dal template grafico doc/template.
   Sequenza animata (solo CSS):
     1. i tre tratti del simbolo si disegnano uno dopo l'altro
     2. il punto lime al centro compare, poi il simbolo ruota lento
     3. le pillole del titolo si scoprono da sinistra
     4. i due nastri da cantiere entrano e scorrono di continuo
   Con "riduci movimento" attivo resta tutto fermo e visibile.
   ===================================================================== */

:root {
    --iogo-nero:    #111111;
    --iogo-bianco:  #FFFFFF;
    --iogo-sfondo:  #E9E9E9;
    --iogo-testo-3: #444444;
    --iogo-lime:    #E2F25C;
    --iogo-lavanda: #A9B4F7;

    /* Decelerazione decisa per gli ingressi */
    --arrivo: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html,
body {
    margin: 0;
    overflow-x: hidden;
}

body {
    background: var(--iogo-sfondo);
    color: var(--iogo-nero);
    font-family: 'Inter Tight', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

::selection {
    background: var(--iogo-lime);
    color: var(--iogo-nero);
}

/* ---- Impaginazione ---------------------------------------------------- */
.lavori {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
}

.lavori-testa {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 24px clamp(16px, 4vw, 40px);
    animation: dissolvenza 600ms var(--arrivo) 1.9s both;
}

.lavori-logo {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.lavori-copy {
    font-size: 13px;
    color: var(--iogo-testo-3);
}

.lavori-centro {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(20px, 3.5vh, 32px);
    padding: 16px 16px 40px;
    text-align: center;
}

/* ---- Simbolo ✱ animato ------------------------------------------------ */
.lavori-simbolo {
    width: clamp(132px, 26vmin, 260px);
    height: auto;
    overflow: visible;
}

.simbolo-giro {
    transform-origin: 50px 50px;
    animation: giro 28s linear 1.6s infinite;
}

.simbolo-tratto {
    fill: none;
    stroke: var(--iogo-nero);
    stroke-width: 17;
    stroke-linecap: round;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: tratto 520ms var(--arrivo) both;
}

.simbolo-tratto--1 { animation-delay: 150ms; }
.simbolo-tratto--2 { animation-delay: 420ms; }
.simbolo-tratto--3 { animation-delay: 690ms; }

.simbolo-punto {
    fill: var(--iogo-lime);
    transform-origin: 50px 50px;
    animation:
        punto 600ms var(--arrivo) 1.1s both,
        battito 2.8s ease-in-out 2.4s infinite;
}

/* ---- Titolo a pillole ------------------------------------------------- */
.lavori-titolo {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 6px;
    font-size: clamp(42px, 8.5vw, 96px);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1.02;
}

.lavori-titolo > span {
    display: inline-block;
    padding: 2px 0.26em 6px;
    border-radius: 6px;
    animation: pillola 700ms var(--arrivo) both;
}

/* Il testo entra dal basso dentro la pillola che si scopre */
.lavori-titolo > span > span {
    display: inline-block;
    animation: parola 700ms var(--arrivo) both;
}

.lavori-titolo > .p-nera {
    padding-inline: 0.34em;
    border-radius: 999px;
    background: var(--iogo-nero);
    color: var(--iogo-bianco);
}

.lavori-titolo > :nth-child(1),
.lavori-titolo > :nth-child(1) > span { animation-delay: 1.15s; }
.lavori-titolo > :nth-child(2),
.lavori-titolo > :nth-child(2) > span { animation-delay: 1.3s; }
.lavori-titolo > :nth-child(3),
.lavori-titolo > :nth-child(3) > span { animation-delay: 1.45s; }

.p-lime    { background: var(--iogo-lime); }
.p-lavanda { background: var(--iogo-lavanda); }

.lavori-testo {
    margin: 0;
    max-width: 30ch;
    font-size: clamp(17px, 2vw, 20px);
    color: var(--iogo-testo-3);
    text-wrap: balance;
    animation: dissolvenza 600ms var(--arrivo) 1.8s both;
}

/* ---- Nastri da cantiere ----------------------------------------------- */
.lavori-nastri {
    position: relative;
    height: clamp(150px, 22vh, 210px);
}

.nastro {
    position: absolute;
    left: -10vw;
    right: -10vw;
    top: 50%;
    padding: 10px 0;
    overflow: hidden;
    font-family: 'Barlow Condensed', 'Inter Tight', sans-serif;
    font-style: italic;
    font-weight: 800;
    font-size: clamp(22px, 3.4vw, 34px);
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    white-space: nowrap;
    box-shadow: 0 10px 24px -12px rgba(17, 17, 17, 0.45);
}

.nastro--lime {
    background: var(--iogo-lime);
    color: var(--iogo-nero);
    transform: translateY(-50%) rotate(-4deg);
    animation: nastro-sx 900ms var(--arrivo) 1.7s both;
}

.nastro--nero {
    background: var(--iogo-nero);
    color: var(--iogo-lime);
    transform: translateY(-50%) rotate(3deg);
    animation: nastro-dx 900ms var(--arrivo) 1.85s both;
}

.nastro-scorre {
    display: flex;
    width: max-content;
    animation: scorri 38s linear infinite;
}

.nastro--nero .nastro-scorre {
    animation-direction: reverse;
}

.nastro-voce {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding-right: 0.5em;
}

.nastro-simbolo {
    width: 0.8em;
    height: 0.8em;
    flex: none;
}

/* ---- Keyframes -------------------------------------------------------- */
@keyframes tratto {
    from { stroke-dashoffset: 1; }
    to   { stroke-dashoffset: 0; }
}

@keyframes punto {
    from { transform: scale(0); }
    60%  { transform: scale(1.35); }
    to   { transform: scale(1); }
}

@keyframes battito {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.18); }
}

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

@keyframes pillola {
    from { clip-path: inset(0 100% 0 0 round 999px); }
    to   { clip-path: inset(0 0 0 0 round 0); }
}

@keyframes parola {
    from { transform: translateY(0.6em); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

@keyframes dissolvenza {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes nastro-sx {
    from { transform: translateY(-50%) translateX(-110%) rotate(-4deg); }
    to   { transform: translateY(-50%) rotate(-4deg); }
}

@keyframes nastro-dx {
    from { transform: translateY(-50%) translateX(110%) rotate(3deg); }
    to   { transform: translateY(-50%) rotate(3deg); }
}

@keyframes scorri {
    to { transform: translateX(-50%); }
}

/* ---- Schermi stretti ---------------------------------------------------- */
@media (max-width: 600px) {
    .lavori-testa {
        padding-block: 18px;
    }

    .lavori-copy {
        font-size: 12px;
    }

    .lavori-titolo > span {
        border-radius: 4px;
    }

    /* Su schermo stretto l'inclinazione da sola non separa i nastri:
       li distanzio in verticale perche' si vedano entrambi */
    .nastro--lime { top: 34%; }
    .nastro--nero { top: 66%; }
}

/* ---- Riduci movimento: tutto fermo e visibile, solo dissolvenze -------- */
@media (prefers-reduced-motion: reduce) {
    .simbolo-giro,
    .simbolo-tratto,
    .simbolo-punto,
    .lavori-titolo > span,
    .lavori-titolo > span > span,
    .nastro-scorre {
        animation: none;
    }

    .nastro--lime,
    .nastro--nero,
    .lavori-titolo,
    .lavori-centro .lavori-simbolo {
        animation: dissolvenza 400ms ease-out both;
    }

    .lavori-testa,
    .lavori-testo {
        animation-delay: 0s;
    }
}
