/* =========================================================
   MINCIO — INTRO (satellite loading)
   Solo intro: immagini + coordinate, poi linea da destra a sinistra.
   ========================================================= */

:root {
  --ground: #f6f5f1;   /* sfondo off-white */
  --line: #fff3f3;     /* colore linea MINCIO */

  /* Bounding box del contenuto nel frame Figma (solo tile) */
  --stage-w: 2853px;
  --stage-h: 737px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
html, body {
  margin: 0;
  padding: 0;
  background: #0e1310;                 /* scuro: evita "strisce bianche" nell'overscroll iOS */
  overscroll-behavior: none;           /* niente rimbalzo che scopre aree bianche su iOS */
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.is-loading { overflow: hidden; height: 100%; }   /* blocca lo scroll durante il loading */

img { display: block; }
a { text-decoration: none; color: inherit; }

/* reveal on-scroll (IntersectionObserver) */
.reveal { opacity: 0; transform: translateY(42px); transition: opacity 0.9s cubic-bezier(0.22,1,0.36,1), transform 0.9s cubic-bezier(0.22,1,0.36,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* Intro a tutto schermo */
#intro {
  position: fixed;
  inset: 0;
  z-index: 10;              /* overlay sopra la hero */
  background: var(--ground);
  overflow: hidden;
}

/* Stage nel sistema di coordinate Figma, centrato via translate + scale (JS) */
.stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--stage-w);
  height: var(--stage-h);
  transform-origin: center center;
  will-change: transform;
}

/* Frammento satellitare */
.tile {
  position: absolute;
  overflow: hidden;
  opacity: 0;                     /* rivelato dalla timeline */
  will-change: transform, opacity;
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.45);
  background: #24331f;
  border: 4px solid #b39b7a;      /* stroke marroncino/beige, sottile */
}
.tile-inner {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.tile-inner img {
  position: absolute;
  max-width: none;
  top: 0;
  left: 0;
  pointer-events: none;
}

/* Etichetta coordinate GPS (compare insieme alla sua immagine) */
.geo {
  position: absolute;
  font-size: 18px;                /* piccole, non coprono le immagini */
  font-weight: 500;
  line-height: 1;
  color: #000;
  white-space: nowrap;
  opacity: 0;
  will-change: opacity;
  letter-spacing: 0.2px;
}

/* Segmento leader che collega il bordo dell'immagine alla coordinata */
.geo-line {
  position: absolute;
  width: 2px;
  transform: translateX(-50%);
  background: #b39b7a;
  opacity: 0;
  will-change: opacity;
}

/* Linea MINCIO */
.mincio-line {
  position: absolute;
  pointer-events: none;
  overflow: visible;
  z-index: 5;
}
.mincio-line svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* =========================================================
   SFONDO FOTO (hero) + NAV centrale
   ========================================================= */
#scene { position: relative; height: 100vh; width: 100%; overflow: hidden; z-index: 1; background: #0e1310; }

#hero {
  position: absolute; inset: 0;
  overflow: hidden;
  color: #fff;
  z-index: 1;
}

#bgPhoto {
  position: absolute; inset: 0; z-index: 0;
  transform: scale(1.16);          /* parte ingrandita: zoom-out quando compare */
  transform-origin: 50% 50%;
  will-change: transform;
}
#bgPhoto img { width: 100%; height: 100%; object-fit: cover; }
/* leggero gradient nero in basso per la leggibilità del testo */
.bg-gradient {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(0deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.16) 24%, rgba(0,0,0,0) 46%);
}

#nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex; justify-content: center;
  padding: clamp(18px, 2.4vw, 28px) clamp(20px, 3.4vw, 44px);
  opacity: 0;                 /* compare a fine transizione */
  pointer-events: none;
}

