/* =============================================================
   RADICA — stile della vetrina
   -------------------------------------------------------------
   Colori, font e misure principali sono in :root, qui sotto.
   Per cambiare un colore basta cambiarlo lì.
   ============================================================= */

/* ---------- Font: ospitati nel sito, nessuna richiesta a Google ---------- */
@font-face {
  font-family: "Bodoni Moda";
  src: url("../fonts/bodoni-moda.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bodoni Moda";
  src: url("../fonts/bodoni-moda-italic.woff2") format("woff2");
  font-weight: 400 600;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/ibm-plex-sans.woff2") format("woff2");
  font-weight: 100 700;
  font-display: swap;
}

/* ---------- Colori e misure ---------- */
:root {
  --fondo: #0e0d0c;        /* quasi nero, caldo */
  --inchiostro: #ece6da;   /* bianco sporco: titoli e pulsanti */
  --testo: #d3ccbf;        /* testo normale */
  --grigio: #9c9487;       /* etichette e dettagli (contrasto verificato) */
  --linea: #35322d;        /* linee decorative sottili */
  --linea-forte: #6b645a;  /* linee dei passaggi, bordi */

  --serif: "Bodoni Moda", "Bodoni 72", Didot, Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --margine: clamp(1.25rem, 5vw, 3.5rem);
  --larghezza: 76rem;
  --morbido: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--fondo);
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  color: var(--testo);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* grana da carta stampata, dietro al contenuto */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
a:hover { color: var(--inchiostro); }

:focus-visible {
  outline: 2px solid var(--inchiostro);
  outline-offset: 4px;
}

::selection { background: var(--inchiostro); color: var(--fondo); }

/* testo leggibile solo dai lettori di schermo */
.sr {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.salta {
  position: absolute;
  top: -10rem;
  left: var(--margine);
  z-index: 10;
  padding: .75rem 1rem;
  background: var(--inchiostro);
  color: var(--fondo);
  font: 500 .875rem/1 var(--mono);
  text-decoration: none;
}
.salta:focus { top: 1rem; }

/* ---------- Tipografia ---------- */
h1, h2, h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  color: var(--inchiostro);
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.6rem, 10.5vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: -.02em;
}
h2 {
  font-size: clamp(2.15rem, 7.6vw, 4.1rem);
  line-height: 1.06;
  letter-spacing: -.015em;
}
h3 {
  font-size: clamp(1.6rem, 5.4vw, 2rem);
  line-height: 1.15;
}
em { font-style: italic; }
/* la parte in corsivo dei titoli va sempre a capo */
h1 em, .problema h2 em { display: block; }

p { margin: 0 0 1.1em; max-width: 36rem; }
p:last-child { margin-bottom: 0; }

.etichetta {
  margin: 0;
  font: 500 .75rem/1.4 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--grigio);
}

/* ---------- Etichette agli angoli (in alto e in fondo) ---------- */
.angoli {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem var(--margine);
  font: 500 .75rem/1.3 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--grigio);
}
.angoli a { text-decoration: none; }
.angoli a:hover { text-decoration: underline; }
.angoli__segno {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.75rem;
  height: 1.75rem;
  transform: translate(-50%, -50%);
  color: var(--inchiostro);
}
.marchio { color: var(--inchiostro); }
/* nelle pagine legali, su telefono, il simbolo lascia spazio a "Torna alla vetrina" */
@media (max-width: 39.99rem) {
  .angoli--legale .angoli__segno { display: none; }
}

/* ---------- Righello tra le sezioni: linea con crocini di registro ---------- */
.righello {
  position: relative;
  height: 1px;
  max-width: calc(var(--larghezza) - 2 * var(--margine));
  margin: 0 var(--margine);
  background: var(--linea);
}
@media (min-width: 80rem) {
  .righello { margin: 0 auto; }
}
.righello::before,
.righello::after {
  content: "+";
  position: absolute;
  top: 50%;
  transform: translateY(-52%);
  font: 400 .875rem/1 var(--mono);
  color: var(--grigio);
  background: var(--fondo);
  padding: 0 .35rem;
}
.righello::before { left: -.35rem; }
.righello::after { right: -.35rem; }

