/* jetbrains-mono-latin-400-normal */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/_astro/jetbrains-mono-latin-400-normal.V6pRDFza.woff2) format('woff2'), url(/_astro/jetbrains-mono-latin-400-normal.6-qcROiO.woff) format('woff');
}/* MANTO — l'architettura del freddo
   Layout: quinta nero-carbone, tipografia geometrica allineata a sinistra su griglia a 12 colonne,
   un solo accento "ember" riservato a pulsanti, hover e stati attivi. */
/* N27 (atipo): solo i pesi usati dal sito. Gli altri file sono in public/fonts/n27/:
   per usarne uno nuovo va aggiunta qui la sua @font-face. */
@font-face { font-family: "N27"; font-weight: 300; font-style: normal; font-display: swap; src: url("/fonts/n27/n27-light.woff2") format("woff2"); }
@font-face { font-family: "N27"; font-weight: 300; font-style: italic; font-display: swap; src: url("/fonts/n27/n27-lightitalic.woff2") format("woff2"); }
@font-face { font-family: "N27"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/n27/n27-regular.woff2") format("woff2"); }
@font-face { font-family: "N27"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/n27/n27-medium.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --carbon: #0c0e10;
  --carbon-2: #131619;
  --carbon-3: #1b1f23;
  --line: #2a3037;
  --silver: #dde6ee;
  --silver-dim: #9aa7b3;
  --ember: #ff5a1f;
  --ember-hot: #ff7d47;
  --ember-glow: rgba(255, 90, 31, 0.35);

  --selection-bg: var(--ember);
  --selection-color: var(--carbon);

  --font-display: "N27", "Avenir Next", "Century Gothic", "Segoe UI", sans-serif;
  --font-body: "N27", "Avenir Next", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --nav-h: 4.25rem;
  --ease: cubic-bezier(0.22, 0.8, 0.2, 1);

  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--nav-h) + 1rem); }
/* Al posto della freccia, il simbolo di MANTO in ember (public/cursor.svg), con il punto attivo al centro.
   Su link e pulsanti resta la mano. */
html { cursor: url('/cursor.svg') 16 16, auto; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--carbon);
  color: var(--silver);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--carbon);
}
img, svg { max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; }
/* Un solo corpo per i titoli di terzo livello, in tutte le sezioni. */
h3 { font-size: clamp(1.2rem, 1.7vw, 1.6rem); }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }

/* La pagina usa tutta la larghezza dello schermo: da 90rem i margini valgono il 4% della
   larghezza e il contenuto si ferma solo a 160rem, oltre i monitor 16:9 più grandi. Le righe di testo restano corte
   perché ogni paragrafo ha la sua larghezza massima in em. */
.wrap {
  width: 100%;
  max-width: 160rem;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 48rem) {
  .wrap {
    padding-left: max(40px, env(safe-area-inset-left, 0px));
    padding-right: max(40px, env(safe-area-inset-right, 0px));
  }
}
@media (min-width: 90rem) {
  .wrap {
    padding-left: max(4vw, env(safe-area-inset-left, 0px));
    padding-right: max(4vw, env(safe-area-inset-right, 0px));
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--silver-dim);
}

/* ---------- Pulsanti ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  border: 1px solid var(--ember);
  border-radius: 2px;
  background: var(--ember);
  color: var(--carbon);
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn:hover {
  background: var(--ember-hot);
  box-shadow: 0 0 0 4px rgba(255, 90, 31, 0.18), 0 10px 30px -8px var(--ember-glow);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0) scale(0.98); box-shadow: none; }
.btn .arrow { transition: transform 0.25s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn--sm { padding: 0.55rem 0.95rem; font-size: 0.82rem; }
/* Secondario: stesso pulsante, solo il contorno. Si riempie al passaggio del mouse. */

/* ---------- Navbar ---------- */
.nav {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: rgba(12, 14, 16, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--nav-h);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  justify-self: start;
  color: var(--silver);
}
.logo svg { flex: none; display: block; }
.logo-mark { height: 1.9rem; width: auto; }
.logo-word { height: 0.82rem; width: auto; }
.logo svg path { fill: var(--silver); transition: fill 0.25s; }
.logo:hover .logo-mark path { fill: var(--ember); }
.nav-links { display: flex; gap: clamp(0.9rem, 3vw, 2.25rem); list-style: none; margin: 0; padding: 0; }
.nav-links a {
  position: relative;
  padding: 0.6rem 0.2rem;
  font-size: 0.88rem;
  font-weight: 400;
  text-decoration: none;
  color: var(--silver-dim);
  white-space: nowrap;
  transition: color 0.2s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--ember);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav-links a:hover { color: var(--ember); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a[aria-current="page"] { color: var(--silver); }
.nav-actions { display: flex; align-items: center; gap: 0.6rem; justify-self: end; }
.lang {
  display: block;
  list-style: none;
  text-transform: uppercase;
  padding: 0.5rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--silver-dim);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.lang:hover, .lang-menu[open] .lang { color: var(--ember); border-color: var(--ember); }
.lang::-webkit-details-marker { display: none; }
.lang-menu { position: relative; }
.lang-menu ul {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  display: flex;
  flex-direction: column;
  min-width: 9rem;
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--carbon-2);
}
.lang-menu li a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0.6rem; font-size: 0.85rem; text-decoration: none; color: var(--silver-dim); }
.lang-menu li a:hover { color: var(--ember); }
.lang-menu li a[aria-current="true"] { color: var(--silver); }
.lang-menu li span { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; }
@media (max-width: 30rem) {
  .nav-inner { display: flex; justify-content: space-between; gap: 0.5rem; }
  .nav-links { gap: 0.7rem; }
  .nav-actions { gap: 0.4rem; }
  .lang { padding: 0.45rem 0.4rem; font-size: 0.8rem; }
  .logo { gap: 0.45rem; }
  .logo-mark { height: 1.5rem; }
  .logo-word { height: 0.62rem; }
  .nav-links a { font-size: 0.8rem; }
  .nav .btn { padding: 0.5rem 0.7rem; font-size: 0.76rem; }
}

/* Touch targets: min 44px */
@media (max-width: 48rem) {
  .nav-links a { min-height: 44px; display: flex; align-items: center; }
  .logo, .nav .btn { min-height: 44px; }
  .lang { min-height: 44px; min-width: 44px; display: flex; align-items: center; justify-content: center; }
  .lang-menu li a { min-height: 44px; align-items: center; }
}

