/* Pagina «Stiamo arrivando» (sito in attesa): autonoma, usa solo tokens.css.
   Motivo conduttore: la mezzeria del Viale che scorre tra il testo e la scena. */
html {
    background: var(--primitive-navy-900);
    color-scheme: dark;
    scrollbar-color: var(--primitive-navy-600) var(--primitive-navy-950);
}
.attesa-body {
    margin: 0;
    min-height: 100vh;
    background: var(--primitive-navy-900);
    color: var(--primitive-white);
    font-family: var(--font-family-body);
    --passo: 54px;            /* un tratto di mezzeria più il vuoto */
    --fascia: 12px;           /* la striscia d'asfalto che porta la mezzeria */
}
::selection { background: var(--primitive-orange-500); color: var(--primitive-white); }

.attesa-anteprima {
    padding: 10px 20px;
    background: var(--primitive-gold-100);
    color: var(--primitive-gold-600);
    font-weight: 700;
    font-size: 0.9rem;
    text-align: center;
}
.attesa-anteprima a { color: inherit; margin-left: 8px; }

.attesa {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    min-height: 100vh;
}

.attesa-testo {
    display: flex;
    flex-direction: column;
    gap: 36px;
    padding: clamp(28px, 4vw, 48px) clamp(24px, 5vw, 72px) clamp(24px, 3vw, 36px);
}

.attesa-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--primitive-white);
    text-decoration: none;
    align-self: flex-start;
    animation: attesa-appare 600ms var(--ease-out) both;
}
.attesa-brand img { width: 52px; height: 52px; border-radius: 50%; }
.attesa-brand b {
    display: block;
    font-family: var(--font-family-display);
    font-size: 1.35rem;
    letter-spacing: 0.02em;
    line-height: 1.1;
    text-transform: uppercase;
}
.attesa-brand small { display: block; color: rgba(255, 255, 255, 0.72); font-size: 0.88rem; }

.attesa-centro { margin: auto 0; max-width: 35rem; }

