/* ── PRODIGI® Manifesto page (chi-siamo) — extends home.css + page.css ── */

/* ── Film: large YouTube player under the hero, driven by static/js/film.js ──
   States on .film[data-state]: idle → loading → playing ⇄ paused → ended.
   .is-full: on screen alone (native fullscreen or .is-immersive, the CSS
   takeover used on iPhone and when a phone is turned sideways). */
.film {
  --film-radius: clamp(16px, 2.2vw, 30px);
  /* YouTube draws its title bar and logo in a band at the top and bottom of
     the iframe as playback starts: meanwhile the iframe is taller than the
     stage by this much on each side, the video stays 16:9 in the middle and
     the bands are cropped out. .is-settled (film.js) drops it once they are
     gone, so subtitles are never cut */
  --film-crop: 72px;
  position: relative;
  padding: clamp(8px, 2vw, 24px) 12px 0;
}
@media (min-width: 768px) { .film { padding-inline: clamp(24px, 4vw, 64px); } }
@media (min-width: 1280px) { .film { --film-crop: 96px; } }

/* As wide as possible, but always whole on screen */
.film__inner {
  position: relative;
  max-width: min(1520px, calc((100svh - 120px) * 16 / 9));
  margin-inline: auto;
}
/* Brand glow behind the frame */
.film__inner::before {
  content: ''; position: absolute; inset: 8% 6% -8%; z-index: -1; pointer-events: none;
  background: var(--grad); border-radius: 50%;
  filter: blur(80px); opacity: .26;
}
[data-theme="light"] .film__inner::before { opacity: .16; }

.film__frame {
  position: relative; overflow: hidden; isolation: isolate;
  aspect-ratio: 16 / 9;
  border-radius: var(--film-radius);
  background: #000;
  box-shadow: 0 40px 120px -40px rgba(0, 0, 0, .75);
}
/* Gradient hairline */
.film__frame::after {
  content: ''; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  padding: 1px; border-radius: inherit;
  background: var(--grad); opacity: .5;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.film__stage { position: absolute; inset: 0; }
.film__mount { position: absolute; inset: 0; overflow: hidden; }
.film__mount iframe {
  position: absolute; left: 0; width: 100%;
  top: calc(var(--film-crop) * -1);
  height: calc(100% + var(--film-crop) * 2);
  border: 0;
  pointer-events: none; /* clicks go to .film__surface: YouTube's hover UI never shows */
}
/* The browser refused to start the video from the page: YouTube's own play button takes the tap */
.film.is-native .film__mount iframe { pointer-events: auto; }
/* Armed (film.js arm): the player waits, paused, under the cover, which lets
   the first tap through to it — mobile browsers start a video with sound
   only on a tap inside the iframe */
.film.is-armed[data-state="idle"] .film__mount iframe { pointer-events: auto; }
.film.is-armed[data-state="idle"] .film__cover,
.film.is-armed[data-state="idle"] .film__surface { pointer-events: none; }

/* Click target over the video: play / pause */
.film__surface { position: absolute; inset: 0; z-index: 1; cursor: pointer; }
.film.is-native .film__surface { display: none; }
.film.is-quiet .film__surface { cursor: none; }

/* Our pause disc over YouTube's own, while it shows (.is-settled: gone) */
.film__bezel {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0; transition: opacity .6s ease;
}
.film[data-state="playing"]:not(.is-settled) .film__bezel { opacity: 1; transition: none; }
.film.is-native .film__bezel { display: none; }

/* Paused: frosted veil, also hides YouTube's pause overlay */
.film__veil {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: rgba(6, 6, 8, .45);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  opacity: 0; visibility: hidden;
  transition: opacity .5s ease, visibility .5s;
}
.film[data-state="paused"] .film__veil { opacity: 1; visibility: visible; }

/* ── Cover: poster, play button and title, until the video plays (and again at the end) ── */
.film__cover {
  position: absolute; inset: 0; z-index: 2;
  display: block; width: 100%; margin: 0; padding: 0; border: 0;
  background: #000; color: #fff;
  font: inherit; text-align: left; cursor: pointer;
  transition: opacity .8s ease, visibility .8s;
}
.film__cover img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.02);
  transition: transform 1.8s cubic-bezier(.2, .7, .2, 1);
}
.film__frame:hover .film__cover img { transform: scale(1.06); }
/* Cinematic vignette, darker at the foot for the title */
.film__cover::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .78) 100%),
    radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, .45) 100%);
}
.film[data-state="playing"] .film__cover,
.film[data-state="paused"] .film__cover,
.film.is-native .film__cover { opacity: 0; visibility: hidden; }
.film[data-state="ended"] .film__cover img { transform: scale(1.06); }