/* <picture> non crea un riquadro: l'immagine si impagina come figlia diretta del contenitore. */
picture { display: contents; }
/* Altrimenti, dentro una griglia, <source> occupa una cella vuota. */
picture > source { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; display: flex; align-items: flex-end; min-height: calc(100svh - var(--nav-h) - 1px); border-bottom: 1px solid var(--line); background: var(--carbon); }
.hero-img, .hero-video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 40%; }
/* Il video sta sopra l'immagine di copertina e compare quando parte (HeroFilm.astro). */
.hero-video { opacity: 0; transition: opacity 1.2s var(--ease); }
.hero-video[data-on] { opacity: 1; }
/* Immagine e video sono neve in pieno sole. Il velo è fatto di due strati: uno leggero su tutta
   la hero (0,25) e uno che segue il blocco del testo (0,62), qualunque sia la sua altezza.
   Sotto il testo i due strati insieme coprono lo 0,71: sul caso peggiore, un fotogramma tutto
   bianco, bastano per il contrasto 4,5:1 dei testi piccoli (serve 0,64) e per il 3:1 del titolo. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(12, 14, 16, 0.25), rgba(12, 14, 16, 0.25)),
    linear-gradient(0deg, var(--carbon) 0%, rgba(12, 14, 16, 0) 22%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: start;
  gap: 1.5rem;
  padding-block: clamp(5rem, 11vw, 8rem) clamp(3.5rem, 6vw, 5rem);
}
/* Lo strato che segue il testo: parte sfumato sopra il blocco e arriva pieno al suo bordo alto. */
.hero-inner::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -10rem -100vw 0;
  background: linear-gradient(180deg, rgba(12, 14, 16, 0) 0, rgba(12, 14, 16, 0.62) 10rem);
  pointer-events: none;
}
/* Da 64rem il titolo sta a sinistra, grande; sottotitolo, pulsante e coordinate a destra, in basso. */
@media (min-width: 64rem) {
  .hero-inner { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); column-gap: clamp(2rem, 5vw, 5rem); align-items: end; }
  .hero-inner .label { grid-column: 1 / -1; }
  .hero-inner h1 { grid-column: 1; grid-row: 2 / span 3; }
  .hero-inner .lede { grid-column: 2; grid-row: 2; padding-top: 1.25rem; border-top: 1px solid rgba(221, 230, 238, 0.4); }
  .hero-inner .btn { grid-column: 2; grid-row: 3; }
  .hero-inner .coordinates { grid-column: 2; grid-row: 4; }
}
.hero h1 { font-size: clamp(2.3rem, 6.6vw, 9rem); font-weight: 400; line-height: 0.98; letter-spacing: -0.04em; max-width: 13em; overflow-wrap: break-word; }
.hero .lede { font-size: clamp(1.02rem, 1.5vw, 1.35rem); max-width: 36em; color: var(--silver); }
.hero .coordinates { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--silver); }
.hero .label { color: var(--silver); }
/* Pulsante che ferma e riavvia il video: compare solo se il video viene caricato. */
.hero-toggle {
  position: absolute;
  z-index: 2;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: 1rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgba(221, 230, 238, 0.35);
  border-radius: 50%;
  background: rgba(12, 14, 16, 0.7);
  color: var(--silver);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, transform 0.25s var(--ease);
}
.hero-toggle[hidden] { display: none; }
.hero-toggle:hover { color: var(--ember); border-color: var(--ember); transform: translateY(-1px); }
.hero-toggle:active { transform: scale(0.96); }
.hero-toggle .icon-play, .hero-toggle[data-state="paused"] .icon-pause { display: none; }
.hero-toggle[data-state="paused"] .icon-play { display: block; }
/* Barra di avanzamento del video (HeroFilm): una linea di 2px in fondo alla hero, con un'area di 24px
   da toccare. Si vede (e si usa) solo dopo aver iniziato a scorrere. Trascinandola si va avanti e indietro. */
.hero-progress {
  --p: 0%;
  position: absolute;
  z-index: 2;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 24px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
}
.hero-progress[hidden] { display: none; }
.hero-progress[data-on] { opacity: 1; visibility: visible; }
.hero-progress::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--silver) var(--p), rgba(221, 230, 238, 0.18) var(--p)); transition: height 0.2s var(--ease); }
.hero-progress::-moz-range-track { height: 2px; background: linear-gradient(90deg, var(--silver) var(--p), rgba(221, 230, 238, 0.18) var(--p)); }
.hero-progress::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -5px; border: 0; border-radius: 50%; background: var(--silver); transform: scale(0); transition: transform 0.2s var(--ease), background-color 0.2s; }
.hero-progress::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--silver); transform: scale(0); transition: transform 0.2s var(--ease), background-color 0.2s; }
.hero-progress:hover::-webkit-slider-thumb, .hero-progress:focus-visible::-webkit-slider-thumb { transform: scale(1); background: var(--ember); }
.hero-progress:hover::-moz-range-thumb, .hero-progress:focus-visible::-moz-range-thumb { transform: scale(1); background: var(--ember); }
.hero-progress:focus-visible { outline: none; }
.hero-progress:focus-visible::-webkit-slider-runnable-track { outline: 2px solid var(--ember); outline-offset: 4px; }
@media (hover: none) { .hero-progress::-webkit-slider-thumb { transform: scale(1); } .hero-progress::-moz-range-thumb { transform: scale(1); } }
@media (min-width: 48rem) { .hero-toggle { right: max(40px, env(safe-area-inset-right, 0px)); bottom: 1.5rem; } }
@media (min-width: 90rem) { .hero-toggle { right: max(4vw, env(safe-area-inset-right, 0px)); } }
@media (prefers-reduced-motion: no-preference) {
  .hero-inner > * { animation: hero-rise 0.7s var(--ease) both; }
  .hero-inner > :nth-child(2) { animation-delay: 0.08s; }
  .hero-inner > :nth-child(3) { animation-delay: 0.16s; }
  .hero-inner > :nth-child(4) { animation-delay: 0.24s; }
  .hero-inner > :nth-child(5) { animation-delay: 0.32s; }
  @keyframes hero-rise { from { opacity: 0; transform: translateY(14px); } }
  /* Il titolo entra una parola alla volta, da dietro la propria riga (le parole sono divise nella pagina). */
  .hero-inner > h1 { animation: none; }
  .hero h1 .word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.16em; margin-bottom: -0.16em; }
  .hero h1 .word > span { display: inline-block; animation: word-rise 0.9s var(--ease) both; animation-delay: calc(0.1s + var(--i) * 0.07s); }
  @keyframes word-rise { from { translate: 0 115%; } }
  /* L'immagine parte appena ingrandita e si assesta. */
  .hero-img, .hero-video { animation: hero-settle 2.6s var(--ease) both; }
  @keyframes hero-settle { from { scale: 1.1; } }
}

