/* ─────────────────────────────────────────────────
   Wrapper — occupa 100vh nel flusso del documento
───────────────────────────────────────────────── */
.hero-wrapper {
    position: relative;
    height: 100vh;
    height: var(--screen-h, 100vh);
    overflow: hidden;
}

/* ─────────────────────────────────────────────────
   APERTURA — nome su sfondo bianco, poi 4 bande nere verticali (dall'alto e dal basso)
───────────────────────────────────────────────── */
.hs-intro {
    position: absolute;
    inset: 0;
    z-index: 200;               /* sopra l'immagine del visore, che sta sotto */
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hs-intro__title {
    position: relative;
    z-index: 1;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-transform: uppercase;
    font-size: clamp(2.6rem, 12vw, 9rem);
    font-weight: 400;
    letter-spacing: .04em;
    line-height: 1.02;
    color: var(--black);
    opacity: 0;                 /* compare con l'animazione JS */
}

/* Quattro bande VERTICALI: ognuna è 1/4 della larghezza dello schermo, quindi coprono tutto
   su qualsiasi dispositivo. Dispari entrano dall'alto, pari dal basso. */
.hs-intro__band {
    position: absolute;
    top: 0;
    height: 100%;
    width: calc(25% + 1px);     /* +1px: nessuna linea chiara fra una banda e l'altra */
    background: var(--black);
    z-index: 2;
    will-change: transform;
}
.hs-intro__band:nth-of-type(1) { left: 0;   transform: translateY(-101%); }
.hs-intro__band:nth-of-type(2) { left: 25%; transform: translateY(101%);  }
.hs-intro__band:nth-of-type(3) { left: 50%; transform: translateY(-101%); }
.hs-intro__band:nth-of-type(4) { left: 75%; transform: translateY(101%);  }

/* ─────────────────────────────────────────────────
   FASE 2+3 — Schermo fullscreen
───────────────────────────────────────────────── */
.hs-screen {
    position: absolute;
    inset: 0;
    z-index: 115; /* sopra l'overlay menu, il toggle (z-index 120) buca comunque */
    /* clip-path viene impostato da JS per la transizione di espansione */
}

.hs-screen[hidden] { display: none; }

.hs-screen__img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    /* se non c'è foto: placeholder scuro */
    background-color: #1a1a1a;
}

/* overlay leggero per leggibilità del testo */
.hs-screen__img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,.18) 0%,
        rgba(0,0,0,.0)  40%,
        rgba(0,0,0,.45) 100%
    );
}

/* ─────────────────────────────────────────────────
   Wordmark / home link (appare in fase 3, in alto a sinistra)
───────────────────────────────────────────────── */
.hs-home {
    position: fixed;
    top: 0; left: 0;
    padding: 1.5rem 1.8rem;
    z-index: 120;
    font-family: var(--font);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #fff;
    text-decoration: none;
    opacity: 0;
    pointer-events: none;
    mix-blend-mode: difference;
}

.hs-home.is-visible {
    animation: fadeUp .5s cubic-bezier(.22,1,.36,1) forwards;
    pointer-events: auto;
}

/* Sopra la hero (sfondo scuro): bianco pieno senza blend */
.hs-home.is-over-hero {
    mix-blend-mode: normal;
}

/* Menu aperto: il wordmark non deve comparire dentro l'overlay */
body:has( #hsNavMenu.is-open ) .hs-home {
    opacity: 0 !important;
    pointer-events: none;
}

/* ─────────────────────────────────────────────────
   Nav (appare in fase 3)
───────────────────────────────────────────────── */
.hs-nav {
    position: fixed;
    top: 0; right: 0;
    padding: 1.4rem 1.8rem;
    z-index: 120;
    opacity: 0;
    pointer-events: none;
    mix-blend-mode: difference;
}

.hs-nav.is-visible {
    animation: fadeUp .5s cubic-bezier(.22,1,.36,1) forwards;
    pointer-events: auto;
}

/* Hero e menu aperto: forza bianco senza blend */
.hs-nav:has([aria-expanded="true"]),
.hs-nav.is-over-hero {
    mix-blend-mode: normal;
}

/* Bottone hamburger */
.hs-nav__toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 110;
    position: relative;
}

.hs-nav__bars {
    display: flex;
    flex-direction: column;
    gap: 0.2px;
}

.hs-bar {
    display: block;
    overflow: visible;
}

/* Quando il menu è aperto le SVG spariscono — la X è disegnata con pseudo-elementi */
.hs-nav__toggle[aria-expanded="true"] .hs-bar {
    opacity: 0;
    transition: opacity .15s;
}

.hs-nav__bars {
    position: relative;
}

.hs-nav__toggle[aria-expanded="true"] .hs-nav__bars::before,
.hs-nav__toggle[aria-expanded="true"] .hs-nav__bars::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 36px;
    height: 1.8px;
    background: #fff;
    border-radius: 1px;
    transition: transform .35s cubic-bezier(.22,1,.36,1);
}

.hs-nav__toggle[aria-expanded="true"] .hs-nav__bars::before {
    transform: translateY(-50%) rotate(45deg);
}

.hs-nav__toggle[aria-expanded="true"] .hs-nav__bars::after {
    transform: translateY(-50%) rotate(-45deg);
}

/* Stato aperto: 1a e 4a formano la X, 2a e 3a spariscono */
.hs-nav__toggle[aria-expanded="true"] .hs-nav__bars span:nth-child(1) {
    transform: translateY(12px) rotate(45deg);
}
.hs-nav__toggle[aria-expanded="true"] .hs-nav__bars span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hs-nav__toggle[aria-expanded="true"] .hs-nav__bars span:nth-child(3) {
    opacity: 0;
    transform: scaleX(0);
}
.hs-nav__toggle[aria-expanded="true"] .hs-nav__bars span:nth-child(4) {
    transform: translateY(-12px) rotate(-45deg);
}

