/* Home virtualcode.ai — strumentazione e vetro.
   Le superfici principali (apertura, schede, blocco dati) sono pannelli di vetro
   appoggiati sopra la grafica generata: restano scure in entrambi i temi, perché
   è l'immagine sotto a decidere. Il resto della pagina segue il tema del sistema.
   Il velo del titolo è dimensionato sul p95 di luminanza della zona (112 → >10:1). */

:root {
  --inchiostro: #13181F;
  --ground:     #EEF1F4;
  --superficie: #FFFFFF;
  --neutro:     #7B746D;
  --filo:       #D8DDE3;
  --accento:    #FF6B12;
  --ombra:      0 1px 2px rgba(19, 24, 31, .05), 0 18px 40px -26px rgba(19, 24, 31, .45);
  --ombra-alta: 0 2px 4px rgba(19, 24, 31, .08), 0 34px 60px -30px rgba(19, 24, 31, .55);

  /* colori dei pannelli di vetro: fissi, l'immagine sotto è scura in ogni tema */
  --vetro-fondo:  rgba(13, 18, 25, .52);
  --vetro-bordo:  rgba(237, 240, 243, .16);
  --vetro-testo:  #EDF0F3;
  --vetro-tenue:  #A8AEB6;
  --cupola-fondo: #0C1016;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --testo:   "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --inchiostro: #EDF0F3;
    --ground:     #0C1016;
    --superficie: #151B23;
    --neutro:     #99918A;
    --filo:       #262E38;
    --accento:    #FF8338;
    --ombra:      0 1px 2px rgba(0, 0, 0, .55), 0 18px 44px -28px rgba(0, 0, 0, .95);
    --ombra-alta: 0 2px 6px rgba(0, 0, 0, .6), 0 36px 64px -30px rgba(0, 0, 0, 1);
    --vetro-fondo: rgba(10, 14, 20, .58);
  }
}
:root[data-theme="dark"] {
  --inchiostro: #EDF0F3;
  --ground:     #0C1016;
  --superficie: #151B23;
  --neutro:     #99918A;
  --filo:       #262E38;
  --accento:    #FF8338;
  --ombra:      0 1px 2px rgba(0, 0, 0, .55), 0 18px 44px -28px rgba(0, 0, 0, .95);
  --ombra-alta: 0 2px 6px rgba(0, 0, 0, .6), 0 36px 64px -30px rgba(0, 0, 0, 1);
  --vetro-fondo: rgba(10, 14, 20, .58);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--inchiostro);
  font-family: var(--testo);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

main {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 24px 72px;
  display: flex;
  flex-direction: column;
  gap: 92px;
}

/* ---- il vetro, una volta per tutte ----
   Dentro un pannello i token di testo diventano chiari: così tutte le regole
   figlie (descrizioni, letture, fili) funzionano senza riscriverle. */

.vetro {
  --inchiostro: var(--vetro-testo);
  --neutro: var(--vetro-tenue);
  --filo: var(--vetro-bordo);
  position: relative;
  z-index: 2;
  background: var(--vetro-fondo);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  border-top: 1px solid var(--vetro-bordo);
  color: var(--vetro-testo);
}

@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .vetro { background: rgba(10, 14, 20, .90); }
}

/* Il bagliore segue il puntatore (--mx/--my li scrive lo script) e sta SOTTO il
   vetro: illumina l'immagine, non il testo che ci sta sopra. */
.scheda::after, .dati::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s ease;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%),
              color-mix(in srgb, var(--accento) 20%, transparent), transparent 62%);
}

.scheda:hover::after, .dati:hover::after { opacity: 1; }

/* ---- barra in alto ---- */

.testa {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  border-bottom: 1px solid transparent;
  transition: background-color .3s ease, border-color .3s ease, backdrop-filter .3s ease;
}

