/* Home di ingresso (front-page.php): cielo stellato, sfera di argomenti, tre ingressi. Caricata solo sulla home. */
@font-face { font-family: 'Oswald'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/oswald-700.woff2') format('woff2'); }
@font-face { font-family: 'Open Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url('fonts/open-sans-regular.woff2') format('woff2'); }

html:has(body.one-splash) { background: #020308; }
body.one-splash { margin: 0; min-height: 100vh; min-height: 100dvh; background: #020308; color: #fff; font-family: 'Open Sans', system-ui, sans-serif; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
.one-splash .screen-reader-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.splash {
    --ink: #f3f5ff; --sky: #86c6f4; --gold: #f6e2ad; --line: rgba(214, 224, 255, .34); --panel: rgba(9, 13, 30, .72);
    position: relative; isolation: isolate; box-sizing: border-box; overflow: hidden;
    display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto; justify-items: center; align-items: center;
    gap: clamp(8px, 2vh, 20px);
    height: 100vh; height: 100dvh; min-height: 540px;
    padding: max(clamp(14px, 3.4vh, 34px), env(safe-area-inset-top)) max(20px, env(safe-area-inset-left)) max(clamp(14px, 3vh, 30px), env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-right));
}
.admin-bar .splash { height: calc(100vh - 32px); height: calc(100dvh - 32px); }
@media (max-width: 782px) { .admin-bar .splash { height: calc(100vh - 46px); height: calc(100dvh - 46px); } }
/* La home resta tutta nera come nel video: la fascia dei cataloghi (plugin) non compare qui, le sue voci sono parole della sfera. */
.one-splash > .po-catalog-nav { display: none; }
.splash-logo { grid-row: 1; }
.splash-search { grid-row: 2; }
.splash-sphere { grid-row: 3; }
.splash-actions { grid-row: 4; }
.splash-welcome { grid-row: 5; }

/* Cielo: stelle disegnate su canvas (intro.js), fascia di nebulosa, scintille e stelle cadenti. */
.splash-sky { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
    background:
        radial-gradient(ellipse 120% 70% at 50% 50%, #080a1e 0%, #020308 72%);
}
.splash-sky::before, .splash-sky::after { content: ''; position: absolute; left: -30%; width: 160%; height: 46%; top: 27%; will-change: transform, opacity; }
.splash-sky::before { background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(74, 70, 190, .40), transparent 70%); animation: splash-nebula 16s ease-in-out infinite alternate; }
.splash-sky::after { top: 20%; background: radial-gradient(ellipse 34% 40% at 64% 50%, rgba(128, 72, 205, .26), transparent 70%); animation: splash-nebula 23s ease-in-out -8s infinite alternate-reverse; }
.splash-sky canvas { position: absolute; animation: splash-drift 520s linear infinite; }
@keyframes splash-drift { to { transform: rotate(360deg); } }
@keyframes splash-nebula { from { opacity: .55; transform: translateX(-5%) scaleY(.85); } to { opacity: 1; transform: translateX(5%) scaleY(1.15); } }
.splash-spark { position: absolute; z-index: 1; width: 9px; height: 9px; opacity: .15; animation: splash-twinkle 4.5s ease-in-out infinite;
    background: linear-gradient(#dfe6ff, #dfe6ff) center / 1px 100% no-repeat, linear-gradient(#dfe6ff, #dfe6ff) center / 100% 1px no-repeat; }
.splash-shoot { position: absolute; left: 0; top: 0; z-index: 1; width: 96px; height: 1.5px; border-radius: 2px; opacity: 0; transform-origin: 0 50%;
    background: linear-gradient(90deg, #fff, rgba(190, 205, 255, .55) 25%, transparent); }
.splash-shoot::before { content: ''; position: absolute; left: -2px; top: -2px; width: 5px; height: 5px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px 2px rgba(200, 215, 255, .8); }
@keyframes splash-twinkle { 0%, 100% { opacity: .12; transform: scale(.7); } 50% { opacity: .85; transform: scale(1.15); } }

/* Logo */
.splash-logo { display: block; width: clamp(190px, 46vw, 264px); line-height: 0; border-radius: 12px; animation: splash-logo 1.1s cubic-bezier(.2, .8, .2, 1) .35s both, splash-float 7s ease-in-out 1.6s infinite; filter: drop-shadow(0 0 18px rgba(120, 110, 255, .28)); }
.splash-logo img { display: block; width: 100%; height: auto; }
@keyframes splash-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes splash-logo { from { opacity: 0; transform: translate(min(26vw, 300px), -6px) scale(1.9); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }

/* Ricerca */
.splash-search { box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: min(100%, 440px); height: clamp(46px, 7.2vh, 56px); padding: 4px 5px 4px 18px;
    color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 0 0 1px rgba(8, 10, 24, .6), 0 10px 34px rgba(4, 6, 20, .5); backdrop-filter: blur(6px);
    animation: splash-rise .7s ease-out 1.25s both; transition: border-color .2s, box-shadow .2s; }
.splash-search:focus-within { border-color: rgba(150, 190, 255, .9); box-shadow: 0 0 0 3px rgba(96, 150, 255, .28), 0 10px 34px rgba(4, 6, 20, .5); }
.splash-search svg { flex: none; width: 22px; height: 22px; }
.splash-search input { flex: 1; min-width: 0; height: 100%; margin: 0; padding: 0; color: inherit; font: 400 clamp(15px, 4vw, 17px) / 1.2 'Open Sans', system-ui, sans-serif; background: none; border: 0; outline: 0; box-shadow: none; appearance: none; -webkit-appearance: none; }
.splash-search input::placeholder { color: #e9edff; opacity: .95; }
.splash-search input::-webkit-search-cancel-button { filter: invert(1); opacity: .6; }
.splash-search button { flex: none; height: 100%; margin: 0; padding: 0 clamp(16px, 4.4vw, 24px); color: #fff; font: 700 clamp(15px, 4vw, 18px) / 1 'Oswald', 'Arial Narrow', sans-serif; letter-spacing: .02em; cursor: pointer;
    background: linear-gradient(180deg, #172044, #0f1630); border: 1px solid rgba(160, 180, 255, .28); border-radius: 999px; animation: splash-pop .6s cubic-bezier(.2, 1.4, .4, 1) 1.6s both; transition: background .2s, border-color .2s, transform .15s; }
.splash-search button:hover { background: linear-gradient(180deg, #223066, #162046); border-color: rgba(190, 205, 255, .6); }
.splash-search button:active { transform: scale(.96); }

/* Sfera di parole. Senza JavaScript resta una nuvola di collegamenti; intro.js aggiunge .is-sphere e muove le parole. */
.splash-sphere { position: relative; align-self: stretch; justify-self: stretch; min-height: 0; margin: 0 -20px; animation: splash-fade 1.2s ease-out both; }
.splash-words { box-sizing: border-box; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 4px 12px; height: 100%; margin: 0; padding: 0 20px; overflow: auto; list-style: none; font-size: 13px; }
.splash-words li { margin: 0; padding: 0; }
.splash-words a { display: block; padding: .12em .2em; color: var(--sky); font: 400 1em / 1.15 'Open Sans', system-ui, sans-serif; white-space: nowrap; text-decoration: none; border-radius: 6px; -webkit-tap-highlight-color: transparent; }
.splash-words a[data-tier="m"] { color: var(--ink); font-size: 1.08em; }
.splash-words a[data-tier="k"], .splash-words a[data-tier="g"] { color: #fff; font: 700 1.5em / 1.1 'Oswald', 'Arial Narrow', sans-serif; letter-spacing: .01em; text-shadow: 0 0 14px rgba(120, 150, 255, .45); }
.splash-words a[data-tier="g"] { color: var(--gold); font-size: 1.72em; text-shadow: 0 0 16px rgba(246, 214, 140, .35); }
.splash-words a:hover, .splash-words a:focus-visible { color: var(--gold); }
.one-splash a:focus-visible, .one-splash button:focus-visible { outline: 2px solid #9cc4ff; outline-offset: 3px; }

.splash-words.is-sphere { display: block; position: absolute; inset: 0; height: auto; padding: 0; overflow: visible; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; }
.splash-words.is-sphere.is-dragging { cursor: grabbing; }
.splash-words.is-sphere::before { content: ''; position: absolute; left: 50%; top: 50%; width: var(--d, 300px); height: var(--d, 300px); transform: translate(-50%, -50%); border: 1px dotted rgba(170, 190, 255, .16); border-radius: 50%;
    background: radial-gradient(circle, rgba(70, 80, 215, .22), rgba(44, 48, 140, .07) 58%, transparent 70%); box-shadow: 0 0 70px rgba(80, 90, 230, .16); pointer-events: none; animation: splash-halo 7s ease-in-out infinite; }
@keyframes splash-halo { 0%, 100% { opacity: .75; transform: translate(-50%, -50%) scale(.98); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.03); } }
.splash-orbits { position: absolute; left: 50%; top: 50%; width: calc(var(--d, 300px) * 1.18); height: calc(var(--d, 300px) * 1.18); margin: calc(var(--d, 300px) * -.59) 0 0 calc(var(--d, 300px) * -.59); pointer-events: none; animation: splash-fade 2.4s ease-out 1.2s both; }
.splash-orbits i { position: absolute; inset: 0; border: 1px solid rgba(150, 175, 255, .2); border-radius: 50%; animation: splash-orbit-a 15s linear infinite; }
.splash-orbits i + i { inset: 5%; border-color: rgba(190, 150, 255, .15); animation: splash-orbit-b 23s linear infinite; }
.splash-orbits i::before { content: ''; position: absolute; left: 50%; top: -4px; width: 7px; height: 7px; margin-left: -3px; border-radius: 50%; background: #fff; box-shadow: 0 0 12px 4px rgba(150, 190, 255, .9); }
.splash-orbits i + i::before { box-shadow: 0 0 12px 4px rgba(210, 150, 255, .9); }
@keyframes splash-orbit-a { from { transform: rotateZ(-18deg) rotateX(73deg) rotateZ(0deg); } to { transform: rotateZ(-18deg) rotateX(73deg) rotateZ(360deg); } }
@keyframes splash-orbit-b { from { transform: rotateZ(24deg) rotateX(68deg) rotateZ(360deg); } to { transform: rotateZ(24deg) rotateX(68deg) rotateZ(0deg); } }
.splash-words.is-sphere li { position: absolute; left: 50%; top: 50%; }
.splash-words.is-sphere a { position: absolute; left: 0; top: 0; opacity: 0; will-change: transform, opacity; transition: color .45s, text-shadow .45s; }
.splash-words.is-sphere a.is-lit { color: var(--gold); text-shadow: 0 0 16px rgba(246, 214, 140, .8), 0 0 34px rgba(246, 190, 110, .35); }

/* Tre ingressi */
.splash-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 3.4vw, 16px); width: min(100%, 560px); }
.splash-actions a { box-sizing: border-box; display: grid; place-items: center; min-height: clamp(58px, 9.6vh, 80px); padding: 8px clamp(8px, 3vw, 18px); color: #fff; font: 700 clamp(15px, 4.1vw, 19px) / 1.3 'Oswald', 'Arial Narrow', sans-serif; letter-spacing: .01em; text-align: center; text-wrap: balance; text-decoration: none;
    background: var(--panel); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 8px 26px rgba(4, 6, 20, .45); animation: splash-pop .7s cubic-bezier(.2, 1.5, .4, 1) both; transition: background .2s, border-color .2s, box-shadow .2s, transform .15s; }
.splash-actions a { position: relative; overflow: hidden; }
.splash-actions a::after { content: ''; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 36%, rgba(200, 215, 255, .26) 50%, transparent 64%); transform: translateX(-130%); animation: splash-sheen 6.5s ease-in-out 3.4s infinite; pointer-events: none; }
.splash-actions a:nth-child(2)::after { animation-delay: 3.75s; }
.splash-actions a:nth-child(3)::after { animation-delay: 4.1s; }
@keyframes splash-sheen { 0% { transform: translateX(-130%); } 22%, 100% { transform: translateX(130%); } }
.splash-actions a:nth-child(1) { animation-delay: 1.9s; }
.splash-actions a:nth-child(2) { animation-delay: 2.15s; }
.splash-actions a:nth-child(3) { animation-delay: 2.4s; }
.splash-actions a:hover { background: rgba(26, 36, 82, .86); border-color: rgba(190, 208, 255, .8); box-shadow: 0 0 0 3px rgba(96, 150, 255, .18), 0 8px 26px rgba(4, 6, 20, .45); }
.splash-actions a:active { transform: scale(.96); }

/* Benvenuto, con un riflesso di luce che attraversa le lettere */
.splash-welcome { margin: 0; padding: 0 2px; color: #dfe4ff; font: 700 clamp(17px, 4.6vw, 32px) / 1.2 'Oswald', 'Arial Narrow', sans-serif; letter-spacing: .01em; text-align: center; text-wrap: balance;
    background: linear-gradient(100deg, #d5dbfb 0%, #d5dbfb 42%, #fff 50%, #d5dbfb 58%, #d5dbfb 100%) 100% 0 / 260% 100% no-repeat; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(150, 170, 255, .28)); animation: splash-rise .9s ease-out 2.9s both, splash-shimmer 5.5s ease-in-out 3.8s infinite; }
/* Il gradiente è largo 260%: fra 100% e 0% copre sempre tutta la scritta e il riflesso la attraversa da sinistra a destra. */
@keyframes splash-shimmer { 0% { background-position: 100% 0; } 55%, 100% { background-position: 0% 0; } }

@keyframes splash-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes splash-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes splash-pop { 0% { opacity: 0; transform: scale(.55); } 60% { opacity: 1; transform: scale(1.1); } 100% { opacity: 1; transform: none; } }

/* Schermi larghi: ingressi distanziati come tre pulsanti autonomi */
@media (min-width: 900px) {
    .splash-search { width: 400px; }
    .splash-actions { display: flex; justify-content: space-between; width: min(760px, 62vw); }
    .splash-actions a { width: 164px; }
}
/* Schermi bassi (telefono in orizzontale): la pagina scorre invece di schiacciare la sfera */
@media (max-height: 539px) { .splash { height: auto; grid-template-rows: auto auto 300px auto auto; } }

/* Visite successive nella stessa sessione: niente sequenza di ingresso */
.splash-seen .splash-logo { animation: splash-float 7s ease-in-out infinite; }
.splash-seen .splash-search, .splash-seen .splash-search button, .splash-seen .splash-sphere, .splash-seen .splash-actions a { animation: none; }
.splash-seen .splash-welcome { animation: splash-shimmer 5.5s ease-in-out 1s infinite; }
.splash-seen .splash-orbits { animation-delay: 0s; animation-duration: 1s; }
@media (prefers-reduced-motion: reduce) {
    /* Variante tranquilla: restano la rotazione lenta della sfera e il cielo; niente ingressi a scatto, riflessi e scie. */
    .splash-logo, .splash-search, .splash-search button, .splash-sphere, .splash-actions a, .splash-actions a::after, .splash-welcome, .splash-words.is-sphere::before { animation: none !important; }
    .splash-sky canvas { animation-duration: 1100s; }
}
