/* Il sito di Fluvia (7/11/2026). Scorrendo passa una giornata: sito.js colora il cielo (--c1, --c2),
   accende le stelle (--stelle) e muove il sole (--sole-x, --sole-y, --sole-o). Niente risorse esterne
   (CSP del _headers): font di sistema, titoli con il serif di sistema (New York sui dispositivi Apple). */

:root {
  --c1: #F6C7B6;
  --c2: #FCE9DC;
  --stelle: 0;
  --blu: #0064D2;
  --lavoro: #0A5FC2;
  --profondo: #0B3D7A;
  --arancio: #F2923E;
  --oro: #FFD21F;
  --roccia: #3A3A3C;
  --lilla: #D9C8F5;
  --personale: #FFD4A8;
  --testo: #1D1D1F;
  --testo-2: #4A4A50;
  --carta: rgba(255, 255, 255, .9);
  --bordo: rgba(0, 0, 0, .07);
  --accento: #C25A12;
  --fuoco: #1D1D1F;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  /* Solo chiaro: il cielo è la storia della giornata e non segue il tema del sistema (scelta dell'8/11). */
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 18px/1.6 var(--sans); color: var(--testo); background: #F7EDE6; overflow-x: hidden; }
/* clip e non hidden: niente scorrimento di lato, e le scene ferme (sticky) funzionano. */
html, body { overflow-x: clip; }
img { display: block; max-width: 100%; }
a { color: inherit; }
strong { font-weight: 650; }
h1, h2, h3, h4 { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -.02em; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 6.2vw, 4.6rem); line-height: 1.04; }
h2 { font-size: clamp(2rem, 4.6vw, 3.2rem); line-height: 1.08; }
h1 em, h2 em { font-style: italic; color: var(--accento); }
h3 { font-size: 1.15rem; line-height: 1.3; letter-spacing: -.01em; }
p { margin: 1em 0 0; text-wrap: pretty; }
:focus-visible { outline: 3px solid var(--fuoco); outline-offset: 3px; border-radius: 6px; }