/* ---------- Sezioni ---------- */
.section { padding-block: clamp(4rem, 9vw, 7.5rem); }
.section + .section { border-top: 1px solid var(--line); }
/* Titoli di sezione: una sola misura, sempre sotto il titolo della pagina (h1). */
.section h2 { font-size: clamp(2rem, 4.4vw, 4.75rem); font-weight: 400; line-height: 0.98; letter-spacing: -0.04em; }

.context { display: grid; gap: 2rem clamp(2rem, 6vw, 6rem); }
.context-head { display: flex; flex-direction: column; gap: 1rem; }
.context p { font-size: clamp(1.05rem, 1.55vw, 1.3rem); line-height: 1.6; max-width: 34em; min-width: 0; }
@media (min-width: 52rem) { .context { grid-template-columns: 5fr 7fr; } }

/* ---------- Contesto climatico ---------- */
/* Un titolo grande, poi quattro righe: a sinistra il numero, grande e in contorno, che si riempie
   mentre attraversa lo schermo; a destra il titolo e il testo del passaggio. */
.climate-head { display: grid; gap: 1.25rem clamp(2rem, 5vw, 4.5rem); align-items: end; }
.climate-head .label { grid-column: 1 / -1; }
.climate-head h2 { max-width: 9em; overflow-wrap: break-word; }
.climate-head p { font-size: clamp(1.1rem, 1.7vw, 1.6rem); line-height: 1.45; color: var(--silver-dim); max-width: 26em; text-wrap: balance; }
@media (min-width: 64rem) { .climate-head { grid-template-columns: 7fr 5fr; } }

.beats { list-style: none; margin: clamp(3rem, 7vw, 6rem) 0 0; padding: 0; border-bottom: 1px solid var(--line); }
.beats li { position: relative; display: grid; gap: 0.75rem clamp(2rem, 5vw, 4.5rem); min-width: 0; padding-block: clamp(1.75rem, 4vw, 3.25rem); border-top: 1px solid var(--line); }
/* La riga sopra ogni passaggio si accende al passaggio del mouse. */
.beats li::before { content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 1px; background: var(--silver); transform: scaleX(0); transform-origin: left; transition: transform 0.5s var(--ease); }
.beats li:hover::before { transform: scaleX(1); }
.beat-value { font-family: var(--font-display); font-size: clamp(2.2rem, 4.8vw, 6rem); font-weight: 300; line-height: 0.9; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; white-space: nowrap; -webkit-text-stroke: 1px var(--silver); }
.beats h3 { font-weight: 400; }
.beats p { font-size: 1rem; line-height: 1.65; color: var(--silver-dim); max-width: 32em; }
@media (min-width: 64rem) {
  .beats li { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
  .beat-value { grid-row: 1 / span 2; }
  .beats h3 { align-self: end; }
}
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .beat-value { animation: beat-fill linear both; animation-timeline: view(); animation-range: entry 80% cover 45%; }
    @keyframes beat-fill { from { color: transparent; } }
  }
}

/* Le fasce hanno un fondo a curve di livello, come una carta di montagna. */
.verdict, .band { background: repeating-radial-gradient(ellipse 70% 120% at 88% 10%, rgba(221, 230, 238, 0) 0 46px, rgba(221, 230, 238, 0.055) 46px 47px), var(--carbon-2); }
.verdict { margin-block: clamp(2rem, 5vw, 4rem) clamp(3rem, 7vw, 6rem); padding-block: clamp(4rem, 11vw, 10rem); border-block: 1px solid var(--line); }
.verdict p { font-family: var(--font-display); font-size: clamp(1.9rem, 5.2vw, 5.5rem); font-weight: 300; line-height: 1.08; letter-spacing: -0.03em; text-wrap: balance; }
.verdict span { color: var(--silver-dim); }
.climate-out { font-family: var(--font-display); font-size: clamp(1.4rem, 2.5vw, 2.1rem); font-weight: 400; line-height: 1.25; letter-spacing: -0.01em; max-width: 26em; text-wrap: balance; }

