/* Intro NowWhat: prima sezione della home, alta quanto lo schermo; il logo animato resta lì */
:root {
  --nw-ink: #141b1f;
  --nw-carta: #fafaf7;
  --nw-notte: #0b1012;
  --nw-verde: #2fd99a;
  --nw-logo-w: min(86vw, 1100px);
}

.intro {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--nw-notte);
}
/* con il giochino sotto, il logo sale nella parte alta */
.intro:has(.gioco) { justify-content: flex-start; }
.intro:has(.gioco) .intro-logo { margin-top: clamp(40px, 8vh, 120px); }

.intro-logo {
  width: var(--nw-logo-w);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.intro-stage {
  width: 100%;
  height: auto;
  aspect-ratio: 2100 / 630;
  overflow: visible;
  display: block;
}

.intro-payoff {
  margin: 0;
  margin-top: calc(var(--nw-logo-w) * -0.035);
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: calc(var(--nw-logo-w) * 0.031);
  letter-spacing: 0.16em;
  white-space: nowrap;
  text-align: center;
}
.intro-payoff span { display: inline-block; opacity: 0; }
.intro-payoff .leggero { font-weight: 300; }
.intro-payoff .deciso { font-weight: 700; }

/* elementi che compaiono dopo il payoff (l'intro li rivela in ordine) */
.intro [data-dopo] { opacity: 0; visibility: hidden; }

/* testo e contatti della pagina segnaposto */
.intro-arrivo {
  margin-top: clamp(40px, 7vh, 80px);
  text-align: center;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.5;
}
.intro-arrivo p { margin: 0; font-weight: 300; text-wrap: balance; }
.intro-arrivo p + p { margin-top: 6px; }

/* giochino: puntini e sinapsi (assets/gioco.js) */
.gioco {
  position: relative;
  flex: 1 1 auto;
  align-self: stretch;
  min-height: 200px;
  margin-top: 8px;
}
.gioco canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.gioco-suggerimento {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  margin: 0;
  text-align: center;
  font: 300 13px/1.4 'Montserrat', system-ui, sans-serif;
  letter-spacing: 0.16em;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}
.gioco-suggerimento.attivo { opacity: 0.55; }
.gioco-suggerimento.nascosto { opacity: 0; }

/* footer della pagina segnaposto, in fondo alla prima schermata */
.piede {
  align-self: stretch;
  padding: 14px 16px 18px;
  text-align: center;
  font: 300 14px/1.5 'Montserrat', system-ui, sans-serif;
}
.piede p { margin: 0; }
.piede a {
  color: var(--nw-accento, #0b7a55);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid currentColor;
}
.piede a:hover { border-bottom-color: transparent; }
.piede a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

/* interruttori in alto a destra: sfondo chiaro/scuro e lingua */
.comandi {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  display: flex;
  gap: 10px;
}
.scelta {
  display: flex;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
}
.scelta button {
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  opacity: 0.55;
  font: 500 12px/1 'Montserrat', system-ui, sans-serif;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}
.scelta button:hover { opacity: 0.9; }
.scelta button[aria-pressed="true"] {
  opacity: 1;
  color: var(--nw-accento, #0b7a55);
  background: color-mix(in srgb, var(--nw-accento, #0b7a55) 14%, transparent);
  cursor: default;
}
.scelta button:focus-visible { outline: 2px solid var(--nw-accento, #0b7a55); outline-offset: 2px; }
.scelta svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.scelta svg circle, .scelta svg path[d^="M13.2"] { fill: currentColor; stroke: none; }

/* cambio morbido quando si usa l'interruttore del tema */
html.nw-cambio .intro,
html.nw-cambio .intro *,
html.nw-cambio body { transition: background-color 0.45s ease, color 0.45s ease, fill 0.45s ease, border-color 0.45s ease; }

/* invito a scorrere: il chevron del logo, ruotato verso il basso */
.intro-giu {
  position: absolute;
  bottom: 24px;
  left: 50%;
  translate: -50% 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
}
.intro-giu svg { width: 22px; height: 22px; animation: nw-giu 2s ease-in-out infinite; }
.intro-giu:focus-visible { outline: 2px solid var(--nw-verde); outline-offset: 3px; }
@keyframes nw-giu { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

@media (max-width: 600px) {
  :root { --nw-logo-w: 92vw; }
}
@media (prefers-reduced-motion: reduce) {
  .intro-giu svg { animation: none; }
}