.dentroTesta {
  max-width: 1060px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* finché sta sopra l'apertura: nessun fondo, colori chiari */
.testa .marchio { color: var(--vetro-testo); }
.testa nav a { color: var(--vetro-tenue); }

/* appena si scorre: vetro, e i colori passano a quelli del tema */
.testa.staccata {
  background: color-mix(in srgb, var(--superficie) 70%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom-color: var(--filo);
}

.testa.staccata .marchio { color: var(--inchiostro); }
.testa.staccata nav a { color: var(--neutro); }
.testa.staccata nav a:hover { color: var(--inchiostro); }


.marchio {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.01em;
}

.marchio svg { width: 30px; height: 30px; display: block; overflow: visible;
                transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.marchio svg path { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.marchio svg .anello { stroke: currentColor; transition: stroke .3s ease; }
.marchio svg .acceso, .marchio svg .vi { stroke: var(--accento); }
/* al passaggio il marchio si chiude su sé stesso di poco, come un anello che si completa */
.marchio:hover svg { transform: rotate(-8deg) scale(1.07); }

.testa nav {
  display: flex;
  gap: 26px;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 500;
}

.testa nav a {
  position: relative;
  text-decoration: none;
  padding-bottom: 4px;
  transition: color .25s ease;
}

/* il filo arancio cresce da sinistra */
.testa nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  width: 0;
  background: var(--accento);
  transition: width .3s cubic-bezier(.2, .8, .2, 1);
}

.testa nav a:hover { color: var(--vetro-testo); }
.testa nav a:hover::after { width: 100%; }

/* ---- cupola: l'apertura sopra la grafica ---- */

.cupola {
  position: relative;
  isolation: isolate;
  background: var(--cupola-fondo) var(--sfondo) no-repeat right center / cover;
  color: var(--vetro-testo);
  padding-bottom: 64px;
  margin-bottom: 88px;
  overflow: hidden;
}

/* il velo: denso a sinistra dove sta il testo, quasi nullo a destra sulla curva */
.cupola::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(100deg, rgba(12, 16, 22, .94) 0%, rgba(12, 16, 22, .82) 38%, rgba(12, 16, 22, .30) 72%, rgba(12, 16, 22, .12) 100%),
    linear-gradient(to bottom, rgba(12, 16, 22, .62) 0%, rgba(12, 16, 22, 0) 30%);
}

.cupola::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 110px;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(12, 16, 22, 0), var(--ground));
}

.apertura {
  max-width: 1060px;
  margin: 0 auto;
  padding: 168px 24px 0;
}

.occhiello {
  margin: 0 0 20px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--vetro-tenue);
}

.apertura h1 {
  margin: 0;
  max-width: 17ch;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 6.4vw, 4.3rem);
  line-height: 1.02;
  letter-spacing: -.03em;
  text-wrap: balance;
}

.apertura h1 em {
  font-style: normal;
  font-weight: 600;
  color: var(--accento);
}

.sommario {
  max-width: 54ch;
  margin: 28px 0 0;
  font-size: 1.1rem;
  color: #C9CED5;
}

/* le letture dell'apertura: pastiglie di vetro */
.strisciaDati {
  margin-top: 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.strisciaDati span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 8px 15px;
  border-radius: 999px;
  color: var(--vetro-tenue);
  background: rgba(237, 240, 243, .07);
  border: 1px solid rgba(237, 240, 243, .14);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), border-color .25s ease, background-color .25s ease;
}

.strisciaDati span:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accento) 65%, transparent);
  background: rgba(237, 240, 243, .11);
}

.strisciaDati b {
  font-weight: 500;
  font-size: 19px;
  color: var(--vetro-testo);
}

/* ---- sezioni ---- */

.titoloSezione {
  margin: 0 0 26px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--neutro);
}

.griglia {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(282px, 1fr));
  gap: 22px;
  align-items: stretch;
}

/* ---- scheda app: grafica sotto, vetro sopra ---- */

.scheda {
  position: relative;
  isolation: isolate;
  min-height: 470px;
  border-radius: 7px;
  overflow: hidden;
  background: var(--cupola-fondo);
  border: 1px solid var(--filo);
  box-shadow: var(--ombra);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform .4s cubic-bezier(.2, .8, .2, 1), box-shadow .4s ease, border-color .4s ease;
}

.ritratto {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform .7s cubic-bezier(.2, .8, .2, 1);
}

.scheda:hover {
  transform: translateY(-7px);
  box-shadow: var(--ombra-alta);
  border-color: color-mix(in srgb, var(--accento) 45%, var(--filo));
}

.scheda:hover .ritratto { transform: scale(1.07); }

.corpoScheda {
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.scheda .cosa {
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accento);
}

.scheda h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.85rem;
  letter-spacing: -.022em;
}

.scheda header { margin-bottom: -4px; }

.descrizione {
  margin: 0;
  color: color-mix(in srgb, var(--inchiostro) 86%, var(--neutro));
}

