:root {
  --navy-950: #061022;
  --navy-900: #0a1730;
  --navy-800: #112449;
  --ink: #121a2c;
  --muted: #5f6b80;
  --paper: #f7f5f1;
  --white: #ffffff;
  --red: #dd334b;
  --red-dark: #b91f38;
  --coral: #ff765d;
  --line: #d9dee7;
  --soft: #eef1f6;
  --max: 1180px;
  --radius: 18px;
  --shadow: 0 24px 65px rgba(6, 16, 34, .15);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
a { color: var(--red-dark); text-underline-offset: .18em; }
a:hover { color: var(--red); }
img { display: block; max-width: 100%; }
button, input { font: inherit; }

.salta {
  position: fixed; left: 1rem; top: -6rem; z-index: 1000;
  padding: .7rem 1rem; color: var(--white); background: var(--red);
}
.salta:focus { top: 1rem; }
.gabbia { width: min(calc(100% - 2.5rem), var(--max)); margin-inline: auto; }

.testata {
  position: sticky; top: 0; z-index: 50;
  color: var(--white); background: rgba(6, 16, 34, .96);
  border-bottom: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(14px);
}
.testata .gabbia { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.marchio { color: var(--white); font-weight: 800; letter-spacing: -.03em; text-decoration: none; font-size: 1.12rem; }
.marchio span { color: var(--red); }
.nav { display: flex; align-items: center; gap: 1.45rem; font-size: .88rem; font-weight: 700; }
.nav a { color: #d8deeb; text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--white); }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px var(--red); }
.menu { display: none; border: 1px solid rgba(255,255,255,.3); color: white; background: transparent; border-radius: 8px; padding: .45rem .7rem; }

.hero {
  overflow: hidden; color: var(--white);
  background:
    radial-gradient(circle at 82% 20%, rgba(221,51,75,.22), transparent 28rem),
    linear-gradient(135deg, var(--navy-950), var(--navy-800));
}
.hero .gabbia { min-height: 690px; display: grid; grid-template-columns: 1.35fr .65fr; align-items: center; gap: 5rem; padding-block: 5rem; }
.occhiello { color: var(--red); font-size: .78rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.hero h1 { margin: .65rem 0 1.25rem; max-width: 760px; font-size: clamp(3.2rem, 7vw, 6.7rem); line-height: .92; letter-spacing: -.065em; }
.hero .sommario { max-width: 720px; margin: 0; color: #cbd4e5; font-size: clamp(1.15rem, 2vw, 1.45rem); }
.equazione { margin: 2.1rem 0; color: #ff6276; font: italic 1.35rem Georgia, serif; letter-spacing: .04em; }
.azioni { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .72rem 1.15rem; border: 1px solid transparent; border-radius: 8px; font-weight: 800; text-decoration: none; }
.btn.primario { color: var(--white); background: var(--red); }
.btn.primario:hover { color: var(--white); background: var(--coral); }
.btn.secondario { color: var(--white); border-color: rgba(255,255,255,.38); }
.btn.secondario:hover { border-color: var(--white); }
.libro {
  position: relative;
  width: min(100%, 315px);
  margin: 0;
  justify-self: end;
  filter: drop-shadow(0 30px 38px rgba(0,0,0,.4));
}
.libro img {
  width: 100%;
  height: auto;
  aspect-ratio: 900 / 1358;
  object-fit: contain;
  border-radius: 3px 9px 9px 3px;
}

.fascia { color: var(--white); background: var(--red); }
.fascia .gabbia { display: grid; grid-template-columns: repeat(3, 1fr); }
.metrica { padding: 1.5rem 2rem; border-right: 1px solid rgba(255,255,255,.25); }
.metrica:first-child { padding-left: 0; }
.metrica:last-child { border: 0; }
.metrica strong { display: block; font-size: 1.55rem; line-height: 1.2; }
.metrica span { font-size: .86rem; opacity: .88; }

main > .gabbia, .pagina .gabbia { padding-block: 5rem; }
.blocco { margin-bottom: 6rem; }
.blocco:last-child { margin-bottom: 0; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.035em; }
h2 { margin: 0 0 1rem; font-size: clamp(2rem, 4vw, 3.1rem); }
h3 { margin: 0 0 .65rem; font-size: 1.25rem; }
.lead { max-width: 820px; color: var(--muted); font-size: 1.16rem; }
.griglia { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-top: 2rem; }
.scheda { padding: 1.6rem; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.68); }
.scheda p { margin-bottom: 0; color: var(--muted); }
.scheda .num { color: var(--red); font-size: 2.4rem; font-weight: 900; line-height: 1; }
.etichetta { display: inline-block; margin-bottom: .8rem; padding: .22rem .58rem; border-radius: 999px; color: var(--red-dark); background: #fde8eb; font-size: .76rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }

.tesi { display: grid; grid-template-columns: .8fr 1.2fr; gap: 3rem; align-items: start; }
.tesi blockquote { margin: 0; padding-left: 1.25rem; border-left: 5px solid var(--red); font: 1.6rem/1.4 Georgia, serif; }
.percorso { counter-reset: fase; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 2rem; padding: 0; list-style: none; }
.percorso li { counter-increment: fase; position: relative; min-height: 160px; padding: 1.5rem 1.5rem 1.5rem 5rem; border-top: 1px solid var(--line); background: rgba(255,255,255,.4); }
.percorso li::before { content: counter(fase, decimal-leading-zero); position: absolute; left: 1.4rem; top: 1.35rem; color: var(--red); font-size: 1.45rem; font-weight: 900; }
.percorso strong { display: block; margin-bottom: .4rem; }
.percorso span { color: var(--muted); }

.pagina-intro { color: var(--white); background: linear-gradient(130deg, var(--navy-950), var(--navy-800)); }
.pagina-intro .gabbia { padding-block: 5rem; }
.pagina-intro h1 { max-width: 900px; margin: .6rem 0 1rem; font-size: clamp(2.7rem, 6vw, 5rem); }
.pagina-intro p { max-width: 800px; color: #c8d1e1; font-size: 1.18rem; }

.controlli { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1.5rem 0 2rem; }
.filtro { padding: .5rem .8rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: white; cursor: pointer; }
.filtro[aria-pressed="true"] { color: white; background: var(--red); border-color: var(--red); }
.fonte-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.fonte { padding: 1.4rem; border: 1px solid var(--line); border-radius: 14px; background: white; }
.fonte[hidden] { display: none; }
.fonte header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.fonte h3 { font-size: 1.08rem; }
.fonte .area { color: var(--red-dark); font-size: .72rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.fonte p { margin: .45rem 0 .8rem; color: var(--muted); font-size: .94rem; }
.fonte a { font-weight: 750; }

.calendario-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.calendario-card { display: flex; flex-direction: column; min-height: 245px; padding: 1.45rem; color: var(--white); border-radius: var(--radius); background: var(--navy-900); }
.calendario-card p { color: #cbd4e5; }
.calendario-card a { margin-top: auto; color: #ff8191; font-weight: 800; }
.protocollo { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { padding: .9rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--navy-900); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; }
.nota { margin: 2rem 0; padding: 1.3rem 1.5rem; border-left: 5px solid var(--red); background: #fff; }
.nota p:last-child { margin-bottom: 0; }
.documento { max-width: 850px; }
.documento h2 { margin-top: 3rem; font-size: 1.65rem; }
.documento h3 { margin-top: 2rem; }
.documento li { margin-bottom: .45rem; }

.piede { color: #bdc7d9; background: var(--navy-950); }
.piede .gabbia { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; padding-block: 3.5rem; }
.piede h2, .piede h3 { color: white; font-size: 1rem; }
.piede p, .piede li { font-size: .86rem; }
.piede ul { margin: 0; padding: 0; list-style: none; }
.piede a { color: #dbe2ee; }
.piede-basso { padding: 1rem 0; border-top: 1px solid rgba(255,255,255,.12); font-size: .78rem; }

.cookie {
  position: fixed; z-index: 100; right: 1rem; bottom: 1rem; width: min(520px, calc(100% - 2rem));
  padding: 1.25rem; color: var(--white); border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px; background: var(--navy-900); box-shadow: var(--shadow);
}
.cookie[hidden] { display: none; }
.cookie p { margin: 0 0 .9rem; color: #d2dae8; font-size: .9rem; }
.cookie .azioni { margin: 0; }
.cookie button { min-height: 42px; padding: .5rem .8rem; border-radius: 7px; border: 1px solid rgba(255,255,255,.3); cursor: pointer; }
.cookie .accetta { color: white; background: var(--red); border-color: var(--red); }
.cookie .secondo { color: white; background: transparent; }
dialog { width: min(620px, calc(100% - 2rem)); padding: 0; border: 0; border-radius: 16px; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(6,16,34,.72); }
.dialogo-corpo { padding: 1.5rem; }
.opzione { display: grid; grid-template-columns: 1fr auto; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.opzione p { margin: .2rem 0 0; color: var(--muted); font-size: .9rem; }
.link-bottone { padding: 0; color: inherit; border: 0; background: none; text-decoration: underline; cursor: pointer; }

@media (max-width: 900px) {
  .menu { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 74px; padding: 1rem 1.25rem 1.5rem; flex-direction: column; align-items: stretch; background: var(--navy-950); }
  .nav.aperta { display: flex; }
  .hero .gabbia { grid-template-columns: 1fr; gap: 2.5rem; min-height: auto; }
  .libro { width: min(100%, 250px); justify-self: start; }
  .griglia, .calendario-grid { grid-template-columns: 1fr 1fr; }
  .tesi { grid-template-columns: 1fr; }
  .piede .gabbia { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .gabbia { width: min(calc(100% - 1.5rem), var(--max)); }
  .hero .gabbia, main > .gabbia, .pagina .gabbia { padding-block: 3.3rem; }
  .hero h1 { font-size: 3.2rem; }
  .fascia .gabbia, .griglia, .fonte-grid, .calendario-grid, .percorso, .piede .gabbia { grid-template-columns: 1fr; }
  .metrica { padding: 1rem 0; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.25); }
  .libro { width: min(100%, 215px); }
  .blocco { margin-bottom: 4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .testata, .piede, .cookie, .menu, .azioni { display: none !important; }
  body { color: #000; background: #fff; }
  a { color: #000; }
}