.film__play {
  position: absolute; left: 50%; top: 50%; z-index: 1;
  display: grid; place-items: center;
  width: clamp(64px, 8vw, 108px); aspect-ratio: 1;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transform: translate(-50%, -50%);
  transition: transform .6s cubic-bezier(.2, .7, .2, 1), background .3s;
}
.film__play svg { width: 34%; height: auto; margin-left: 7%; transition: opacity .3s; }
/* Gradient ring */
.film__play::before {
  content: ''; position: absolute; inset: 0; padding: 1.5px; border-radius: inherit;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
/* Slow breathing halo */
.film__play::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  animation: film-breathe 2.8s ease-out infinite;
}
@keyframes film-breathe {
  0% { box-shadow: 0 0 0 0 rgba(255, 0, 140, .38), 0 0 0 0 rgba(0, 255, 255, .22); }
  100% { box-shadow: 0 0 0 26px rgba(255, 0, 140, 0), 0 0 0 44px rgba(0, 255, 255, 0); }
}
.film__frame:hover .film__cover .film__play { transform: translate(-50%, -50%) scale(1.08); background: rgba(255, 255, 255, .2); }

/* Bezel: no halo, dark enough to hide YouTube's icon underneath */
.film__play--still { background: rgba(8, 8, 10, .62); }
.film__play--still::after { animation: none; }
.film__play--still svg { margin-left: 0; }

/* Loading: the ring turns into a spinner */
.film[data-state="loading"] .film__play svg { opacity: .35; }
.film[data-state="loading"] .film__play::before {
  padding: 2px;
  background: conic-gradient(from 0deg, transparent 0 30%, #FF008C 65%, #00FFFF);
  animation: film-spin 1s linear infinite;
}
.film[data-state="loading"] .film__play::after { animation: none; }
@keyframes film-spin { to { transform: rotate(1turn); } }

.film__caption {
  position: absolute; z-index: 1;
  left: clamp(18px, 4vw, 56px); right: clamp(18px, 4vw, 56px); bottom: clamp(14px, 3.6vw, 48px);
  display: grid; justify-items: start; gap: clamp(6px, 1vw, 12px);
}
.film__eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: clamp(10px, 1vw, 12px); font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase;
  color: rgba(255, 255, 255, .75);
}
.film__eyebrow::before { content: ''; width: 28px; height: 1px; background: var(--grad); }
.film__eyebrow-replay { display: none; }
.film[data-state="ended"] .film__eyebrow-start { display: none; }
.film[data-state="ended"] .film__eyebrow-replay { display: inline; }
.film__title {
  max-width: 20ch;
  font-size: clamp(18px, 3.4vw, 48px); font-weight: 500;
  letter-spacing: -0.03em; line-height: 1.05;
}

/* ── Controls: shown while the video is in use, hidden after a few idle seconds ── */
.film__controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; align-items: center; gap: clamp(6px, 1.2vw, 14px);
  padding: 56px clamp(10px, 2.4vw, 28px) clamp(8px, 1.8vw, 22px);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .65));
  color: #fff;
  pointer-events: none;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .45s ease, transform .45s cubic-bezier(.2, .7, .2, 1), visibility .45s;
}
.film__controls > * { pointer-events: auto; }
.film[data-state="playing"] .film__controls,
.film[data-state="paused"] .film__controls { opacity: 1; visibility: visible; transform: none; }
.film.is-quiet .film__controls:not(:focus-within) { opacity: 0; visibility: hidden; transform: translateY(8px); }