/* La targa della via: arriva dondolando, come appesa al palo */
.attesa-targa {
    position: relative;
    z-index: 3;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    margin: 0 0 20px;
    padding: 9px 30px 8px;
    background:
        radial-gradient(circle at 12px 50%, #8E8672 0 2.5px, transparent 3px),
        radial-gradient(circle at calc(100% - 12px) 50%, #8E8672 0 2.5px, transparent 3px),
        linear-gradient(180deg, #FFFDF7, #F1EBDB);
    border-radius: 5px;
    box-shadow:
        inset 0 0 0 3px #FFFDF7,
        inset 0 0 0 4.5px var(--primitive-navy-800),
        0 10px 22px -8px rgba(1, 27, 36, 0.7);
    color: var(--primitive-navy-800);
    font-family: var(--font-family-display);
    text-transform: uppercase;
    line-height: 1;
    transform: rotate(-1.6deg);
    transform-origin: 50% -40%;
    animation: attesa-targa 1100ms cubic-bezier(0.3, 0.7, 0.3, 1) 120ms both;
}
.attesa-targa span { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.3em; margin-right: -0.3em; }
.attesa-targa b { font-size: 1.28rem; font-weight: 800; letter-spacing: 0.07em; }

/* Il titolo sale riga per riga da dietro un bordo, come un manifesto srotolato */
.attesa-titolo {
    margin: 0;
    font-family: var(--font-family-display);
    font-weight: 800;
    font-size: clamp(3.6rem, 7vw, 6rem);
    line-height: 0.9;
    letter-spacing: -0.005em;
    text-transform: uppercase;
    color: var(--primitive-white);
}
.attesa-riga { display: block; overflow: hidden; padding-top: 0.06em; }
.attesa-riga > span {
    display: block;
    animation: attesa-sale 800ms var(--ease-spring) 280ms both;
}
.attesa-riga--oro { color: var(--primitive-gold-500); }
.attesa-riga--oro > span { animation-delay: 370ms; }

.attesa-messaggio {
    margin: 22px 0 0;
    font-size: 1.2rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    text-wrap: pretty;
}

/* Tutto ciò che segue il titolo entra in fila, a breve distanza */
.attesa-entra {
    animation: attesa-entra 700ms var(--ease-spring) both;
    animation-delay: calc(560ms + var(--i, 0) * 85ms);
}

/* Quando apriamo, e come ricordarselo */
.attesa-apertura { margin-top: 26px; }
.attesa-quando {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin: 0 0 16px;
    font-family: var(--font-family-display);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.05;
    text-transform: uppercase;
}
.attesa-quando b { font-weight: 800; }
.attesa-mancano {
    padding: 5px 11px 4px;
    border-radius: var(--radius-xs, 3px);
    background: var(--primitive-gold-500);
    color: var(--primitive-navy-950);
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    font-variant-numeric: tabular-nums;
    box-shadow: 3px 3px 0 var(--primitive-navy-950);
    animation: attesa-timbro 260ms var(--ease-out) 900ms both;
}

.attesa-azioni { display: flex; flex-wrap: wrap; gap: 10px; }
.attesa-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    padding: 6px 16px;
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    border-radius: var(--radius-sm, 4px);
    background: transparent;
    color: var(--primitive-white);
    font-family: var(--font-family-display);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color var(--duration-fast) var(--ease-out),
                border-color var(--duration-fast) var(--ease-out),
                color var(--duration-fast) var(--ease-out),
                transform var(--duration-instant) var(--ease-out);
}
.attesa-btn[hidden] { display: none; }
.attesa-btn svg { flex: none; color: var(--primitive-gold-500); transition: color var(--duration-fast) var(--ease-out); }
.attesa-btn:active { transform: scale(0.97); }
.attesa-esito {
    margin: 10px 0 0;
    min-height: 1.4em;
    font-size: 0.95rem;
    color: var(--primitive-gold-100);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.attesa-esito.is-visibile { opacity: 1; transform: none; }

.attesa .listino { margin-top: 30px; }
.attesa .listino-titolo { font-size: 1.5rem; }

.attesa-contatto { margin: 28px 0 0; color: rgba(255, 255, 255, 0.82); line-height: 1.5; }
.attesa-contatto a {
    color: var(--primitive-white);
    font-weight: 700;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.attesa-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.66);
    animation: attesa-appare 600ms var(--ease-out) 900ms both;
}
.attesa-footer a { color: rgba(255, 255, 255, 0.8); text-underline-offset: 3px; }

/* ---------- La scena: il Viale, con la mezzeria che scorre sul bordo ---------- */
.attesa-scena {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--primitive-navy-950);
}
.attesa-scena img {
    position: absolute;
    inset: 0 0 0 var(--fascia);
    width: calc(100% - var(--fascia));
    height: 100%;
    object-fit: cover;
    object-position: 62% 50%;
    transform-origin: 38% 62%;
    animation:
        attesa-scopre 1200ms var(--ease-spring) 80ms both,
        attesa-avanza 32s ease-in-out 80ms infinite alternate;
}
/* la striscia d'asfalto … */
.attesa-scena::before {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0 auto 0 0;
    width: var(--fascia);
    background: var(--primitive-navy-950);
}
/* … e i tratti bianchi che le corrono sopra, verso chi guarda */
.attesa-scena::after {
    content: "";
    position: absolute;
    z-index: 2;
    top: calc(var(--passo) * -1);
    left: calc(var(--fascia) / 2 - 1px);
    width: 2px;
    height: calc(100% + var(--passo));
    background: repeating-linear-gradient(180deg, var(--primitive-white) 0 30px, transparent 30px var(--passo));
    animation: attesa-scorre-giu 2600ms linear infinite;
}

@media (hover: hover) and (pointer: fine) {
    .attesa-btn:hover { background: var(--primitive-white); border-color: var(--primitive-white); color: var(--primitive-navy-900); }
    .attesa-btn:hover svg { color: var(--primitive-orange-600); }
    .attesa-contatto a:hover, .attesa-footer a:hover { color: var(--primitive-gold-500); }
    .attesa-brand:hover b { color: var(--primitive-gold-500); }
}
.attesa a:not(.listino-btn):focus-visible,
.attesa-btn:focus-visible { outline: 3px solid var(--primitive-gold-500); outline-offset: 3px; }

/* ---------- Telefono e tablet: marchio, scena, poi il testo ---------- */
@media (max-width: 900px) {
    .attesa { grid-template-columns: minmax(0, 1fr); min-height: 0; }
    .attesa-testo { display: contents; }
    .attesa-brand { order: 1; padding: 14px 20px; gap: 12px; }
    .attesa-brand img { width: 44px; height: 44px; }
    .attesa-brand b { font-size: 1.2rem; }
    .attesa-brand small { font-size: 0.8rem; }

    .attesa-scena { position: relative; order: 2; height: 36vh; min-height: 220px; max-height: 420px; }
    .attesa-scena img {
        inset: 0 0 var(--fascia) 0;
        width: 100%;
        height: calc(100% - var(--fascia));
        object-position: 60% 50%;
    }
    .attesa-scena::before { inset: auto 0 0 0; width: auto; height: var(--fascia); }
    .attesa-scena::after {
        top: auto;
        bottom: calc(var(--fascia) / 2 - 1px);
        left: 0;
        width: calc(100% + var(--passo));
        height: 2px;
        background: repeating-linear-gradient(90deg, var(--primitive-white) 0 30px, transparent 30px var(--passo));
        animation-name: attesa-scorre-lato;
    }

    .attesa-centro { order: 3; margin: 0; max-width: 38rem; padding: 0 20px 8px; }
    /* la targa è appesa a cavallo della mezzeria, sopra la scena */
    .attesa-targa { margin-top: -30px; margin-bottom: 18px; }
    .attesa-titolo { font-size: clamp(3.6rem, 17vw, 5.4rem); }
    .attesa-messaggio { font-size: 1.12rem; margin-top: 18px; }
    .attesa-quando { font-size: 1.5rem; }
    .attesa-btn { flex: 1 1 auto; justify-content: center; }
    .attesa-footer { order: 4; padding: 28px 20px 28px; }
}

/* ---------- Movimento ---------- */
@keyframes attesa-appare { from { opacity: 0; } }
@keyframes attesa-sale { from { transform: translateY(105%); } }
@keyframes attesa-entra { from { opacity: 0; transform: translateY(16px); } }
@keyframes attesa-targa {
    0%   { opacity: 0; transform: rotate(-11deg); }
    18%  { opacity: 1; }
    38%  { transform: rotate(4.5deg); }
    60%  { transform: rotate(-3.6deg); }
    80%  { transform: rotate(-0.6deg); }
    100% { transform: rotate(-1.6deg); }
}
@keyframes attesa-timbro { from { opacity: 0; transform: scale(1.12) rotate(-3deg); } }
@keyframes attesa-scopre { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
@keyframes attesa-avanza { from { scale: 1.02; } to { scale: 1.1; } }
@keyframes attesa-scorre-giu { to { transform: translateY(var(--passo)); } }
@keyframes attesa-scorre-lato { to { transform: translateX(calc(var(--passo) * -1)); } }

/* Chi preferisce meno movimento: niente corse né dondolii, solo una comparsa breve */
@media (prefers-reduced-motion: reduce) {
    .attesa-brand, .attesa-targa, .attesa-riga > span, .attesa-entra, .attesa-footer {
        animation: attesa-appare 300ms ease-out both;
    }
    .attesa-scena img { animation: attesa-appare 400ms ease-out both; }
    .attesa-mancano { animation: attesa-appare 200ms ease-out 700ms both; }
    .attesa-scena::after { animation: none; }
    .attesa-btn { transition: none; }
    .attesa-esito { transform: none; transition: opacity 200ms ease-out; }
}