/* ---------- Testo e immagine affiancati ---------- */
/* Testo e immagine affiancati da 56rem; con --flip l'immagine passa a sinistra. */
.split { display: grid; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.split-text { display: flex; flex-direction: column; align-items: flex-start; gap: 1.25rem; min-width: 0; }
.split-text p { font-size: clamp(1.02rem, 1.3vw, 1.15rem); line-height: 1.7; max-width: 34em; }
.split-text .statement { font-family: var(--font-display); font-size: clamp(1.4rem, 2.5vw, 2.1rem); font-weight: 400; line-height: 1.25; letter-spacing: -0.01em; max-width: 20em; text-wrap: balance; }
/* Form contatti */
.contact-form { display: grid; gap: 1rem; width: 100%; max-width: 34rem; }
.field { display: grid; gap: 0.4rem; }
.field label { font-size: 0.82rem; letter-spacing: 0.04em; color: var(--silver-dim); }
.field input, .field textarea {
  width: 100%; padding: 0.75rem 0.9rem; font: inherit; font-size: 1rem; color: inherit;
  background: var(--carbon-2); border: 1px solid var(--line); border-radius: 0;
  transition: border-color 0.2s var(--ease);
}
.field textarea { resize: vertical; min-height: 8rem; }
.field input:hover, .field textarea:hover { border-color: var(--silver-dim); }
.field input:focus-visible, .field textarea:focus-visible { outline-offset: 0; border-color: var(--ember); }
.field-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.split-text .form-note { margin: 0; font-size: 0.85rem; line-height: 1.5; color: var(--silver-dim); }
.contact-form .btn { justify-self: start; }
.contact-form .btn:disabled { opacity: 0.6; cursor: wait; }
.split-text .form-status { margin: 0; min-height: 1.5em; font-size: 0.95rem; }
.form-status[data-state="invalid"], .form-status[data-state="error"] { color: var(--ember-hot); }

.split-img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border: 1px solid var(--line); }
/* Stessa soglia di ArtImage.astro: sotto c'è il ritaglio 4:5, sopra il 16:9. */
@media (min-width: 40rem) { .split-img { aspect-ratio: 16 / 9; } }
@media (min-width: 56rem) {
  /* L'immagine prende sette colonne su dodici. */
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .split--flip { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .split-img { aspect-ratio: 3 / 2; }
  .split--flip .split-text { order: 2; }
}

.footer-col a.plain { overflow-wrap: anywhere; }

/* ---------- Riquadri delle immagini ---------- */
/* Il riquadro ritaglia, l'immagine dentro si ingrandisce appena al passaggio del mouse.
   Le soglie sono quelle di ArtImage.astro: 4:5 sotto 40rem, 16:9 sopra. */
.shot { position: relative; overflow: hidden; min-width: 0; aspect-ratio: 4 / 5; border: 1px solid var(--line); background: var(--carbon-2); }
.shot img, .shot video { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
@media (hover: hover) { .shot:hover img { transform: scale(1.03); } }
@media (min-width: 40rem) {
  .shot { aspect-ratio: 16 / 9; }
  /* Soggetto sul lato destro del ritaglio 16:9. */
  .shot--right img { object-position: 80% 50%; }
}
@media (min-width: 56rem) { .shot--half { aspect-ratio: 3 / 2; } }
/* Quattro tacche agli angoli, come il mirino di una ripresa. */
.shot::after {
  content: "";
  position: absolute;
  inset: 0.75rem;
  --tick: rgba(221, 230, 238, 0.75);
  background:
    linear-gradient(var(--tick), var(--tick)) left top / 14px 1px,
    linear-gradient(var(--tick), var(--tick)) left top / 1px 14px,
    linear-gradient(var(--tick), var(--tick)) right top / 14px 1px,
    linear-gradient(var(--tick), var(--tick)) right top / 1px 14px,
    linear-gradient(var(--tick), var(--tick)) left bottom / 14px 1px,
    linear-gradient(var(--tick), var(--tick)) left bottom / 1px 14px,
    linear-gradient(var(--tick), var(--tick)) right bottom / 14px 1px,
    linear-gradient(var(--tick), var(--tick)) right bottom / 1px 14px;
  background-repeat: no-repeat;
  pointer-events: none;
}
.shot--card { aspect-ratio: 3 / 2; }
.shot--wide { aspect-ratio: 16 / 9; }

/* ---------- Mappa dei componenti ---------- */
/* Un indice: una riga per componente, con il nome grande. Al passaggio del mouse la riga
   si accende dal basso e il nome scorre a destra. */
.map { margin-top: clamp(2.5rem, 6vw, 4.5rem); }
.map ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.map a {
  position: relative;
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) 1.5rem;
  grid-template-areas: "n name arrow" ". tag .";
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  padding-block: clamp(1.1rem, 2.4vw, 1.9rem);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.map a::before { content: ""; position: absolute; z-index: -1; inset: 0 -100vw; background: var(--carbon-2); transform: scaleY(0); transform-origin: bottom; transition: transform 0.45s var(--ease); }
.map a:hover::before { transform: scaleY(1); }
.map-n { grid-area: n; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; color: var(--silver-dim); }
.map .label { grid-area: tag; }
.map strong { grid-area: name; font-family: var(--font-display); font-size: clamp(2rem, 6.2vw, 6rem); font-weight: 400; line-height: 1; letter-spacing: -0.04em; overflow-wrap: break-word; min-width: 0; transition: transform 0.45s var(--ease); }
.map-arrow { grid-area: arrow; justify-self: end; font-size: 1.25rem; color: var(--silver-dim); transition: transform 0.3s var(--ease), color 0.3s; }
.map a:hover strong { transform: translateX(clamp(0.5rem, 1.5vw, 1.5rem)); }
.map a:hover .map-arrow { transform: translateY(4px); color: var(--ember); }
.map a:focus-visible { outline-offset: -2px; }
/* La fascia che si accende esce dai margini: va tagliata al bordo della pagina. */
#manto { position: relative; z-index: 0; overflow-x: clip; }
@media (min-width: 48rem) {
  .map a { grid-template-columns: 3.5rem minmax(0, 1fr) auto 2.5rem; grid-template-areas: "n name tag arrow"; column-gap: 1.5rem; }
  .map .label { text-align: right; }
}

/* ---------- Capitoli dei componenti ---------- */
.chapters + .section { border-top: 1px solid var(--line); }
/* La barra resta sotto la navbar per tutta la lunghezza dei capitoli. */
.rail {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + var(--nav-h) + 1px);
  z-index: 15;
  border-block: 1px solid var(--line);
  background: rgba(12, 14, 16, 0.9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.rail ul { display: flex; gap: 0.25rem 1.75rem; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.rail ul::-webkit-scrollbar { display: none; }
.rail a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  font-size: 0.88rem;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
  color: var(--silver-dim);
  transition: color 0.2s;
}
.rail a span { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; }
.rail a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--ember); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease); }
.rail a:hover { color: var(--silver); }
.rail a[aria-current="true"] { color: var(--silver); }
.rail a[aria-current="true"]::after { transform: scaleX(1); }
.rail a:focus-visible { outline-offset: -2px; }

/* Le ancore dei capitoli si fermano sotto la barra. */
.chapter { scroll-margin-top: 2.75rem; }
.chapter .wrap { display: flex; flex-direction: column; gap: clamp(3rem, 7vw, 5.5rem); }
/* In alto il filo e il numero del capitolo, enorme e in contorno; accanto il nome del componente. */
.chapter-head { display: grid; gap: 0.5rem 2.5rem; align-items: end; position: relative; padding-top: clamp(1.25rem, 3vw, 2.5rem); }
.chapter-head::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--silver-dim); transform-origin: left; }
.chapter-n {
  font-family: var(--font-display);
  font-size: clamp(5rem, 20vw, 18rem);
  font-weight: 300;
  line-height: 0.78;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1px var(--silver-dim);
  opacity: 0.55;
}
.chapter-title { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.chapter-title h2 { overflow-wrap: break-word; }
.chapter-title p { font-size: clamp(1.15rem, 2vw, 1.6rem); line-height: 1.3; color: var(--silver-dim); max-width: 26em; text-wrap: balance; }
@media (min-width: 56rem) {
  .chapter-head { grid-template-columns: minmax(0, 1fr) auto; }
  .chapter-n { order: 2; }
}
.chapter-lede { font-size: clamp(1.05rem, 1.55vw, 1.3rem); line-height: 1.6; max-width: 38em; }
/* L'uscita del capitolo e quella del contesto climatico. */
.chapter-out { margin: 0; }
.climate-next { margin-top: 2rem; }
/* Il pulsante di pausa del video del B_Lock sta nell'angolo del riquadro. */
.shot .hero-toggle { right: 1.5rem; bottom: 1.5rem; }

/* Scheda tecnica: nome a sinistra, valore a destra. */
.spec { display: flex; flex-direction: column; width: 100%; max-width: 34em; margin: 0.5rem 0 0; }
.spec div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1.5rem; padding-block: 0.7rem; border-top: 1px solid var(--line); }
.spec div:last-child { border-bottom: 1px solid var(--line); }
.spec dt { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--silver-dim); }
.spec dd { margin: 0; font-size: 0.98rem; font-weight: 400; }

