/* N27 — loaded via fonts.css (@font-face locale) */

/* ─── Design Tokens ─────────────────────────────────────────── */
:root {
    color-scheme: dark;

    /* Canali RGB — per rgba(var(--*-rgb), alpha) */
    --text-rgb:  238, 237, 232;
    --red-rgb:   152, 17, 24;
    --gold-rgb:  255, 178, 14;

    /* Surfaces */
    --c-bg:  #111516;
    --c-s1:  #1a2022;
    --c-s2:  #1f2729;
    --c-s3:  #293133;

    /* Accents */
    --c-red:  #981118;
    --c-gold: #FFB20E;
    --c-text: #EEEDE8;

    /* Semantic text — HIG/WCAG AA compliant (su --c-s1 ~14.1:1 base) */
    --c-text-primary:   rgba(238, 237, 232, 1);    /* 14.1:1 — heading */
    --c-text-secondary: rgba(238, 237, 232, 0.65); /* ~8.0:1  — corpo principale */
    --c-text-tertiary:  rgba(238, 237, 232, 0.55); /* ~6.0:1  — descrizioni card */
    --c-text-muted:     rgba(238, 237, 232, 0.45); /* ~3.9:1  — label uppercase bold (large text) */
    --c-text-ghost:     rgba(238, 237, 232, 0.28); /* ~2.2:1  — puramente decorativo */

    /* UI */
    --c-scroll-thumb: #2a3234;

    /* Motion — calibrati HIG (micro-interazioni veloci, transizioni fluide) */
    --ease:      cubic-bezier(0.22, 1, 0.36, 1);   /* spring deceleration */
    --ease-out:  cubic-bezier(0.0, 0.0, 0.2, 1);   /* entrate elementi */
    --dur-fast:  0.18s;  /* hover colore/bordo */
    --dur-mid:   0.42s;  /* reveal bento-card */
    --dur-slow:  0.55s;  /* reveal hero */
    --stagger:   0.055s; /* moltiplicatore delay progressivo */

    /* Layout */
    --gap:    1rem;
    --radius: 1rem;
    --nav-h:  4.5rem; /* 72px — altezza bottom nav / mobile header */

    /* Typography — N27 (font acquistato, file locali via fonts.css) */
    --font-display: 'N27', sans-serif;
    --font-body:    'N27', sans-serif;
}

/* ─── Base ──────────────────────────────────────────────────── */

html { scroll-behavior: smooth; }

* { caret-color: transparent; }
input, textarea { caret-color: auto; }

body {
    margin: 0;
    font-family: var(--font-body);
    background-color: var(--c-bg);
    color: var(--c-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ─── Tipografia — N27 unico font ──────────────────────────────
   N27: titolazioni, badge, nav, corpo, label — tutto il sito
   ─────────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6,
nav a,
.hero-accent,
.hero-accent .typewriter-role,
.block-badge,
.block-cta-btn,
.filter-btn,
.logo-strip-item,
.block-list-label,
.section-nav-label {
    font-family: var(--font-display);
}

/* ─── Skip Link ─────────────────────────────────────────────── */
/* WCAG 2.4.1 — Bypass Blocks. Obbligatorio. */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 9999;
    padding: 0.5rem 1.25rem;
    background: var(--c-gold);
    color: #111516;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-decoration: none;
    border-radius: 0 0 var(--radius) var(--radius);
    transition: top 0.15s ease;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid var(--c-s1);
    outline-offset: -2px;
}

/* ─── Focus Visible ─────────────────────────────────────────── */
/* WCAG 2.4.7 — Focus Visible. HIG: ogni elemento interattivo deve
   avere un indicatore di focus chiaro e consistente. */
:focus-visible {
    outline: 2px solid var(--c-gold);
    outline-offset: 3px;
    border-radius: 4px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* ─── Active Nav State ──────────────────────────────────────── */
.mobile-nav-panel > a[aria-current="page"] {
    opacity: 1 !important;
    font-weight: 900;
}

.nav-center-back a[aria-current="page"] {
    color: var(--c-gold) !important;
    background: #111516;
    border-radius: 9999px;
    padding: 0.4rem 1.25rem;
    font-size: 0.825rem;
}

.nav-center-back a[aria-current="page"]:hover {
    color: var(--c-gold) !important;
}


/* ─── Bento Cards ───────────────────────────────────────────── */

.bento-card {
    opacity: 0;
    transform: translateY(14px);
    transition:
        opacity    var(--dur-mid)  var(--ease),
        transform  var(--dur-mid)  var(--ease),
        box-shadow var(--dur-fast) ease;
}

.bento-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.bento-card.is-visible:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 52px -18px rgba(0, 0, 0, 0.65);
}

/* Stagger — delay moltiplicato per N */
.delay-1 { transition-delay: calc(var(--stagger) * 1); }
.delay-2 { transition-delay: calc(var(--stagger) * 2); }
.delay-3 { transition-delay: calc(var(--stagger) * 3); }
.delay-4 { transition-delay: calc(var(--stagger) * 4); }
.delay-5 { transition-delay: calc(var(--stagger) * 5); }

/* ─── Hero ──────────────────────────────────────────────────── */

.hero-heading {
    opacity: 0;
    transform: translateY(12px);
    transition:
        opacity   var(--dur-slow) var(--ease) 0.12s,
        transform var(--dur-slow) var(--ease) 0.12s;
}

.hero-heading.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-accent {
    animation: pulseAccent 3s ease-in-out infinite 0.6s;
}

@keyframes pulseAccent {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.55; }
}

/* ─── Image Placeholder ─────────────────────────────────────── */

.img-placeholder {
    overflow: hidden;
    position: relative;
    background: linear-gradient(148deg, var(--c-s1) 0%, var(--c-s2) 100%);
}

.img-placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(var(--text-rgb), 0.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--text-rgb), 0.028) 1px, transparent 1px);
    background-size: 28px 28px;
}

.img-placeholder::after {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -5%;
    width: 55%;
    height: 55%;
    background: radial-gradient(ellipse, rgba(var(--red-rgb), 0.07) 0%, transparent 70%);
}

/* ─── Block Components ──────────────────────────────────────── */

/* block-cta — strip orizzontale con testo + pill button */
.block-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.block-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.375rem;
    min-height: 44px; /* HIG touch target */
    border-radius: 9999px;
    border: 1px solid rgba(var(--text-rgb), 0.15);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--c-text);
    text-decoration: none;
    white-space: nowrap;
    transition: border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}

.block-cta-btn:hover {
    border-color: var(--c-gold);
    color: var(--c-gold);
}

/* block-stat — display tipografico puro (anno, numero chiave) */
.block-stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* block-badge — label categoria su card immagine */
.block-badge {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.875rem;
    border-radius: 9999px;
    background: var(--c-red);
    font-size: 0.5625rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-text);
}

/* block-list — lista link con freccia */
.block-list {
    display: flex;
    flex-direction: column;
}