.nav-pill {
  display: flex; align-items: center; gap: 4px;
  padding: 5px; border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.20);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 30px -12px rgba(0,0,0,0.35);
  pointer-events: auto;
}
.nav-pill a {
  padding: 9px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: #fff;
  transition: background 0.25s ease, color 0.25s ease;
}
.nav-pill a:hover { background: rgba(255,255,255,0.14); }
.nav-pill a.active { background: #fff; color: #16210f; }

/* Testo hero */
#heroText {
  position: absolute;
  left: clamp(20px, 3.4vw, 52px);
  bottom: clamp(36px, 8vh, 88px);
  z-index: 15;
  max-width: min(92vw, 780px);
  color: #fff;
  opacity: 0;                      /* compare a fine transizione */
}
.hero-title {
  margin: 0 0 24px;
  font-weight: 600;
  font-size: clamp(32px, 5.2vw, 76px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  text-shadow: 0 10px 40px rgba(0,0,0,0.45);
}
.hero-title span { font-weight: 300; }

.hero-actions {
  display: flex; align-items: flex-end; gap: clamp(20px, 3vw, 48px); flex-wrap: wrap;
}
.hero-sub {
  margin: 0; max-width: 400px;
  font-size: clamp(13px, 1.1vw, 15px); line-height: 1.55; font-weight: 400; opacity: 0.92;
}

.cta {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 22px; border-radius: 999px;
  background: #fff; color: #16210f; font-weight: 600; font-size: 14px;
  white-space: nowrap;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  box-shadow: 0 8px 24px -14px rgba(0,0,0,0.5);
}
.cta:hover { transform: translateY(-3px); box-shadow: 0 16px 34px -14px rgba(0,0,0,0.55); }
.cta-arrow {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 999px;
  background: #16210f; color: #fff;
  transition: transform 0.28s ease, background 0.28s ease;
}
.cta:hover .cta-arrow { transform: translateX(4px); }
/* piccola animazione idle della freccia per invitare al click */
.cta-arrow svg { animation: arrowNudge 1.6s ease-in-out infinite; }
@keyframes arrowNudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }

/* Indicatore scroll animato (a destra) */
#scrollHint {
  position: absolute; right: clamp(18px, 3vw, 44px); bottom: clamp(26px, 6vh, 54px);
  z-index: 15; opacity: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: #fff; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
}
.scroll-arrow {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px; border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  animation: scrollBounce 1.6s ease-in-out infinite;
}
@keyframes scrollBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(7px); } }