/* ReST: tre dettagli con immagine. */
.details { display: grid; gap: 2.5rem 1.5rem; list-style: none; margin: 0; padding: 0; }
@media (min-width: 56rem) { .details { grid-template-columns: repeat(3, 1fr); } }
.detail { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.detail h3 { margin-top: 0.5rem; }
.detail p, .stack p, .parts p, .moments p { font-size: 0.98rem; line-height: 1.65; color: var(--silver-dim); max-width: none; }

/* SoFT: la sezione del sandwich accanto ai suoi tre strati. */
.layers { display: grid; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
@media (min-width: 56rem) { .layers { grid-template-columns: 7fr 5fr; } }
.stack, .parts, .moments { list-style: none; margin: 0; padding: 0; counter-reset: item; }
.stack li, .parts li, .moments li { position: relative; display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; counter-increment: item; }
.stack li::before, .parts li::before, .moments li::before {
  content: counter(item, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--silver-dim);
}
.stack { display: flex; flex-direction: column; min-width: 0; }
.stack li { padding-block: 1.25rem; border-top: 1px solid var(--line); transition: border-color 0.3s; }
/* Lo strato centrale è la canapa: è quello che isola. */
.stack li:nth-child(2) { border-top: 3px solid var(--silver-dim); }
.stack li:hover { border-top-color: var(--ember); }

/* B_Lock e Smart B_Lock: elenco delle parti. */
.parts { display: grid; gap: 0; width: 100%; align-items: stretch; }
.parts li { padding-block: 1.25rem; border-top: 1px solid var(--line); }
@media (min-width: 40rem) {
  .parts { grid-template-columns: 1fr 1fr; column-gap: 2rem; }
  .parts--single { grid-template-columns: 1fr; }
}

/* M_0: il componente che accompagna B_Lock. */
.companion { padding: clamp(1.25rem, 3vw, 2.5rem); border: 1px solid var(--line); border-radius: 3px; background: var(--carbon-2); }
.companion h3 { font-weight: 400; letter-spacing: -0.03em; }

/* GRiD: i tre momenti della stagione. */
.moments { display: grid; gap: 0 2rem; }
.moments li { padding-block: 1.5rem; border-top: 1px solid var(--line); }
@media (min-width: 56rem) { .moments { grid-template-columns: repeat(3, 1fr); } }

/* Confronto ReST / SoFT: su schermi stretti la tabella scorre di lato dentro il suo riquadro. */
.compare-scroll { margin-top: clamp(2rem, 4vw, 3.5rem); overflow-x: auto; }
.compare { width: 100%; min-width: 34rem; border-collapse: collapse; text-align: left; }
.compare th, .compare td { padding: 1rem 1.5rem 1rem 0; border-top: 1px solid var(--line); vertical-align: top; }
.compare tbody tr:last-child > * { border-bottom: 1px solid var(--line); }
.compare thead th { font-size: clamp(1.25rem, 2.2vw, 1.75rem); font-weight: 400; letter-spacing: -0.02em; border-top: 0; }
.compare thead th:first-child, .compare tbody th { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase; color: var(--silver-dim); }
.compare tbody th { width: 28%; }
.compare td { font-size: 0.98rem; line-height: 1.5; }

/* Domande frequenti: domanda e risposta su due colonne da 56rem in su. */
.faq-list { list-style: none; margin: clamp(2rem, 4vw, 3.5rem) 0 0; padding: 0; }
.faq-list li { display: grid; gap: 0.75rem 2rem; padding-block: 1.5rem; border-top: 1px solid var(--line); }
.faq-list li:last-child { border-bottom: 1px solid var(--line); }
.faq-list h3 { margin: 0; }
.faq-list p { margin: 0; font-size: 0.98rem; line-height: 1.65; color: var(--silver-dim); max-width: 42em; }
@media (min-width: 56rem) { .faq-list li { grid-template-columns: 5fr 7fr; } }

/* Entrata allo scorrimento, solo dove il browser la sa legare allo scroll:
   altrove il contenuto è fermo e visibile. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    [data-reveal] { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 35%; }
    @keyframes reveal { from { opacity: 0; transform: translateY(24px); } }
    /* Le immagini si scoprono dal basso, come un telo che viene sollevato. */
    .shot[data-reveal] { animation-name: reveal-shot; animation-range: entry 0% entry 70%; }
    @keyframes reveal-shot { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0); } }

    /* Hero: uscendo dallo schermo l'immagine scende più lenta della pagina e il testo sfuma. */
    .hero-img, .hero-video { animation: hero-settle 2.6s var(--ease) both, hero-drift linear both; animation-timeline: auto, view(); animation-range: normal, exit 0% exit 100%; }
    @keyframes hero-drift { to { translate: 0 14%; } }
    .hero-inner { animation: hero-leave linear both; animation-timeline: view(); animation-range: exit 10% exit 80%; }
    @keyframes hero-leave { to { opacity: 0; translate: 0 -2.5rem; } }

    /* Le immagini scorrono piano dentro il loro riquadro. */
    .shot img, .shot video, .mosaic img { scale: 1.1; animation: shot-drift linear both; animation-timeline: view(); }
    @keyframes shot-drift { from { translate: 0 -4%; } to { translate: 0 4%; } }

    /* I titoli grandi salgono da dietro la loro riga. */
    .climate-head h2, .chapter-title h2, .manifesto p { animation: title-rise linear both; animation-timeline: view(); animation-range: entry 5% entry 75%; }
    @keyframes title-rise { from { translate: 0 0.45em; clip-path: inset(0 0 100% 0); } to { clip-path: inset(-0.2em); } }

    /* Capitoli: il filo si disegna da sinistra, il numero sale più lento del resto. */
    .chapter-head::before { animation: line-draw linear both; animation-timeline: view(); animation-range: entry 0% cover 30%; }
    @keyframes line-draw { from { transform: scaleX(0); } }
    .chapter-n { animation: number-drift linear both; animation-timeline: view(); animation-range: entry 0% cover 55%; }
    @keyframes number-drift { from { translate: 0 35%; } }

    /* La frase sui ghiacciai mette a fuoco mentre entra. */
    .verdict [data-reveal] { animation-name: reveal-focus; animation-range: entry 0% cover 32%; }
    @keyframes reveal-focus { from { opacity: 0; filter: blur(14px); translate: 0 1.5rem; } }

    /* Indice dei componenti: le righe entrano da sinistra. */
    .map li { animation: reveal-row linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
    @keyframes reveal-row { from { opacity: 0; translate: -2.5rem 0; } }

    /* Elementi affiancati: entrano uno dopo l'altro. */
    .figure, .member, .timeline li, .mosaic li { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 35%; }
    :is(.details, .moments, .figures, .team, .timeline, .mosaic) > :nth-child(3n + 2) { animation-range: entry 10% entry 45%; }
    :is(.details, .moments, .figures, .team, .timeline, .mosaic) > :nth-child(3n + 3) { animation-range: entry 20% entry 55%; }

    /* Titoli di sezione e frase di chiusura: salgono da dietro la loro riga, come i titoli grandi. */
    .context-head h2, .closing p { animation: title-rise linear both; animation-timeline: view(); animation-range: entry 5% entry 75%; }

    /* Numeri del clima: il filo sopra ogni riga si disegna entrando. */
    .beats li::before { animation: line-draw-full linear both; animation-timeline: view(); animation-range: entry 10% cover 35%; }
    @keyframes line-draw-full { from { transform: scaleX(0); } to { transform: scaleX(1); } }

    /* Tabella e domande: le righe entrano da sinistra, una dopo l'altra. */
    .compare tbody tr, .faq-list li { animation: reveal-row linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }

    /* Foto del contatto: si scopre dal basso, come le altre immagini. */
    .split-img { animation: reveal-shot linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }

    /* DDW: le lettere del marchio crescono dal basso, una dopo l'altra; i dati entrano in fila. */
    .ddw-logo path { transform-box: fill-box; transform-origin: 50% 100%; animation: bar-grow linear both; animation-timeline: view(); animation-range: entry 10% entry 60%; }
    .ddw-logo path:nth-child(n + 6) { animation-range: entry 20% entry 70%; }
    .ddw-logo path:nth-child(n + 11) { animation-range: entry 30% entry 80%; }
    @keyframes bar-grow { from { opacity: 0; transform: scaleY(0); } }
    .ddw-facts div { animation: reveal linear both; animation-timeline: view(); animation-range: entry 0% entry 40%; }
    .ddw-facts div:nth-child(2) { animation-range: entry 8% entry 48%; }
    .ddw-facts div:nth-child(3) { animation-range: entry 16% entry 56%; }
  }
}