.block-list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 0;
    min-height: 44px; /* HIG touch target */
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-decoration: none;
    transition: border-color var(--dur-fast) ease;
}

.block-list-item:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.block-list-item:hover { border-color: rgba(255, 255, 255, 0.14); }
.block-list-item:hover .block-list-arrow { color: var(--c-gold); }
.block-list-item:hover .block-list-label { color: var(--c-text); }

.block-list-arrow {
    font-size: 0.875rem;
    color: rgba(var(--text-rgb), 0.3);
    flex-shrink: 0;
    transition: color var(--dur-fast) ease;
}

.block-list-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: rgba(var(--text-rgb), 0.55);
    transition: color var(--dur-fast) ease;
}

/* ─── Global ─────────────────────────────────────────────────── */

::selection { background: rgba(var(--gold-rgb), 0.18); }

::-webkit-scrollbar       { width: 5px; }
::-webkit-scrollbar-track { background: var(--c-bg); }
::-webkit-scrollbar-thumb { background: var(--c-scroll-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-red); }

@media (prefers-reduced-motion: reduce) {
    /* Reveal cards e hero: opacity immediata, no translateY */
    .bento-card, .hero-heading {
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    .hero-accent { animation: none !important; }
}

/* ─── Block Featured ────────────────────────────────────────────
   Card progetto in evidenza. Applicare sull'articolo testo della
   riga featured — non sull'immagine.
   ─────────────────────────────────────────────────────────────── */
.block-featured {
    position: relative;
    overflow: hidden;
}

.block-featured-num {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    font-size: 7rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.04em;
    color: rgba(var(--text-rgb), 0.04);
    user-select: none;
    pointer-events: none;
}

/* ─── Filter Bar ────────────────────────────────────────────────
   Barra filtro per tipo di progetto in portfolio.html.
   ─────────────────────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 1rem;
    min-height: 44px; /* HIG touch target */
    border-radius: 9999px;
    border: 1px solid rgba(var(--text-rgb), 0.08);
    background: transparent;
    font-family: var(--font-display);
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(var(--text-rgb), 0.35);
    cursor: pointer;
    transition:
        border-color var(--dur-fast) ease,
        color        var(--dur-fast) ease,
        background   var(--dur-fast) ease;
}

.filter-btn:hover {
    border-color: rgba(var(--text-rgb), 0.18);
    color: rgba(var(--text-rgb), 0.7);
}

.filter-btn.is-active {
    border-color: var(--c-red);
    background: rgba(var(--red-rgb), 0.10);
    color: var(--c-text);
}

.filter-item.is-hidden { display: none; }

/* ─── Device Frame ──────────────────────────────────────────────
   Cornice browser attorno a img-placeholder o immagine reale.
   Avvolgere il blocco in un wrapper con bento-card + rounded-2xl.
   ─────────────────────────────────────────────────────────────── */
.device-frame {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--c-s1);
}

.device-frame-bar {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: var(--c-s2);
    border-bottom: 1px solid rgba(var(--text-rgb), 0.05);
    flex-shrink: 0;
}

.device-frame-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(var(--text-rgb), 0.10);
    flex-shrink: 0;
}

.device-frame-url {
    flex: 1;
    height: 16px;
    border-radius: 4px;
    background: rgba(var(--text-rgb), 0.05);
    margin-left: 0.375rem;
    padding: 0 0.5rem;
    font-size: 0.5rem;
    font-family: ui-monospace, 'Courier New', monospace;
    color: rgba(var(--text-rgb), 0.18);
    display: flex;
    align-items: center;
    letter-spacing: 0.03em;
    overflow: hidden;
    white-space: nowrap;
}

/* ─── Block Timeline ────────────────────────────────────────────
   Timeline di processo per i case study. Non usare in homepage.
   Wrapper: <div class="block-timeline" style="--steps:4">
   ─────────────────────────────────────────────────────────────── */
.block-timeline {
    display: flex;
    flex-direction: column;
}

@media (min-width: 1280px) {
    .block-timeline { flex-direction: row; }
}

.timeline-step {
    position: relative;
    padding: 1.5rem 1.5rem 1.5rem 2.25rem;
    flex: 1;
    border-left: 1px solid rgba(var(--text-rgb), 0.08);
}

.timeline-step:first-child {
    border-left: none;
    padding-left: 0;
}

@media (min-width: 1280px) {
    .timeline-step {
        padding: 2rem 1.5rem 1.5rem 0;
        border-left: none;
        border-top: 1px solid rgba(var(--text-rgb), 0.08);
    }
    .timeline-step:first-child { border-top: 1px solid rgba(var(--text-rgb), 0.08); }
}

/* dot indicatore */
.timeline-step::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--c-s3);
    border: 1px solid rgba(var(--text-rgb), 0.14);
    top: 1.625rem;
    left: -4px;
}

@media (min-width: 1280px) {
    .timeline-step::before {
        top: -5px;
        left: 0;
    }
}

.timeline-step.is-active::before {
    background: var(--c-red);
    border-color: rgba(var(--red-rgb), 0.4);
    box-shadow: 0 0 0 4px rgba(var(--red-rgb), 0.10);
}

/* ─── Logo Strip ────────────────────────────────────────────────
   Striscia clienti testuale. Preferire testo a immagini SVG per
   ora — più robusta e coerente col sistema tipografico.
   ─────────────────────────────────────────────────────────────── */
.logo-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.logo-strip-item {
    padding: 0.5rem 1.5rem;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(var(--text-rgb), 0.22);
    border-right: 1px solid rgba(var(--text-rgb), 0.06);
    white-space: nowrap;
    transition: color var(--dur-fast) ease;
}

.logo-strip-item:first-child { padding-left: 0; }
.logo-strip-item:last-child  { border-right: none; }
.logo-strip-item:hover       { color: rgba(var(--text-rgb), 0.5); }

/* ─── Fase 3: Hero Word Stagger ────────────────────────────────
   JS inietta .hero-word su ogni parola, aggiunge .is-split al
   parent. Il parent diventa trasparente, le parole animano con
   delay progressivo assegnato via inline style.
   ─────────────────────────────────────────────────────────────── */
.hero-heading.is-split {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

.hero-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(14px);
    transition:
        opacity   var(--dur-slow) var(--ease),
        transform var(--dur-slow) var(--ease);
}

