@font-face {
  font-family: 'Astralaga';
  src: url('fonts/astralaga-regular.woff2') format('woff2'),
       url('fonts/astralaga-regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Astralaga';
  src: url('fonts/astralaga-semibold.woff2') format('woff2'),
       url('fonts/astralaga-semibold.ttf') format('truetype');
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Astralaga';
  src: url('fonts/astralaga-bold.woff2') format('woff2'),
       url('fonts/astralaga-bold.ttf') format('truetype');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --paper: #efece4;
  --black: #10100f;
  --brick: #8a3b32;
  --line: rgba(16, 16, 15, .22);
  --mono: 'IBM Plex Mono', monospace;
  --display: 'Astralaga', Georgia, serif;
  --hero-serif: 'Astralaga', Georgia, serif;
  --sans: 'Bricolage Grotesque', system-ui, sans-serif;
  --role: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --role-size: clamp(1.0625rem, .55vw + .9rem, 1.375rem);
  --pad: clamp(20px, 4vw, 64px);
  --screen-height: 100vh;
}

@supports (height: 100dvh) {
  :root { --screen-height: 100dvh; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
.home-root { height: 100%; overflow: hidden; }
.work-root { height: 100%; overflow: hidden; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--black);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
body.drawer-open { overflow: hidden; }
a { color: inherit; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

.topbar {
  position: relative;
  z-index: 80;
  min-height: 88px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 17px var(--pad);
  border-bottom: 1px solid var(--line);
}
.home-page {
  height: var(--screen-height);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
}
.home-page .topbar {
  position: fixed; inset: 0 0 auto;
  color: white;
  border-color: rgba(255,255,255,.35);
  mix-blend-mode: difference;
}
.home-page main > section {
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.wordmark {
  justify-self: start;
  display: flex;
  flex-direction: column;
  font-size: .9375rem;
  font-weight: 700;
  line-height: 1.08;
  text-decoration: none;
  letter-spacing: -.02em;
}
.language {
  justify-self: end;
  display: flex;
  gap: 5px;
  font-family: var(--mono);
  font-size: .75rem;
}
.language a { padding: 7px; text-decoration: none; opacity: .35; }
.language a.on { opacity: 1; }
.top-contact {
  justify-self: center;
  font-family: var(--mono);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  text-underline-offset: 5px;
}
.site-footer {
  min-height: 78px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px var(--pad);
  border-top: 1px solid currentColor;
  font-family: var(--mono);
  font-size: .75rem;
  text-transform: uppercase;
}
.site-footer p { margin: 0; }

/* Home — manifesto e indice, non catalogo. */
.home-hero {
  position: relative;
  isolation: isolate;
  min-height: var(--screen-height);
  padding: clamp(116px, 13vh, 150px) var(--pad) 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  gap: 36px;
  overflow: hidden;
}
.hero-silhouette {
  position: absolute;
  z-index: -1;
  right: clamp(-120px, -5vw, -54px);
  bottom: clamp(-110px, -8vh, -54px);
  width: clamp(540px, 43vw, 760px);
  height: auto;
  opacity: .13;
  pointer-events: none;
  user-select: none;
  filter: saturate(.68) contrast(1.04);
}
.hero-copy,
.hero-intro,
.scroll-cue {
  position: relative;
  z-index: 1;
}
.overline {
  margin: 0 0 clamp(14px, 2vh, 24px);
  font-family: var(--sans);
  font-size: clamp(14px, 1.15vw, 17px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.015em;
}
.role-type,
.role,
.stage-role,
.tour-role {
  font-family: var(--role);
  font-size: var(--role-size);
  font-weight: 600;
  font-variant-caps: all-small-caps;
  text-transform: uppercase;
  letter-spacing: .075em;
}
.home-hero h1 {
  max-width: 1100px;
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(4rem, 8vw + 2.9rem, 11.25rem);
  font-weight: 600;
  line-height: .84;
  letter-spacing: -.055em;
}
.home-hero h1 span, .home-hero h1 em { display: block; }
.home-hero h1 span { color: #782d3b; }
.home-hero h1 em {
  margin-top: 0;
  font-family: var(--hero-serif);
  font-weight: 400;
  width: max-content;
  padding-right: .08em;
  font-style: normal;
  transform: skewX(-9deg);
  transform-origin: left bottom;
  line-height: inherit;
  letter-spacing: inherit;
  color: var(--black);
}
.hero-intro {
  align-self: start;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0;
  min-width: 0;
  width: 100%;
  max-width: none;
  margin-top: clamp(0px, 2vh, 24px);
}
.hero-intro blockquote {
  margin: 0;
  padding: 0 clamp(28px, 3.5vw, 56px) 0 0;
  text-align: right;
}
.hero-intro blockquote p {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(1.5625rem, 1.7vw + .65rem, 2.625rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}
.hero-intro cite {
  font-family: var(--mono);
  font-size: .75rem;
  font-style: normal;
}
.hero-intro-copy {
  max-width: 46em;
  min-height: 100%;
  padding-left: clamp(28px, 3.5vw, 56px);
  border-left: 1px solid var(--line);
  font-size: clamp(1rem, .9vw + .4rem, 1.1875rem);
  line-height: 1.5;
}
.hero-intro-copy p { margin: 0; }
.hero-intro-copy p + p { margin-top: .75em; }
@media (min-width: 901px) {
  .home-hero .hero-intro-copy {
    max-width: 46em;
  }
}
.scroll-cue {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: .75rem;
  text-decoration: none;
  text-transform: uppercase;
}
.scroll-cue i,
.index-arrow,
.work-next i {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 1em;
  height: 1em;
  font-size: 0;
  line-height: 1;
  color: currentColor;
}
.scroll-cue i::before,
.index-arrow::before,
.work-next i::before {
  content: '';
  position: absolute;
  inset: 0;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: translate(.1em, .1em) rotate(45deg);
  transform-origin: center;
}
.scroll-cue i {
  width: 1.2em;
  height: 1.2em;
}
.scroll-cue i::before {
  border-width: 1.5px;
  transform: translate(.18em, .18em) rotate(45deg);
}

.work-index {
  height: var(--screen-height);
  min-height: var(--screen-height);
  display: flex;
  flex-direction: column;
  background: var(--black);
  color: var(--paper);
  padding: clamp(100px, 11vh, 130px) var(--pad) 0;
  overflow: hidden;
}
.home-page .index-heading { flex: 0 0 auto; padding-bottom: clamp(32px, 4vh, 56px); }
.index-heading {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 32px;
  padding-bottom: 100px;
}
.index-heading p {
  margin: 9px 0;
  font-family: var(--mono);
  font-size: .75rem;
  text-transform: uppercase;
}
.index-heading h2 {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(2.25rem, 2.6vw, 3.5rem);
  font-weight: 600;
  line-height: .94;
  letter-spacing: -.04em;
}
.index-list { border-top: 1px solid rgba(239, 236, 228, .3); }
.home-page .index-list { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.home-page .index-item { flex: 1 1 0; min-height: 0; }
.index-item {
  position: relative;
  isolation: isolate;
  min-height: 118px;
  display: grid;
  grid-template-columns: 7vw minmax(240px, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 24px 0;
  overflow: hidden;
  border-bottom: 1px solid rgba(239, 236, 228, .3);
  text-decoration: none;
  transition: color .25s ease, padding .25s ease;
}
.index-item::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--preview, #d9ff00);
  transform: translateY(102%);
  transition: transform .35s cubic-bezier(.7, 0, .2, 1);
}
.index-item:hover { color: var(--preview-ink, #10100f); padding-inline: 20px; }
.index-item:hover::before { transform: translateY(0); }
.index-no {
  font-family: var(--mono);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.index-name {
  font-family: var(--sans);
  font-size: clamp(1.5rem, 2.5vw + 1rem, 3.375rem);
  font-weight: 600;
  line-height: .95;
  letter-spacing: -.03em;
  word-spacing: .06em;
}
.index-mark {
  position: absolute;
  right: 7vw;
  z-index: -1;
  opacity: 0;
  font-family: var(--display);
  font-size: clamp(3.75rem, 6.3vw + 2.4rem, 8.75rem);
  font-style: normal;
  transform: translateX(30px) rotate(-5deg);
  transition: .3s ease;
}
.index-item:hover .index-mark { opacity: .18; transform: translateX(0) rotate(-5deg); }
.index-arrow { margin-left: .25em; }
.preview-studio { --preview: #d7ff36; }
.preview-session { --preview: #ff6b35; }
.preview-screen { --preview: #bfc7ff; }
.preview-stage { --preview: #a5142d; --preview-ink: #fff4df; }
.preview-tour { --preview: #304ffe; --preview-ink: white; }
.preview-teaching { --preview: #ffde59; }
.preview-education { --preview: #b8d8c0; }
.preview-archive { --preview: #d9d1c3; }
.preview-console { --preview: #2a1547; --preview-ink: #ece4fb; }

.home-contact {
  min-height: var(--screen-height);
  padding: 100px var(--pad) 50px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.home-contact h2 {
  margin: 0;
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 400;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.home-contact > a {
  width: max-content;
  font-family: var(--display);
  font-size: clamp(1.5rem, 3.9vw + 1.4rem, 5rem);
  line-height: .9;
  text-decoration-thickness: 2px;
  text-underline-offset: 12px;
}
.contact-bottom {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  font-family: var(--mono);
  font-size: .75rem;
  text-transform: uppercase;
}
.contact-bottom div { display: flex; gap: 24px; }

/* Pagine lavoro — impianto condiviso, scena diversa per ogni disciplina. */
.work-page {
  --bg: #f0eee8;
  --ink: #111;
  --accent: #d7ff36;
  --soft: rgba(17, 17, 17, .1);
  background: var(--bg);
  color: var(--ink);
  height: var(--screen-height);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
}
.work-page .work-hero,
.work-page .sec,
.work-page .work-next {
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.work-page .topbar {
  position: absolute;
  inset: 0 0 auto;
  color: var(--hero-ink, var(--ink));
  border-color: color-mix(in srgb, var(--hero-ink, var(--ink)) 25%, transparent);
}
.work-toolbar {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 48px);
}
.work-switch,
.work-step {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-family: var(--mono);
  font-size: .75rem;
  text-transform: uppercase;
  text-decoration: none;
}
.work-switch { gap: 14px; }
.work-switch i,
.work-step i { width: 24px; height: 1px; flex: 0 0 auto; background: currentColor; position: relative; }
.work-switch i::after,
.work-step i::after { content: ''; position: absolute; right: 0; top: -3px; width: 7px; height: 7px; border-right: 1px solid; border-bottom: 1px solid; transform: rotate(45deg); }
.work-step-prev i { transform: rotate(180deg); }
.work-step:hover { opacity: .55; }
.work-step-copy { min-width: 0; display: flex; align-items: baseline; gap: 7px; }
.work-step-copy small { opacity: .55; font: inherit; }
.work-step-copy strong { max-width: 28ch; overflow: hidden; font: inherit; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.work-step-prev .work-step-copy { text-align: left; }
.work-step-next .work-step-copy { text-align: right; }
.work-drawer {
  position: fixed;
  z-index: 100;
  inset: 0;
  padding: 24px var(--pad) 40px;
  overflow-y: auto;
  background: #111;
  color: #f5f0e7;
  transform: translateY(-102%);
  visibility: hidden;
  transition: transform .45s cubic-bezier(.7, 0, .2, 1), visibility .45s;
}
.work-drawer.open { transform: translateY(0); visibility: visible; }
.drawer-top { display: flex; justify-content: space-between; border-bottom: 1px solid #555; }
.drawer-top p { font-family: var(--mono); font-size: .75rem; text-transform: uppercase; }
.drawer-close { border: 0; background: none; color: inherit; font-size: 2.25rem; cursor: pointer; }
.work-drawer nav a {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: baseline;
  padding: 13px 0;
  border-bottom: 1px solid #333;
  text-decoration: none;
  opacity: .55;
  transition: opacity .2s, padding .2s;
}
.work-drawer nav a:hover, .work-drawer nav a.current { opacity: 1; padding-left: 14px; }
.work-drawer nav span { font-family: var(--mono); font-size: .75rem; }
.work-drawer nav strong { min-width: 0; overflow-wrap: anywhere; font-size: clamp(1.75rem, 3.5vw + 1rem, 4rem); line-height: 1; letter-spacing: -.035em; }


.work-hero {
  position: relative;
  min-height: var(--screen-height);
  display: grid;
  grid-template-columns: 1fr 2fr;
  grid-template-rows: auto 1fr auto;
  gap: 22px 50px;
  padding: 145px var(--pad) 54px;
  overflow: hidden;
  background: var(--hero-bg, var(--bg));
  color: var(--hero-ink, var(--ink));
}
.work-number {
  position: relative;
  z-index: 2;
  margin: 0;
  font-family: var(--mono);
  font-size: .75rem;
  text-transform: uppercase;
}
.work-hero h1 {
  position: relative;
  z-index: 2;
  grid-column: 1 / -1;
  align-self: center;
  max-width: 1250px;
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(4.25rem, 8.4vw + 3.2rem, 11.875rem);
  font-weight: 600;
  line-height: .85;
  letter-spacing: -.045em;
  word-spacing: .08em;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
}
.work-hero h1 span { display: block; }
.work-mark {
  position: absolute;
  right: -2vw;
  bottom: -8vw;
  opacity: .1;
  font-family: var(--display);
  font-size: clamp(11.25rem, 27vw + 7rem, 37.5rem);
  font-style: normal;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}
.sec {
  position: relative;
  min-height: var(--screen-height);
  padding: 110px var(--pad) 150px;
}
.sec > :not(.sec-end-lock) {
  width: 100%;
  max-width: var(--content-max, none);
  margin-inline: auto;
}
.sec-end-lock {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  pointer-events: none;
  scroll-snap-align: end;
  scroll-snap-stop: always;
}
.sec-head {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  margin-bottom: 72px;
  padding-bottom: 14px;
  border-bottom: 1px solid currentColor;
}
.sec-title { margin: 0; font-family: var(--mono); font-size: .75rem; font-weight: 700; text-transform: uppercase; }
.sec-count { font-family: var(--mono); font-size: .75rem; }
.work-next {
  min-height: var(--screen-height);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 70px var(--pad);
  background: var(--ink);
  color: var(--bg);
}
.work-next a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0;
  border-bottom: 1px solid;
  font-family: var(--sans);
  font-size: clamp(3.125rem, 6.3vw + 2.4rem, 8.75rem);
  font-weight: 600;
  line-height: .95;
  letter-spacing: -.04em;
  text-decoration: none;
}
.work-next a span { min-width: 0; overflow-wrap: anywhere; }
.work-next i { margin-left: .3em; width: .9em; height: .9em; }

/* Produzione: studio tecnico, griglia serrata, verde segnale. */
.theme-studio { --bg: #e8e8df; --ink: #121310; --accent: #d7ff36; --hero-bg: #d7ff36; }
.theme-studio .work-hero::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(0,0,0,.07) calc(10% - 1px) 10%);
}
.theme-studio .cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 60px 20px; }
.theme-studio .card:nth-child(4n + 2), .theme-studio .card:nth-child(4n + 4) { transform: translateY(36px); }

/* Session: materia calda, album come tasti sfalsati. */
.theme-session { --bg: #f0ddc8; --ink: #24130d; --accent: #ff6433; --hero-bg: #ff6433; }
.theme-session .work-hero h1 { font-family: var(--sans); font-weight: 600; font-style: normal; }
.theme-session .work-mark { opacity: .18; letter-spacing: -.2em; }
.theme-session .cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.theme-session .card { padding: 20px; border: 1px solid currentColor; border-radius: 999px 999px 12px 12px; }

/* Cinema: buio, frame orizzontali, tipografia da titoli di coda. */
.theme-screen { --bg: #0b0c10; --ink: #e7e9f2; --accent: #bfc7ff; --hero-bg: #090a0e; --hero-ink: #e7e9f2; }
.theme-screen .work-hero { border-bottom: 1px solid #444; }
.theme-screen .work-hero::after { content: ''; position: absolute; inset: 12% 6%; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; filter: blur(1px); transform: scale(1.4, .55); }
.theme-screen .mlist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  border-top: 0;
}
.theme-screen .mitem {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #444;
  background: color-mix(in srgb, var(--bg) 88%, black);
}
.theme-screen .mthumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid #444;
  background: #151720;
}
.theme-screen .mbody {
  --card-pad: clamp(20px, 2.4vw, 30px);
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: var(--card-pad);
}
.theme-screen .mhead { margin-bottom: 16px; }
.theme-screen .mbody h3 {
  font-size: clamp(2.25rem, 3.2vw, 3.75rem);
  overflow-wrap: anywhere;
}
.theme-screen .role { margin-bottom: 12px; }
.theme-screen .credits { min-height: 3.5em; margin-bottom: 0; }
.theme-screen .media-details {
  min-height: 43px;
  margin-top: auto;
  margin-bottom: calc(-1 * var(--card-pad));
  padding-top: 0;
}
.theme-screen .mbody.has-media-action > .media-details { margin-top: 0; }
.theme-screen .media-details summary {
  position: relative;
  z-index: 22;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-top: 1px solid #444;
  background: color-mix(in srgb, var(--bg) 88%, black);
  color: var(--accent);
  cursor: pointer;
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .05em;
  list-style: none;
  text-transform: uppercase;
}
.theme-screen .media-details summary::-webkit-details-marker { display: none; }
.theme-screen .media-details summary::after { content: '+'; color: var(--ink); font-size: 1rem; }
.theme-screen .media-details[open] summary::after { content: '−'; }
.theme-screen .media-description { padding: var(--card-pad); }
.theme-screen .media-details[open] .media-description {
  position: absolute;
  z-index: 21;
  inset: 0 0 43px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #151720;
}
.theme-screen .playbtn { align-self: stretch; }

/* Teatro: sipario, locandine verticali, oro spento. */
.theme-stage { --bg: #f1dfc4; --ink: #401018; --accent: #d2a84a; --hero-bg: #8f1029; --hero-ink: #fff0d6; }
.theme-stage .work-hero { background-image: linear-gradient(90deg, rgba(0,0,0,.22), transparent 22%, transparent 78%, rgba(0,0,0,.22)), repeating-linear-gradient(90deg, transparent 0 11%, rgba(255,255,255,.035) 11% 22%); }
.theme-stage .work-hero h1 { font-family: var(--sans); font-weight: 600; text-align: center; }
.theme-stage .timeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 8px; gap: 18px; align-items: start; }
.theme-stage .timeline li { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; overflow: hidden; border: 1px solid color-mix(in srgb, currentColor 68%, transparent); background: color-mix(in srgb, white 10%, transparent); text-align: center; }
.theme-stage .timeline li:nth-child(4n + 2),
.theme-stage .timeline li:nth-child(4n + 4) { margin-top: 36px; }
.theme-stage .media-stack { order: 2; width: 100%; }
.theme-stage .tmedia { width: 100%; margin: 0; aspect-ratio: auto; }
.theme-stage .tmedia.media-empty { display: none; }
.theme-stage .tmedia .media-back { display: none; }
.theme-stage .tmedia .media-main { position: static; height: auto; object-fit: contain; object-position: center; }
.theme-stage .tbody { order: 1; display: flex; flex-direction: column; align-items: stretch; padding: 14px; }
.theme-stage .tbody h3 { margin-bottom: 8px; font-size: clamp(1.25rem, 1.4vw + .25rem, 1.75rem); }
.theme-stage .stage-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 7px; align-items: baseline; margin: 0; color: color-mix(in srgb, currentColor 68%, transparent); font-size: .75rem; }
.theme-stage .stage-meta i { font-style: normal; }
.theme-stage .stage-meta time { font-family: var(--mono); font-size: .6875rem; white-space: nowrap; }
.theme-stage .timeline .stage-role { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid color-mix(in srgb, currentColor 22%, transparent); color: var(--ink); font-size: var(--role-size); line-height: 1.15; }
/* Tour: poster elettrico e lista da scaletta. */
.theme-tour { --bg: #dce3ff; --ink: #0e1b55; --accent: #304ffe; --hero-bg: #183cff; --hero-ink: white; }
.theme-tour .work-hero { background-image: radial-gradient(circle at 80% 20%, #a7ff4f 0 2px, transparent 3px), radial-gradient(circle at 15% 80%, #a7ff4f 0 1px, transparent 2px); background-size: 37px 37px, 23px 23px; }
.theme-tour .work-hero h1 { text-transform: uppercase; transform: skewY(-4deg); text-shadow: .04em .04em 0 #0a1c89; }
.theme-tour .timeline { list-style: none; margin: 0; padding: 0; }
.theme-tour .timeline li { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); align-items: center; gap: 24px; padding: 18px 0; border-bottom: 2px solid; }
.theme-tour .timeline li:first-child { border-top: 2px solid; }
.theme-tour .tmedia { aspect-ratio: 4 / 3; }
.theme-tour .timeline .tbody h3 {
  margin-bottom: 8px;
  font-family: var(--sans);
  font-size: clamp(1.875rem, 2.8vw + 1.1rem, 3.875rem);
  font-weight: 600;
  line-height: .9;
  letter-spacing: -.035em;
}
.theme-tour .tour-event {
  display: block;
  margin-bottom: 7px;
  font-size: clamp(.875rem, 1vw + .35rem, 1.1875rem);
  font-weight: 500;
  line-height: 1.1;
}
.theme-tour .tour-details { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 8px; color: color-mix(in srgb, currentColor 68%, transparent); font: .75rem var(--mono); }
.theme-tour .tour-details i { font-style: normal; }

/* Docenza: quaderno, moduli sovrapposti. */
.theme-teaching { --bg: #fff8d6; --ink: #22200f; --accent: #ffde59; --hero-bg: #ffde59; }
.theme-teaching .work-hero { background-image: linear-gradient(rgba(0,0,0,.08) 1px, transparent 1px); background-size: 100% 32px; }
.theme-teaching .work-hero h1 { font-family: var(--sans); font-weight: 600; }
.theme-teaching .blocks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.theme-teaching .block { min-height: 290px; padding: 30px; background: #fffdf2; border: 1px solid; box-shadow: 9px 9px 0 var(--ink); transform: rotate(-1deg); font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; }
.theme-teaching .block:nth-child(even) { transform: rotate(1deg) translateY(25px); }
.theme-teaching .block-academic-head { margin: 0 0 20px; padding: 0 0 16px; border-bottom: 1px solid color-mix(in srgb, currentColor 24%, transparent); }
.theme-teaching .block-institution { margin: 0; padding: 0; background: none; border: 0; }
.theme-teaching .block-institution strong { color: color-mix(in srgb, currentColor 66%, transparent); font-family: var(--mono); font-size: clamp(.6875rem, .25vw + .64rem, .8125rem); font-weight: 500; letter-spacing: -.015em; line-height: 1.25; }
.theme-teaching .block-academic-head h3 { margin: 4px 0 0; color: currentColor; font-family: var(--display); font-size: clamp(1.5rem, 1vw + 1.15rem, 2rem); font-variant-caps: normal; font-weight: 600; letter-spacing: -.025em; line-height: 1.02; }

/* Formazione: modernismo accademico, ordine e misura. */
.theme-education { --bg: #dbe9df; --ink: #173328; --accent: #9cbd9f; --hero-bg: #b8d8c0; }
.theme-education .work-hero h1 { max-width: 1000px; font-family: var(--sans); font-weight: 600; }
.theme-education .blocks { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }
.theme-education .block { grid-column: span 6; padding: 24px 0 60px; border-top: 3px solid; }
.theme-education .block:nth-child(3n) { grid-column: 4 / span 6; }

/* Pubblicazioni: pagina editoriale, margini larghi. */
.theme-archive { --bg: #e9e3d9; --ink: #171512; --accent: #cbc1b1; --hero-bg: #d8d0c3; }
.theme-archive .work-hero h1 { font-family: var(--sans); font-weight: 600; }
.theme-archive .blocks { margin: 0 auto; }
.theme-archive .block { padding: 60px; border: 1px solid; background: #f4efe7; }
.theme-archive .block h3 { font-family: var(--display); font-size: clamp(2.25rem, 3.5vw + 1.1rem, 4.375rem); font-weight: 400; line-height: 1; }

/* Competenze: indice editoriale, con il viola usato come segnale. */
.theme-console { --bg: #eae5f2; --ink: #1d1230; --accent: #6f3ff5; --hero-bg: #2a1547; --hero-ink: #ece4fb; }
.theme-console .work-hero h1 { font-family: var(--sans); font-weight: 600; }
.theme-console .work-hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(6.25% - 1px), rgba(236, 228, 251, .09) calc(6.25% - 1px) 6.25%),
    repeating-linear-gradient(0deg, transparent 0 calc(25% - 1px), rgba(236, 228, 251, .06) calc(25% - 1px) 25%);
}
.skills { border-top: 1px solid currentColor; }
.skill {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(0, 2fr);
  gap: clamp(30px, 6vw, 96px);
  min-width: 0;
  padding: clamp(34px, 5vw, 72px) 0;
  border-bottom: 1px solid currentColor;
}
.skill-featured {
  padding-left: clamp(18px, 2.5vw, 36px);
  box-shadow: inset 4px 0 0 var(--accent);
}
.skill-no { font-family: var(--mono); font-size: .75rem; color: var(--accent); }
.skill-featured .skill-no::after { content: ' · IN EVIDENZA'; }
.skill-side h3 {
  max-width: 14ch;
  margin: 14px 0 0;
  font-family: var(--sans);
  font-size: clamp(2rem, 3.2vw, 3.75rem);
  font-weight: 600;
  line-height: .94;
  letter-spacing: -.045em;
}
.skill-copy { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.skill-lead {
  max-width: 48ch;
  margin: 0 0 8px;
  font-size: clamp(1.125rem, 1.5vw, 1.5rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.02em;
}
.skill-lead-copy .skill-lead + .skill-lead { margin-top: 12px; }
.skill-points { max-width: 70ch; margin: 4px 0 0; padding: 0; list-style: none; }
.skill-points li {
  position: relative;
  margin: 0;
  padding: 14px 0 14px 28px;
  border-top: 1px solid color-mix(in srgb, currentColor 25%, transparent);
  font-size: 1rem;
  line-height: 1.55;
  opacity: .84;
}
.skill-points li::before {
  content: '●';
  position: absolute;
  top: 16px;
  left: 0;
  color: var(--accent);
  font-size: .65em;
}
.skill-point-paragraph { margin: 0; }
.skill-point-paragraph + .skill-point-paragraph { margin-top: .8em; }
.skills-tools {
  margin-top: clamp(42px, 6vw, 88px);
  padding: clamp(30px, 4.5vw, 64px);
  background: var(--ink);
  color: var(--bg);
}
.skills-tools-head { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr); gap: 28px; align-items: end; }
.skills-tools-head span { color: var(--accent); font-family: var(--mono); font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; }
.skills-tools-head h3 { margin: 0; font-family: var(--sans); font-size: clamp(2rem, 3.2vw, 3.75rem); line-height: .94; letter-spacing: -.045em; }
.skills-tools-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(28px, 4vw, 64px); margin: clamp(28px, 4vw, 52px) 0 0; }
.skills-tools-group { margin: 0; padding: 20px 0 24px; border-top: 1px solid color-mix(in srgb, var(--bg) 28%, transparent); }
.skills-tools-group dt { margin: 0 0 10px; color: var(--accent); font-family: var(--mono); font-size: .6875rem; letter-spacing: .06em; text-transform: uppercase; }
.skills-tools-group dd { margin: 0; max-width: 48ch; font-family: var(--sans); font-size: clamp(.9375rem, .35vw + .86rem, 1.0625rem); line-height: 1.55; }

/* Immagini adattive: file completo + riempimento sfocato per ogni proporzione. */
.adaptive-media {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--soft, rgba(0, 0, 0, .08));
}
.adaptive-media .media-back { position: absolute; z-index: 0; inset: -10%; overflow: hidden; }
.adaptive-media .media-back img {
  width: 100%; height: 100%; object-fit: cover;
  filter: blur(18px) saturate(.8); transform: scale(1.12); opacity: .58;
}
.adaptive-media .media-main {
  /* Assoluta: in flusso, height:100% si risolverebbe contro la riga/contenuto
     (alta quanto l'immagine originale) e non contro il riquadro, annullando il contain. */
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; display: block; object-fit: contain;
}
.media-empty { display: grid; place-items: center; }
.media-placeholder { position: relative; z-index: 1; font-family: var(--display); font-size: clamp(3.375rem, 5.6vw + 2.2rem, 7.5rem); opacity: .22; }

/* Modelli creati dall'admin: quattro strutture, un solo linguaggio visivo. */
.flexible-section {
  --flex-gap-x: 22px;
  --flex-gap-y: 58px;
}
.flex-density-compact { --flex-gap-x: 14px; --flex-gap-y: 28px; }
.flex-density-airy { --flex-gap-x: 36px; --flex-gap-y: 92px; }
.flex-media,
.flex-list-media,
.flex-timeline-media,
.flex-block-media { width: 100%; }
.flex-ratio-square :is(.flex-media, .flex-list-media, .flex-timeline-media, .flex-block-media) { aspect-ratio: 1; }
.flex-ratio-portrait :is(.flex-media, .flex-list-media, .flex-timeline-media, .flex-block-media) { aspect-ratio: 3 / 4; }
.flex-ratio-landscape :is(.flex-media, .flex-list-media, .flex-timeline-media, .flex-block-media) { aspect-ratio: 16 / 9; }
.flex-ratio-natural :is(.flex-media, .flex-list-media, .flex-timeline-media, .flex-block-media) { min-height: 180px; }
.flex-kicker,
.flex-list-index,
.flex-timeline-date,
.flex-tag {
  font-family: var(--mono);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.flex-kicker { display: flex; justify-content: space-between; gap: 16px; margin: 15px 0 10px; }
.flexible-section h3 { margin: 0; font-size: clamp(1.5rem, 2vw + .7rem, 2.75rem); font-weight: 500; line-height: .98; letter-spacing: -.03em; }
.flex-subtitle { margin: 8px 0 0; font-size: .8125rem; opacity: .62; }
.flex-body { max-width: 65ch; margin: 18px 0 0; font-size: .9375rem; line-height: 1.55; }
.flex-body + .flex-body { margin-top: 10px; }
.flex-link { display: inline-block; margin-top: 20px; font-family: var(--mono); font-size: .75rem; text-transform: uppercase; text-underline-offset: 4px; }
.flex-grid,
.flex-blocks,
.flex-timeline { display: grid; grid-template-columns: repeat(var(--flex-cols), minmax(0, 1fr)); gap: var(--flex-gap-y) var(--flex-gap-x); }
.flex-card { min-width: 0; padding-top: 12px; border-top: 1px solid currentColor; }
.flex-card-copy { min-width: 0; }
.flex-card .flex-body { font-size: .8125rem; }

.flex-list {
  display: grid;
  grid-template-columns: repeat(var(--flex-cols), minmax(0, 1fr));
  gap: 0 var(--flex-gap-x);
}
.flex-list-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(14px, 2vw, 28px);
  align-items: start;
  padding: var(--flex-gap-y) 0;
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
}
.flex-cols-1 .flex-list { display: block; border-top: 1px solid currentColor; }
.flex-cols-1 .flex-list-item {
  grid-template-columns: minmax(180px, .8fr) minmax(0, 2fr);
  border-top: 0;
}
.flex-list-media { min-height: 150px; }
.flex-list-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.flex-list-index { opacity: .62; white-space: nowrap; }
.flex-list-copy h3 { margin-top: 10px; font-family: var(--display); font-weight: 400; font-size: clamp(2.125rem, 3.5vw + 1.35rem, 4.5rem); }

.flex-timeline { list-style: none; margin: 0; padding: 0; }
.flex-timeline li { min-width: 0; padding: 16px 0 32px; border-top: 2px solid currentColor; }
.flex-timeline-date { margin-bottom: 18px; }
.flex-timeline-media { margin-bottom: 22px; }
.flex-timeline-copy h3 { margin-top: 8px; }

.flex-block { min-width: 0; padding: 24px; border: 1px solid currentColor; }
.flex-block-media { margin: -24px -24px 24px; width: calc(100% + 48px); }
.flex-block .flex-kicker { margin-top: 0; }
.flex-block h3 { font-family: var(--display); font-weight: 400; }

/* Le identità storiche restano attive anche sui modelli creati con il builder. */
.theme-studio .flex-grid .flex-card:nth-child(4n + 2),
.theme-studio .flex-grid .flex-card:nth-child(4n + 4) { transform: translateY(30px); }
.theme-studio .flex-card { border-top-width: 3px; }

.theme-session .flex-card,
.theme-session .flex-block { padding: 20px; border: 1px solid currentColor; border-radius: 80px 80px 12px 12px; }
.theme-session .flex-card .flex-media { border-radius: 64px 64px 5px 5px; }

.theme-screen .flex-list { border-color: #444; }
.theme-screen .flex-list-item { border-color: #444; }
.theme-screen .flex-list-copy h3 { color: var(--hero-ink, var(--ink)); }
.theme-screen :is(.flex-card, .flex-block, .flex-timeline li) { border-color: #444; }

.theme-stage :is(.flex-grid, .flex-blocks, .flex-timeline) { grid-template-columns: repeat(var(--flex-cols), minmax(0, 1fr)); }
.theme-stage :is(.flex-card, .flex-block, .flex-timeline li) { padding: 18px; border: 1px solid currentColor; text-align: center; }

.theme-tour .flex-list { border-top: 2px solid; }
.theme-tour .flex-list-item { border-bottom-width: 2px; }
.theme-tour .flexible-section h3 { font-family: var(--sans); font-weight: 650; text-transform: uppercase; }
.theme-tour :is(.flex-card, .flex-timeline li) { border-top-width: 2px; }

.theme-teaching .flex-blocks { grid-template-columns: repeat(var(--flex-cols), minmax(0, 1fr)); gap: var(--flex-gap-y) var(--flex-gap-x); }
.theme-teaching .flex-block { min-height: 290px; padding: 30px; background: #fffdf2; border: 1px solid; box-shadow: 9px 9px 0 var(--ink); transform: rotate(-1deg); }
.theme-teaching .flex-block:nth-child(even) { transform: rotate(1deg) translateY(25px); }

.theme-education .flex-blocks { grid-template-columns: repeat(var(--flex-cols), minmax(0, 1fr)); gap: var(--flex-gap-y) var(--flex-gap-x); }
.theme-education .flex-block { padding: 24px 0 60px; border: 0; border-top: 3px solid; }

.theme-archive .flex-blocks { grid-template-columns: repeat(var(--flex-cols), minmax(0, 1fr)); }
.theme-archive { --content-max: 850px; }
.theme-archive .flex-block { padding: 60px; background: #f4efe7; border: 1px solid; }
.theme-archive .flex-block h3 { font-size: clamp(2.25rem, 3.5vw + 1.1rem, 4.375rem); line-height: 1; }

.theme-console .flexible-section { border-top: 1px solid currentColor; }
.theme-console :is(.flex-card, .flex-block, .flex-timeline li) { box-shadow: inset 4px 0 0 var(--accent); padding-left: clamp(18px, 2.5vw, 36px); }
.theme-console .flex-tag { color: var(--accent); }

/* Componenti contenuto */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 50px 22px; }
.card { min-width: 0; cursor: pointer; }
.cover { position: relative; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; background: var(--soft); }
.ph { font-family: var(--display); font-size: clamp(4.375rem, 7vw + 2.7rem, 9.375rem); opacity: .25; }
.badge { position: absolute; z-index: 2; left: 10px; bottom: 10px; max-width: calc(100% - 20px); padding: 5px 8px; background: var(--accent); color: var(--ink); font-family: var(--mono); font-size: .75rem; text-transform: uppercase; }
.card h3 { margin: 15px 0 2px; font-size: .9375rem; line-height: 1.2; }
.meta { margin: 0; font-size: .75rem; }
.dim { opacity: .55; }

/* Scorciatoia editoriale: esiste nel markup soltanto durante una sessione admin. */
.card,
.mitem,
.timeline li,
.block,
.skill,
.flex-card,
.flex-list-item,
.flex-timeline li,
.flex-block { position: relative; }
.admin-item-edit {
  position: absolute;
  z-index: 30;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(16,16,15,.25);
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  color: #10100f;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  opacity: .68;
  transition: opacity .18s ease, transform .18s ease;
}
.admin-item-edit:hover,
.admin-item-edit:focus-visible { opacity: 1; transform: scale(1.08); }

.mlist { display: flex; flex-direction: column; }
.mthumb { overflow: hidden; display: grid; place-items: center; }
.mph { font-family: var(--mono); font-size: .75rem; opacity: .5; }
.mhead { display: flex; gap: 15px; margin-bottom: 18px; }
.tag, .myear { font-family: var(--mono); font-size: .75rem; text-transform: uppercase; }
.tag { color: var(--accent); }
.mbody h3 { margin: 0 0 8px; font-family: var(--display); font-size: clamp(2.25rem, 3.5vw + 1.35rem, 4.625rem); font-weight: 400; line-height: .95; }
.role {
  max-width: 680px;
  margin: 0 0 8px;
  color: var(--ink);
  font-size: var(--role-size);
  line-height: 1.18;
}
.credits {
  margin: 0 0 20px;
  opacity: .58;
  font-family: var(--mono);
  font-size: .75rem;
  font-weight: 400;
  line-height: 1.45;
  text-transform: uppercase;
}
.desc { max-width: 650px; margin: 0; font-size: .9375rem; }
.desc + .desc { margin-top: 1em; }
.playbtn {
  width: auto;
  height: 34px;
  min-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 25px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, currentColor 48%, transparent);
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-family: var(--mono);
  font-size: .6875rem;
  letter-spacing: .055em;
  line-height: 1;
  text-transform: uppercase;
  transition: background-color .18s ease, color .18s ease, transform .18s ease;
}
.playbtn::before {
  content: '';
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask-image: var(--media-icon);
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-image: var(--media-icon);
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}
.playbtn.media-video::before {
  --media-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 12s3.5-6.5 9.5-6.5 9.5 6.5 9.5 6.5-3.5 6.5-9.5 6.5S2.5 12 2.5 12Z'/%3E%3Ccircle cx='12' cy='12' r='2.75'/%3E%3C/svg%3E");
}
.playbtn.media-audio::before {
  --media-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9a6 6 0 1 1 12 0c0 3-1.5 4.4-3.2 5.5-1.2.8-1.8 1.5-1.8 2.7a3 3 0 0 1-6 0'/%3E%3Cpath d='M10 9a2 2 0 0 1 4 0c0 1.2-.6 1.8-1.5 2.4'/%3E%3C/svg%3E");
}
.media-stack { min-width: 0; }
.media-stack > .playbtn,
.theme-screen .mbody > .playbtn {
  --action-bg: color-mix(in srgb, var(--accent) 16%, var(--bg));
  --action-fg: var(--ink);
  --action-hover-bg: var(--accent);
  --action-hover-fg: var(--ink);
  width: 100%;
  height: 38px;
  align-self: stretch;
  justify-content: center;
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--ink) 28%, transparent);
  border-width: 1px 0;
  background: var(--action-bg);
  color: var(--action-fg);
}
.theme-screen .mbody > .playbtn {
  --action-hover-fg: var(--bg);
  width: calc(100% + (2 * var(--card-pad)));
  margin: auto calc(-1 * var(--card-pad)) 0;
}
.media-stack > .playbtn:hover,
.theme-screen .mbody > .playbtn:hover {
  background: var(--action-hover-bg);
  color: var(--action-hover-fg);
  transform: none;
}
.playbtn:hover { background: var(--ink); color: var(--bg); transform: translateY(-1px); }
.playbtn:active { transform: translateY(0); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: minmax(150px, 230px) 100px 1fr; align-items: center; gap: 6px; }
.tmedia { aspect-ratio: 4 / 3; }
.timeline .tyear { font-family: var(--mono); font-size: .75rem; }
.timeline .tbody h3 { margin: 0 0 4px; font-size: clamp(1.25rem, 1.55vw + .6rem, 2.125rem); line-height: 1.05; }
.timeline .tbody p { font-size: .95rem; }

.blocks { display: grid; gap: 25px; }
.block-media { width: 100%; margin-bottom: 24px; aspect-ratio: 16 / 9; }
.block h3 { margin: 0 0 20px; font-size: 1.4375rem; line-height: 1.15; }
.block-academic-head { margin: 0 0 20px; }
.block-academic-head h3 { margin-bottom: 0; }
.block-institution { display: flex; flex-direction: column; gap: 4px; margin: 0 0 20px; }
.block-institution span { font: .6875rem var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.block-institution strong { font-family: var(--sans); font-weight: 650; line-height: 1.15; }
.block .period { display: block; margin-bottom: 20px; font-family: var(--mono); font-size: .75rem; text-transform: uppercase; }
.block p { margin: 0; font-size: .9375rem; }
.block-body p + p { margin-top: 1.15em; }

/* Modal */
.modal { position: fixed; z-index: 120; inset: 0; display: grid; place-items: center; padding: 20px; color: #111; }
.modal[hidden] { display: none; }
.modal-back { position: absolute; inset: 0; background: rgba(0,0,0,.78); backdrop-filter: blur(7px); }
.modal-card { position: relative; width: min(660px, 100%); max-height: 90vh; overflow: auto; padding: 40px; background: #f2eee5; }
.modal-x { position: absolute; z-index: 2; top: 10px; right: 15px; border: 0; background: none; font-size: 2.125rem; cursor: pointer; }
.modal-body img.mcover { width: 180px; aspect-ratio: 1; object-fit: contain; background: rgba(0,0,0,.06); margin-bottom: 20px; }
.modal-body h3 { margin: 0; font-family: var(--display); font-size: 2.625rem; font-weight: 400; line-height: 1; }
.martist { margin: 5px 0 25px; opacity: .55; }
.mrow { margin: 15px 0; }
.mrow b { display: block; font-family: var(--mono); font-size: .75rem; text-transform: uppercase; }
.mrow-role span { display: block; font-family: var(--role); font-size: var(--role-size); font-weight: 600; font-variant-caps: all-small-caps; line-height: 1.15; letter-spacing: .075em; text-transform: uppercase; }
.mrow-tracks { margin-top: 24px; }
.modal-tracklist { list-style: none; margin: 9px 0 0; padding: 0; border-top: 1px solid rgba(0,0,0,.18); }
.modal-tracklist li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 9px 0; border-bottom: 1px solid rgba(0,0,0,.18); font-size: .875rem; line-height: 1.25; }
.track-preview-play { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 1px solid currentColor; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; font-size: .6875rem; }
.track-preview-controls { grid-column: 1 / -1; padding: 8px 0 4px; }
.track-preview-controls[hidden] { display: none; }
.modal .track-preview-controls audio { display: none; }
.track-preview-controls a { display: inline-block; margin-top: 6px; color: inherit; font: .625rem var(--mono); opacity: .58; }
.mcert { display: inline-block; padding: 5px 8px; background: #d7ff36; font-family: var(--mono); font-size: .75rem; }
.media-player { --player-bg: #171714; --player-fg: #f2eee5; --player-accent: var(--accent); width: 100%; margin-top: 18px; color: var(--player-fg); background: var(--player-bg); }
.audio-player { display: grid; grid-template-columns: 42px minmax(80px, 1fr) auto 34px; align-items: center; gap: 12px; min-height: 66px; padding: 12px 14px; }
.audio-player audio { display: none; }
.media-play { width: 42px; height: 42px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.55); border-radius: 50%; background: transparent; color: inherit; cursor: pointer; font-size: .75rem; }
.audio-player.is-playing .media-play { border-color: var(--player-accent); color: var(--player-accent); }
.media-timeline { width: 100%; height: 2px; margin: 0; border: 0; accent-color: var(--player-accent); cursor: pointer; }
.media-time, .media-volume { font: .625rem var(--mono); letter-spacing: .02em; }
.media-time { min-width: 76px; text-align: right; opacity: .7; }
.media-volume { padding: 5px 0; border: 0; background: transparent; color: inherit; cursor: pointer; opacity: .7; }
.embed-player { overflow: hidden; border: 1px solid rgba(255,255,255,.16); }
.embed-player-head { height: 38px; display: flex; align-items: center; justify-content: space-between; padding: 0 13px; border-bottom: 1px solid rgba(255,255,255,.16); font-family: var(--mono); text-transform: uppercase; }
.embed-player-head span { color: var(--player-accent); font-size: .625rem; letter-spacing: .12em; }
.embed-player-head strong { font-size: .6875rem; font-weight: 500; opacity: .7; }
.emb { display: block; width: 100%; border: 0; margin: 0; background: #000; }
.emb.vid { aspect-ratio: 16/9; }
.emb.sp { height: 152px; }
.mlink { display: inline-block; margin-top: 18px; }

/* Mini-player persistente: non blocca mai navigazione o scorrimento. */
.media-popup { position: fixed; z-index: 220; right: 18px; bottom: 18px; width: min(560px, calc(100vw - 36px)); pointer-events: none; }
.media-popup[hidden] { display: none; }
.media-popup-card { display: grid; grid-template-columns: 1fr; align-items: stretch; overflow: hidden; color: #f2eee5; background: #171714; box-shadow: 0 12px 45px rgba(0,0,0,.32); pointer-events: auto; }
.media-popup-card > header { min-width: 0; min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 14px 10px 18px; border-bottom: 1px solid rgba(255,255,255,.16); }
.media-popup-card > header span { display: block; margin-bottom: 4px; color: var(--accent); font: .625rem var(--mono); letter-spacing: .12em; }
.media-popup-card > header h2 { margin: 0; overflow: hidden; font-family: var(--sans); font-size: 1rem; font-weight: 550; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.media-popup-close { flex: 0 0 auto; width: 32px; height: 32px; padding: 0; border: 1px solid rgba(255,255,255,.45); border-radius: 50%; background: transparent; color: inherit; cursor: pointer; font-size: 1.25rem; line-height: 1; }
.media-popup-body .media-player { margin: 0; }
.local-video-player video { display: block; width: 100%; max-height: min(70vh, 720px); background: #000; }
.media-group-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; padding: 8px 14px; color: #f2eee5; background: #171714; border-top: 1px solid rgba(255,255,255,.16); font: .6875rem var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.media-group-nav button { width: 34px; height: 30px; padding: 0; border: 1px solid rgba(255,255,255,.4); border-radius: 50%; color: inherit; background: transparent; cursor: pointer; }
.media-popup-body .embed-player { border: 0; }
.media-popup-body .embed-player-head { display: none; }
.media-popup-body .audio-player { min-height: 68px; padding-inline: 16px; }
.media-popup-body .emb.vid { height: 135px; aspect-ratio: auto; }
.media-popup-body .emb.sp { height: 152px; }
.media-popup.is-video { width: min(440px, calc(100vw - 36px)); }
.media-popup.is-video .media-popup-card { grid-template-columns: 1fr; }
.media-popup.is-video .media-popup-body { grid-column: 1; grid-row: 2; }
.media-popup.is-video .media-popup-card > header { grid-column: 1; grid-row: 1; }
.media-popup.is-video .media-popup-body .emb.vid { height: auto; aspect-ratio: 16 / 9; }

@media (max-width: 520px) {
  .audio-player { grid-template-columns: 38px minmax(60px, 1fr) 32px; gap: 9px; padding: 10px; }
  .media-play { width: 38px; height: 38px; }
  .media-time { display: none; }
  .media-popup { right: 0; bottom: 0; width: 100%; }
  .media-popup-card { grid-template-columns: 1fr; }
  .media-popup-card > header { min-height: 52px; padding: 8px 10px 8px 14px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.16); }
  .media-popup-card > header span { display: none; }
  .media-popup-body .emb.vid { height: auto; aspect-ratio: 16 / 9; }
  .media-popup.is-video { width: 100%; }
}

@media (max-width: 900px) {
  .home-hero { grid-template-columns: minmax(0, 1fr); }
  .hero-intro { grid-template-columns: 1fr 2fr; }
  .index-heading { grid-template-columns: 1fr; padding-bottom: 60px; }
  .index-item { grid-template-columns: 45px 1fr auto; }
  .index-mark { display: none; }
  .work-hero { grid-template-columns: 1fr 2fr; }
  .cards, .theme-studio .cards { grid-template-columns: repeat(3, 1fr); }
  .theme-session .cards { grid-template-columns: repeat(2, 1fr); }
  .theme-stage .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .theme-stage .timeline li:nth-child(even) { margin-top: 28px; }
  .flex-grid,
  .flex-list,
  .flex-blocks,
  .flex-timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flex-cols-1 :is(.flex-grid, .flex-list, .flex-blocks, .flex-timeline) { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar { min-height: 72px; padding-block: 14px; grid-template-columns: 1fr auto; }
  .home-page .top-contact { display: none; }
  .work-toolbar { grid-row: 2; grid-column: 1 / -1; width: 100%; justify-content: space-between; gap: 10px; margin-top: 14px; }
  .work-toolbar .work-switch span { display: none; }
  .work-step { max-width: 42%; gap: 7px; font-size: .6875rem; }
  .work-step i { width: 18px; }
  .work-step-copy { gap: 5px; }
  .work-step-copy strong { max-width: 13ch; }
  .work-page .topbar { align-items: start; }
  .language { grid-column: 2; }
  .language { align-items: center; }
  .home-hero { min-height: var(--screen-height); padding-top: 100px; grid-template-rows: auto 1fr auto; gap: 28px; }
  .hero-silhouette {
    right: -42vw;
    bottom: 8vh;
    width: 145vw;
    opacity: .13;
  }
  .hero-copy,
  .hero-intro { width: calc(100vw - (2 * var(--pad))); max-width: none; }
  .home-hero h1 { font-size: clamp(3.875rem, 14vw + 1.5rem, 6rem); line-height: .86; }
  .hero-intro { display: block; align-self: start; margin-top: 0; }
  .hero-intro blockquote {
    margin-bottom: 24px;
    padding: 0 0 24px;
    text-align: right;
    border-bottom: 1px solid var(--line);
  }
  .hero-intro blockquote p { font-size: clamp(1.5rem, 5.3vw + .55rem, 2.125rem); }
  .hero-intro-copy {
    min-height: 0;
    padding-left: 0;
    border-left: 0;
    font-size: 1rem;
    line-height: 1.5;
  }
  .work-index { padding-top: 84px; }
  .index-heading h2 { font-size: 2.6875rem; }
  .index-item { min-height: 88px; padding-block: 18px; gap: 10px; }
  .index-name { font-size: 1.5625rem; }
  .index-item:hover { padding-inline: 10px; }
  .index-arrow,
  .work-next i,
  .scroll-cue i {
    width: .85em;
    height: .85em;
  }
  .index-arrow::before,
  .work-next i::before,
  .scroll-cue i::before {
    border-width: 1.5px;
  }
  .home-contact { min-height: var(--screen-height); padding-top: 84px; }
  .home-contact > a { font-size: clamp(1.125rem, 4vw + .45rem, 1.75rem); }
  .flex-grid,
  .flex-list,
  .flex-blocks,
  .flex-timeline { grid-template-columns: 1fr; }
  .theme-stage :is(.flex-grid, .flex-blocks, .flex-timeline),
  .theme-teaching .flex-blocks,
  .theme-education .flex-blocks { grid-template-columns: 1fr; }
  .theme-studio .flex-grid .flex-card:nth-child(n),
  .theme-teaching .flex-block:nth-child(n) { transform: none; }
  .theme-education .flex-block,
  .theme-education .flex-block:nth-child(3n) { grid-column: 1 / -1; }
  .flex-list-item,
  .flex-cols-1 .flex-list-item { grid-template-columns: 1fr; }
  .flex-list-meta { padding-bottom: 8px; border-bottom: 1px solid currentColor; }
  .contact-bottom { flex-direction: column; }
  .contact-bottom span { overflow-wrap: anywhere; }
  .site-footer { align-items: flex-start; gap: 20px; flex-direction: column; }
  .site-footer a { overflow-wrap: anywhere; }
  .work-hero { min-height: var(--screen-height); grid-template-columns: 1fr; padding-top: 145px; }
  .work-hero h1 { font-size: clamp(3rem, 10.5vw + 1.1rem, 5.125rem); line-height: .88; }
  .theme-studio .work-hero h1 { font-size: clamp(2.875rem, 10vw + 1.1rem, 4.875rem); }
  .sec { padding-top: 75px; padding-bottom: 100px; }
  .sec-head { margin-bottom: 45px; }
  .cards, .theme-studio .cards, .theme-session .cards { grid-template-columns: repeat(2, 1fr); gap: 40px 12px; }
  .theme-studio .card:nth-child(n) { transform: none; }
  .theme-session .card { padding: 10px; }
  .card h3 { font-size: .8125rem; }
  .theme-screen .mitem { grid-template-columns: 1fr; }
  .theme-stage .timeline { grid-template-columns: 1fr; }
  .theme-stage .timeline li:nth-child(n) { margin-top: 0; }
  .theme-tour .timeline li { grid-template-columns: 1fr; }
  .theme-tour .tmedia { grid-column: 1 / -1; width: 100%; aspect-ratio: 16 / 9; }
  .theme-teaching .blocks { grid-template-columns: 1fr; }
  .theme-teaching .block:nth-child(n) { transform: none; }
  .theme-education .block, .theme-education .block:nth-child(3n) { grid-column: 1 / -1; }
  .theme-archive .block { padding: 30px 22px; }
  .skill { grid-template-columns: 1fr; gap: 26px; }
  .skill-featured { padding-left: 18px; }
  .skill-points li { padding-left: 24px; }
  .skills-tools { padding: 28px 22px; }
  .skills-tools-head { grid-template-columns: 1fr; gap: 10px; }
  .skills-tools-list { grid-template-columns: 1fr; }
  .work-next { min-height: var(--screen-height); }
  .work-next a { font-size: calc(10.5vw + 1.1rem); }
  .modal-card { padding: 30px 22px; }
}

/* Nelle viewport basse l'indice deve poter superare l'altezza dello schermo. */
@media (max-height: 820px) {
  .home-page { scroll-snap-type: y proximity; }
  .work-index {
    height: auto;
    min-height: var(--screen-height);
    padding-top: clamp(68px, 10vh, 84px);
    padding-bottom: 40px;
    overflow: visible;
  }
  .home-page .index-heading { padding-bottom: 24px; }
  .index-heading h2 { font-size: clamp(2.25rem, 6vh, 3rem); }
  .home-page .index-list { flex: none; }
  .home-page .index-item {
    flex: none;
    min-height: 88px;
    padding-block: 16px;
  }
}

/* Riquadro immagine scelto dall'admin: default = intera su sfondo sfocato,
   "riempi" ritaglia ai bordi, "naturale" segue le proporzioni del file.
   In coda al foglio per vincere sui rapporti fissi dei temi. */
.adaptive-media.fit-fill .media-back,
.adaptive-media.fit-natural .media-back { display: none; }
.adaptive-media.fit-fill .media-main {
  object-fit: cover;
  object-position: var(--media-x, 50%) var(--media-y, 50%);
}
.adaptive-media.fit-natural { aspect-ratio: auto; }
.adaptive-media.fit-natural .media-main { position: static; height: auto; }
.flex-ratio-natural :is(.flex-media, .flex-list-media, .flex-timeline-media, .flex-block-media) .media-main { position: static; }
.theme-screen .fit-natural { align-self: start; }

/* Cinema: ogni progetto conserva lo stesso peso e lo stesso formato visivo. */
.theme-screen .mitem .mthumb.fit-natural { aspect-ratio: 16 / 9; align-self: auto; }
.theme-screen .mitem .mthumb.fit-natural .media-back { display: block; }
.theme-screen .mitem .mthumb.fit-natural .media-main {
  position: absolute;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 760px) {
  .theme-screen .mlist { grid-template-columns: 1fr; }
  .theme-screen .credits { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .home-page { scroll-snap-type: y proximity; }
  .work-page { scroll-snap-type: y proximity; }
  *, *::before, *::after { transition: none !important; }
}