/* ---------- Schermi larghi e bassi (16:9) ---------- */
/* Su un desktop in orizzontale l'altezza è poca: spazi, numeri e immagini si misurano
   sull'altezza dello schermo, così la testata di un capitolo e il suo primo blocco
   stanno insieme in una schermata, sotto navbar e barra dei componenti. */
@media (min-width: 64rem) and (min-aspect-ratio: 3 / 2) {
  .section { padding-block: clamp(3.5rem, 10svh, 7.5rem); }
  .verdict { margin-block: 5svh; padding-block: clamp(3.5rem, 11svh, 10rem); }
  .verdict p { font-size: clamp(1.9rem, min(5.2vw, 7svh), 5.5rem); }
  /* Il contesto climatico resta entro due schermate: righe e numeri si misurano sull'altezza. */
  .beats { margin-top: clamp(2.5rem, 6svh, 6rem); }
  .beats li { padding-block: clamp(1.1rem, 2.4svh, 3.25rem); }
  .beat-value { font-size: clamp(2.2rem, min(4.8vw, 11svh), 6rem); }
  .chapter .wrap { gap: clamp(2rem, 4svh, 5.5rem); }
  .chapter-n { font-size: clamp(5rem, min(20vw, 18svh), 18rem); }
  .shot--half, .shot--wide, .split-img { max-height: 42svh; }
  .shot--full { max-height: calc(100svh - var(--nav-h) - 7rem); }
  /* Il contatto prende una schermata intera, con il contenuto al centro. */
  #contatto { display: flex; align-items: center; min-height: calc(100svh - var(--nav-h)); }
}