.hero-heading.is-visible .hero-word {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Fase 3: Tagline Typewriter ────────────────────────────────
   .typewriter-role avvolge il testo del badge. JS cicla i ruoli,
   CSS gestisce il micro-fade in/out.
   ─────────────────────────────────────────────────────────────── */
.typewriter-role {
    display: inline-block;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.typewriter-role.is-leaving {
    opacity: 0;
    transform: translateY(-4px);
}

.typewriter-role.is-entering {
    opacity: 0;
    transform: translateY(4px);
}

/* ─── Mobile Header ─────────────────────────────────────────────
   Visibile solo sotto md (768px). Gold bg + hamburger toggle.
   ─────────────────────────────────────────────────────────────── */
.mobile-header {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 60;
    height: var(--nav-h);
    background: var(--c-gold);
    border-bottom: 1px solid rgba(17, 21, 22, 0.10);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}

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

/* ── Main padding mobile ─────────────────────────────────────────── */
@media (max-width: 767px) {
    main#main-content {
        padding-top:    7rem;   /* 112px — clearance header fisso 72px + respiro */
        padding-bottom: 2.5rem; /* 40px — ridotto da 80px, no nav fissa sotto */
    }
}

.mobile-header-logo {
    font-size: 1.875rem;
    font-weight: 700;
    font-family: var(--font-display);
    color: #111516;
    letter-spacing: -0.05em;
    text-decoration: none;
    line-height: 1;
    display: flex;
    align-items: center;
}

.hamburger-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 2.75rem;
    height: 2.75rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    -webkit-tap-highlight-color: transparent;
}

.hamburger-btn span {
    display: block;
    width: 20px;
    height: 1.5px;
    background: #111516;
    border-radius: 2px;
    transition: transform var(--dur-fast) ease, opacity var(--dur-fast) ease;
    transform-origin: center;
}

.hamburger-btn[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}
.hamburger-btn[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger-btn[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

.mobile-nav-panel {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--nav-h);
    height: calc(100vh - var(--nav-h));
    overflow-y: auto;
    background: var(--c-gold);
    padding: 0.5rem 0 4rem;        /* no side padding — i link gestiscono il proprio */
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-0.5rem);
    transition: opacity var(--dur-mid) var(--ease), transform var(--dur-mid) var(--ease);
    z-index: 59;
}

.mobile-nav-panel.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.mobile-nav-panel > a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    font-size: 2.1rem;
    font-weight: 800;
    font-family: var(--font-display);
    color: rgba(17, 21, 22, 0.38);
    text-decoration: none;
    padding: 0.8rem 1.05rem;
    border-bottom: 1px solid rgba(17, 21, 22, 0.12);
    text-transform: uppercase;
    letter-spacing: -0.03em;
    line-height: 1;
    transform: translateX(-1.5rem);
    transition:
        transform var(--dur-mid) var(--ease),
        color     var(--dur-fast) ease;
}

/* Freccia destra via CSS mask — segue il currentColor del link */
.mobile-nav-panel > a::before {
    content: '';
    display: block;
    flex-shrink: 0;
    width: 1.4rem;
    height: 1.4rem;
    background-color: currentColor;
    -webkit-mask: url('assets/vectors/icons/Arrow_Right.svg') no-repeat center / contain;
    mask: url('assets/vectors/icons/Arrow_Right.svg') no-repeat center / contain;
    transition: transform var(--dur-fast) ease;
}

.mobile-nav-panel > a:last-of-type          { border-bottom: none; }

.mobile-nav-panel > a:hover                 { color: rgba(17, 21, 22, 0.65); }
.mobile-nav-panel > a:hover::before         { transform: translateX(0.375rem); }

/* Pagina attiva — colori invertiti: bg scuro, testo gold */
.mobile-nav-panel > a[aria-current="page"] {
    color: var(--c-gold);
    background-color: #111516;
}

/* Lang + ruolo in fondo al panel */
.mobile-panel-footer {
    margin-top: auto;
    padding: 1.5rem 1.5rem 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

/* Full-width lang switch nel panel mobile */
.mobile-nav-panel .nav-lang-switch {
    display: flex;
    width: 100%;
}
.mobile-nav-panel .lang-current,
.mobile-nav-panel .lang-target {
    flex: 1;
    justify-content: center;
}

/* Testo professione — centrato */
.mobile-panel-role {
    font-size: 0.6875rem;
    font-weight: 600;
    font-family: var(--font-display);
    color: rgba(17, 21, 22, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
    pointer-events: none;
}

/* ── Accordion slide-in con stagger all'apertura ───────────────── */
.mobile-nav-panel.is-open > a               { transform: translateX(0); }
/* transition-delay: N per transform, 0s per color (no ritardo sull'hover) */
.mobile-nav-panel.is-open > a:nth-child(1)  { transition-delay: 0.05s, 0s; }
.mobile-nav-panel.is-open > a:nth-child(2)  { transition-delay: 0.12s, 0s; }
.mobile-nav-panel.is-open > a:nth-child(3)  { transition-delay: 0.19s, 0s; }
.mobile-nav-panel.is-open > a:nth-child(4)  { transition-delay: 0.26s, 0s; }
.mobile-nav-panel.is-open > a:nth-child(5)  { transition-delay: 0.33s, 0s; }

/* ─── Mobile — Material Design 3 type & spacing calibration ────────
   Breakpoint ≤ 767px.
   MD3 type scale (mobile):
     Display S  = 36sp  → hero heading (.hero-heading)
     Headline L = 32sp  → footer CTA heading (.footer-gold h2)
     Headline S = 24sp  → section headings text-2xl → invariati (già corretti)
     Body L     = 16sp  → corpo card text-base → invariato ✓
     Body M     = 14sp  → testo secondario text-sm → invariato ✓
     Label S    = 11sp  → label uppercase text-[10px] → invariato (accettabile)
   Spacing (8dp grid):
     Card padding    : 20dp (da 40dp p-10)
     Article padding : 24dp (da 40dp p-10)
     Page bottom     : 40dp (da 80dp pb-20) — già aggiunto sopra
   ─────────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {

    /* ── Card padding — MD3 standard card: 20dp ─────────────────── */
    /* !important necessario per vincere su Tailwind utility p-10/p-12 */
    .bento-card {
        padding: 1.25rem !important; /* 20px — da 2.5rem (40px) */
    }

    /* Hero article: leggermente più respiro (24dp) */
    article.bento-card {
        padding: 1.5rem !important;  /* 24px — da 2.5rem (40px) */
    }

    /* ── Hero heading — MD3 Display Small: 36sp ─────────────────── */
    .hero-heading {
        font-size: 2.25rem !important;  /* 36px — da text-5xl 48px */
        line-height: 0.92 !important;   /* leggermente meno compresso rispetto 0.88 desktop */
    }

    /* ── Section heading h2/h3 in card — text-2xl = 24px = MD3 Headline S ✓ */
    /* invariato — già nel range corretto */

    /* ── Stat display number — text-4xl = 36px = MD3 Display S ✓ */
    /* invariato — già nel range corretto */

    /* ── Footer CTA heading — MD3 Headline Large: 32sp ─────────── */
    .footer-gold h2 {
        font-size: 2rem;    /* 32px — da text-5xl 48px */
        line-height: 1.05;
    }

    /* ── Footer link text — text-xl = 20px → 16sp MD3 Body Large ─ */
    .footer-gold nav a span {
        font-size: 1rem;    /* 16px — più leggibile su mobile */
    }

    /* ── Footer inner top padding ────────────────────────────────── */
    .footer-inner {
        padding-top: 1.75rem; /* 28px — da 2.5rem (40px) */
    }
}

/* ─── Bottom Nav (Desktop) ──────────────────────────────────────
   Visibile da md (768px). Gold bg. Fisso in basso, si aggancia
   al footer tramite JS (bottom nav dock).
   ─────────────────────────────────────────────────────────────── */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: max(0px, calc((100vw - 2440px) / 2));
    right: max(0px, calc((100vw - 2440px) / 2));
    height: var(--nav-h);
    background: var(--c-gold);
    border-top: 1px solid rgba(17, 21, 22, 0.10);
    z-index: 50;
    align-items: center;
    justify-content: space-between;
    padding: 0 2.5rem;
    will-change: transform, height;
    transition: height 0.55s var(--ease);
}

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