/* ---------- Pulsanti ---------- */
.bottone {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 3.5rem;
  padding: .9rem 1.25rem;
  font: 500 .9375rem/1.25 var(--mono);
  letter-spacing: .01em;
  text-decoration: none;
  color: var(--fondo);
  background: var(--inchiostro);
  border: 1px solid var(--inchiostro);
  transition: background-color .2s, color .2s;
}
.bottone svg {
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
  transition: transform .3s var(--morbido);
}
.bottone:hover { background: transparent; color: var(--inchiostro); }
.bottone:hover svg { transform: translateX(4px); }

.bottone--vuoto { background: transparent; color: var(--inchiostro); }
.bottone--vuoto:hover { background: var(--inchiostro); color: var(--fondo); }
.bottone--vuoto:hover svg { transform: translate(3px, -3px); }

@media (max-width: 39.99rem) {
  .bottone { width: 100%; }
}

/* =============================================================
   HOME
   ============================================================= */

/* ---------- Hero ---------- */
.hero {
  display: grid;
  gap: 2.75rem;
  max-width: var(--larghezza);
  margin: 0 auto;
  padding: clamp(2.25rem, 9vw, 4rem) var(--margine) 3.5rem;
}
.hero h1 { margin: 1.1rem 0 1.5rem; }
.hero__sotto {
  font-size: 1.125rem;
  line-height: 1.6;
  max-width: 33rem;
  margin-bottom: 2rem;
}
.hero__albero {
  margin: 0 calc(var(--margine) * -.5);
  color: var(--inchiostro);
}
.hero__albero svg {
  width: 100%;
  height: auto;
  max-width: 40rem;
  margin: 0 auto;
}

@media (min-width: 60rem) {
  .hero {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: center;
    gap: 2rem;
    min-height: calc(100svh - 4.5rem);
    padding-top: 1rem;
    padding-bottom: 2rem;
  }
  .hero__albero { margin: 0; }
  .hero__albero svg { max-height: calc(100svh - 6rem); }
}

/* ---------- Sezioni ---------- */
.sezione {
  max-width: var(--larghezza);
  margin: 0 auto;
  padding: clamp(4.5rem, 14vw, 9rem) var(--margine);
}
.sezione h2 { margin-bottom: 2rem; }

/* ---------- Il problema ---------- */
.enfasi {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.35rem, 4.6vw, 1.7rem);
  line-height: 1.35;
  color: var(--inchiostro);
  margin-top: 2rem;
}
.raggio {
  position: relative;
  width: min(100%, 21rem);
  margin: 3.5rem auto 0;
  color: var(--inchiostro);
}
.raggio svg { width: 100%; height: auto; }
.raggio figcaption {
  margin-top: .75rem;
  text-align: center;
  font: 400 .75rem/1.4 var(--mono);
  letter-spacing: .08em;
  color: var(--grigio);
}
/* scansione che gira: parte dal centro e copre il raggio esterno */
.raggio__scan {
  position: absolute;
  left: 8.333%;
  top: 0;
  width: 83.333%;
  aspect-ratio: 1;
  margin-top: 8.333%;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(from 0deg, rgba(236, 230, 218, 0) 0deg, rgba(236, 230, 218, 0) 290deg, rgba(236, 230, 218, .13) 359deg, rgba(236, 230, 218, 0) 360deg);
  animation: gira 9s linear infinite;
}
@keyframes gira { to { transform: rotate(360deg); } }

@media (min-width: 60rem) {
  .problema {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    column-gap: 4rem;
    align-items: center;
  }
  .problema h2 { grid-column: 1 / -1; max-width: 18ch; }
  .raggio { margin: 0 0 0 auto; }
}