.salta { position: absolute; left: 12px; top: -60px; z-index: 50; background: #000; color: #fff; padding: 10px 14px; border-radius: 10px; }
.salta:focus { top: 12px; }
.nascosto { display: none !important; }

/* Il cielo, le stelle e il sole, dietro a tutto. Il sole sorge a sinistra, a mezzogiorno è in alto,
   tramonta a destra; poi escono le stelle. */
.cielo { position: fixed; inset: 0; z-index: -2; overflow: hidden; background: linear-gradient(180deg, var(--c1), var(--c2)); }
.stelle { position: absolute; top: 0; left: 0; width: 2px; height: 2px; border-radius: 50%; opacity: var(--stelle); }
/* Un bagliore morbido, non una palla netta: passa anche dietro al testo senza disturbare la lettura. */
.sole {
  position: absolute; left: 0; top: 0; width: 260px; height: 260px; border-radius: 50%;
  transform: translate(calc(var(--sole-x, 10) * 1vw - 50%), calc(var(--sole-y, 80) * 1vh - 50%));
  opacity: calc(var(--sole-o, 1) * .9);
  background: radial-gradient(circle, rgba(255, 244, 200, .95) 0, rgba(255, 222, 120, .7) 14%, rgba(255, 210, 31, .28) 34%, rgba(255, 200, 60, 0) 68%);
}

/* La barra in alto: l'unico vetro della pagina (vetro solo sui controlli). */
.barra {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10; height: 60px;
  display: flex; align-items: center; gap: 14px;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--c1) 62%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  transition: color .4s;
}
html[data-buio="si"] .barra { color: #F5F5F7; border-bottom-color: rgba(255, 255, 255, .08); --fuoco: #FFD21F; }
@supports not (color: color-mix(in srgb, red, blue)) {
  .barra { background: rgba(255, 255, 255, .55); }
  html[data-buio="si"] .barra { background: rgba(10, 18, 34, .55); }
}
.marchio { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: -.02em; }
.orologio {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 999px;
  font: 600 13px/1 var(--sans); font-variant-numeric: tabular-nums; background: rgba(255, 255, 255, .45);
}
.orologio i { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 38% 32%, #FFF6CC, #F9D35A 55%, #EDBB3F); }
html[data-buio="si"] .orologio { background: rgba(255, 255, 255, .1); }
html[data-buio="si"] .orologio i { background: #E8EEF8; box-shadow: inset -4px -1px 0 0 #9AA6BC; }
.menu { display: flex; gap: 22px; margin: 0 auto; font-size: 15px; }
.menu a { text-decoration: none; opacity: .78; }
.menu a:hover { opacity: 1; }
.azioni { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.menu + .azioni { margin-left: 0; }
.tondo { width: 36px; height: 36px; border-radius: 18px; border: 0; display: grid; place-items: center; cursor: pointer; background: rgba(255, 255, 255, .6); color: var(--blu); }
html[data-buio="si"] .tondo { background: rgba(255, 255, 255, .12); color: #7DB8FF; }
.tondo[aria-pressed="true"] { background: var(--blu); color: #fff; }

/* Tasti. */
.tasto {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 24px; border-radius: 999px; border: 0;
  font: 600 16px/1 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.tasto:hover { transform: translateY(-1px); }
.tasto.blu { background: var(--blu); color: #fff; box-shadow: 0 6px 18px rgba(0, 100, 210, .28); }
.tasto.chiaro { background: rgba(255, 255, 255, .7); color: #1D1D1F; }
.tasto.piccolo { height: 36px; padding: 0 15px; font-size: 14px; }
.tasto.largo { width: 100%; }
.tasto.spento { background: transparent; color: inherit; opacity: .7; border: 1.5px dashed currentColor; cursor: default; white-space: normal; height: auto; min-height: 50px; padding: 12px 20px; text-align: center; line-height: 1.25; }
.tasto.spento:hover, .tasto[disabled]:hover { transform: none; }
.tasto[disabled], .tasto[aria-disabled="true"] { opacity: .6; cursor: default; }
/* Misura l'altezza piccola dello schermo (100svh): non cambia quando Safari chiude o apre le barre. */
.sonda { position: fixed; top: 0; left: 0; width: 0; height: 100vh; height: 100svh; visibility: hidden; pointer-events: none; }
.bottoni { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Sezioni, più vicine tra loro. Il colore del testo segue l'ora: scuro di giorno, chiaro la sera. */
main { position: relative; z-index: 1; }
.sezione { position: relative; padding: 13vh 0; }
[data-ora="sera"], [data-ora="notte"], [data-ora="notte-fonda"], .piede {
  --testo: #F5F5F7; --testo-2: #C9C9D2; --carta: rgba(22, 30, 52, .88); --bordo: rgba(255, 255, 255, .13); --accento: #FFC27A; --fuoco: #FFD21F;
  color: var(--testo);
}
[data-ora="tramonto"] { --testo: #2A1608; --testo-2: #5B3A22; --accento: #8E2F00; --carta: rgba(255, 255, 255, .62); color: var(--testo); }
[data-ora="mezzogiorno"], [data-ora="mattino"] { --accento: #0A5FC2; }
.colonna { width: 100%; max-width: 700px; margin: 0 auto; padding: 0 24px; }
.grande { font-size: clamp(1.2rem, 2.3vw, 1.5rem); line-height: 1.5; color: var(--testo); }
.sezione p { color: var(--testo-2); }
.sezione p.grande, .sezione p.forte { color: var(--testo); }
.forte { font-family: var(--serif); font-size: clamp(1.25rem, 2.4vw, 1.6rem); line-height: 1.4; font-style: italic; margin-top: 1.4em; }
.nota { font-size: 16px; }
.sotto-titolo { font-family: var(--serif); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600; margin-top: 64px; }

/* Comparire allo scorrimento (solo con JavaScript acceso: sito.js mette la classe js). */
html.js .appare { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 70ms); }
html.js .appare.visto { opacity: 1; transform: none; }

/* Alba. */
.eroe { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-top: 92px; padding-bottom: 6vh; }
.eroe .colonna { max-width: 880px; }
.eroe .grande { max-width: 34em; }
.etichetta {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 26px; padding: 7px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .55); font: 600 14px/1 var(--sans); letter-spacing: .01em; color: var(--testo) !important;
}
.etichetta .punto { width: 8px; height: 8px; border-radius: 50%; background: #F2923E; box-shadow: 0 0 0 4px rgba(242, 146, 62, .25); animation: respira 2.4s ease-in-out 3; }
.icona-viva { position: relative; width: 120px; height: 120px; margin-bottom: 24px; }
.icona-viva .onde, .icona-viva .strato { position: absolute; inset: 0; width: 100%; height: 100%; }
/* All'apertura: prima la pallina (tu), poi il lavoro e la vita le girano attorno in versi opposti, si
   mescolano e si fermano nell'icona. Una volta sola. */
.icona-viva .pallina-icona { animation: compare .7s ease-out .2s both; }
.icona-viva .strato.blu { animation: avvolge-blu 2.6s cubic-bezier(.2, .7, .2, 1) .8s both; }
.icona-viva .strato.arancio { animation: avvolge-arancio 2.6s cubic-bezier(.2, .7, .2, 1) 1.2s both; }
@keyframes compare { from { opacity: 0; transform: scale(.4); } }
@keyframes avvolge-blu { from { opacity: 0; transform: rotate(-240deg) scale(1.18); } 30% { opacity: 1; } }
@keyframes avvolge-arancio { from { opacity: 0; transform: rotate(240deg) scale(1.18); } 30% { opacity: 1; } }
@keyframes respira { 50% { transform: scale(1.1); } }
.suggerimento { margin-top: 40px; font-size: 15px; }
.freccia { display: inline-block; animation: scendi 1.8s ease-in-out 4; }
@keyframes scendi { 50% { transform: translateY(5px); } }

/* Perché l'ennesimo calendario: testo a sinistra, a destra l'agenda quasi vuota e i pensieri attorno. */
.due-colonne { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; align-items: center; max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.vignetta { position: relative; height: 470px; }
.agenda {
  position: absolute; left: 18%; right: 18%; top: 6%; bottom: 6%;
  background: rgba(255, 255, 255, .9); border-radius: 18px; box-shadow: 0 16px 40px rgba(0, 0, 0, .08);
  padding: 46px 14px 14px 44px;
}
.agenda-giorno { position: absolute; top: 14px; left: 18px; margin: 0; font: 700 14px/1 var(--sans); color: #1D1D1F !important; }
.agenda-ore { position: absolute; left: 0; right: 0; top: 46px; bottom: 14px; }
.agenda-ore span { display: block; height: 10%; border-top: 1px solid #ECECF0; padding-left: 14px; font: 600 10px/1.6 var(--sans); color: #9A9AA2; }
.riunione {
  position: absolute; left: 44px; right: 14px;
  top: calc(46px + (var(--da) - 9) / 10 * (100% - 60px)); height: max(22px, calc((var(--a) - var(--da)) / 10 * (100% - 60px)));
  white-space: nowrap; overflow: hidden; display: flex; align-items: center;
  background: var(--lavoro); color: #fff; border-radius: 8px; padding: 4px 8px; font: 600 12px/1.3 var(--sans);
}
.pensiero {
  position: absolute; left: var(--x); top: var(--y);
  padding: 9px 14px; border-radius: 14px; background: #fff; color: #1D1D1F; font: 600 14px/1.25 var(--sans);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .1); white-space: nowrap; rotate: var(--r);
  border: 1.5px dashed #B8C6D6;
}
.pensiero.personale { background: #FFF1E2; border-color: #F2B98A; }
.in-testa { position: absolute; left: 0; right: 0; bottom: -34px; text-align: center; font: italic 15px/1.3 var(--serif); }
/* I pensieri compaiono uno alla volta e poi galleggiano piano, per poco. */
html.js .vignetta .pensiero { opacity: 0; transform: translateY(14px) scale(.96); transition: opacity .6s ease, transform .6s ease; transition-delay: calc(.35s + var(--i) * .22s); }
html.js .vignetta.visto .pensiero { opacity: 1; transform: none; animation: galleggia 5s ease-in-out calc(1.6s + var(--i) * .3s) 4 alternate; }
@keyframes galleggia { to { translate: 0 -8px; } }

/* Scene che restano ferme mentre scorri. */
.scena { padding: 0; }
#idea { height: 300vh; }
#fiume { height: 280vh; }
#vita { height: 220vh; }
.palco {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; gap: 56px;
  max-width: 1080px; margin: 0 auto; padding: 84px 24px 28px;
}
.testi { position: relative; min-height: 20em; }
.passo { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; transition: opacity .55s ease, transform .55s ease; }
.passo p { font-size: clamp(1.1rem, 2vw, 1.3rem); }
/* La lista (due passi) e il fiume (quattro passi): si vede solo il passo corrente. */
#idea .passo.due { opacity: 0; transform: translateY(24px); pointer-events: none; }
#idea.al-piano .passo.uno { opacity: 0; transform: translateY(-24px); pointer-events: none; }
#idea.al-piano .passo.due { opacity: 1; transform: none; pointer-events: auto; }
#fiume .passo { opacity: 0; transform: translateY(24px); pointer-events: none; }
#fiume .passo.ora { opacity: 1; transform: none; pointer-events: auto; }
#fiume .passo.dopo { transform: translateY(-24px); }

/* La lista che diventa un piano (posizioni da sito.js). */
.piano, .giorno { position: relative; height: min(70vh, 620px); font-size: 15px; }
.ore span, .fascia, .pranzo, .argine { position: absolute; }
.piano .ore span, .piano .fascia, .piano .pranzo, .piano .argine { opacity: var(--p2, 0); transition: opacity .2s; }
.ore span { left: 0; transform: translateY(-50%); font: 600 12px/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--testo-2); }
.piano .ore span { top: calc((var(--h) - 9) / 12 * 100%); }
.fascia, .pranzo { left: 20%; right: -4px; border-radius: 12px; }
.piano .fascia, .piano .pranzo { top: calc((var(--da) - 9) / 12 * 100%); height: calc((var(--a) - var(--da)) / 12 * 100%); }
.fascia { background: rgba(255, 255, 255, .5); border: 1.5px dashed #9EB6CE; }
.fascia span, .pranzo span { position: absolute; right: 8px; top: -18px; font: 600 11px/1 var(--sans); color: var(--testo-2); }
.pranzo { background: repeating-linear-gradient(135deg, rgba(0, 0, 0, .05) 0 6px, transparent 6px 12px); }
.pranzo span { top: 50%; transform: translateY(-50%); right: 12px; }
.argine { left: 20%; right: -4px; border-top: 2px dashed var(--arancio); }
.piano .argine { top: calc((var(--da) - 9) / 12 * 100%); }
.argine span { position: absolute; right: 0; top: -17px; font: 600 11px/1 var(--sans); color: #9A4410; }
.voce { position: absolute; border-radius: 10px; }
.voce > span { position: absolute; inset: 0; display: flex; align-items: center; border-radius: inherit; overflow: hidden; white-space: nowrap; }
.voce .riga { gap: 12px; padding: 0 16px; background: #fff; color: #1D1D1F; box-shadow: 0 2px 10px rgba(0, 0, 0, .08); opacity: calc(1 - var(--t, 0)); }
.voce .riga i { flex: none; width: 17px; height: 17px; border: 2px solid #C7C7CC; border-radius: 5px; }
.voce .blocco { padding: 0 12px; font: 600 13px/1.2 var(--sans); opacity: var(--t, 0); }
.voce.lavoro .blocco { background: var(--lavoro); color: #fff; }
.voce.profondo .blocco { background: var(--profondo); color: #fff; }
.voce.roccia .blocco { background: var(--roccia); color: #fff; border-radius: 6px; }
.voce.personale .blocco { background: var(--personale); color: #3A2412; }
.voce.fluida .blocco { background: #fff; color: #1D1D1F; justify-content: center; font-size: 12px; border: 1px solid #9EB6CE; }

/* Il fiume a mezzogiorno: la giornata dalle 9 alle 19:30, con rocce fisse e acqua che si sposta. */
.giorno .ore span { top: calc((var(--h) - 9) / 10.5 * 100%); }
.giorno .pranzo { top: calc((var(--da) - 9) / 10.5 * 100%); height: calc((var(--a) - var(--da)) / 10.5 * 100%); }
.giorno .argine { top: calc((var(--da) - 9) / 10.5 * 100%); opacity: 0; transition: opacity .5s; }
.giorno[data-passo="3"] .argine { opacity: 1; border-top-width: 3px; }
/* Nel fiume l'etichetta dell'argine sta nella colonna delle ore, così non copre i blocchi. */
.giorno .argine span { right: auto; left: -25%; width: 23%; top: -8px; text-align: right; line-height: 1.2; white-space: normal; }
.giorno .pranzo { opacity: .8; }
.sasso, .onda, .imprevisto {
  position: absolute; left: 20%; right: -4px; display: flex; align-items: center; padding: 0 12px;
  font: 600 13px/1.2 var(--sans); white-space: nowrap; overflow: hidden;
}
.sasso { top: calc((var(--da) - 9) / 10.5 * 100%); height: calc((var(--a) - var(--da)) / 10.5 * 100%); background: var(--roccia); color: #fff; border-radius: 16px 9px 14px 8px; box-shadow: 0 6px 16px rgba(0, 0, 0, .18); z-index: 2; }
.onda {
  border-radius: 10px; background: var(--lavoro); color: #fff; z-index: 1;
  transition: top .7s cubic-bezier(.3, .7, .2, 1), height .7s cubic-bezier(.3, .7, .2, 1), opacity .5s, transform .5s;
  opacity: 0; transform: translateX(18px);
}
.onda.profonda { background: var(--profondo); }
.onda.personale { background: var(--personale); color: #3A2412; }
.onda.dentro { opacity: 1; transform: none; }
.onda b { font-weight: 600; display: none; }
.giorno[data-passo="3"] .onda.ultima { background: transparent; color: var(--testo); border: 2px dashed var(--arancio); }
.giorno[data-passo="3"] .onda.ultima b { display: inline; color: #9A4410; margin-left: .3em; }
.imprevisto {
  top: calc((var(--da) - 9) / 10.5 * 100%); height: calc((var(--a) - var(--da)) / 10.5 * 100%);
  background: var(--lilla); color: #2A1450; border-radius: 10px; z-index: 3;
  opacity: 0; transform: scale(.9); transition: opacity .45s, transform .45s;
}
.giorno[data-passo="2"] .imprevisto, .giorno[data-passo="3"] .imprevisto { opacity: 1; transform: none; }

/* Carte. */
.carte {
  list-style: none; margin: 40px auto 0; padding: 0 24px; width: 100%; max-width: 1060px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr)); gap: 16px;
}
.carta { background: var(--carta); border: 1px solid var(--bordo); border-radius: 22px; padding: 26px 24px 24px; box-shadow: 0 10px 30px rgba(0, 0, 0, .05); }
.carta h3 { color: var(--testo); }
.carta p { margin-top: .6em; font-size: 16.5px; line-height: 1.55; }
.segno { display: block; width: 34px; height: 9px; border-radius: 5px; margin-bottom: 18px; }
.segno.lavoro { background: var(--lavoro); }
.segno.acqua { background: linear-gradient(90deg, var(--lavoro), var(--arancio)); }
.segno.fluida { background: #fff; border: 1.5px dashed #9EB6CE; }
.segno.detta { background: #8E6AD8; }
.segno.personale { background: var(--personale); }
.segno.roccia { background: var(--roccia); }
.studi .carta { display: flex; flex-direction: column; }
.studi .perche { color: var(--accento) !important; font-weight: 600; }
.studi .fonte { margin-top: auto; padding-top: 16px; font-size: 13.5px; line-height: 1.45; color: var(--testo-2); text-underline-offset: 3px; }
.studi .libro { grid-column: 1 / -1; background: linear-gradient(135deg, rgba(255, 194, 122, .16), rgba(22, 30, 52, .88)); }
.studi .libro h3 { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; }
.studi .libro p:first-of-type { font-size: 18px; max-width: 46em; }
.sezione a:not(.tasto) { text-underline-offset: 3px; }

/* Lavoro e vita: le onde compaiono in dissolvenza mentre ruotano (sito.js). */
#vita .palco { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.ruota-onde { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.disco { position: relative; width: min(46vh, 380px); aspect-ratio: 1; }
.disco .strato { position: absolute; inset: 0; width: 100%; height: 100%; will-change: opacity, transform; }
.disco .blu, .disco .arancio { opacity: 0; }
.nomi { position: relative; height: 1.6em; width: 100%; margin: 0; text-align: center; font: italic 600 clamp(1.3rem, 2.4vw, 1.7rem)/1.6 var(--serif); }
.nomi span { position: absolute; inset: 0; opacity: 0; transition: opacity .4s; }
.ruota-onde[data-fase="tu"] .n-tu, .ruota-onde[data-fase="lavoro"] .n-lavoro, .ruota-onde[data-fase="vita"] .n-vita, .ruota-onde[data-fase="insieme"] .n-insieme { opacity: 1; }
.n-tu { color: #5E4100; }
html[data-buio="si"] #vita .n-tu { color: #FFD84D; }
.n-lavoro { color: var(--lavoro); }
.n-vita { color: #B4561A; }
.testi.centro { min-height: 0; }
.testi.centro p { font-size: clamp(1.1rem, 2vw, 1.3rem); }
.citazione { font-family: var(--serif); font-style: italic; font-size: clamp(1.4rem, 2.8vw, 2rem) !important; line-height: 1.3; color: var(--testo) !important; margin-top: 1.2em; }
/* Quando il cielo diventa sera mentre la scena è ancora sullo schermo, il testo passa al chiaro. */
html[data-buio="si"] #vita { --testo: #F5F5F7; --testo-2: #C9C9D2; --accento: #FFC27A; }
html[data-buio="si"] #vita .n-lavoro { color: #7DB8FF; }
html[data-buio="si"] #vita .n-vita { color: #FFC27A; }
/* Gli studi entrano quando il cielo è ancora al tramonto: titolo e frase scuri finché non è sera. */
html[data-buio="no"] #studi > .colonna:first-child { --testo: #2A1608; --testo-2: #5B3A22; color: var(--testo); }

/* Il progetto: le tappe. */
.strada { list-style: none; padding: 0; margin: 44px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.strada::before { content: ""; position: absolute; left: 6px; right: 6px; top: 6px; height: 2px; background: rgba(255, 255, 255, .25); }
.strada li { position: relative; padding: 26px 10px 0 0; }
.strada li::before { content: ""; position: absolute; left: 0; top: 0; width: 14px; height: 14px; border-radius: 50%; background: #2C3A55; border: 2px solid rgba(255, 255, 255, .35); }
.strada li.qui::before { background: radial-gradient(circle at 38% 30%, #FFF6CC, #F9D35A 55%, #EDBB3F); border-color: transparent; box-shadow: 0 0 16px 4px rgba(255, 210, 31, .5); }
.strada b { display: block; color: var(--testo); }
.strada span { display: block; font-size: 15px; color: var(--testo-2); line-height: 1.4; margin-top: 4px; }
#progetto h3 { margin-top: 52px; font-family: var(--serif); font-size: 1.6rem; font-weight: 600; }
.aiuto { margin: 14px 0 0; padding-left: 1.2em; color: var(--testo-2); }
.aiuto li { margin-top: 6px; }

/* Partecipa e dove trovi Fluvia. */
.stato { display: inline-block; margin: 0 0 12px !important; padding: 4px 10px; border-radius: 999px; font: 700 12px/1.3 var(--sans); letter-spacing: .04em; text-transform: uppercase; background: rgba(255, 255, 255, .1); color: var(--testo-2) !important; }
.stato.pronto { background: rgba(52, 199, 89, .18); color: #7EE29A !important; }
.posti .tasto { margin-top: 20px; }
.posti .carta { display: flex; flex-direction: column; align-items: flex-start; }
.posti .stato { order: -1; }
.posti h4 { margin: 0; font-size: 1.15rem; line-height: 1.3; letter-spacing: -.01em; color: var(--testo); }
.posti .tasto.chiaro { background: rgba(255, 255, 255, .14); color: #F5F5F7; }
.passi { margin: 12px 0 0; padding-left: 1.3em; color: var(--testo-2); font-size: 16px; }
.passi li { margin-top: 4px; }
.dati { margin-top: 56px; padding: 26px 26px 24px; border-radius: 22px; border: 1px solid var(--bordo); background: var(--carta); }
.dati h3 { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; }
.dati p { font-size: 16.5px; }

/* Il riquadro per chiedere l'iscrizione. */
.riquadro {
  width: min(460px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 24px;
  background: #fff; color: #1D1D1F; box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.riquadro::backdrop { background: rgba(5, 11, 22, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.riquadro form { position: relative; padding: 30px 28px 26px; display: flex; flex-direction: column; }
.riquadro h2 { font-size: 1.9rem; }
.riquadro p { color: #4A4A50; font-size: 16px; margin-top: .6em; }
.riquadro label { margin-top: 18px; font: 600 14px/1.3 var(--sans); }
.riquadro label span { font-weight: 400; color: #6C6C70; }
.riquadro input[type="email"], .riquadro input[type="text"] {
  margin-top: 6px; height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid #C7C7CC;
  font: 17px var(--sans); background: #fff; color: #1D1D1F;
}
.riquadro .spunta { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 15px; line-height: 1.4; }
.riquadro .spunta input { margin-top: 3px; width: 18px; height: 18px; flex: none; }
.riquadro .piccola { font-size: 14px; margin-top: 8px; }
.riquadro .esito { min-height: 1.4em; font-weight: 600; }
.riquadro .esito.bene { color: #1E7B34; }
.riquadro .esito.male { color: #B42318; }
.riquadro .tasto { margin-top: 14px; }
.chiudi { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 18px; border: 0; background: #F0F0F2; color: #3A3A3C; font-size: 22px; line-height: 1; cursor: pointer; }

.piede { position: relative; z-index: 1; padding: 56px 24px 72px; text-align: center; font-size: 15px; }
.piede img { margin: 0 auto 14px; }
.piede p { margin: 6px 0 0; color: var(--testo-2); }
.piede a { color: var(--testo); }

/* Scene libere: senza JavaScript, con «riduci movimento» o su schermi bassi le scene non restano
   ferme: si leggono una dopo l'altra, già al loro stato finale (sito.js mette html.libere). */
html:not(.js) #idea, html:not(.js) #fiume, html:not(.js) #vita, html.libere #idea, html.libere #fiume, html.libere #vita { height: auto; }
html:not(.js) .palco, html.libere .palco { position: static; height: auto; padding-top: 76px; padding-bottom: 40px; }
html:not(.js) .testi, html.libere .testi { min-height: 0; display: block; }
html:not(.js) .passo, html.libere .passo { position: static; opacity: 1 !important; transform: none !important; pointer-events: auto !important; }
html:not(.js) .passo + .passo, html.libere .passo + .passo { margin-top: 1.6em; }
html.libere .piano, html.libere .giorno { height: 460px; max-height: none; }
html:not(.js) .piano, html:not(.js) .giorno, html:not(.js) #leggi, html:not(.js) .orologio, html:not(.js) .solo-js { display: none; }
html:not(.js) .disco .strato { opacity: 1; }
html:not(.js) [data-ora="sera"] { background: linear-gradient(#2B2350, #7A4558); }
html:not(.js) [data-ora="notte"] { background: linear-gradient(#0B1A2F, #1B2D50); }
html:not(.js) [data-ora="notte-fonda"], html:not(.js) .piede { background: #050B16; }

/* Portatili e schermi stretti. */
@media (max-width: 1099px) {
  .colonna, .carte, .due-colonne, .palco { padding-left: calc(24px + env(safe-area-inset-left, 0px)); padding-right: calc(24px + env(safe-area-inset-right, 0px)); }
}
@media (max-width: 899px) {
  .menu { display: none; }
}
@media (max-width: 820px) {
  body { font-size: 17px; }
  .sezione { padding: 10vh 0; }
  .sezione.scena { padding: 0; }
  .eroe { padding-top: 80px; }
  .sole { width: 60px; height: 60px; }
  .due-colonne { grid-template-columns: 1fr; gap: 28px; }
  .vignetta { height: 380px; margin-bottom: 40px; }
  .agenda { left: 14%; right: 14%; }
  .pensiero { font-size: 12.5px; padding: 7px 11px; left: max(1%, min(calc(var(--x) * .9 + 2%), 50%)); }
  .palco { grid-template-columns: 1fr; grid-template-rows: auto minmax(220px, 1fr); gap: 12px; padding-top: 68px; padding-bottom: 12px; align-items: start; }
  .testi { min-height: 0; display: grid; }
  .passo { position: static; grid-area: 1 / 1; justify-content: flex-start; }
  .passo p { font-size: 1.02rem; margin-top: .6em; }
  .piano, .giorno { height: 100%; max-height: none; font-size: 13px; }
  .voce .riga { padding: 0 10px; gap: 8px; }
  .voce .riga i { width: 14px; height: 14px; }
  .voce .blocco, .sasso, .onda, .imprevisto { font-size: 11.5px; padding: 0 8px; }
  .voce.fluida .blocco { font-size: 0; }
  #vita .palco { grid-template-columns: 1fr; grid-template-rows: auto auto; align-content: center; }
  .disco { width: min(34vh, 260px); }
  .strada { grid-template-columns: 1fr 1fr; row-gap: 26px; }
  .strada::before { display: none; }
  /* Sul telefono, se il browser è già collegato, «La tua giornata» prende il posto di «Partecipa». */
  html.collegato .azioni .apri-iscrizione { display: none; }
}
/* Telefono: i pensieri stanno in due fasce, sopra e sotto l'agenda, e non coprono gli impegni. */
@media (max-width: 480px) {
  .vignetta { height: 470px; }
  .agenda { top: 104px; bottom: 104px; left: 4%; right: 4%; }
  .vignetta .pensiero { white-space: nowrap; max-width: none; rotate: 0deg; }
  .vignetta .pensiero:nth-of-type(1) { left: 0; top: 0; }
  .vignetta .pensiero:nth-of-type(2) { left: auto; right: 0; top: 46px; }
  .vignetta .pensiero:nth-of-type(3) { left: auto; right: 0; top: auto; bottom: 48px; }
  .vignetta .pensiero:nth-of-type(4) { left: 0; top: auto; bottom: 48px; }
  .vignetta .pensiero:nth-of-type(5) { left: auto; right: 0; top: auto; bottom: 2px; }
  .vignetta .pensiero:nth-of-type(6) { left: 0; top: auto; bottom: 2px; }
  .in-testa { bottom: -30px; }
}
@media (max-width: 420px) {
  .marchio span { display: none; }
}

/* Domande frequenti (sezione #domande, di notte): domanda e risposta vicine, una dopo l'altra. */
.domande h3.gruppo { margin-top: 44px; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accento); }
.domande h2 + h3.gruppo { margin-top: 28px; }
.domande h4 { margin-top: 22px; font-size: 1.15rem; line-height: 1.3; color: var(--testo); }
.domande h3.gruppo + h4 { margin-top: 12px; }
.domande p { margin-top: .4em; }

/* Le pagine semplici (privacy, «non c'è»): stesso cielo dell'alba, fermo; testo scuro, righe corte, tabelle
   leggibili. Non caricano sito.js: per questo il piede va rimesso chiaro qui (html:not(.js) .piede lo farebbe notte). */
.semplice main { padding: 104px 0 24px; }
.semplice .colonna { max-width: 640px; }
.semplice h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); }
.semplice h2 { font-size: 1.55rem; margin-top: 46px; }
.semplice .grande { margin-top: .5em; }
.semplice main p, .semplice main li { color: var(--testo-2); font-size: 18px; }
.semplice main strong { color: var(--testo); }
.semplice main ul { margin: 1em 0 0; padding-left: 1.2em; }
.semplice main li { margin-top: 8px; }
.semplice main li ul { margin-top: 4px; }
.semplice main a:not(.tasto) { color: #004C9E; }
.semplice .dati { margin-top: 32px; }
.semplice .dati h2 { font-family: var(--serif); font-size: 1.5rem; margin-top: 0; }
.semplice .dati ul { margin-top: .6em; }
.indice { margin-top: 28px; }
.indice ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0 !important; }
.indice li { margin: 0 !important; font-size: 15px !important; }
.indice a { display: inline-block; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .6); text-decoration: none; }
.tabella { margin-top: 16px; overflow-x: auto; border-radius: 16px; border: 1px solid var(--bordo); background: var(--carta); }
.tabella table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.45; }
.tabella th, .tabella td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--bordo); }
.tabella tr:last-child th, .tabella tr:last-child td { border-bottom: 0; }
.tabella thead th { font-weight: 650; color: var(--testo); }
.tabella tbody th { font-weight: 500; color: var(--testo); overflow-wrap: anywhere; }
.tabella td { color: var(--testo-2); }
.tabella code { font: 14px ui-monospace, SFMono-Regular, Menlo, monospace; }
html.semplice .piede { background: transparent; --testo: #1D1D1F; --testo-2: #4A4A50; --fuoco: #1D1D1F; color: var(--testo); }

/* La pagina «non c'è» (/404/, la manda il Worker con stato 404 per gli indirizzi sbagliati). */
.nonce main { padding-top: max(18vh, 104px); padding-bottom: 12vh; }
.nonce .tasti { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Chi chiede meno movimento: niente animazioni (le scene diventano libere in sito.js). */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.js .appare, html.js .vignetta .pensiero { opacity: 1; transform: none; }
}