@media (min-width: 1280px) {
    .bottom-nav { padding: 0 4rem; }
}

/* ── Sezione sinistra: orologio — riga unica HH:MM / Gg DD Mmm 🕐 */
.nav-clock-wrap {
    display: flex;
    align-items: center;
}

.nav-clock-line {
    display: inline-flex;
    align-items: center;
    gap: 0;
    white-space: nowrap;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-display);
    color: #111516;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

/* separatore legacy — rimosso dall'HTML, regola inattiva */
.nav-clock-sep {
    color: rgba(17, 21, 22, 0.35);
    font-weight: 400;
    margin: 0 0.4rem;
}

/* ── Clock icon — img tag con Clock_Icon.svg ────────────────── */
.nav-clock-icon-svg {
    width: 22px;
    height: 22px;
    margin: 0 0.5rem;
    flex-shrink: 0;
    display: block;
    object-fit: contain;
    /* Converte l'SVG dorato in colore coerente con il testo navbar */
    filter: brightness(0);
    opacity: 1;
}

/* ── Sezione destra: toggle HUD */
.nav-hud-wrap {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

/* ── Language switcher — split pill EN · IT ─────────────────── */
.nav-lang-switch {
    display: inline-flex;
    align-items: stretch;
    border-radius: 9999px;
    overflow: hidden;
    box-shadow: 0 0 0 1.5px #111516;
    text-decoration: none;
    white-space: nowrap;
    font-family: var(--font-display);
}

.lang-current, .lang-target {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 13px;
}

.lang-current {
    background: #111516;
    color: var(--c-gold);
    user-select: none;
}

.lang-target {
    background: var(--c-gold);
    color: #111516;
    transition: opacity var(--dur-fast) ease;
}
/* Separator always between the two halves, never on the outer edge */
.lang-target:last-child  { border-left:  1.5px solid #111516; } /* EN page: IT on right */
.lang-target:first-child { border-right: 1.5px solid #111516; } /* IT page: EN on left  */

.nav-lang-switch:hover .lang-target {
    opacity: 0.75;
}

@media (max-width: 767px) {
    .nav-lang-switch { min-height: 44px; }
    .lang-current,
    .lang-target     { font-size: 0.75rem; line-height: 1; padding: 3px 15px; }
}

/* ── Brand fisso — centro bordo superiore, solo desktop xl+ ──── */
.nav-brand-top {
    display: none;
    position: fixed;
    top: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9998;
    font-family: var(--font-display);
    font-size: 1.465rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--c-gold);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

@media (min-width: 1280px) {
    .nav-brand-top { display: block; }
}

/* ── Sezione destra: explore */
/* ── Sezione centrale: nav-center flip 3D su asse X ─────────────
   Front = dot-grid + label "Explore" (default).
   Back  = row di link di navigazione (su hover).
   ─────────────────────────────────────────────────────────────── */
.nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 600px;
}

.nav-center-front {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    cursor: default;
    user-select: none;
    transform-origin: center bottom;
    backface-visibility: hidden;
    transition:
        transform var(--dur-mid) var(--ease),
        opacity   var(--dur-mid) var(--ease);
}

.nav-center-back {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 2.5rem;
    white-space: nowrap;
    transform-origin: center bottom;
    transform: rotateX(90deg);
    opacity: 0;
    pointer-events: none;
    backface-visibility: hidden;
    transition:
        transform var(--dur-mid) var(--ease),
        opacity   var(--dur-mid) var(--ease);
}

.bottom-nav:hover .nav-center-front {
    transform: rotateX(-90deg);
    opacity: 0;
}

.bottom-nav:hover .nav-center-back {
    transform: rotateX(0deg);
    opacity: 1;
    pointer-events: auto;
}

/* Icone wide + label — affiancano il testo Explore */
.explore-wide-icon {
    height: 1.03125rem;
    width: auto;
    filter: brightness(0);
    flex-shrink: 0;
    display: block;
}

.explore-wide-icon--flip {
    transform: scaleX(-1);
}

.explore-label {
    font-size: 1.03125rem;
    font-weight: 700;
    font-family: var(--font-display);
    color: #111516;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Link nel back — riga orizzontale con stagger */
.nav-center-back a {
    font-size: 0.825rem;
    font-weight: 700;
    font-family: var(--font-display);
    color: rgba(17, 21, 22, 0.45);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transform: translateY(5px);
    transition:
        transform 0.18s var(--ease),
        color     var(--dur-fast) ease;
}

.bottom-nav:hover .nav-center-back a   { transform: translateY(0); }
.nav-center-back a:hover               { color: #111516; }

.bottom-nav:hover .nav-center-back a:nth-child(1) { transition-delay: 0.07s; }
.bottom-nav:hover .nav-center-back a:nth-child(2) { transition-delay: 0.12s; }
.bottom-nav:hover .nav-center-back a:nth-child(3) { transition-delay: 0.17s; }
.bottom-nav:hover .nav-center-back a:nth-child(4) { transition-delay: 0.22s; }
.bottom-nav:hover .nav-center-back a:nth-child(5) { transition-delay: 0.27s; }

/* ── Drag to scroll ─────────────────────────────────────────────
   body.is-dragging: feedback visivo nei contesti senza cursor custom.
   ─────────────────────────────────────────────────────────────── */
body.is-dragging,
body.is-dragging * {
    cursor: grabbing !important;
}

/* ── HUD Panels — 3 lati (left / right / top) ────────────────────
   Solo xl+ (1280px). Colore gold, puramente decorativi.
   Toggle switch nella navbar. Font 3× rispetto al precedente.
   ─────────────────────────────────────────────────────────────── */
.hud-panel {
    display: none;
    position: fixed;
    pointer-events: none;
    z-index: 9997;
    color: var(--c-gold);
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.15;
    user-select: none;
    transition: opacity 0.3s ease;
    will-change: transform;
    transform: translateZ(0);
}

@media (min-width: 1280px) {
    .hud-panel { display: flex; }
}

/* Left — column, gutter-aligned, same vertical span as .hud-top */
.hud-left {
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.875rem;
    left: max(1.5rem, calc((100vw - 2440px) / 2 + 1.5rem));
    top: 1.25rem;
    bottom: calc(var(--nav-h) + 1.25rem);
    overflow: hidden;
    max-width: calc(4rem - 1.5rem - 0.5rem); /* stays inside gutter, never touches top panel */
}

/* Right — column, gutter-aligned, same vertical span as .hud-top */
.hud-right {
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.875rem;
    right: max(1.5rem, calc((100vw - 2440px) / 2 + 1.5rem));
    top: 1.25rem;
    bottom: calc(var(--nav-h) + 1.25rem);
    overflow: hidden;
    max-width: calc(4rem - 1.5rem - 0.5rem); /* stays inside gutter, never touches top panel */
}

/* Side panel text spans: vertical orientation (icons excluded) */
.hud-left > span:not(.hud-aest-icon),
.hud-right > span:not(.hud-aest-icon) {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
}

/* Top — row inset to match xl:px-16 content padding */
.hud-top {
    flex-direction: row;
    align-items: center;
    gap: 0;
    justify-content: space-between;
    top: 1.25rem;
    left: max(4rem, calc((100vw - 2440px) / 2 + 4rem));
    right: max(4rem, calc((100vw - 2440px) / 2 + 4rem));
    white-space: nowrap;
}

/* Left / right content groups inside top panel */
.hud-top-group {
    display: inline-flex;
    align-items: center;
    gap: 1.125rem;
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
}
.hud-top-group:last-child { justify-content: flex-end; }

/* Center gap — keeps the logo area clear of all icons */
.hud-top-gap {
    flex: 0 0 auto;
    min-width: 2rem;
}

/* Wide flanking icons — fill horizontal space on each side of .hud-top */
.hud-wide-icon {
    flex: 1;
    height: 1.171875rem;
    flex-shrink: 1;
    background-color: var(--c-gold);
    -webkit-mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-size: 100% 100%;
    mask-repeat: no-repeat;
    mask-position: center;
}

.hud-panel.is-hidden { opacity: 0; }

/* Aest icons inside any HUD panel — same cap height as HUD text */
.hud-aest-icon {
    display: inline-block;
    width: 1.171875rem;
    height: 1.171875rem;
    flex-shrink: 0;
    background-color: var(--c-gold);
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

/* Side panel icons rotate to match text direction of each side */
.hud-left  > span.hud-aest-icon { transform: rotate(90deg); }
.hud-right > span.hud-aest-icon { transform: rotate(-90deg); }

/* ── HUD Toggle Switch ───────────────────────────────────────── */
.nav-clock-wrap {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.hud-toggle-wrap {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

/* Visually hide the native checkbox — still focusable */
.hud-toggle-cb {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.hud-toggle-track {
    position: relative;
    width: 3.375rem;
    height: 1.6875rem;
    background: rgba(17, 21, 22, 0.45);
    border-radius: 9999px;
    transition: background var(--dur-fast) ease;
    flex-shrink: 0;
}

.hud-toggle-cb:checked + .hud-toggle-track {
    background: #111516;
}

.hud-toggle-thumb {
    position: absolute;
    top: 0.28125rem;
    left: 0.28125rem;
    width: 1.125rem;
    height: 1.125rem;
    background: var(--c-gold);
    border-radius: 50%;
    transition: transform var(--dur-fast) ease;
}

.hud-toggle-cb:checked + .hud-toggle-track .hud-toggle-thumb {
    transform: translateX(1.6875rem);
}

/* Focus ring on the track when checkbox is focused */
.hud-toggle-cb:focus-visible + .hud-toggle-track {
    outline: 2px solid var(--c-gold);
    outline-offset: 2px;
}

/* ── HUD ironic label — rotates every 3s with shake ─────────── */
.hud-ironic-label {
    display: inline-block;
    font-size: 0.625rem;
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(17, 21, 22, 0.50);
    white-space: nowrap;
    user-select: none;
    cursor: default;
    margin-left: 1.5rem;
}

.hud-ironic-label.is-shaking {
    animation: hud-shake 0.45s ease;
}

@keyframes hud-shake {
    0%   { transform: translate(0, 0) rotate(0deg); }
    15%  { transform: translate(-3px,  1px) rotate(-1.2deg); }
    30%  { transform: translate( 3px, -1px) rotate( 1.2deg); }
    45%  { transform: translate(-2px,  0px) rotate(-0.6deg); }
    60%  { transform: translate( 2px,  1px) rotate( 0.6deg); }
    75%  { transform: translate(-1px,  0px) rotate(-0.3deg); }
    90%  { transform: translate( 1px,  0px) rotate( 0.1deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

/* ── Scroll to Top Button — full-width, dark bg, gold ─────────── */
.btn-scroll-top {
    display: flex;
    width: 100%;
    margin-top: auto;
    position: relative;
    z-index: 9998;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: var(--nav-h);
    background-color: #111516;
    border: none;
    cursor: pointer;
    padding: 1.25rem 2rem;
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--c-gold);
    transition: opacity var(--dur-fast) ease;
    -webkit-tap-highlight-color: transparent;
}

.btn-scroll-top:hover  { opacity: 0.8; }
.btn-scroll-top:active { opacity: 0.9; }

/* ── Desktop: fisso in basso, SOTTO la bottom-nav (z-index 49 < 50) ──
   La navbar lo copre completamente a riposo. Man mano che la navbar
   sale durante il docking (translateY negativo), il bottone si rivela
   dal basso — nessun JS necessario, è il movimento della nav che
   controlla quanti pixel del bottone sono visibili. ─────────────────── */
@media (min-width: 768px) {
    .btn-scroll-top {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin-top: 0;
        z-index: 49;
    }
}

/* ── Mobile: fixed bottom, slide-in al 40% scroll ────────────── */
@media (max-width: 767px) {
    .btn-scroll-top {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin-top: 0;
        min-height: calc(var(--nav-h) * 0.75);
        transform: translateY(110%);
        transition: transform var(--dur-mid) var(--ease);
        opacity: 1;
    }
    .btn-scroll-top:hover  { opacity: 1; }
    .btn-scroll-top:active { transform: translateY(0); }
    .btn-scroll-top.scroll-top-visible { transform: translateY(0); }
}

.btn-scroll-label { color: var(--c-gold); }

/* Freccia gold via CSS mask */
.scroll-up-arrow-icon {
    display: inline-block;
    flex-shrink: 0;
    width: 1.125rem;
    height: 1.125rem;
    background-color: var(--c-gold);
    -webkit-mask: url('assets/vectors/icons/Arrow_Top.svg') no-repeat center / contain;
    mask: url('assets/vectors/icons/Arrow_Top.svg') no-repeat center / contain;
}

/* ─── Footer — icon animation strip ────────────────────────────
   Banda decorativa tra footer-inner e "Torna su".
   Le icone vengono iniettate via JS (initFooterAestStrip).
   ─────────────────────────────────────────────────────────────── */
.footer-aest-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: clamp(1rem, 3vw, 2rem);
    padding: 2rem 1.5rem;
    border-top: 1px solid rgba(17, 21, 22, 0.10);
    overflow: hidden;
}

.footer-aest-icon {
    display: block;
    flex-shrink: 0;
    background-color: rgba(17, 21, 22, 0.22);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-position: center;
    mask-position: center;
}

@keyframes aest-float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-10px); }
}
@keyframes aest-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes aest-pulse {
    0%, 100% { transform: scale(1);    opacity: 0.22; }
    50%       { transform: scale(1.2); opacity: 0.45; }
}
@keyframes aest-rock {
    0%, 100% { transform: rotate(-10deg); }
    50%       { transform: rotate(10deg); }
}
@keyframes aest-drift {
    0%, 100% { transform: translate(0, 0); }
    33%       { transform: translate(5px, -7px); }
    66%       { transform: translate(-4px, 4px); }
}
@keyframes aest-blink {
    0%, 100% { opacity: 0.12; }
    50%       { opacity: 0.40; }
}

/* ─── Footer — full-viewport layout ────────────────────────────
   .footer-gold è un sibling di <main> — occupa l'intera larghezza.
   min-height garantisce che riempia il viewport meno la nav bar.
   ─────────────────────────────────────────────────────────────── */
.footer-gold {
    min-height: calc(100vh - var(--nav-h));
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
}

@media (min-width: 768px) {
    /* La bottom nav si aggancia al top del footer via JS docking —
       nessun padding-bottom necessario: il btn-scroll-top è in flusso normale */
    .footer-gold { padding-bottom: 0; }
}

.footer-inner {
    max-width: 2440px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 0;
}

@media (min-width: 768px) {
    .footer-inner {
        padding: calc(var(--nav-h) + 0.75rem) 2.5rem 0;
    }
}

@media (min-width: 1280px) {
    .footer-inner {
        padding-left: 4rem;
        padding-right: 4rem;
    }
}

/* ─── Footer — gold override ─────────────────────────────────────
   .footer-gold inverte la palette: bg gold, testo dark.
   ─────────────────────────────────────────────────────────────── */
.footer-gold .footer-arrow-img {
    filter: brightness(0) opacity(0.35);
}

.footer-gold .group:hover .footer-arrow-img,
.footer-gold .group.is-touching .footer-arrow-img {
    filter: brightness(0) opacity(1);
    transform: rotate(-45deg);
}

/* ─── Fase 3: Custom Cursor ─────────────────────────────────────
   Solo desktop. JS controlla touch detection e aggiunge
   .has-custom-cursor su body. Dot puntuale + ring con lag lerp.
   ─────────────────────────────────────────────────────────────── */
.has-custom-cursor * {
    cursor: none !important;
}

.cursor-dot,
.cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    will-change: transform;
    opacity: 0;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background: var(--c-gold);
    mix-blend-mode: difference;
    transition: opacity 0.3s ease, width 0.2s ease, height 0.2s ease;
}

.cursor-ring {
    width: 30px;
    height: 30px;
    border: 1.5px solid var(--c-gold);
    mix-blend-mode: difference;
    transition: opacity 0.3s ease, width 0.3s ease, height 0.3s ease;
}

.cursor-dot.is-hovering {
    width: 40px;
    height: 40px;
}

.cursor-ring.is-hovering {
    width: 56px;
    height: 56px;
}

.cursor-ring.is-dragging {
    width: 16px;
    height: 16px;
}

/* ─── Fase 3: Before / After Slider ────────────────────────────
   Componente drag per confronto visivo prima/dopo. Usare solo
   per redesign con un prima/dopo visivamente forte.
   ─────────────────────────────────────────────────────────────── */
.ba-slider {
    position: relative;
    overflow: hidden;
    cursor: ew-resize;
    user-select: none;
    touch-action: pan-y;
    border-radius: var(--radius);
}

.ba-after,
.ba-before {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    border-radius: var(--radius);
}

.ba-after { z-index: 1; }

.ba-before {
    z-index: 2;
    clip-path: inset(0 50% 0 0);
}

/* Img-placeholder o immagini reali dentro il ba-slider */
.ba-after > *,
.ba-before > * {
    position: absolute;
    inset: 0;
    height: 100% !important;
    min-height: 100% !important;
}

.ba-label {
    position: absolute;
    bottom: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.5rem;
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(17, 21, 22, 0.8);
    backdrop-filter: blur(8px);
    z-index: 4;
    pointer-events: none;
}

.ba-label--before {
    left: 1rem;
    color: rgba(var(--text-rgb), 0.5);
    border: 1px solid rgba(var(--text-rgb), 0.12);
}

.ba-label--after {
    right: 1rem;
    color: var(--c-gold);
    border: 1px solid rgba(var(--gold-rgb), 0.25);
}

.ba-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    z-index: 5;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.ba-handle-line {
    flex: 1;
    width: 2px;
    background: rgba(var(--text-rgb), 0.3);
}

.ba-handle-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--c-s1);
    border: 1px solid rgba(var(--text-rgb), 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    flex-shrink: 0;
}

.ba-arrow {
    font-size: 0.625rem;
    color: rgba(var(--text-rgb), 0.5);
    line-height: 1;
}

/* ─── Fase 3: Sticky Section Nav ────────────────────────────────
   Solo case study, solo xl. Dot + label che appaiono su hover/
   active. IntersectionObserver marca .is-active.
   ─────────────────────────────────────────────────────────────── */
.section-nav {
    display: none;
    position: fixed;
    right: max(1.25rem, calc((100vw - 2440px) / 2 + 1.25rem));
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
    flex-direction: column;
    gap: 1.25rem;
    align-items: flex-end;
}

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

.section-nav-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    padding: 0.125rem 0;
}

.section-nav-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(var(--text-rgb), 0.18);
    flex-shrink: 0;
    transition: background var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.section-nav-label {
    font-size: 0.5625rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(var(--text-rgb), 0.0);
    white-space: nowrap;
    transition: color var(--dur-fast) ease;
    pointer-events: none;
    font-family: var(--font-display);
}

.section-nav-item:hover .section-nav-dot  { background: rgba(var(--text-rgb), 0.4); }
.section-nav-item:hover .section-nav-label { color: rgba(var(--text-rgb), 0.4); }

.section-nav-item.is-active .section-nav-dot {
    background: var(--c-red);
    transform: scale(1.4);
}

.section-nav-item.is-active .section-nav-label { color: rgba(var(--text-rgb), 0.5); }

/* ─── Heading Uppercase ─────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    text-transform: uppercase;
}

/* ─── Footer Clock ───────────────────────────────────────────── */
.footer-clock-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
}

.footer-clock-icon {
    width: 1.375rem;
    height: 1.375rem;
    color: rgba(var(--text-rgb), 0.22);
    flex-shrink: 0;
}

.footer-clock-time {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    font-family: var(--font-display);
    color: var(--c-gold);
    letter-spacing: -0.03em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.footer-clock-colon {
    animation: clockBlink 1s step-end infinite;
}

@keyframes clockBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

.footer-clock-label {
    display: block;
    font-size: 0.5625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(var(--text-rgb), 0.25);
    margin-top: 0.3rem;
    font-family: var(--font-display);
}

/* ─── Footer Arrow ───────────────────────────────────────────── */
.footer-arrow-img {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    filter: brightness(0) opacity(0.28);
    transition: transform var(--dur-mid) var(--ease), filter var(--dur-fast) ease;
}

.group:hover .footer-arrow-img,
.group.is-touching .footer-arrow-img {
    transform: rotate(-45deg);
    filter: brightness(0) invert(1) sepia(1) saturate(500%) hue-rotate(-5deg) brightness(1.05);
}

/* =========================================================
   AEST BLOCKS — aesthetic bento replacements
   Overview only · active when HUD toggle is ON
   Box has no animation; content does.
   ========================================================= */

.aest-block {
    position: relative;
    overflow: hidden;
    cursor: default;
    user-select: none;
    min-height: 200px;
    opacity: 1; /* fallback when aest-block-in is replaced by is-quaking !important */
    animation: aest-block-in 0.38s var(--ease) both;
}
@keyframes aest-block-in {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

/* ── Type 1: Scroll text ─────────────────────────────────── */
.aest-block--scroll {
    display: flex;
    align-items: center;
    background-color: var(--c-s1);
}
.aest-scroll-track {
    display: flex;
    align-items: center;
    white-space: nowrap;
    will-change: transform;
    animation: aest-marquee 13s linear infinite;
}
.aest-scroll-word {
    font-family: var(--font-display);
    font-size: clamp(4rem, 8vw, 7rem);
    font-weight: 700;
    color: var(--c-gold);
    opacity: 0.13;
    padding: 0 1.25rem;
    text-transform: uppercase;
    letter-spacing: -0.04em;
    line-height: 1;
    flex-shrink: 0;
}
@keyframes aest-marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ── Type 2: Vibrate text ────────────────────────────────── */
.aest-block--vibe {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--c-s2);
}
.aest-vibe-text {
    position: relative;
    z-index: 1;
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    font-weight: 700;
    color: var(--c-gold);
    text-transform: uppercase;
    letter-spacing: -0.04em;
    line-height: 1.1;
    text-align: center;
    pointer-events: none;
    transition: color 0.15s;
}
.aest-block--vibe:hover .aest-vibe-text {
    animation: aest-vibe 0.32s ease infinite;
    color: #fff;
}
@keyframes aest-vibe {
    0%   { transform: translate(0,    0)    rotate(0deg); }
    15%  { transform: translate(-2px, 1px)  rotate(-0.7deg); }
    30%  { transform: translate(2px, -1px)  rotate( 0.7deg); }
    50%  { transform: translate(-1px, 2px)  rotate(-0.4deg); }
    65%  { transform: translate(2px, -2px)  rotate( 0.4deg); }
    80%  { transform: translate(-2px, 0px)  rotate(-0.2deg); }
    100% { transform: translate(0,    0)    rotate(0deg); }
}
.aest-vibe-bg-icon {
    position: absolute;
    background-color: var(--c-gold);
    opacity: 0.05;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    pointer-events: none;
}

/* ── Type 3: Bounce letters ──────────────────────────────── */
.aest-block--bounce {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--c-s3);
}
.aest-bounce-wrap {
    display: flex;
    align-items: flex-end;
    gap: 0.02em;
}
.aest-letter {
    display: inline-block;
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 4.5rem);
    font-weight: 700;
    color: var(--c-gold);
    text-transform: uppercase;
    letter-spacing: 0;
    line-height: 1;
}
.aest-block--bounce:hover .aest-letter {
    animation: aest-letter-bounce 0.55s var(--ease) both;
}
@keyframes aest-letter-bounce {
    0%   { transform: translateY(0); }
    25%  { transform: translateY(-24px); }
    48%  { transform: translateY(-8px); }
    65%  { transform: translateY(-17px); }
    82%  { transform: translateY(-4px); }
    100% { transform: translateY(0); }
}

/* ── Type 4: Gravity icons ───────────────────────────────── */
.aest-block--gravity {
    background-color: var(--c-s1);
}
.aest-gravity-icon {
    position: absolute;
    width: 1.75rem;
    height: 1.75rem;
    background-color: var(--c-gold);
    opacity: 0;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    animation: aest-gravity-fall var(--fall-dur, 2.5s) var(--fall-delay, 0s) ease-in infinite;
}
@keyframes aest-gravity-fall {
    0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
    7%   { opacity: 0.75; }
    88%  { opacity: 0.75; }
    100% { transform: translateY(var(--fall-dist, 260px)) rotate(var(--rot, 20deg)); opacity: 0; }
}
.aest-gravity-label {
    position: absolute;
    bottom: 1.25rem;
    left: 1.5rem;
    font-family: var(--font-display);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-gold);
    opacity: 0.35;
    pointer-events: none;
}