@media (max-width: 760px) {
  .nav-pill a { padding: 8px 12px; font-size: 13px; }
  .hero-actions { flex-direction: column; align-items: flex-start; gap: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .cta-arrow svg, .scroll-arrow { animation: none; }
}

/* =========================================================
   STORY — sequenza scroll-driven (pin + scrub)
   ========================================================= */
#story { position: absolute; inset: 0; width: 100%; background: #ffffff; overflow: hidden; z-index: 2; }
.story-inner { position: absolute; inset: 0; }

.story-text {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(90vw, 880px); text-align: center; z-index: 4;
  opacity: 0; pointer-events: none; will-change: transform, opacity;
}
.story-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; font-weight: 600;
  color: #a3866a; margin-bottom: 20px;
}
.story-eyebrow i { width: 6px; height: 6px; border-radius: 999px; background: #a3866a; }
.story-lead {
  margin: 0; font-weight: 600; font-size: clamp(26px, 3.8vw, 54px);
  line-height: 1.18; letter-spacing: -0.02em; color: #c9c6bf; transform-origin: center top;
}

.story-cards {
  position: absolute; left: 50%; top: 60%; transform: translate(-50%, -50%);
  width: min(92vw, 1200px);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  z-index: 3; opacity: 0; pointer-events: none; will-change: transform, opacity;
}

.story-maptitle {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  margin: 0; text-align: center; color: #16210f;
  font-weight: 600; font-size: clamp(32px, 5vw, 72px); letter-spacing: -0.02em;
  z-index: 4; opacity: 0; pointer-events: none; transform-origin: center top; will-change: transform, opacity;
}

.story-map {
  position: absolute; left: 50%; top: 58%; transform: translate(-50%, -50%);
  width: min(95vw, 1640px); z-index: 5; opacity: 0; will-change: transform, opacity;
}
.story-map .map-card { height: min(66vh, 800px); }
.story-cards .card { height: min(40vh, 380px); }

/* =========================================================
   ENTI / FONTI DEI DATI (logo cloud bordata, stile 21st.dev)
   Dentro la sequenza pinnata #story: due layer assoluti che
   compaiono con lo scroll (prima l'intestazione, poi la griglia).
   ========================================================= */
.story-entihead {
  position: absolute; left: 50%; top: 29%;
  width: min(90vw, 760px); text-align: center; z-index: 6;
  opacity: 0; pointer-events: none; will-change: transform, opacity;
}
.story-enti {
  position: absolute; left: 50%; top: 66%;
  width: min(94vw, 1120px); z-index: 6;
  opacity: 0; pointer-events: none; will-change: transform, opacity;
}
/* durante la fase enti riabilitiamo i click sulla griglia (via GSAP: .is-live) */
.story-enti.is-live { pointer-events: auto; }
.enti-eyebrow {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; font-weight: 600;
  color: #a3866a;
}
.enti-eyebrow i { width: 6px; height: 6px; border-radius: 999px; background: #a3866a; }
.enti-title {
  margin: 14px 0 0; text-align: center; color: #26221e;
  font-weight: 600; font-size: clamp(26px, 3.4vw, 46px); letter-spacing: -0.02em; line-height: 1.12;
}
.enti-title span { color: #a3866a; }
.enti-sub {
  margin: 16px auto 0; max-width: 560px; text-align: center;
  color: #6b6459; font-size: clamp(14px, 1.3vw, 17px); line-height: 1.55;
}

.enti-grid-wrap { position: relative; }
/* linee a tutta larghezza (si "disegnano" con GSAP) */
.enti-fullline {
  position: absolute; left: 50%; transform: translateX(-50%) scaleX(1);
  transform-origin: 50% 50%; width: 100vw; height: 1px; background: rgba(38, 34, 30, 0.14);
  z-index: 1;
}
.enti-fullline.top { top: -1px; }
.enti-fullline.bottom { display: none; }

.enti-grid {
  position: relative;
  display: grid; grid-template-columns: repeat(2, 1fr);
  border-left: 1px solid rgba(38, 34, 30, 0.12);
  border-top: 1px solid rgba(38, 34, 30, 0.12);
}
@media (min-width: 760px) { .enti-grid { grid-template-columns: repeat(4, 1fr); } }

.enti-card {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: clamp(78px, 11vh, 120px); padding: 20px; text-decoration: none;
  border-right: 1px solid rgba(38, 34, 30, 0.12);
  border-bottom: 1px solid rgba(38, 34, 30, 0.12);
  background: #ffffff; transition: background .45s ease;
  will-change: transform, opacity;
}
/* leggera scacchiera (su 4 colonne diventa un vero checkerboard) */
.enti-card:nth-child(odd) { background: #faf8f4; }
.enti-card:hover { background: #f4f2ee; }
.enti-logo {
  font-weight: 600; font-size: clamp(15px, 1.5vw, 19px); letter-spacing: -0.01em;
  color: #8a8175; transition: color .45s ease, transform .45s ease;
}
.enti-card:hover .enti-logo { color: #26221e; transform: translateY(-2px); }

/* i "+" sulle intersezioni interne (solo desktop: 4 col × 2 righe) */
.enti-plus {
  position: absolute; top: 50%; width: 15px; height: 15px;
  transform: translate(-50%, -50%) scale(1); color: #a3866a; z-index: 3; pointer-events: none;
}
.enti-plus::before, .enti-plus::after { content: ""; position: absolute; background: currentColor; }
.enti-plus::before { left: 50%; top: 0; width: 1.5px; height: 100%; transform: translateX(-50%); }
.enti-plus::after { top: 50%; left: 0; height: 1.5px; width: 100%; transform: translateY(-50%); }
@media (max-width: 759px) { .enti-plus { display: none; } }

/* =========================================================
   STORIA / TIMELINE — stage pinnato (viewport-locked).
   Titolo grande -> piccolo in alto, poi gli eventi si
   sostituiscono in place con lo scroll.
   ========================================================= */
#storia { position: relative; height: 100vh; background: #ffffff; overflow: hidden; }
.storia-stage { position: absolute; inset: 0; }

/* intestazione (layer centrato; GSAP la porta grande -> piccola in alto) */
.storia-head {
  position: absolute; left: 50%; top: 50%;
  width: min(92vw, 900px); text-align: center; z-index: 6; will-change: transform, opacity;
}
.storia-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; font-weight: 600; color: #a3866a;
}
.storia-eyebrow i { width: 6px; height: 6px; border-radius: 999px; background: #a3866a; }
.storia-title {
  margin: 16px 0 0; color: #26221e; font-weight: 600;
  font-size: clamp(34px, 5.4vw, 76px); letter-spacing: -0.025em; line-height: 1.05;
}
.storia-sub {
  margin: 16px auto 0; color: #6b6459; max-width: 520px;
  font-size: clamp(16px, 1.5vw, 20px); line-height: 1.5;
}

/* asse centrale + progressione + nodo che scende */
.tl-axis {
  position: absolute; top: 16%; bottom: 12%; left: 50%; width: 1px;
  transform: translateX(-50%); background: rgba(38, 34, 30, 0.13); z-index: 1;
}
/* linea orizzontale: vive DENTRO il track letteratura, così scorre con le
   tappe ed è sempre sotto di loro (stesso colore/spessore della verticale). */
.lett-line {
  position: absolute; top: 50%; left: -100vw; right: 0; height: 1px;
  background: rgba(38, 34, 30, 0.13); z-index: 0;
}
.tl-progress {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: #a3866a; transform: scaleY(0); transform-origin: top center;
}
.tl-node {
  position: absolute; left: 50%; top: 16%; width: 13px; height: 13px;
  border-radius: 999px; background: #ffffff; border: 2px solid #a3866a;
  box-shadow: 0 0 0 6px #ffffff; z-index: 3;
}

/* evento = layer sovrapposto, contenuto centrato nell'area sotto l'header */
.tl-event {
  position: absolute; left: 0; right: 0; top: 10vh; bottom: 4vh;
  display: grid; grid-template-columns: 1fr 1fr;
  column-gap: clamp(40px, 7vw, 120px); align-items: center;
  z-index: 4; opacity: 0; will-change: opacity, transform;
}

/* alternanza rigorosa */
.tl-media, .tl-text { grid-row: 1; }
.tl-event[data-side="left"] .tl-media { grid-column: 1; justify-self: end; }
.tl-event[data-side="left"] .tl-text  { grid-column: 2; justify-self: start; text-align: left; }
.tl-event[data-side="right"] .tl-media { grid-column: 2; justify-self: start; }
.tl-event[data-side="right"] .tl-text  { grid-column: 1; justify-self: end; text-align: right; }

/* immagine 3:4, protagonista, con mask */
.tl-mask {
  position: relative; overflow: hidden; border-radius: 6px; background: #f4f2ee;
  height: min(66vh, 600px); aspect-ratio: 3 / 4;
}
.tl-mask img { display: block; width: 100%; height: 100%; object-fit: cover; will-change: transform; }

/* testo: anno enorme, poi titolo, poi descrizione */
.tl-text { max-width: 440px; }
.tl-year {
  display: block; color: #26221e; font-weight: 600;
  font-size: clamp(40px, 5.2vw, 78px); line-height: 0.98; letter-spacing: -0.035em;
}
.tl-etitle {
  margin: 18px 0 0; color: #26221e; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.02em;
  font-size: clamp(16px, 1.7vw, 24px); line-height: 1.18;
}
.tl-desc {
  margin: 14px 0 0; color: #6b6459;
  font-size: clamp(14px, 1.1vw, 16px); line-height: 1.62;
}

/* ---- responsive: colonna singola, linea nascosta ---- */
@media (max-width: 860px) {
  .tl-axis, .tl-node { display: none; }
  .tl-event {
    grid-template-columns: 1fr; column-gap: 0; row-gap: 18px;
    top: 11vh; bottom: 4vh; align-content: center; padding: 0 22px;
  }
  .tl-event .tl-media,
  .tl-event .tl-text {
    grid-column: 1 !important; grid-row: auto !important;
    justify-self: center !important; text-align: center !important; margin: 0 auto !important;
  }
  .tl-text { order: 1; max-width: 560px; }
  .tl-media { order: 2; }
  .tl-mask { height: min(42vh, 360px); }
  .tl-year { font-size: clamp(38px, 11vw, 60px); }
}

/* =========================================================
   SEZIONE ABOUT / territorio (editoriale)
   ========================================================= */
#about {
  position: sticky;
  top: 0;
  background: #ffffff;
  height: 100vh;                 /* pannello a schermo intero (scroll stacking) */
  z-index: 2;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(84px, 13vh, 120px) clamp(20px, 5vw, 80px) clamp(36px, 6vh, 64px);
}
.about-head { max-width: 840px; margin: 0 auto clamp(24px, 4.5vh, 48px); text-align: center; }
.about-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; font-weight: 600;
  color: #a3866a; margin-bottom: 22px;
}
.about-eyebrow i { width: 6px; height: 6px; border-radius: 999px; background: #a3866a; }
.about-lead {
  margin: 0; font-size: clamp(20px, 2.6vw, 34px); font-weight: 500; line-height: 1.28;
  letter-spacing: -0.015em; color: #9a958c;
}
.about-lead .lead-strong { color: #1b1a17; }

.about-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  max-width: 1200px; margin: 0 auto;
}
.card {
  border-radius: 22px; overflow: hidden;
  height: clamp(260px, 46vh, 460px);
  display: flex; flex-direction: column; position: relative;
}
.card-title { margin: 0; font-size: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; line-height: 1.3; }
.card-desc { font-size: 13.5px; line-height: 1.5; }

/* Card 1 numerica */
.card-num { background: #f4f2ee; padding: 28px 26px; }
.card-num .card-title { color: #6c675e; }
.card-num-bottom { margin-top: auto; }
.big-num {
  font-size: clamp(38px, 4.2vw, 60px); font-weight: 700; letter-spacing: -0.03em;
  color: #1b1a17; line-height: 1; margin-bottom: 16px;
}
.big-num span { font-size: 0.4em; font-weight: 600; margin-left: 7px; color: #6c675e; letter-spacing: 0; }
.card-num .card-desc { color: #6c675e; margin: 0 0 16px; }
.card-meta { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: #a09a8f; font-weight: 600; }

/* Card 2 fotografica */
.card-photo { background: #26221e; }
.card-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-photo-grad { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,0.74) 0%, rgba(0,0,0,0.05) 46%, rgba(0,0,0,0.18) 100%); }
.card-photo-text { position: relative; margin-top: auto; padding: 26px 24px; z-index: 1; }
.card-title.light { color: #fff; }
.card-desc.light { color: rgba(255,255,255,0.82); margin: 10px 0 0; }

/* Card 3 concettuale */
.card-concept { background: #26221e; padding: 28px 26px; }
.card-title.cream { color: #f2ede4; }
.card-desc.cream-soft { color: rgba(242,237,228,0.66); margin: 12px 0 0; }
.concept-list { list-style: none; margin: auto 0 0; padding: 0; position: relative; color: #f2ede4; }
.concept-list::before { content: ""; position: absolute; left: 4px; top: 20px; bottom: 20px; width: 1px; background: rgba(163,134,106,0.55); }
.concept-list li { position: relative; display: flex; align-items: center; gap: 15px; padding: 12px 0; font-size: 17px; font-weight: 500; }
.concept-list li .dot { width: 9px; height: 9px; border-radius: 999px; background: #a3866a; flex: none; position: relative; z-index: 1; }

@media (max-width: 860px) {
  .about-cards { grid-template-columns: 1fr; }
  .card { min-height: 380px; }
}

/* =========================================================
   SEZIONE MAPPA (Mapbox)
   ========================================================= */
.stack-wrap { position: relative; }

#map {
  position: relative;
  height: 100vh;
  width: 100%;
  z-index: 3;
  background: #ffffff;                 /* sezione bianca, arriva con scroll normale */
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(12px, 2.4vh, 26px);
  padding: clamp(80px, 11vh, 120px) clamp(14px, 3vw, 40px) clamp(22px, 4vh, 44px);
}
.map-title {
  margin: 0; text-align: center; color: #16210f;
  font-weight: 600; font-size: clamp(26px, 3.6vw, 48px); letter-spacing: -0.02em;
}

/* card della mappa: quasi full-screen, angoli arrotondati */
.map-card {
  position: relative;
  width: min(95vw, 1640px);
  height: min(80vh, 940px);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 40px 90px -40px rgba(0,0,0,0.55);
  border: 1px solid rgba(0,0,0,0.08);
  background: #0e1512;
}
#mapContainer { position: absolute; inset: 0; }

/* bottone per tornare alla vista dall'alto (appare in 3D) */
.map-reset {
  position: absolute; top: 14px; left: 14px; z-index: 3;
  padding: 9px 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(22, 33, 15, 0.85); color: #fff;
  font: 500 13px "Inter", sans-serif; letter-spacing: 0.01em;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none; transform: translateY(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.map-reset.show { opacity: 1; pointer-events: auto; transform: none; }
.map-reset:hover { background: rgba(22, 33, 15, 0.95); }

/* marker colorati per stato (pulse dello stesso colore via --mcr) */
.map-marker {
  width: 18px; height: 18px; border-radius: 999px;
  border: 3px solid #fff; cursor: pointer;
  background: var(--mc, #43c463);
  box-shadow: 0 2px 8px rgba(0,0,0,0.45);
}
.map-marker.pulse { animation: markerPulse 1.9s ease-out infinite; }
@keyframes markerPulse {
  0%   { box-shadow: 0 0 0 0 var(--mcr, rgba(67,196,99,0.55)), 0 2px 8px rgba(0,0,0,0.45); }
  70%  { box-shadow: 0 0 0 16px transparent, 0 2px 8px rgba(0,0,0,0.45); }
  100% { box-shadow: 0 0 0 0 transparent, 0 2px 8px rgba(0,0,0,0.45); }
}

/* ===== Widget compatto stile Apple (in basso al centro) ===== */
.map-widget {
  position: absolute; left: 50%; bottom: 20px;
  transform: translateX(-50%) translateY(16px);
  z-index: 4; width: min(90%, 360px);
  background: rgba(16, 20, 18, 0.74);
  backdrop-filter: blur(24px) saturate(1.25); -webkit-backdrop-filter: blur(24px) saturate(1.25);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px; padding: 13px 15px 14px; color: #fff;
  box-shadow: 0 22px 60px -22px rgba(0,0,0,0.65);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.map-widget.show { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }

.widget-close {
  position: absolute; top: 11px; right: 11px; width: 24px; height: 24px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,0.12); color: #fff; font-size: 14px; line-height: 1;
}
.widget-close:hover { background: rgba(255,255,255,0.2); }

.widget-head { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.widget-badge { padding: 3px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 600; }
.badge-success { background: rgba(67,196,99,0.22); color: #7ee2a0; }
.badge-warning { background: rgba(245,179,1,0.22); color: #ffce5c; }
.badge-danger  { background: rgba(239,68,68,0.24); color: #ff9090; }
.widget-time { font-size: 10px; opacity: 0.55; }

.widget-title { margin: 0 0 9px; font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }

.widget-stats { display: flex; gap: 22px; margin-bottom: 8px; }
.wstat { display: flex; flex-direction: column; }
.wnum { font-size: 19px; font-weight: 700; line-height: 1; }
.wnum em { font-size: 10.5px; font-weight: 500; font-style: normal; opacity: 0.65; margin-left: 2px; }
.wlabel { font-size: 10px; opacity: 0.55; margin-top: 3px; }

.widget-bar { height: 5px; border-radius: 999px; background: rgba(255,255,255,0.12); overflow: hidden; }
.widget-bar-fill { height: 100%; border-radius: 999px; transition: width 0.6s ease; }
.bar-success { background: #43c463; }
.bar-warning { background: #f5b301; }
.bar-danger  { background: #ef4444; }

/* sezione espandibile "Approfondisci" */
.widget-more { max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.4s ease, opacity 0.3s ease, margin-top 0.3s ease; }
.map-widget.expanded .widget-more { max-height: 260px; opacity: 1; margin-top: 12px; }
.widget-msgs { display: flex; flex-direction: column; gap: 9px; }
.wmsg { display: flex; gap: 9px; align-items: flex-start; }
.wmsg-ico { font-size: 13px; }
.wmsg p { margin: 0; font-size: 12px; line-height: 1.4; opacity: 0.9; }
.wmsg strong { display: block; font-size: 9.5px; opacity: 0.5; font-weight: 600; margin-bottom: 1px; letter-spacing: 0.06em; text-transform: uppercase; }
.widget-link { display: inline-block; margin-top: 11px; font-size: 11.5px; font-weight: 600; color: #9fd3ff; }
.widget-link:hover { color: #c5e5ff; }

.widget-btn {
  margin-top: 11px; width: 100%; padding: 9px; border: 0; cursor: pointer;
  border-radius: 12px; background: rgba(255,255,255,0.1); color: #fff;
  font: 600 12px "Inter", sans-serif;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.2s ease;
}
.widget-btn:hover { background: rgba(255,255,255,0.16); }
.widget-btn span { display: inline-block; transition: transform 0.3s ease; font-size: 9px; }
.map-widget.expanded .widget-btn span { transform: rotate(180deg); }

/* nav su sezione chiara: testo scuro */
#nav.on-light .nav-pill {
  background: rgba(20, 28, 14, 0.06);
  border-color: rgba(20, 28, 14, 0.12);
  box-shadow: 0 8px 30px -16px rgba(0,0,0,0.25);
}
#nav.on-light .nav-pill a { color: #16210f; }
#nav.on-light .nav-pill a:hover { background: rgba(20,28,14,0.08); }
#nav.on-light .nav-pill a.active { background: #16210f; color: #fff; }

/* =========================================================
   LETTERATURA (Virgilio, Dante) — SEZIONE A SÉ: scroll orizzontale,
   sfondo bianco, SENZA linea. Pulita e semplice.
   ========================================================= */
#versi {
  position: relative; height: 100vh; overflow: hidden;
  background: #ffffff; color: #26221e;
}
.versi-track {
  position: absolute; top: 0; left: 0; height: 100%;
  display: flex; align-items: stretch; flex-wrap: nowrap;
  width: max-content; will-change: transform;
}

/* pannello base */
.versi-panel {
  position: relative; flex: 0 0 auto; height: 100%;
  display: flex; align-items: center; justify-content: center;
}

/* intro / titolo */
.versi-intro {
  width: min(96vw, 760px); padding: 0 6vw; text-align: center; flex-direction: column;
}
.versi-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px;
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; font-weight: 600; color: #a3866a;
}
.versi-eyebrow i { width: 6px; height: 6px; border-radius: 999px; background: #a3866a; }
.versi-title {
  margin: 0; font-weight: 600; letter-spacing: -0.025em; line-height: 1.05;
  font-size: clamp(34px, 5vw, 74px);
}
.versi-title span { color: #a3866a; }
.versi-sub {
  margin: 20px auto 0; max-width: 460px; color: #6b6459; line-height: 1.55;
  font-size: clamp(15px, 1.4vw, 19px);
}

/* pannello evento (Virgilio / Dante): due metà separate dalla linea */
.versi-item {
  width: min(88vw, 700px); padding: 0 clamp(24px, 4vw, 60px);
  display: grid; grid-template-rows: 1fr 1fr; align-items: center; justify-items: center;
}
.versi-item .vi-text  { max-width: 460px; }
.versi-item[data-pos="text-top"]    .vi-text  { grid-row: 1; align-self: end; padding-bottom: clamp(20px, 3vh, 40px); }
.versi-item[data-pos="text-top"]    .vi-photo { grid-row: 2; align-self: start; padding-top: clamp(20px, 3vh, 40px); }
.versi-item[data-pos="text-bottom"] .vi-photo { grid-row: 1; align-self: end; padding-bottom: clamp(20px, 3vh, 40px); }
.versi-item[data-pos="text-bottom"] .vi-text  { grid-row: 2; align-self: start; padding-top: clamp(20px, 3vh, 40px); }

/* nodo: non usato in questa sezione (senza linea) */
.vi-node { display: none; }

/* foto ritratto */
.vi-photo {
  position: relative; overflow: hidden; border-radius: 8px; background: #e9e4da;
  height: min(34vh, 320px); aspect-ratio: 3 / 4;
  box-shadow: 0 24px 50px -26px rgba(0,0,0,0.5);
}
.vi-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* testo */
.vi-name {
  display: block; color: #a3866a; font-weight: 600;
  font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase;
}
.vi-etitle {
  margin: 10px 0 16px; color: #26221e; font-weight: 600; line-height: 1.15;
  font-size: clamp(20px, 2.2vw, 30px); letter-spacing: -0.015em;
}
.vi-quote {
  margin: 0; padding: 0 0 0 16px; border-left: 2px solid #c9b79e;
  font-style: italic; color: #3d3833; line-height: 1.5;
  font-size: clamp(15px, 1.5vw, 19px);
}
.vi-trans {
  margin: 14px 0 0; color: #6b6459; line-height: 1.55;
  font-size: clamp(13.5px, 1.3vw, 16px);
}
.vi-src {
  display: inline-block; margin-top: 16px; color: #a3866a;
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600;
}

/* su schermi molto stretti: alza un po' i contenuti */
@media (max-width: 560px) {
  .versi-item { width: 92vw; }
  .vi-photo { height: min(28vh, 240px); }
}

/* =========================================================
   FOOTER — scuro, wordmark "hackathon", colonne nomi/email
   ========================================================= */
.site-footer {
  position: relative; background: #0e0e0e; color: #e9e6e1;
  padding: clamp(60px, 9vh, 110px) clamp(24px, 6vw, 90px) 0;
  overflow: hidden;
}
.footer-inner {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; gap: clamp(30px, 5vw, 80px);
  align-items: flex-start; justify-content: space-between;
  padding-bottom: clamp(150px, 24vw, 380px);
}
.footer-msg {
  margin: 0; font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 2.6vw, 40px); line-height: 1.15; color: #ffffff;
  max-width: 420px;
}
.footer-cols {
  display: grid; grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: clamp(24px, 3vw, 56px);
}
@media (min-width: 900px) { .footer-cols { grid-template-columns: repeat(4, auto); } }
.footer-col { display: flex; flex-direction: column; gap: 14px; }
.footer-label {
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: #8a857d; font-weight: 600;
}
.footer-col a {
  color: #e9e6e1; font-size: clamp(15px, 1.1vw, 18px); text-decoration: none;
  transition: color .2s ease;
}
.footer-col a:hover { color: #ffffff; }
.footer-wordmark {
  position: absolute; left: 50%; bottom: clamp(-6px, -0.4vw, 0px);
  transform: translateX(-50%);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(56px, 18vw, 360px); line-height: 0.82; font-weight: 400;
  color: #1a1a1a; letter-spacing: -0.02em; white-space: nowrap;
  pointer-events: none; z-index: 1;
}
.footer-wordmark .reg { font-size: 0.16em; vertical-align: top; color: #2c2c2c; }

/* =========================================================
   MOBILE + SAFARI / APPLE — friendly
   ========================================================= */
html { -webkit-text-size-adjust: 100%; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a, button { -webkit-tap-highlight-color: transparent; }

@media (max-width: 768px) {
  /* TIMELINE: foto e testo IMPILATI (flex, foto sopra e testo sotto),
     centrati e leggibili. Il flex sovrascrive la griglia desktop. */
  .tl-event {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    row-gap: clamp(16px, 3vh, 30px);
    top: 10vh; bottom: 6vh; padding: 0 22px;
  }
  .tl-event .tl-media { width: auto; }
  .tl-event .tl-text { text-align: center; max-width: 88vw; }
  .tl-mask { height: min(34vh, 280px); }
  .tl-year { font-size: clamp(30px, 10vw, 46px); }
  .tl-etitle { font-size: clamp(15px, 4.6vw, 20px); }
  .tl-desc { font-size: clamp(13px, 3.8vw, 16px); }
  /* la linea verticale un filo più a sinistra non serve: resta al centro */

  /* STORY: le 3 card sovrapposte non stanno su mobile -> nascoste,
     restano testo, titolo mappa, mappa ed enti */
  .story-cards { display: none; }

  /* ENTI: griglia 2 colonne già gestita; riduci un filo il titolo */
  .enti-title { font-size: clamp(24px, 7vw, 34px); }

  /* FOOTER: messaggio e wordmark un po' più contenuti; nomi/email su una
     colonna (le email lunghe entrano bene) */
  .footer-inner { flex-direction: column; gap: 34px; padding-bottom: clamp(120px, 40vw, 240px); }
  .footer-cols { grid-template-columns: 1fr; gap: 22px; }
  .footer-col a { font-size: 16px; word-break: break-word; }
  .footer-wordmark { font-size: clamp(64px, 30vw, 220px); }
}

/* schermi molto stretti: nav-pill compatta */
@media (max-width: 380px) {
  .nav-pill { gap: 2px; padding: 4px; }
  .nav-pill a { padding: 7px 10px; font-size: 12px; }
}