/* ---------- Come lavoro: tre passaggi su una traccia ---------- */
.passi {
  list-style: none;
  margin: 3rem 0 0;
  padding: 0;
}
.passo {
  position: relative;
  padding: 0 0 3.25rem 4.5rem;
}
.passo:last-child { padding-bottom: 0; }
/* la traccia verticale che collega i numeri */
.passo::before {
  content: "";
  position: absolute;
  left: 1.4375rem;
  top: 2.875rem;
  bottom: 0;
  width: 1px;
  background: var(--linea-forte);
}
.passo:last-child::before { display: none; }
.passo__num {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 2.875rem;
  height: 2.875rem;
  border: 1px solid var(--inchiostro);
  font: 500 .8125rem/1 var(--mono);
  color: var(--inchiostro);
  background: var(--fondo);
}
/* il piccolo tratto orizzontale verso il titolo */
.passo__num::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  width: 1rem;
  height: 1px;
  background: var(--linea-forte);
}
.passo h3 { margin: .35rem 0 .9rem; }
.passo p { max-width: 30rem; }

@media (min-width: 60rem) {
  .passi {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3rem;
    margin-top: 4rem;
  }
  .passo { padding: 5rem 0 0; }
  .passo::before {
    left: 2.875rem;
    right: -3rem;
    top: 1.4375rem;
    bottom: auto;
    width: auto;
    height: 1px;
  }
  .passo:last-child::before { display: block; right: 0; }
  /* il nodo finale della traccia */
  .passo:last-child::after {
    content: "";
    position: absolute;
    right: 0;
    top: calc(1.4375rem - 4px);
    width: 9px;
    height: 9px;
    border: 1px solid var(--inchiostro);
    border-radius: 50%;
    background: var(--fondo);
  }
  .passo__num::after { display: none; }
  .passo h3 { margin-top: 0; }
}

/* ---------- Chi c'è dietro ---------- */
.scheda {
  margin: 0 0 2.75rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--linea);
  border-bottom: 1px solid var(--linea);
  font: 400 .875rem/1.5 var(--mono);
  max-width: 26rem;
}
.scheda div {
  display: flex;
  align-items: baseline;
  padding: .3rem 0;
}
.scheda dt {
  display: flex;
  flex: 1;
  align-items: baseline;
  color: var(--grigio);
}
/* puntini di guida tra voce e valore */
.scheda dt::after {
  content: "";
  flex: 1;
  min-width: 1rem;
  margin: 0 .6rem;
  border-bottom: 1px dotted var(--linea-forte);
}
.scheda dd { margin: 0; color: var(--inchiostro); text-align: right; }

@media (min-width: 60rem) {
  .chi {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    column-gap: 5rem;
    align-items: start;
  }
  .chi__testa { position: sticky; top: 3rem; }
  .chi__corpo { padding-top: .75rem; }
}
.chi__corpo p { font-size: 1.125rem; }

/* ---------- Contatto finale ---------- */
.contatto h2 { max-width: 14ch; }
.contatto > p { font-size: 1.125rem; }
.bottoni {
  display: flex;
  flex-wrap: wrap;
  gap: .875rem;
  margin-top: 2.5rem;
}
.bottoni__nota {
  margin-top: 1.25rem;
  font: 400 .75rem/1.6 var(--mono);
  color: var(--grigio);
  max-width: 34rem;
}