/* ── Type 5: Magnet icons ────────────────────────────────── */
.aest-block--magnet {
    background-color: var(--c-s2);
}
.aest-magnet-icon {
    position: absolute;
    width: 2rem;
    height: 2rem;
    background-color: var(--c-gold);
    opacity: 0.55;
    transition: transform 0.22s var(--ease-out);
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    pointer-events: none;
}
.aest-magnet-label {
    position: absolute;
    bottom: 1.25rem;
    left: 1.5rem;
    font-family: var(--font-display);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-gold);
    opacity: 0.35;
    pointer-events: none;
}

/* ── Type 6: Logo Bigger ─────────────────────────────────── */
.aest-block--logobig {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.875rem;
    background-color: var(--c-s3);
    padding: 3.5rem 3rem;
}
.aest-logobig-icon {
    width: 3rem;
    height: 3rem;
    background-color: var(--c-gold);
    flex-shrink: 0;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}
.aest-logobig-text {
    font-family: var(--font-display);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-gold);
    opacity: 0.6;
    margin: 0;
    text-align: center;
}
.aest-logobig-sub {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    margin: 0;
    min-height: 1.4rem;
    text-align: center;
}
.aest-logobig-btn {
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #111516;
    background-color: var(--c-gold);
    border: none;
    padding: 0.75rem 2.25rem;
    border-radius: 999px;
    cursor: pointer;
    transition: opacity 0.15s;
    min-height: 44px;
}
.aest-logobig-btn:hover  { opacity: 0.82; }
.aest-logobig-btn:active { opacity: 0.65; }