.film__btn {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: inherit; cursor: pointer;
  transition: background .2s;
}
.film__btn:hover { background: rgba(255, 255, 255, .14); }
.film__icon-pause,
.film__icon-muted,
.film__icon-collapse { display: none; }
.film[data-state="playing"] .film__icon-play { display: none; }
.film[data-state="playing"] .film__icon-pause { display: block; }
.film.is-muted .film__icon-sound { display: none; }
.film.is-muted .film__icon-muted { display: block; }
.film.is-full .film__icon-expand { display: none; }
.film.is-full .film__icon-collapse { display: block; }

.film__time {
  flex: none; min-width: 9ch;
  font-size: 13px; letter-spacing: .04em; font-variant-numeric: tabular-nums;
  opacity: .85;
}

/* Progress: thin brand-gradient line, thumb on hover / focus */
.film__seek {
  --pct: 0%;
  flex: 1; min-width: 0; height: 28px; margin: 0;
  background: transparent; cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.film__seek::-webkit-slider-runnable-track {
  height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, #FF008C, #00FFFF) 0 0 / var(--pct) 100% no-repeat, rgba(255, 255, 255, .24);
}
.film__seek::-moz-range-track {
  height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, #FF008C, #00FFFF) 0 0 / var(--pct) 100% no-repeat, rgba(255, 255, 255, .24);
}
.film__seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px; height: 13px; margin-top: -5px; border: 0; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .16);
  transform: scale(0); transition: transform .2s;
}
.film__seek::-moz-range-thumb {
  width: 13px; height: 13px; border: 0; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .16);
  transform: scale(0); transition: transform .2s;
}
.film__seek:hover::-webkit-slider-thumb,
.film__seek:focus-visible::-webkit-slider-thumb,
.film__seek:active::-webkit-slider-thumb { transform: none; }
.film__seek:hover::-moz-range-thumb,
.film__seek:focus-visible::-moz-range-thumb,
.film__seek:active::-moz-range-thumb { transform: none; }

/* Small frames: play button above the title */
@media (max-width: 767px) {
  .film__cover .film__play { top: 40%; }
}

@media (max-width: 479px) {
  .film__btn { width: 36px; height: 36px; }
  .film__time { min-width: 0; font-size: 12px; }
}

/* ── Full screen: native fullscreen, or the CSS takeover (.is-immersive) ── */
html.film-lock, html.film-lock body { overflow: hidden; }

.film.is-full { --film-crop: 110px; }
.film.is-full .film__inner { transform: none; transition: none; }
.film.is-full .film__inner::before,
.film.is-full .film__frame::after { display: none; }
.film.is-immersive .film__frame { position: fixed; inset: 0; z-index: 1000; }
.film.is-full .film__frame {
  width: 100%; height: 100%;
  aspect-ratio: auto; border-radius: 0; box-shadow: none;
}
/* 16:9 picture, as large as the screen allows, centred */
.film.is-full .film__stage {
  margin: auto;
  width: min(100%, 100vh * 16 / 9);
  height: min(100%, 100vw * 9 / 16);
}
@supports (height: 100dvh) {
  .film.is-full .film__stage {
    width: min(100%, 100dvh * 16 / 9);
    height: min(100%, 100dvw * 9 / 16);
  }
}
.film.is-full .film__controls {
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  padding-inline: max(24px, env(safe-area-inset-left)) max(24px, env(safe-area-inset-right));
}

/* Title bar gone: the iframe fits the stage, subtitles fully visible */
.film.is-settled { --film-crop: 0px; }

@media (prefers-reduced-motion: reduce) {
  .film__play::after { animation: none; }
  .film__cover img, .film__frame:hover .film__cover img { transform: none; transition: none; }
  .film[data-state="loading"] .film__play::before { animation-duration: 2.4s; }
}

/* ── Infrastructure: compact cards once .steps stacks (page.css, 860px) ──
   Icon beside the title instead of above it, tighter padding and gap */
@media (max-width: 860px) {
  .steps--compact { gap: 12px; }
  .steps--compact .step {
    display: grid; grid-template-columns: auto minmax(0, 1fr);
    column-gap: 16px; align-items: center;
    padding: 18px 20px;
  }
  .steps--compact .step__icon { grid-row: span 2; align-self: start; margin-bottom: 0; }
  .steps--compact .step h3 { margin: 0 0 4px; font-size: 20px; }
  .steps--compact .step p { font-size: 14px; }
}