/* Overlay fullscreen — sempre nel DOM, mai display:none */
.hs-nav__menu {
    position: fixed;
    inset: 0;
    background: var(--black);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding-left: clamp(2rem, 6vw, 6rem);
    z-index: 118;
    pointer-events: none;
    /* Chiuso di default */
    clip-path: inset(0 0 100% 0);
    visibility: hidden;
    transition:
        clip-path .65s cubic-bezier(.76,0,.24,1),
        visibility  0s linear .65s;
}

/* Aperto */
.hs-nav__menu.is-open {
    clip-path: inset(0 0 0% 0);
    visibility: visible;
    pointer-events: auto;
    transition:
        clip-path .65s cubic-bezier(.76,0,.24,1),
        visibility  0s linear 0s;
}

/* Voci di menu: entrano dal basso con delay sfalsato */
.hs-nav__menu.is-open .hs-nav__list li {
    animation: menuItemIn .55s cubic-bezier(.22,1,.36,1) both;
}
.hs-nav__menu.is-open .hs-nav__list li:nth-child(1) { animation-delay: .15s; }
.hs-nav__menu.is-open .hs-nav__list li:nth-child(2) { animation-delay: .22s; }
.hs-nav__menu.is-open .hs-nav__list li:nth-child(3) { animation-delay: .29s; }
.hs-nav__menu.is-open .hs-nav__list li:nth-child(4) { animation-delay: .36s; }
.hs-nav__menu.is-open .hs-nav__list li:nth-child(5) { animation-delay: .43s; }

.hs-nav__menu.is-open .hs-nav__lang {
    animation: menuItemIn .55s cubic-bezier(.22,1,.36,1) .48s both;
}

@keyframes menuItemIn {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hs-nav__list {
    list-style: none;
    text-align: left;
}

.hs-nav__list li + li { margin-top: 1rem; }

.hs-nav__list a {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 300;
    color: var(--white);
    letter-spacing: -.03em;
    transition: opacity .2s;
    display: inline-block;
}

/* Niente fade all'hover: l'affordance è la linea che vibra sopra la parola */

/* ─────────────────────────────────────────────────
   Testo hero (appare in fase 3)
───────────────────────────────────────────────── */
.hs-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding: clamp(1.5rem, 3vw, 3rem) clamp(1.5rem, 3vw, 3rem);
    z-index: 25;
    pointer-events: none;
    opacity: 0;
}

.hs-text.is-visible { opacity: 1; }   /* le righe entrano da sé con la maschera (js/reveal.js) */
.hs-text .rv { padding-top: .12em; margin-top: -.12em; }   /* line-height < 1: non tagliare le maiuscole */

.hs-text__name {
    display: flex;
    flex-direction: column;
    line-height: .86;
    font-size: clamp(5rem, 13.5vw, 16rem);
    font-weight: 400;
    letter-spacing: -.04em;
    color: var(--white);
}

/* Riga "Schermi + tagline" affiancati */
.hs-name-row {
    display: flex;
    align-items: flex-end;
    gap: clamp(.8rem, 1.5vw, 2rem);
    line-height: .86;
}

.hs-text__tagline {
    display: flex;
    flex-direction: column;
    gap: .18rem;
    font-size: clamp(1.1rem, 1.6vw, 1.7rem);
    font-weight: 400;
    letter-spacing: .01em;
    color: var(--white);
    line-height: 1.35;
    padding-bottom: .18em; /* allinea baseline con il fondo della lettera */
}

/* ─────────────────────────────────────────────────
   Keyframe condiviso
───────────────────────────────────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0);    }
}

/* ─────────────────────────────────────────────────
   Pagine interne — header standard
───────────────────────────────────────────────── */
.home .site-header { display: none; }
.home .site-main   { margin-top: 0; }

/* ─────────────────────────────────────────────────
   Mobile
───────────────────────────────────────────────── */
@media (max-width: 640px) {
    .hs-text {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-end;
        gap: 1rem;
    }

    .hs-text__name { font-size: clamp(3rem, 16vw, 5rem); }

    /* Schermi + tagline impilati: niente colonna stretta accanto al nome,
       così "Simone" e "Schermi" restano vicini con spaziatura normale */
    .hs-name-row {
        flex-direction: column;
        align-items: flex-start;
        gap: .9rem;
    }

    /* tagline sotto al nome, a piena larghezza */
    .hs-text__tagline {
        text-align: left;
        font-size: 1.05rem;
        line-height: 1.4;
        padding-bottom: 0;
    }
}

/* ─────────────────────────────────────────────────
   Mobile: wordmark e icona menu — icona 24px, entrambi centrati in altezza
   (stessa fascia alta 64px, allineamento verticale al centro)
───────────────────────────────────────────────── */
@media (max-width: 900px) {
    .hs-home,
    .hs-nav {
        height: 64px;
        display: flex;
        align-items: center;
        padding-top: 0;
        padding-bottom: 0;
    }
    .hs-home { line-height: 1; }

    /* barre dell'hamburger: 36px → 24px (le SVG hanno viewBox 36×10) */
    .hs-bar { width: 24px; height: auto; }
    .hs-nav__toggle[aria-expanded="true"] .hs-nav__bars::before,
    .hs-nav__toggle[aria-expanded="true"] .hs-nav__bars::after { width: 24px; }
}