/* ── Type 7: Heartquake ──────────────────────────────────── */
.aest-block--heartquake {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background-color: var(--c-s1);
    padding: 2.5rem;
}
.aest-heartquake-label {
    font-family: var(--font-display);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-gold);
    opacity: 0.45;
    margin: 0;
}
.aest-heartquake-btn {
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #111516;
    background-color: var(--c-gold);
    border: none;
    padding: 0.75rem 2.25rem;
    border-radius: 999px;
    cursor: pointer;
    transition: opacity 0.15s;
    min-height: 44px;
}
.aest-heartquake-btn:hover    { opacity: 0.82; }
.aest-heartquake-btn:active   { opacity: 0.65; }
.aest-heartquake-btn:disabled { opacity: 0.35; cursor: not-allowed; }
@keyframes aest-quake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    10%  { transform: translate(-4px,  2px) rotate(-0.6deg); }
    20%  { transform: translate( 4px, -2px) rotate( 0.6deg); }
    30%  { transform: translate(-3px,  4px) rotate(-0.4deg); }
    40%  { transform: translate( 4px, -3px) rotate( 0.5deg); }
    50%  { transform: translate(-4px,  1px) rotate(-0.5deg); }
    60%  { transform: translate( 3px, -1px) rotate( 0.4deg); }
    70%  { transform: translate(-2px,  3px) rotate(-0.3deg); }
    80%  { transform: translate( 2px, -3px) rotate( 0.3deg); }
    90%  { transform: translate(-3px,  0px) rotate(-0.2deg); }
}
.is-quaking {
    animation: aest-quake 0.28s ease infinite !important;
    transform-origin: center center;
}

