/* MedGalaxia showcase, version 2: sticky scenes driven by the scroll (--p from 0 to 1 per scene, set by sito.js),
   three environments (Notte, Nero, Chiaro) like the colour of a car in a configurator: only navy, black, white and
   cyan, never violet. System fonts, no third-party request. With prefers-reduced-motion every scene stands still and
   reads on its own; every interactive point also works with keyboard and buttons. */
:root, [data-ambiente="notte"] {
  --bg: #07111F; --bg-2: #0B1A2D; --panel: rgba(15, 28, 46, .78); --panel-solid: #0F1C2E; --line: rgba(120, 180, 220, .22);
  --accent: #2CC6E6; --accent-soft: rgba(44, 198, 230, .14); --on-accent: #04121C;
  --text: #E6F1FA; --muted: #A9BED1; --veil: 7, 17, 31; --leaf-off: #33506B; --leaf-on: #7CCB9E;
  color-scheme: dark;
}
[data-ambiente="nero"] {
  --bg: #000000; --bg-2: #0A0A0A; --panel: rgba(18, 18, 20, .82); --panel-solid: #121214; --line: rgba(255, 255, 255, .16);
  --accent: #2CC6E6; --accent-soft: rgba(44, 198, 230, .12); --on-accent: #001018;
  --text: #F3F6F8; --muted: #A3ACB5; --veil: 0, 0, 0; --leaf-off: #3A3F45; --leaf-on: #7CCB9E;
  color-scheme: dark;
}
[data-ambiente="chiaro"] {
  --bg: #EEF4F9; --bg-2: #FFFFFF; --panel: rgba(255, 255, 255, .86); --panel-solid: #FFFFFF; --line: rgba(14, 60, 90, .18);
  --accent: #0B7FA0; --accent-soft: rgba(11, 127, 160, .12); --on-accent: #FFFFFF;
  --text: #0B1B2B; --muted: #3D5468; --veil: 238, 244, 249; --leaf-off: #C3D3E0; --leaf-on: #3E9B6B;
  color-scheme: light;
}
:root { --gutter: max(16px, env(safe-area-inset-left, 0px)); --gutter-r: max(16px, env(safe-area-inset-right, 0px)); }
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: clip; transition: background-color .5s, color .5s; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.08; letter-spacing: -.025em; text-wrap: balance; font-weight: 700; }
h1, h2 { font-size: clamp(32px, 5.2vw, 72px); }
h3 { font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
p { margin: 0; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; } /* hidden wins over the display of buttons (sound, copy) */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: var(--gutter); top: -60px; z-index: 50; padding: 12px 16px; background: var(--accent); color: var(--on-accent); border-radius: 10px; font-weight: 700; text-decoration: none; }
.skip:focus { top: calc(12px + env(safe-area-inset-top, 0px)); }

/* header: brand and the environment selector (nothing towards the app) */
.top { position: fixed; inset: 0 0 auto; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) var(--gutter-r) 10px var(--gutter);
  background: linear-gradient(to bottom, rgba(var(--veil), .9), rgba(var(--veil), 0)); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none; min-height: 44px; }
.brand__rod { color: var(--accent); }
.amb { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.amb__b { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; min-width: 44px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); }
.amb__b[aria-checked="true"] { background: var(--accent-soft); color: var(--text); }
.amb__dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.amb__dot--notte { background: #07111F; } .amb__dot--nero { background: #000000; } .amb__dot--chiaro { background: #EEF4F9; }
@media (max-width: 520px) { .amb__l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .amb__b { padding: 0; justify-content: center; } }

.dots { position: fixed; right: calc(8px + env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%); z-index: 20; }
.dots ol { list-style: none; margin: 0; padding: 0; display: grid; }
.dots a { display: grid; place-items: center; width: 44px; height: 44px; }
.dots a::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); opacity: .5; transition: transform .3s, background .3s, opacity .3s; }
.dots a:hover::before, .dots a[aria-current="true"]::before { background: var(--accent); opacity: 1; transform: scale(1.5); }
@media (max-width: 899px) { .dots { display: none; } }