/* ---------- Piede ---------- */
.piede {
  border-top: 1px solid var(--linea);
  margin-top: 2rem;
}
.piede__marchio {
  margin: 0;
  padding: 2.5rem var(--margine) 0;
  font: 400 clamp(5rem, 27vw, 20rem)/.8 var(--serif);
  letter-spacing: -.04em;
  color: var(--inchiostro);
  max-width: none;
  overflow: hidden;
}
.piede__dati {
  display: grid;
  gap: 1.25rem;
  padding: 2.5rem var(--margine) 1rem;
  font: 400 .8125rem/1.6 var(--mono);
  color: var(--grigio);
}
.piede__dati p { max-width: none; }
.piede__legale {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.piede__legale a {
  display: inline-block;
  padding: .5rem 0;   /* area di tocco più alta */
  color: var(--testo);
}
.piede__legale a[aria-current="page"] { color: var(--inchiostro); text-decoration: none; }
.piede .angoli { padding-top: 1.5rem; padding-bottom: 1.75rem; }

@media (min-width: 60rem) {
  .piede__dati { grid-template-columns: 1fr auto; align-items: center; }
}

/* =============================================================
   ALBERO (illustrazione della hero)
   ============================================================= */
.albero path { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.albero .tr  { stroke-width: 1.35; }
.albero .rm  { opacity: .78; }
.albero .rd  { opacity: .62; }
.albero .w0 { stroke-width: 1.2; }
.albero .w1 { stroke-width: .95; }
.albero .w2 { stroke-width: .72; }
.albero .w3 { stroke-width: .56; }
.albero .w4 { stroke-width: .46; }
.albero .gd  { stroke-width: .7; opacity: .22; stroke-linecap: butt; }
.albero .rg  { stroke-width: .8; opacity: .45; stroke-linecap: butt; }
.albero .rt  { stroke-width: .5; opacity: .3; }
.albero .via { fill: var(--fondo); stroke: currentColor; stroke-width: 1.2; }
.albero .pt  { fill: currentColor; opacity: .7; }
.albero .chip { fill: var(--fondo); stroke: currentColor; stroke-width: 1.1; }
.albero .box { stroke-width: .9; opacity: .55; }
.albero .ang { stroke-width: 1.6; stroke-linecap: square; }
.albero .ld  { stroke-width: .8; opacity: .7; }
.albero .lbl { font: 400 17px/1 var(--mono); fill: var(--grigio); }
.albero .lbl-f { fill: var(--inchiostro); }
.albero .cur { fill: var(--inchiostro); }

/* disegno progressivo all'apertura (solo se il dispositivo non chiede meno movimento) */
@media (prefers-reduced-motion: no-preference) {
  .albero [pathLength] {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: traccia 1.4s var(--morbido) forwards;
  }
  .albero .f0 [pathLength] { animation-delay: .1s; animation-duration: 1.1s; }
  .albero .f1 [pathLength] { animation-delay: .6s; }
  .albero .f2 [pathLength] { animation-delay: 1.1s; }
  .albero .f3 [pathLength] { animation-delay: 1.5s; }
  .albero .f4 [pathLength] { animation-delay: 1.9s; animation-duration: 2s; }
  .albero .compare {
    opacity: 0;
    animation: compare .8s ease forwards;
    animation-delay: 2.1s;
  }
  .albero .cur { animation: lampeggia 1.1s steps(1) infinite; }
}
@keyframes traccia { to { stroke-dashoffset: 0; } }
@keyframes compare { to { opacity: 1; } }
@keyframes lampeggia { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .raggio__scan { display: none; }
  .bottone svg { transition: none; }
}

/* =============================================================
   PAGINE LEGALI
   ============================================================= */
.legale {
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 9vw, 5rem) var(--margine) clamp(4rem, 12vw, 7rem);
}
.legale h1 {
  font-size: clamp(2.3rem, 8.5vw, 3.75rem);
  margin: 1rem 0 .75rem;
}
.legale h2 {
  font-size: clamp(1.45rem, 4.8vw, 1.8rem);
  line-height: 1.2;
  margin: 3rem 0 1rem;
  scroll-margin-top: 2rem;
}
.legale h3 {
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 500;
  margin: 1.75rem 0 .5rem;
}
.legale p, .legale li { max-width: 40rem; }
.legale ul, .legale ol { padding-left: 1.25rem; margin: 0 0 1.1em; }
.legale code { font: 400 .9em var(--mono); color: var(--inchiostro); }
.legale li { margin-bottom: .45em; }
.legale li::marker { color: var(--grigio); }
.aggiornato {
  font: 400 .8125rem/1.5 var(--mono);
  color: var(--grigio);
}
.in-breve {
  margin: 2.25rem 0 0;
  padding: 1.5rem 1.5rem 1.4rem;
  border: 1px solid var(--linea-forte);
  position: relative;
}
.in-breve .etichetta { margin-bottom: .9rem; }
.in-breve ul { margin: 0; }

/* segnaposto ancora da compilare: ben visibili finché ci sono */
.dc {
  font-family: var(--mono);
  font-size: .88em;
  color: var(--inchiostro);
  background: none;
  outline: 1px dashed var(--grigio);
  outline-offset: 1px;
  padding: 0 .3em;
}