/* ── Type 8: Gun ─────────────────────────────────────────── */
.aest-block--gun {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 3.5rem 4rem;
    min-height: 280px;
    background-color: var(--c-s2);
    cursor: crosshair;
}
.aest-gun-wrap {
    position: relative;
    width: 7.5rem;
    height: 5.625rem;
    flex-shrink: 0;
    color: var(--c-gold);
    transition: transform 0.18s var(--ease);
}
.aest-gun-wrap svg {
    display: block;
    width: 100%;
    height: auto;
}
.aest-gun-body {
    position: absolute;
    left: 0;
    top: 0;
    width: 2.5rem;
    height: 2.1rem;
    background-color: var(--c-gold);
    border-radius: 4px;
}
.aest-gun-barrel {
    position: absolute;
    left: 2.2rem;
    top: 0.45rem;
    right: 0;
    height: 0.75rem;
    background-color: var(--c-gold);
    border-radius: 0 4px 4px 0;
}
.aest-gun-grip {
    position: absolute;
    left: 0.65rem;
    top: 2.1rem;
    width: 1.25rem;
    height: 1.65rem;
    background-color: var(--c-gold);
    border-radius: 0 0 4px 4px;
    transform: skewX(-7deg);
}
/* invisible marker — getBoundingClientRect gives muzzle coords */
.aest-gun-muzzle {
    position: absolute;
    right: 0;
    top: 10%;
    width: 1px;
    height: 1px;
}
.aest-gun-label {
    font-family: var(--font-display);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-gold);
    opacity: 0.45;
    margin: 0;
    animation: aest-gun-blink 1.4s ease-in-out infinite;
}
@keyframes aest-gun-blink {
    0%, 100% { opacity: 0.45; }
    50%       { opacity: 0.15; }
}
/* bullets — appended to body, not to block */
.aest-bullet-icon {
    position: fixed;
    width: 1.5rem;
    height: 1.5rem;
    background-color: var(--c-gold);
    pointer-events: none;
    z-index: 99999;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

/* ── Type 9: Pet ─────────────────────────────────────────── */
.aest-block--pet {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    padding: 3rem 3.5rem;
    background-color: var(--c-s3);
    cursor: pointer;
}
.aest-pet-icons {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.aest-pet-hand {
    color: var(--c-gold);
    width: 8rem;
    transition: transform 0.32s var(--ease);
    flex-shrink: 0;
}
.aest-pet-hand svg { display: block; width: 100%; height: auto; }
.aest-pet-cat {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--c-gold);
    text-align: center;
    line-height: 1;
    margin: 0;
    min-width: 8ch;
}
.aest-pet-pat-text {
    position: fixed;
    z-index: 99999;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--c-gold);
    pointer-events: none;
    white-space: nowrap;
    animation: aest-pet-pat-rise 0.82s var(--ease) both;
}
@keyframes aest-pet-pat-rise {
    from { transform: translateY(0)        scale(0.75); opacity: 1; }
    to   { transform: translateY(-3.25rem) scale(1.05); opacity: 0; }
}
.aest-pet-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.aest-pet-counter {
    font-family: var(--font-display);
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--c-gold);
    margin: 0;
    line-height: 1;
    min-width: 3ch;
    text-align: left;
}
.aest-pet-label {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-gold);
    opacity: 0.4;
    margin: 0;
}
.aest-pet-mood {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    margin: 0;
    min-height: 1em;
    opacity: 0;
    transition: opacity 0.2s;
}
.aest-pet-mood.is-visible { opacity: 1; }

