/* =========================================================
   INNOVA — Lista d'Istituto
   ========================================================= */
:root {
  --red: #ff2d2d;
  --red-deep: #d81414;
  --ink: #141414;
  --ink-2: #1e1e1e;
  --ink-3: #2a2a2a;
  --paper: #f6f3ee;
  --white: #ffffff;
  --muted: #9a9a9a;
  --radius: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --gutter: clamp(16px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; overflow-x: clip; }
body {
  margin: 0;
  font-family: "Outfit", system-ui, sans-serif;
  background: var(--ink);
  color: var(--white);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip; /* "clip" e non "hidden": hidden rompe position: sticky della carta */
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1; }
p { margin: 0; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }

.eyebrow {
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 18px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  transition: transform .3s var(--ease), background .3s, color .3s, box-shadow .3s;
}
.btn:hover { transform: translateY(-3px); }
.btn--red { background: var(--red); color: var(--white); box-shadow: 0 10px 30px -10px rgba(255, 45, 45, .7); }
.btn--red:hover { background: var(--red-deep); }
.btn--ghost { border: 1.5px solid rgba(255,255,255,.3); }
.btn--ghost:hover { border-color: var(--white); background: rgba(255,255,255,.06); }
.btn--white { background: var(--white); color: var(--red); }

/* ---------- Nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter);
  transition: background .4s, backdrop-filter .4s, padding .4s;
}
/* Sfondo sfocato su uno pseudo-elemento: se il backdrop-filter stesse sulla .nav,
   il menu mobile (position: fixed) resterebbe intrappolato dentro la barra. */
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(20, 20, 20, .72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0; transition: opacity .4s;
}
.nav.is-scrolled::before { opacity: 1; }
.nav.is-scrolled { padding-top: 10px; padding-bottom: 10px; }
.nav__logo img { height: 44px; width: auto; }
.nav__links { display: flex; align-items: center; gap: 32px; font-weight: 500; }
.nav__links a { position: relative; opacity: .85; transition: opacity .2s; }
.nav__links a:not(.nav__cta)::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 2px; width: 100%;
  background: var(--red); transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease);
}
.nav__links a:hover { opacity: 1; }
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__cta { background: var(--red); padding: 10px 20px; border-radius: 999px; opacity: 1 !important; }
.nav__burger {
  display: none; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer;
  position: relative; z-index: 60;
}
.nav__burger span {
  position: absolute; left: 10px; right: 10px; height: 2px; background: var(--white);
  transition: transform .35s var(--ease), top .35s var(--ease);
}
.nav__burger span:first-child { top: 17px; }
.nav__burger span:last-child { top: 25px; }
.nav__burger[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: grid; place-items: center;
  padding: 120px var(--gutter) 90px;
  overflow: hidden;
  text-align: center;
}
.hero__bg { position: absolute; inset: 0; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .45; }
.blob--1 { width: 520px; height: 520px; background: var(--red); top: -160px; left: -140px; animation: float 14s ease-in-out infinite; }
.blob--2 { width: 420px; height: 420px; background: #8a0a0a; bottom: -140px; right: -100px; animation: float 18s ease-in-out infinite reverse; }
@keyframes float { 50% { transform: translate(60px, 40px) scale(1.1); } }

.hero__inner { position: relative; max-width: 900px; display: flex; flex-direction: column; align-items: center; }
.hero__logo {
  width: min(420px, 78vw); margin: 6px 0 34px;
  filter: drop-shadow(0 20px 40px rgba(255, 45, 45, .35));
  animation: ride 5s ease-in-out infinite;
}
@keyframes ride { 50% { transform: translateY(-10px) rotate(-1.5deg); } }
.hero__title { font-size: clamp(2.8rem, 8vw, 6.4rem); font-weight: 800; letter-spacing: -.03em; line-height: .95; }
.hero__title em { font-style: normal; color: var(--red); }
.hero__lead { margin-top: 24px; max-width: 560px; font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: #c9c9c9; font-weight: 300; }
.hero__actions { margin-top: 36px; display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.hero__scroll {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid rgba(255,255,255,.4); border-radius: 20px;
}
.hero__scroll span {
  position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 2px; background: var(--white); animation: wheel 1.8s infinite;
}
@keyframes wheel { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Marquee ---------- */
.marquee { background: var(--red); overflow: hidden; padding: 18px 0; transform: rotate(-1.5deg); margin: 0 -20px; }
.marquee__track { display: flex; gap: 36px; width: max-content; animation: marquee 28s linear infinite; }
.marquee span { font-size: clamp(1.4rem, 3vw, 2.2rem); font-weight: 800; white-space: nowrap; letter-spacing: -.01em; }
.marquee i { font-style: normal; font-size: 1.4rem; align-self: center; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: clamp(90px, 12vw, 150px) 0; }
.section--light { background: var(--paper); color: var(--ink); }
.section__head { max-width: 720px; margin-bottom: clamp(44px, 6vw, 72px); }
.section__title { font-size: clamp(2.8rem, 7vw, 5.6rem); font-weight: 800; letter-spacing: -.035em; text-transform: uppercase; }
.section__lead { margin-top: 20px; font-size: 1.12rem; font-weight: 300; color: #bdbdbd; max-width: 560px; }
.section--light .section__lead { color: #555; }

/* ---------- Assemblee ---------- */
.assemblies { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 18px; }
.assembly {
  position: relative; display: flex; gap: 22px;
  padding: 26px; border-radius: var(--radius);
  background: var(--ink-2); border: 1px solid var(--ink-3);
  transition: transform .4s var(--ease), border-color .4s, background .4s;
  overflow: hidden;
}
.assembly:hover { transform: translateY(-6px); border-color: var(--red); }
.assembly__date {
  flex: none; width: 78px; height: 92px; border-radius: 16px;
  background: var(--ink); border: 1px solid var(--ink-3);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
}
.assembly__date .d { font-size: 2.1rem; font-weight: 800; }
.assembly__date .m { font-size: .9rem; font-weight: 600; text-transform: uppercase; color: var(--red); margin-top: 4px; }
.assembly__date .y { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.assembly__date .m:first-child { font-size: 1.5rem; font-weight: 800; margin-top: 0; }
.assembly__date .m:first-child + .y { margin-top: 8px; }
.assembly__body h3 { font-size: 1.35rem; font-weight: 700; margin: 10px 0 8px; letter-spacing: -.01em; }
.assembly__body p { color: #b5b5b5; font-weight: 300; font-size: .98rem; }
.assembly__meta { display: inline-block; margin-top: 14px; font-size: .82rem; color: var(--muted); }
.tag {
  display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px; background: rgba(255, 45, 45, .14); color: var(--red);
}
.assembly.is-past { opacity: .45; }
.assembly.is-past .tag::after { content: " · Svolta"; }
.assembly.is-next { background: var(--red); border-color: var(--red); }
.assembly.is-next .assembly__date { background: rgba(0,0,0,.18); border-color: transparent; }
.assembly.is-next .assembly__date .m,
.assembly.is-next .assembly__date .y,
.assembly.is-next .assembly__meta { color: rgba(255,255,255,.85); }
.assembly.is-next .assembly__body p { color: rgba(255,255,255,.92); }
.assembly.is-next .tag { background: var(--white); color: var(--red); }
.assembly.is-next .tag::after { content: " · Prossima"; }

/* Work in progress: contenuti sfocati + striscione */
.wip { position: relative; }
.wip__content { filter: blur(7px); pointer-events: none; user-select: none; }
#assemblee { overflow: hidden; }
.wip__banner {
  /* esce dal container e copre tutta la larghezza dello schermo */
  position: absolute; top: 0; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%);
  pointer-events: none; z-index: 2;
}
.wip__tape {
  /* centrata a mano: con grid il browser la allineava a sinistra perché è più larga dello schermo */
  position: absolute; top: 50%; left: 50%; margin: 0;
  display: flex; gap: 32px; white-space: nowrap;
  width: 220vw; justify-content: flex-start; overflow-x: clip;
  padding: 14px 0;
  box-shadow: 0 18px 50px -10px rgba(0,0,0,.7);
  font-size: clamp(1rem, 2.6vw, 1.8rem); font-weight: 900; letter-spacing: .04em;
}
.wip__tape--a {
  --rot: -7deg; --dir: 1;
  background: var(--red); color: var(--white);
  border-top: 3px dashed rgba(255,255,255,.55); border-bottom: 3px dashed rgba(255,255,255,.55);
}
.wip__tape--b {
  --rot: 6deg; --dir: -1;
  background: var(--white); color: var(--red);
  border-top: 3px dashed rgba(255,45,45,.55); border-bottom: 3px dashed rgba(255,45,45,.55);
}
.wip__tape span::after { content: "✦"; margin-left: 32px; opacity: .8; }

/* --- effetto 3D al passaggio del cursore (valori aggiornati da main.js) --- */
.wip__banner { perspective: 1100px; }
.wip__tape {
  position: relative; pointer-events: auto; cursor: default;
  transform: translate(-50%, -50%) rotate(calc(var(--rot) + var(--rz, 0deg))) rotateX(var(--rx, 0deg)) translateZ(var(--z, 0px));
  will-change: transform;
  transition: box-shadow .5s var(--ease), filter .5s var(--ease);
}
.wip__tape span { animation: tapeScroll 14s linear infinite; animation-direction: normal; }
.wip__tape--b span { animation-direction: reverse; }
@keyframes tapeScroll { to { transform: translateX(calc(-100% - 32px)); } }
/* riflesso di luce che segue il cursore */
.wip__tape::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background:
    radial-gradient(260px 120px at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.7), transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,.18), transparent 45%, rgba(0,0,0,.18));
  mix-blend-mode: soft-light; opacity: var(--glow, 0);
}
/* hitbox invisibile più alta della banda, così il cursore non "scivola" via subito */
.wip__tape::after {
  content: ""; position: absolute; left: 0; right: 0; top: -38px; bottom: -38px;
}
.wip__tape.is-hot::after { top: -60px; bottom: -60px; }
.wip__tape.is-hot {
  z-index: 3;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,.85), 0 0 60px -10px rgba(255,45,45,.55);
}
.wip__banner.has-hot .wip__tape:not(.is-hot) { filter: brightness(.55) saturate(.8); }
@media (prefers-reduced-motion: reduce) {
  .wip__tape span { animation: none; }
}

/* ---------- Innova Card (3D scroll) ---------- */
.cardsec { position: relative; height: 320vh; background: radial-gradient(ellipse at 70% 50%, #2a0c0c 0%, var(--ink) 60%); }
.cardsec__sticky { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; align-items: center; overflow: hidden; }
.cardsec__grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 40px; align-items: center; }
.perks { list-style: none; padding: 0; margin: 28px 0 34px; display: grid; gap: 12px; }
.perks li { display: flex; gap: 14px; align-items: baseline; color: #cfcfcf; font-weight: 300; }
.perks b { color: var(--red); font-weight: 800; font-size: 1.15rem; min-width: 62px; }

.cardsec__stage { perspective: 1600px; display: grid; place-items: center; position: relative; }
.card3d {
  position: relative; width: min(560px, 100%); aspect-ratio: 869 / 520;
  transform-style: preserve-3d; will-change: transform;
  container-type: inline-size;
}
.card3d__face {
  position: absolute; inset: 0; border-radius: 6.5cqw;
  background: var(--red); overflow: hidden;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.card3d__back { transform: rotateY(180deg); }
.card3d__shine {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,.75) var(--shine, 45%), transparent calc(var(--shine, 45%) + 22%));
}
.card3d__shadow {
  position: absolute; bottom: -12%; left: 15%; right: 15%; height: 30px;
  background: radial-gradient(ellipse, rgba(0,0,0,.65), transparent 70%); filter: blur(8px);
  transform: translateZ(-1px);
}

/* front */
.cf__top { position: absolute; top: 6.5cqw; left: 4.5cqw; font-size: 2.1cqw; font-weight: 300; opacity: .95; }
.cf__star { position: absolute; top: 4cqw; right: 3cqw; width: 9cqw; height: 9cqw; }
.cf__logo { position: absolute; left: -.5cqw; bottom: -1cqw; width: 77cqw; }
.cf__label { position: absolute; right: 4.5cqw; bottom: 4.2cqw; font-size: 2.8cqw; font-weight: 700; letter-spacing: .01em; }

/* back */
.cb__top { position: absolute; top: 4.4cqw; left: 2.7cqw; font-size: 1.45cqw; font-weight: 400; }
.cb__stripe { position: absolute; top: 11cqw; left: 0; right: 0; height: 9cqw; background: var(--white); }
.cb__main { position: absolute; top: 25cqw; left: 4.5cqw; right: 5cqw; display: flex; align-items: flex-start; }
.cb__title { font-size: 6cqw; font-weight: 700; letter-spacing: -.01em; line-height: 1; }
.cb__url { font-size: 4.2cqw; font-weight: 200; margin-top: .6cqw; }
.cb__arrow { width: 14cqw; margin: 1.5cqw 1cqw 0 1.5cqw; flex: none; }
.cb__qr { width: 14cqw; margin-left: auto; margin-top: -1cqw; image-rendering: pixelated; }
.cb__bottom { position: absolute; left: 3cqw; right: 4.5cqw; bottom: 3.6cqw; display: flex; align-items: flex-end; gap: 6cqw; }
.cb__logo { width: 11.5cqw; }
.cb__info { font-size: 1.32cqw; font-weight: 300; flex: 1; padding-bottom: .4cqw; }
.cb__label { position: static; }

.cardsec__progress { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 34px; height: 2px; background: var(--ink-3); border-radius: 2px; max-width: 1144px; margin: 0 auto; }
.cardsec__progress span { display: block; height: 100%; width: 0; background: var(--red); border-radius: 2px; }

/* ---------- Collaborazioni ---------- */
.partners-sec { padding-top: clamp(60px, 8vw, 100px); }
.partners { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.partner {
  padding: 22px; border-radius: var(--radius); background: var(--ink-2); border: 1px solid var(--ink-3);
  transition: transform .4s var(--ease), border-color .4s;
}
.partner:hover { transform: translateY(-6px); border-color: var(--red); }
.partner__logo {
  position: relative; aspect-ratio: 1; border-radius: 16px; background: var(--white); overflow: hidden;
  display: grid; place-items: center;
}
.partner__logo img { width: 78%; height: 78%; object-fit: contain; }
.partner__mono {
  display: none; padding: 12px; text-align: center; color: var(--white);
  font-size: clamp(1.1rem, 2.2vw, 1.6rem); font-weight: 900; text-transform: uppercase; letter-spacing: -.02em; line-height: 1;
}
.partner__logo.is-missing { background: linear-gradient(140deg, var(--red), var(--red-deep)); }
.partner__logo.is-missing img { display: none; }
.partner__logo.is-missing .partner__mono { display: block; }
.partner h3 { margin-top: 16px; font-size: 1.15rem; font-weight: 700; }
.partner p { margin-top: 6px; color: #b5b5b5; font-weight: 300; font-size: .9rem; }
.partner p b { color: var(--red); font-weight: 800; }
.partner--featured { border-color: var(--red); }

/* ---------- Candidati ---------- */
.candidates { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px 20px; }
.cand { cursor: default; }
.cand__photo {
  position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: #ddd;
}
.cand__photo img {
  width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05);
  transition: filter .6s var(--ease), transform .8s var(--ease);
}
.cand:hover .cand__photo img { filter: grayscale(0); transform: scale(1.06); }
.cand__num {
  position: absolute; top: 14px; left: 14px; z-index: 1;
  width: 38px; height: 38px; border-radius: 50%; background: var(--red); color: var(--white);
  display: grid; place-items: center; font-weight: 800;
}
.cand h3 { margin-top: 16px; font-size: 1.3rem; font-weight: 700; letter-spacing: -.01em; }
.cand__class { margin-top: 4px; color: #666; font-size: .95rem; }

/* ---------- Punti ---------- */
.points { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.point {
  position: relative; padding: 30px 26px 32px; border-radius: var(--radius);
  background: var(--ink-2); border: 1px solid var(--ink-3); overflow: hidden;
  transition: transform .4s var(--ease), background .4s;
}
.point::before {
  content: ""; position: absolute; inset: 0; background: var(--red);
  transform: translateY(101%); transition: transform .5s var(--ease); z-index: 0;
}
.point > * { position: relative; z-index: 1; }
.point:hover { transform: translateY(-6px); }
.point:hover::before { transform: translateY(0); }
.point__n { display: block; font-size: 3.4rem; font-weight: 900; color: var(--red); letter-spacing: -.04em; line-height: 1; transition: color .4s; }
.point:hover .point__n { color: var(--white); }
.point h3 { margin: 26px 0 10px; font-size: 1.3rem; font-weight: 700; }
.point p { color: #b5b5b5; font-weight: 300; font-size: .97rem; transition: color .4s; }
.point:hover p { color: rgba(255,255,255,.92); }

/* ---------- Vota / Footer ---------- */
.vota { background: var(--red); padding: clamp(90px, 12vw, 140px) 0; text-align: center; overflow: hidden; }
.vota__inner { display: flex; flex-direction: column; align-items: center; }
.vota__logo { width: min(260px, 60vw); margin-bottom: 30px; }
.vota h2 { font-size: clamp(2.6rem, 7vw, 5.4rem); font-weight: 800; letter-spacing: -.035em; line-height: .95; }
.vota p { font-size: 1.2rem; margin: 18px 0 34px; font-weight: 300; }

.footer { padding: 40px 0; border-top: 1px solid var(--ink-3); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; color: var(--muted); font-size: .9rem; }
.footer__logo { height: 36px; width: auto; }
.footer a:hover { color: var(--white); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .candidates { grid-template-columns: repeat(3, 1fr); }
  .points { grid-template-columns: repeat(2, 1fr); }
  .partners { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 680px) {
  .partners { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .partner { padding: 14px; }
}

@media (max-width: 820px) {
  .nav__burger { display: block; }
  .nav__links {
    position: fixed; inset: 0; z-index: 55;
    flex-direction: column; justify-content: center; gap: 28px;
    background: rgba(20,20,20,.97); font-size: 1.6rem; font-weight: 700;
    opacity: 0; pointer-events: none; transition: opacity .35s;
  }
  .nav__links.is-open { opacity: 1; pointer-events: auto; }
  .nav__logo img { height: 36px; }

  .cardsec { height: 260vh; }
  .cardsec__grid { grid-template-columns: 1fr; gap: 28px; text-align: center; }
  .cardsec__text .section__title br { display: none; }
  .cardsec__text .section__lead { margin-left: auto; margin-right: auto; font-size: 1rem; margin-top: 12px; }
  .cardsec__text .eyebrow { margin-bottom: 10px; }
  .cardsec__text .section__title { font-size: clamp(2.4rem, 11vw, 3.4rem); }
  .perks, .cardsec__text .btn { display: none; }
  .card3d { width: min(440px, 88vw); }

  .candidates { grid-template-columns: repeat(2, 1fr); gap: 22px 14px; }
}

@media (max-width: 520px) {
  .points { grid-template-columns: 1fr; }
  .assembly { padding: 20px; gap: 16px; }
  .assembly__date { width: 66px; height: 80px; }
  .cand h3 { font-size: 1.08rem; }
  .cand__class { font-size: .85rem; }
  .footer__inner { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