/* ---------- Numeri e tappe ---------- */
.band { border-block: 1px solid var(--line); }
.section.band + .section { border-top: 0; }
.figures { display: grid; grid-template-columns: 1fr; gap: 2.5rem 2rem; margin: 0; }
@media (min-width: 64rem) { .figures { grid-template-columns: repeat(3, 1fr); } }
.figure { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; padding-top: 1.5rem; border-top: 1px solid var(--silver-dim); }
.figure dt { font-family: var(--font-display); font-size: clamp(2.2rem, 4.2vw, 4.75rem); font-weight: 300; line-height: 0.95; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.figure dd { margin: 0; font-size: 1rem; color: var(--silver-dim); max-width: 24em; }

/* ---------- Tappe ---------- */
/* In colonna con il filo a sinistra; da 56rem in riga con il filo sopra. L'ultima tappa ha il punto pieno. */
.timeline { display: grid; list-style: none; margin: clamp(2.5rem, 6vw, 4.5rem) 0 0; padding: 0; }
.timeline li { position: relative; display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; padding: 0 0 2.5rem 1.75rem; border-left: 1px solid var(--line); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; top: 0.2rem; left: -5px; width: 9px; height: 9px; border: 1px solid var(--silver-dim); border-radius: 50%; background: var(--carbon); }
.timeline li:last-child::before { background: var(--silver); border-color: var(--silver); }
.timeline h3 { font-weight: 400; }
.timeline p { font-size: 0.98rem; color: var(--silver-dim); max-width: 30em; }
@media (min-width: 56rem) {
  .timeline { grid-template-columns: repeat(3, 1fr); }
  .timeline li, .timeline li:last-child { padding: 2rem 2.5rem 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .timeline li::before { top: -5px; left: 0; }
}

/* ---------- Team ---------- */
/* Tre colonne separate da un filo; al posto delle foto le iniziali, grandi e in contorno. */
.team { display: grid; list-style: none; margin: 1.5rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.member { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; padding-block: 2rem 2.25rem; border-bottom: 1px solid var(--line); }
/* Foto del team: in bianco e nero già nel file (about.astro), tagliate 4:5 qui; il punto di taglio è nello style della singola foto. */
.member-photo { overflow: hidden; width: 100%; max-width: 20rem; aspect-ratio: 4 / 5; margin-bottom: 0.75rem; border: 1px solid var(--line); background: var(--carbon-2); }
.member-photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
@media (hover: hover) { .member:hover .member-photo img { transform: scale(1.03); } }
.member h2 { font-size: clamp(1.5rem, 2.4vw, 2.25rem); font-weight: 400; }
.member .label { line-height: 1.6; }
.member-link { display: inline-flex; align-items: center; gap: 0.5rem; align-self: flex-start; min-height: 44px; margin-top: 0.25rem; font-size: 0.9rem; color: var(--silver-dim); text-decoration: none; transition: color 0.2s var(--ease); }
.member-link:hover { color: var(--ember); }
@media (min-width: 52rem) {
  .team { grid-template-columns: repeat(3, 1fr); }
  .member { padding: 2.5rem 2rem 2.75rem; border-left: 1px solid var(--line); }
  .member:first-child { padding-left: 0; border-left: 0; }
  .member-photo { max-width: none; }
  /* La prima colonna non ha padding a sinistra: senza questo la sua foto verrebbe 2rem più larga delle altre. */
  .member:first-child .member-photo { width: calc(100% - 2rem); }
}

/* Chiusura di About Us: il simbolo, la frase e il pulsante, al centro. */
.closing { display: flex; flex-direction: column; align-items: center; gap: clamp(1.75rem, 4vw, 3rem); text-align: center; }
.closing p { font-family: var(--font-display); font-size: clamp(1.6rem, 3.4vw, 3.25rem); font-weight: 300; line-height: 1.15; letter-spacing: -0.02em; max-width: 22em; min-width: 0; text-wrap: balance; }
.logo--seal .logo-word { display: none; }
.logo--seal .logo-mark { height: clamp(3rem, 6vw, 4.5rem); }
.logo--seal .logo-mark path { fill: var(--silver-dim); }

/* ---------- Apertura al centro (Home e About Us) ---------- */
/* Tutto al centro; in Home il logo grande sta sopra il titolo. */
.hero--center { align-items: center; }
.hero--center .hero-inner { justify-items: center; text-align: center; padding-block: clamp(4rem, 9vh, 6rem); }
.hero--center .hero-inner::before { inset: -100vh -100vw; background: radial-gradient(ellipse 60vw 50vh at 50% 50%, rgba(12, 14, 16, 0.66), rgba(12, 14, 16, 0.3)); }
/* In Home il testo va dal logo alle coordinate: il velo pieno (0,7) copre tutta la colonna del testo,
   quindi anche i testi piccoli in alto e in basso restano sopra 0,64 (vedi il conto del velo della hero). */
.hero--home .hero-inner::before { background: radial-gradient(ellipse 60vw 100vh at 50% 50%, rgba(12, 14, 16, 0.7) 60%, rgba(12, 14, 16, 0.4)); }
/* Su schermi stretti il testo arriva ai bordi: velo pieno uniforme. */
@media (max-width: 47.99rem) { .hero--home .hero-inner::before { background: rgba(12, 14, 16, 0.7); } }
/* Home: immagine e video stanno in `.hero-stage`. Di norma lo stage riempie la hero come prima. */
.hero-stage { position: absolute; inset: 0; }
/* Con il movimento consentito lo stage resta fermo sotto la navbar per un altro schermo:
   il testo (con il suo velo) scorre via verso l'alto, poi resta solo il video, poi la pagina
   prosegue e il video esce con lei. La hero è alta poco più di due schermi: il primo per il testo,
   poi (margine sotto il testo) lo spazio in cui lo stage resta fermo: uno schermo, più un terzo
   in cui si vede solo il video anche quando il testo riempie lo schermo (telefoni). Va nel contenuto
   e non nel padding: lo stage si ferma solo dentro il contenuto della hero. */
@media (prefers-reduced-motion: no-preference) {
  .hero--home { display: block; overflow: clip; min-height: 0; }
  .hero--home::after { content: none; }
  .hero--home .hero-stage { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--nav-h) + 1px); height: calc(100svh - var(--nav-h) - 1px); overflow: hidden; }
  /* Il velo leggero di tutta la hero passa sullo stage, così resta fermo con il video. */
  .hero--home .hero-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(rgba(12, 14, 16, 0.25), rgba(12, 14, 16, 0.25)),
      linear-gradient(0deg, var(--carbon) 0%, rgba(12, 14, 16, 0) 22%);
    pointer-events: none;
  }
  .hero--home .hero-inner { margin-top: calc(-100svh + var(--nav-h) + 1px); margin-bottom: calc(130svh - var(--nav-h) - 1px); min-height: calc(100svh - var(--nav-h) - 1px); align-content: center; }
  /* Lo stage è fermo: niente discesa lenta dell'immagine, resta solo l'assestamento iniziale. */
  .hero--home .hero-img, .hero--home .hero-video { animation: hero-settle 2.6s var(--ease) both; }
}
.hero--center h1 { font-size: clamp(2.3rem, 5.2vw, 6.5rem); max-width: 14em; }
.hero--center .lede { max-width: 32em; }
@media (min-width: 64rem) {
  .hero--center .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .hero--center .hero-inner > * { grid-column: 1; grid-row: auto; }
  .hero--center .hero-inner .lede { padding-top: 0; border-top: 0; }
}
.logo--intro { justify-self: center; flex-direction: column; gap: clamp(1.1rem, 2.4vw, 2rem); margin-bottom: clamp(1rem, 3vh, 2.5rem); }
.logo--intro .logo-mark { height: clamp(5.5rem, 14vh, 10rem); }
.logo--intro .logo-word { height: clamp(1.4rem, 3.4vh, 2.5rem); }

/* Ogni sezione di About Us prende una schermata intera, con il contenuto al centro. */
@media (min-width: 48rem) {
  .screen { display: flex; align-items: center; min-height: calc(100svh - var(--nav-h)); }
  .screen > .wrap { width: 100%; }
}

/* Titoli delle sezioni di About Us: grandi, ma sotto il titolo della pagina. */

/* Percorso: numeri grandi a contorno sopra ogni tappa. */
.timeline-n { font-family: var(--font-display); font-size: clamp(3.5rem, 8vw, 7.5rem); font-weight: 300; line-height: 0.9; letter-spacing: -0.04em; color: transparent; -webkit-text-stroke: 1px var(--silver-dim); margin-bottom: 0.5rem; }