.letture {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  padding: 14px 0;
  border-top: 1px solid var(--filo);
  border-bottom: 1px solid var(--filo);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.letture div { display: flex; flex-direction: column; gap: 1px; }
.letture dt { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--neutro); }
.letture dd { margin: 0; font-size: 15px; font-weight: 500; }

.scheda footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--display);
  font-size: 13px;
}

.stato {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--neutro);
}

.stato::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--neutro);
}

.stato.acceso { color: var(--inchiostro); }
.stato.acceso::before {
  background: var(--accento);
  border-color: var(--accento);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accento) 24%, transparent);
}

.scheda footer a {
  position: relative;
  color: var(--neutro);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--filo);
  transition: color .25s ease, border-color .25s ease;
}

.scheda footer a:hover { color: var(--inchiostro); border-bottom-color: var(--accento); }

/* ---- come si parlano ---- */

.catena {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  counter-reset: passo;
}

.catena p {
  counter-increment: passo;
  margin: 0;
  padding: 22px 26px 26px 0;
  border-top: 2px solid var(--filo);
  font-size: 1.05rem;
  transition: border-color .3s ease;
}

.catena p:first-child { border-top-color: var(--accento); }
.catena p:hover { border-top-color: var(--accento); }

.catena p::before {
  content: counter(passo, decimal-leading-zero);
  display: block;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--neutro);
  transition: color .3s ease;
}

.catena p:hover::before { color: var(--accento); }
.catena b { font-family: var(--display); font-weight: 700; }

.incrocio .nota {
  margin: 26px 0 0;
  max-width: 62ch;
  color: var(--neutro);
  font-size: .98rem;
}

/* ---- i tuoi dati: grafica specchiata sotto, vetro sopra ---- */

.dati {
  position: relative;
  isolation: isolate;
  border-radius: 7px;
  overflow: hidden;
  background: var(--cupola-fondo) var(--sfondo) no-repeat center / cover;
  border: 1px solid var(--filo);
  box-shadow: var(--ombra);
}

.dentroDati {
  padding: 46px 38px 42px;
  border-top: none;
}

.dueColonne {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 26px 44px;
}

.dueColonne p { margin: 0; max-width: 56ch; }

.azioni {
  margin: 36px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.bottone {
  position: relative;
  overflow: hidden;
  display: inline-block;
  padding: 12px 22px;
  border-radius: 4px;
  background: var(--accento);
  color: #13181F;
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s ease, background-color .25s ease, border-color .25s ease;
}

.bottone:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px -10px color-mix(in srgb, var(--accento) 70%, transparent);
}

.bottone.chiaro {
  background: rgba(237, 240, 243, .06);
  color: var(--vetro-testo);
  border: 1px solid rgba(237, 240, 243, .28);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-family: var(--mono);
  font-weight: 400;
}

.bottone.chiaro:hover {
  border-color: var(--accento);
  background: rgba(237, 240, 243, .10);
  box-shadow: none;
}

/* ---- piede ---- */

.piede {
  border-top: 1px solid var(--filo);
  max-width: 1060px;
  margin: 0 auto;
  padding: 24px 24px 44px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 20px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--neutro);
}

.piede p { margin: 0; display: inline-flex; align-items: center; gap: 9px; }
.piede a { color: inherit; transition: color .25s ease; }
.piede a:hover { color: var(--accento); }
.piede .marchio { color: var(--neutro); }
.piede .marchio.piccolo svg { width: 20px; height: 20px; }
.piede .marchio.piccolo svg path { stroke-width: 2.8; }

/* ---- accessibilità ---- */

a:focus-visible, .bottone:focus-visible {
  outline: 2px solid var(--accento);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .scheda:hover { transform: none; }
  .scheda:hover .ritratto, .marchio:hover svg { transform: none; }
  .strisciaDati span:hover, .bottone:hover { transform: none; }
  .scheda::after, .dati::after { display: none; }
}

@media (max-width: 620px) {
  .cupola { background-position: 70% center; margin-bottom: 64px; padding-bottom: 48px; }
  .cupola::before { background: linear-gradient(to bottom, rgba(12, 16, 22, .84) 0%, rgba(12, 16, 22, .88) 55%, rgba(12, 16, 22, .94) 100%); }
  .apertura { padding-top: 128px; }
  main { gap: 68px; padding-bottom: 48px; }
  .scheda { min-height: 430px; }
  .dentroDati { padding: 32px 22px 30px; }
  .catena p { padding-right: 0; }
}