/* ── Type 10: Stickman ───────────────────────────────────── */
.aest-block--stickman {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 1.75rem;
    padding: 2rem 2rem 2.5rem;
    background-color: var(--c-s2);
    cursor: pointer;
    min-height: 280px;
}
.aest-stickman {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.15rem;
    line-height: 1.45;
    color: var(--c-gold);
    text-align: center;
    white-space: pre;
    pointer-events: none;
    transform-origin: bottom center;
}
.aest-stickman.is-jumping {
    animation: stickman-jump 0.65s var(--ease) both;
}
@keyframes stickman-jump {
    0%   { transform: translateY(0)      scaleY(1);    }
    12%  { transform: translateY(6px)    scaleY(0.82); }
    38%  { transform: translateY(-72px)  scaleY(1);    }
    62%  { transform: translateY(-50px)  scaleY(1);    }
    85%  { transform: translateY(-8px)   scaleY(1);    }
    93%  { transform: translateY(0)      scaleY(0.88); }
    100% { transform: translateY(0)      scaleY(1);    }
}
.aest-stickman-label {
    font-family: var(--font-display);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c-gold);
    opacity: 0.4;
    text-align: center;
    pointer-events: none;
}

/* ─── Reduced Motion — HIG + WCAG 2.3.3 ────────────────────────
   Disabilita TUTTE le animazioni CSS e Fase 3.
   JS deve rispettare window.matchMedia('(prefers-reduced-motion)').
   ─────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration:       0.01ms !important;
        animation-iteration-count: 1     !important;
        transition-duration:      0.01ms !important;
        scroll-behavior:          auto   !important;
    }

    /* Reveal senza translateY */
    .bento-card, .hero-heading, .hero-word {
        opacity:   1    !important;
        transform: none !important;
    }

    /* Mobile nav — link sempre in posizione finale, nessuno slide */
    .mobile-nav-panel > a,
    .mobile-nav-panel > a::before {
        transform: none !important;
    }

    /* Fase 3 */
    .typewriter-role       { transition: none !important; }
    .cursor-dot,
    .cursor-ring           { display: none !important; }
    .footer-clock-colon    { animation: none !important; }
    .footer-arrow-img      { transition: none !important; }
}