@media (prefers-reduced-motion: no-preference) {
  /* Il simbolo ruota e si assesta, la scritta sale da sotto la sua riga, poi entra il resto. */
  .hero-inner > .logo--intro { animation: none; }
  .logo--intro .logo-mark { animation: mark-in 1.6s var(--ease) both; }
  .logo--intro .logo-word { animation: word-in 1.1s var(--ease) 0.55s both; }
  .hero--home .hero-inner > :not(.logo--intro) { animation-delay: 1s; }
  .hero--home h1 .word > span { animation-delay: calc(1s + var(--i) * 0.07s); }
  @keyframes mark-in { from { opacity: 0; scale: 0.55; rotate: -120deg; filter: blur(10px); } }
  @keyframes word-in { from { opacity: 0; clip-path: inset(0 0 100% 0); translate: 0 40%; } to { clip-path: inset(0); } }

  @supports (animation-timeline: view()) {
    /* Manifesto: ogni parola si accende quando arriva a metà dello schermo. */
    .manifesto .words { animation: none; }
    .manifesto .words span { color: rgba(221, 230, 238, 0.18); animation: word-light linear both; animation-timeline: view(); animation-range: cover 15% cover 35%; }
    @keyframes word-light { to { color: var(--silver); } }
    /* Galleria: la foto grande si apre dal centro. */
    .mosaic .mosaic-wide { animation: reveal-wide linear both; animation-timeline: view(); animation-range: entry 0% cover 40%; }
    @keyframes reveal-wide { from { clip-path: inset(0 12% round 2px); } to { clip-path: inset(0); } }
  }
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: var(--carbon); }
.footer-grid { display: grid; gap: 2.5rem; padding-block: clamp(3rem, 6vw, 5rem) 2.5rem; }
@media (min-width: 48rem) { .footer-grid { grid-template-columns: 6fr 3fr 3fr; } }
.footer-about { display: flex; flex-direction: column; gap: 1.1rem; align-items: flex-start; }
.footer-about p { max-width: 30em; color: var(--silver-dim); }
.footer-col { display: flex; flex-direction: column; gap: 0.9rem; }
.footer-col ul { display: flex; flex-direction: column; gap: 0.45rem; list-style: none; margin: 0; padding: 0; font-size: 0.95rem; }
.footer-col a { text-decoration: none; transition: color 0.2s; min-height: 44px; display: flex; align-items: center; }
.footer-col a:hover { color: var(--ember); }
.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1.25rem 2rem;
  border-top: 1px solid var(--line);
}

/* ---------- Manifesto ---------- */
.manifesto { display: flex; flex-direction: column; gap: 1.5rem; }
.manifesto p { font-family: var(--font-display); font-size: clamp(1.9rem, 4.6vw, 4.75rem); font-weight: 300; line-height: 1.1; letter-spacing: -0.03em; max-width: 20em; text-wrap: balance; }

/* ---------- Mosaico DDW ---------- */
/* Ogni foto nel suo formato (about.astro, DDW_SHOWN): la «wide» apre a tutta larghezza;
   le orizzontali («land») sono 4:3, le verticali («port») 2:3.
   Sotto 40rem, su 2 colonne: orizzontale a tutta riga, verticali a coppie, l'ultima verticale sola a tutta riga.
   Da 40rem, su 3 colonne: ogni riga è un'orizzontale su due colonne più una verticale; la verticale dà l'altezza
   alla riga e l'orizzontale la segue, quindi le due finiscono pari. L'immagine è assoluta per non spingere la riga. */
.mosaic { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; list-style: none; margin: clamp(2rem, 5vw, 3.5rem) 0 0; padding: 0; }
.mosaic li { position: relative; overflow: hidden; min-width: 0; border: 1px solid var(--line); background: var(--carbon-2); }
.mosaic .mosaic-wide { grid-column: 1 / -1; aspect-ratio: 16 / 9; max-height: 78svh; width: 100%; }
.mosaic .mosaic-land { grid-column: span 2; aspect-ratio: 4 / 3; }
.mosaic .mosaic-port { aspect-ratio: 2 / 3; }
.mosaic .mosaic-port:last-child { grid-column: 1 / -1; aspect-ratio: 4 / 5; }
.mosaic img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); }
@media (hover: hover) { .mosaic li:hover img { transform: scale(1.03); } }
@media (min-width: 40rem) {
  .mosaic { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
  .mosaic .mosaic-land { aspect-ratio: auto; }
  .mosaic .mosaic-port:last-child { grid-column: auto; aspect-ratio: 2 / 3; }
}

/* DDW: titolo e dati a sinistra, marchio della fiera a destra; foto verticali sfalsate. */
.ddw-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 2rem; }
.ddw-facts { display: flex; flex-wrap: wrap; gap: 0.75rem clamp(1.5rem, 4vw, 3.5rem); margin: 0.75rem 0 0; }
.ddw-facts div { display: flex; flex-direction: column; gap: 0.3rem; }
.ddw-facts dt { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--silver-dim); }
.ddw-facts dd { margin: 0; font-size: 1rem; }
.ddw-text { max-width: 38em; margin: 0.5rem 0 0; color: var(--silver-dim); text-wrap: pretty; }
.ddw-source { display: inline-flex; align-items: center; gap: 0.4rem; align-self: flex-start; min-height: 44px; font-size: 0.9rem; color: var(--silver); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 0.3em; transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease); }
.ddw-source:hover { color: var(--ember); text-decoration-color: currentColor; }
.ddw-logo { display: block; width: clamp(5.5rem, 11vw, 9.5rem); color: var(--silver); transition: color 0.3s, transform 0.3s var(--ease); }
.ddw-logo svg { display: block; width: 100%; height: auto; }
.ddw-logo:hover { color: var(--ember); transform: translateY(-2px); }

/* ---------- 404 ---------- */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  min-height: 60vh;
  padding-block: 6rem 4rem;
  text-align: center;
}
.error-code { font-family: var(--font-display); font-size: clamp(4rem, 12vw, 8rem); font-weight: 300; line-height: 1; letter-spacing: -0.03em; }
.error-page h1 { font-size: clamp(1.2rem, 2.5vw, 1.8rem); font-weight: 300; color: var(--silver-dim); }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.75rem 1.25rem;
  background: var(--ember);
  color: var(--carbon);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 2px;
  z-index: 100;
}
.skip-link:focus {
  top: 1rem;
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}

/* ---------- Selection ---------- */
::selection {
  background: var(--selection-bg);
  color: var(--selection-color);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