/* scenes: a tall section with a sticky stage; --p is the progress of the scene */
.scene { position: relative; height: calc(var(--len) * 1svh); --p: 0; }
.stage { position: sticky; top: 0; height: 100svh; overflow: hidden; isolation: isolate; display: grid; align-items: center;
  padding: calc(72px + env(safe-area-inset-top, 0px)) var(--gutter-r) calc(20px + env(safe-area-inset-bottom, 0px)) var(--gutter); }
.stage__inner { width: min(1180px, 100%); margin: 0 auto; display: grid; gap: clamp(16px, 4vw, 56px); align-items: center; min-width: 0; position: relative; z-index: 1; }
@media (min-width: 900px) {
  .stage__inner--split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .stage__inner--rev { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .stage__inner--rev > .copy { order: 2; }
}
.stage__inner--center { justify-items: center; text-align: center; gap: 16px; }
.stage__inner--low { align-self: end; padding-bottom: 6vh; }
.copy { max-width: 36rem; display: grid; gap: 14px; min-width: 0; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.lead { font-size: clamp(17px, 1.7vw, 20px); color: var(--muted); max-width: 34em; }
.source { font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.notice { display: inline-block; justify-self: start; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 14px; }
.notice--big { justify-self: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 15px; text-decoration: none; border: 0; cursor: pointer; }
.btn--ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn--ghost[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
@media (max-width: 899px) { .stage { align-items: start; } .copy { gap: 8px; } h1, h2 { font-size: clamp(26px, 7.6vw, 40px); } .lead { font-size: 15.5px; } }

.layer { position: absolute; inset: 0; z-index: -1; }
.layer img { width: 100%; height: 100%; object-fit: cover; }
.layer--side { left: auto; width: min(60%, 860px); opacity: .45; -webkit-mask-image: linear-gradient(to right, transparent, #000 40%); mask-image: linear-gradient(to right, transparent, #000 40%); }
.layer--left { left: 0; right: auto; -webkit-mask-image: linear-gradient(to left, transparent, #000 40%); mask-image: linear-gradient(to left, transparent, #000 40%); }
.layer--dim::after { content: ""; position: absolute; inset: 0; background: rgba(var(--veil), .72); }
.layer--side img { transform: translateY(calc((var(--p) - .5) * -60px)) scale(1.1); }

/* 1 · galaxy: flight into the layers, the word made of stars, a little movement with the pointer */
.scene--galassia .layer--bg img { transform: translate(calc(var(--mx, 0) * -14px), calc(var(--my, 0) * -10px)) scale(calc(1.05 + var(--p) * .55)); transform-origin: 62% 40%; will-change: transform; }
.scene--galassia .layer--bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(var(--veil), .95), rgba(var(--veil), .15) 55%, rgba(var(--veil), .3)); }
.stars { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.scene--galassia .copy { --t: clamp(0, (var(--p) - .38) * 4, 1); opacity: var(--t); transform: translateY(calc((1 - var(--t)) * 30px)); }
.scroll-hint { position: absolute; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); translate: -50% 0; z-index: 2; display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); opacity: clamp(0, 1 - var(--p) * 5, 1); }
.scroll-hint span { width: 22px; height: 34px; border: 2px solid var(--muted); border-radius: 12px; position: relative; }
.scroll-hint span::after { content: ""; position: absolute; left: 50%; top: 6px; width: 4px; height: 7px; margin-left: -2px; border-radius: 2px; background: var(--accent); animation: hint 1.8s ease-in-out infinite; }
@keyframes hint { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(10px); opacity: 0; } 100% { opacity: 0; } }

/* 2 · hospital (27/11/2026, user): the planet grows a little and slowly, behind the door and never behind the texts;
   the four doors one at a time, in the centre, large, each with its own stretch of scroll; numbers to jump to a door */
.planet { position: absolute; z-index: -1; left: 72%; top: 55%; width: min(95vmin, 900px); aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  transform: translate(-50%, -50%) scale(calc(.6 + var(--p) * .18)) rotate(calc(-6deg + var(--p) * 8deg)); opacity: calc(.28 + var(--p) * .12);
  box-shadow: 0 0 120px rgba(44, 198, 230, .3); will-change: transform; }
.planet__img, .planet__img img { width: 100%; height: 100%; object-fit: cover; }
.planet::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 40% 35%, transparent 30%, rgba(var(--veil), .85) 72%); }
.doors-wrap { display: grid; gap: 12px; min-width: 0; justify-items: center; }
.doors { list-style: none; margin: 0; padding: 0; display: grid; width: min(100%, 460px); }
.door { grid-area: 1 / 1; display: grid; align-content: start; border-radius: 18px; overflow: hidden; border: 1px solid var(--accent); background: var(--panel-solid);
  box-shadow: 0 0 0 1px var(--accent), 0 0 36px rgba(44, 198, 230, .35); opacity: 0; transform: translateY(18px) scale(.96); transition: opacity .5s ease, transform .5s ease; }
.door.is-on { opacity: 1; transform: none; }
.door__img img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.door__body { display: grid; gap: 6px; padding: 14px 16px 16px; }
.door__t { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 22px; }
.door__d { margin: 0; font-size: 16px; line-height: 1.45; color: var(--muted); }
.lock { width: 20px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 2; flex: none; }
.door-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; justify-content: center; }
.door-step { min-width: 44px; min-height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-weight: 700; font-size: 15px; cursor: pointer; }
.door-step[aria-current] { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
@media (max-width: 899px) { .planet { left: 50%; top: 82%; width: 105vmin; } .door__img img { aspect-ratio: 16 / 9; } .door__t { font-size: 20px; } .door__d { font-size: 15px; } }

/* 3 · heart: it beats on its own on screen, the ECG runs as on a monitor (sito.js draws it and moves the heart) */
.scene--cuore { background: radial-gradient(60% 50% at 70% 50%, rgba(28, 110, 140, .28), transparent 70%), var(--bg); }
.heart-lab { display: grid; gap: 12px; min-width: 0; }
.heart-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 12px; align-items: center; }
.heart-box { aspect-ratio: 1; -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent); mask-image: radial-gradient(closest-side, #000 72%, transparent); }
.heart, .heart img { width: 100%; height: 100%; object-fit: contain; }
.heart img { transform-origin: 50% 60%; transform: scale(var(--hs, 1), var(--hv, 1)); filter: drop-shadow(0 0 calc(18px + var(--hg, 0) * 30px) rgba(44, 198, 230, .55)); will-change: transform; }
.ecg-box { display: grid; gap: 6px; min-width: 0; }
.ecg { width: 100%; height: 170px; border-radius: 12px; background: var(--panel-solid); border: 1px solid var(--line); }
.phase { font-size: 14px; font-weight: 600; color: var(--accent); min-height: 1.5em; }
.heart-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.rate { display: grid; gap: 2px; font-size: 14px; flex: 1 1 220px; }
.rate input { width: 100%; min-height: 44px; accent-color: var(--accent); }
.times { display: flex; gap: 10px; margin: 0; }
.times div { flex: 1; padding: 8px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.times dt { font-size: 12px; color: var(--muted); } .times dd { margin: 0; font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.tones { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13.5px; color: var(--muted); }
.tones b { color: var(--accent); margin-right: 4px; }
@media (max-width: 899px) { .ecg { height: 104px; } .tones, .scene--cuore .source { display: none; } .heart-row { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } .times dd { font-size: 16px; } }

/* 4 · workspace: the page breaks up and becomes three flashcards; a tap turns a card */
.ws { display: grid; gap: 14px; min-width: 0; position: relative; }
.pdf { padding: 18px 20px; border-radius: 12px; background: #FDFEFF; color: #13212E; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); display: grid; gap: 8px; font-size: 14px; line-height: 1.5;
  transform: scale(calc(1 - var(--p) * .1)); transform-origin: 50% 0; }
.pdf__t { font-weight: 800; font-size: 18px; }
.pdf__l--c { --h: clamp(0, (var(--p) - .1) * 4 - var(--i) * .3, 1); background: linear-gradient(90deg, rgba(44, 198, 230, .35), rgba(44, 198, 230, .35)) no-repeat left / calc(var(--h) * 100%) 100%; border-radius: 4px;
  opacity: calc(1 - clamp(0, (var(--p) - .45) * 3, 1) * .55); }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; perspective: 900px; }
.cards li { --t: clamp(0, (var(--p) - .4) * 3.2 - var(--i) * .22, 1);
  opacity: var(--t); transform: translateY(calc((1 - var(--t)) * -120px)) scale(calc(.7 + var(--t) * .3)) rotate(calc((1 - var(--t)) * (var(--i) - 1) * 10deg)); }
.card { width: 100%; min-height: 150px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; }
.card__in { display: grid; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.card[aria-pressed="true"] .card__in { transform: rotateY(180deg); }
.card__f, .card__b { grid-area: 1 / 1; display: grid; align-content: start; gap: 8px; padding: 14px; border-radius: 14px; backface-visibility: hidden; -webkit-backface-visibility: hidden; font-size: 14px; line-height: 1.4; text-align: left; }
.card__f { background: var(--panel-solid); border: 1px solid var(--accent); }
.card__b { background: var(--accent); color: var(--on-accent); transform: rotateY(180deg); font-weight: 600; }
.card__k { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--accent); }
@media (max-width: 899px) { .pdf { font-size: 12.5px; padding: 12px 14px; gap: 5px; } .pdf__t { font-size: 15px; } .pdf__l:nth-child(n+4) { display: none; } .card { min-height: 126px; } .card__f, .card__b { font-size: 12px; padding: 9px; } .scene--workspace .source { display: none; } }

/* 5 · diagnostica: grey CT slices; the scroll or a drag changes slice; never colours on the images */
.viewer { display: grid; gap: 10px; min-width: 0; }
.viewer__screen { position: relative; aspect-ratio: 1; width: min(100%, 58svh); border-radius: 14px; overflow: hidden; background: #000; border: 1px solid var(--line); touch-action: pan-x; cursor: ns-resize; justify-self: center; }
.viewer__img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); user-select: none; -webkit-user-drag: none; }
.viewer__ov { position: absolute; font: 600 12px/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace; color: #E6E6E6; text-shadow: 0 1px 2px #000; pointer-events: none; }
.viewer__ov--tl { top: 10px; left: 12px; } .viewer__ov--bl { bottom: 10px; left: 12px; } .viewer__ov--br { bottom: 10px; right: 12px; }
.viewer__ctl { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.seg__b { min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg__b[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.slice { display: flex; align-items: center; gap: 6px; flex: 1 1 200px; }
.slice input { flex: 1; min-height: 44px; accent-color: var(--accent); }
.icon-b { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 20px; font-weight: 700; flex: none; }
@media (max-width: 899px) { .viewer__screen { width: min(100%, 38svh); } .seg__b { padding: 0 10px; font-size: 13px; } .scene--diagnostica .source { font-size: 11px; } }

/* 6 · crown: the leaves turn green with the scroll; the calculator saves nothing */
.scene--corona { background: radial-gradient(55% 45% at 72% 50%, rgba(28, 110, 140, .25), transparent 70%), var(--bg); }
.crown-lab { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: center; min-width: 0; }
@media (min-width: 900px) { .crown-lab { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.crown { width: min(100%, 340px); justify-self: center; }
.leaf { fill: var(--leaf-off); stroke: rgba(255, 255, 255, .15); stroke-width: .8; transition: fill .4s; }
.leaf.on { fill: var(--leaf-on); }
.ribbon { fill: var(--accent); }
.crown__n { fill: var(--text); font: 700 26px system-ui, sans-serif; }
.calc { display: grid; gap: 10px; padding: 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); min-width: 0; }
.calc__t { font-weight: 700; }
.calc__in { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.calc__in label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.calc__in input { min-height: 44px; width: 100%; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-solid); color: var(--text); font: 700 18px system-ui, sans-serif; }
.calc__out { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.calc__out div { padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); }
.calc__out dt { font-size: 12px; color: var(--muted); } .calc__out dd { margin: 0; font-weight: 800; font-size: 22px; font-variant-numeric: tabular-nums; }
@media (max-width: 899px) { .crown { width: min(52vw, 200px); } .crown-lab .source { display: none; } .calc { padding: 12px; gap: 8px; } }

/* 7 · arrival: the stars draw the rod of Asclepius (one staff, one serpent), the live countdown */
.sky-rod { width: min(96px, 20vw); height: auto; overflow: visible; }
.sky-rod path { fill: none; stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 1 1; filter: drop-shadow(0 0 4px rgba(44, 198, 230, .8)); }
.sky-rod__staff { stroke-width: 2.4; stroke-dashoffset: calc(1 - clamp(0, var(--p) * 2.4, 1)); }
.sky-rod__snake { stroke-width: 2; stroke-dashoffset: calc(1 - clamp(0, var(--p) * 2.4 - .4, 1)); }
.sky-rod__eye { fill: var(--accent); opacity: clamp(0, var(--p) * 3 - 1.2, 1); }
.sky-rod__stars circle { fill: var(--text); }
.finale__brand { display: block; font-size: clamp(44px, 8vw, 104px); background: linear-gradient(90deg, var(--text), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.finale__date { display: block; font-size: clamp(20px, 3vw, 34px); font-weight: 600; letter-spacing: -.01em; margin-top: 6px; }
.countdown { display: flex; flex-wrap: wrap; justify-content: center; align-items: end; gap: 8px; }
.countdown__l { width: 100%; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.cd { display: grid; min-width: 72px; padding: 8px 10px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.cd b { font-size: clamp(22px, 3.4vw, 34px); font-variant-numeric: tabular-nums; } .cd small { font-size: 12px; color: var(--muted); }
.finale__grid { display: grid; gap: 20px; width: min(760px, 100%); padding: 18px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
@media (min-width: 700px) { .finale__grid { grid-template-columns: 1fr 1fr; text-align: left; } }
.finale__grid > div { min-width: 0; }
.soon { color: var(--muted); font-size: 15px; }
.social { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.contact { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.contact__mail { font-size: 18px; font-weight: 600; overflow-wrap: anywhere; user-select: all; min-height: 44px; display: inline-flex; align-items: center; }
.copy-status { min-height: 1.4em; font-size: 14px; color: var(--muted); margin-top: 6px; }
@media (max-width: 899px) { .scene--arrivo .stage { align-items: center; } .finale__grid { padding: 14px; gap: 10px; } .cd { min-width: 58px; padding: 6px 8px; } .finale__brand { font-size: 40px; } .finale__grid h3 { margin-bottom: 4px; } }

.foot { padding: 28px var(--gutter-r) calc(28px + env(safe-area-inset-bottom, 0px)) var(--gutter); border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; display: grid; gap: 6px; text-align: center; }
.foot p { max-width: 70ch; margin-inline: auto; }
.foot a { display: inline-flex; align-items: center; min-height: 44px; }

/* still: with «riduci movimento» (or without JavaScript) every scene is a normal block, shown at its final state */
@media (prefers-reduced-motion: reduce) {
  body { transition: none; }
  .scene { height: auto; --p: 1 !important; }
  .stage { position: relative; height: auto; min-height: 100svh; }
  .scroll-hint span::after { animation: none; }
  .card__in, .leaf, .door, .dots a::before { transition: none; }
  .door { grid-area: auto; opacity: 1; transform: none; } .doors { gap: 12px; } .door-steps { display: none; }
  .cd--s.beat b, .cd--s.beat .cd__ecg { animation: none; }
}
.no-js .scene { height: auto; --p: 1; }
.no-js .stage { position: relative; height: auto; min-height: 100svh; }
.no-js .door { grid-area: auto; opacity: 1; transform: none; } .no-js .doors { gap: 12px; } .no-js .door-steps, .no-js .audio-b { display: none; }

/* «Privacy e note legali» */
.top--static { position: static; background: none; }
.legal__main { width: min(70ch, 100%); margin: 0 auto; padding: 8px var(--gutter-r) 48px var(--gutter); display: grid; gap: 18px; }
.legal__main h1 { font-size: clamp(32px, 5vw, 48px); }
.legal__main h2 { font-size: 22px; letter-spacing: -.01em; margin-bottom: 8px; }
.legal__main section { display: grid; gap: 10px; }
.legal__main p, .legal__main li { color: var(--muted); }
.legal__main ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.legal__main li a { display: inline-flex; min-height: 44px; align-items: center; }
.legal__updated { font-size: 14px; }
.notice--draft { justify-self: stretch; border-radius: 12px; border-color: var(--accent); background: var(--accent-soft); }
.todo { padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; color: var(--text) !important; }

/* scene lengths (in svh) and item indexes: here, not in style attributes (the CSP allows no inline style) */
#galassia { --len: 230; } #ospedale { --len: 460; } #cuore { --len: 150; } #workspace { --len: 260; } #diagnostica { --len: 260; } #corona { --len: 240; } #arrivo { --len: 200; }
[data-i="0"] { --i: 0; } [data-i="1"] { --i: 1; } [data-i="2"] { --i: 2; } [data-i="3"] { --i: 3; }

/* header tools: language switch and environment selector; heartbeat sound button */
.top__tools { display: inline-flex; align-items: center; gap: 8px; }
.lang { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-weight: 700; font-size: 14px; text-decoration: none; }
.lang:hover { border-color: var(--accent); }
.btn--icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn--icon[aria-pressed="false"] .wave { opacity: .25; }
@media (max-width: 520px) { .btn--icon span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .btn--icon { padding: 0 12px; } }

/* galaxy on the phone (27/11/2026, user): the background grows later and less, and does not follow the finger */
@media (max-width: 699px) {
  #galassia { --len: 290; }
  .scene--galassia .layer--bg img { transform: scale(calc(1.05 + var(--p) * var(--p) * .22)); }
}

/* the sound of the site: one switch in a corner, always visible, off at the start (27/11/2026, user) */
.audio-b { position: fixed; z-index: 25; left: calc(12px + env(safe-area-inset-left, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); background: var(--panel-solid);
  color: var(--text); cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.audio-b svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.audio-b__on { display: none; }
.audio-b[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.audio-b[aria-pressed="true"] .audio-b__on { display: inline; }
.audio-b[aria-pressed="true"] .audio-b__off { display: none; }
.audio-b:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* countdown: the seconds «beat» every second, with a tiny ECG spike under them (27/11/2026, user) */
.countdown .cd { position: relative; padding-bottom: 16px; }
.cd--s b { display: inline-block; }
.cd__ecg { position: absolute; left: 10px; right: 10px; bottom: 3px; width: calc(100% - 20px); height: 10px; fill: none; stroke: var(--accent); stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }
.cd--s.beat b { animation: cd-beat .5s ease-out; }
.cd--s.beat .cd__ecg { animation: cd-ecg .8s linear; }
@keyframes cd-beat { 0% { transform: scale(1); text-shadow: none; } 18% { transform: scale(1.12); text-shadow: 0 0 14px var(--accent); } 100% { transform: scale(1); text-shadow: none; } }
@keyframes cd-ecg { 0% { stroke-dashoffset: 1; opacity: .9; } 60% { stroke-dashoffset: 0; opacity: .9; } 100% { stroke-dashoffset: 0; opacity: 0; } }
