/* ============================================================
   BoarioMasterclass — unified single-page redesign
   Tokens retrofitted to the maintenance-page / legacy style:
   warm cream paper (#FAF6F0), walnut ink (#5D4037),
   antique gold (#c4a86b), Playfair Display display + Lato body.
   (Component styles ported from the Claude-Design draft.)
   ============================================================ */

:root {
  /* palette — light (default) */
  --bg:        #faf6f0;
  --bg-2:      #f0e7d7;
  --paper:     #fffdf9;
  --ink:       #5d4037;
  --ink-soft:  #795548;
  --ink-faint: #a1887f;
  --gold:      #c4a86b;
  --gold-deep: #a48a4c;
  --gold-soft: #d9c89b;
  --gold-glow: #ffd700;
  --gold-rgb:  196, 168, 107;
  --line:      rgba(93, 64, 55, 0.14);
  --line-2:    rgba(93, 64, 55, 0.08);
  --green:     #2e9e5b;
  --shadow:    0 24px 60px -28px rgba(93, 64, 55, 0.42);
  --shadow-sm: 0 10px 30px -18px rgba(93, 64, 55, 0.45);

  /* type — retrofit to maintenance/legacy */
  --display: "Playfair Display", Georgia, serif;
  --serif:   "Lato", "Segoe UI", system-ui, sans-serif;
  --sans:    "Lato", "Segoe UI", system-ui, sans-serif;

  /* rhythm */
  --maxw: 1180px;
  --pad: clamp(20px, 5vw, 80px);
  --motion: 1;
  --radius: 4px;
}

[data-theme="dark"] {
  --bg:        #2c2622;
  --bg-2:      #241f1a;
  --paper:     #322b25;
  --ink:       #e0d8d0;
  --ink-soft:  #b0a090;
  --ink-faint: #8a7d6d;
  --gold:      #cdb583;
  --gold-deep: #c4a86b;
  --gold-soft: #5f4d2c;
  --line:      rgba(224, 216, 208, 0.14);
  --line-2:    rgba(224, 216, 208, 0.07);
  --shadow:    0 24px 60px -28px rgba(0, 0, 0, 0.7);
  --shadow-sm: 0 10px 30px -18px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--bg); transition: background 0.5s ease; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background 0.5s ease, color 0.5s ease;
}

::selection { background: var(--gold-soft); color: var(--ink); }

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

/* ============================================================
   Site-wide abstract background (req #1)
   Fixed, full-viewport musical texture behind ALL content.
   Theme-aware source; subtle opacity; gentle brightness breathing.
   ============================================================ */
.site-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url(../images/background-light.jpg) center / cover no-repeat;
  opacity: 0.16;
  will-change: filter;
  animation: bgBreathe 6s ease-in-out infinite alternate;
}
[data-theme="dark"] .site-bg {
  background-image: url(../images/background-dark.jpg);
  opacity: 0.22;
}
@keyframes bgBreathe {
  from { filter: brightness(0.96); }
  to   { filter: brightness(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  .site-bg { animation: none; }
}

h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; margin: 0; line-height: 1.05; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }

.eyebrow {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.section { padding-block: clamp(72px, 11vw, 150px); position: relative; }
/* alternating sections: tint that FEATHERS into the base background at top/bottom
   (no hard rectangular seams between differently-coloured regions) */
.section-alt {
  background: linear-gradient(180deg,
    transparent 0%,
    var(--bg-2) 9%,
    var(--bg-2) 91%,
    transparent 100%);
}
/* Section-specific atmospheric backgrounds (Docenti + Regolamento) — palette-matched
   (recolor-section-bg.py). Each lays an OPAQUE base of the theme colour (hiding the busy
   global .site-bg in this section) with the section texture veiled over it at low strength,
   then feathers top/bottom so it melts into the neighbouring site background — no seams,
   no muddy double-texture. Contatti intentionally keeps the plain site background. */
/* opaque theme base hides the busy global .site-bg INSIDE these two sections, so only the
   section's own texture shows; the masked ::before then feathers that texture to the plain
   base at top/bottom (revealing the base cream/dark — NOT the site illustration). */
#faculty, #rules, #venue { isolation: isolate; background-color: var(--bg); }
#faculty::before, #rules::before, #venue::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--tex) center / cover no-repeat;
  -webkit-mask: linear-gradient(180deg, transparent 0%, #000 20%, #000 80%, transparent 100%);
          mask: linear-gradient(180deg, transparent 0%, #000 20%, #000 80%, transparent 100%);
}
#faculty { --tex: url(../images/backgrounds/faculty-light.jpg); }
#rules   { --tex: url(../images/backgrounds/rules-light.jpg); }
#venue   { --tex: url(../images/backgrounds/venue-light.jpg); }
[data-theme="dark"] #faculty { --tex: url(../images/backgrounds/faculty-dark.jpg); }
[data-theme="dark"] #rules   { --tex: url(../images/backgrounds/rules-dark.jpg); }
[data-theme="dark"] #venue   { --tex: url(../images/backgrounds/venue-dark.jpg); }

/* ============================================================
   Cinematic separator band — full-bleed video divider between
   Docenti (#faculty) and Regolamento (#rules). Decorative only.
   The top/bottom feather (mask) dissolves the band into the
   neighbouring sections' cream/dark base (both are var(--bg),
   as is the html root behind the band) — no hard seam, either theme.
   ============================================================ */
.cine-band {
  position: relative; z-index: 1;
  width: 100%; height: clamp(260px, 42vh, 520px);
  overflow: hidden;
  /* poster (inline background-image) sits under the video so a non-playing clip never
     exposes a native play button — the still shows through instead */
  background-position: center; background-size: cover; background-repeat: no-repeat;
  /* modest negative margin tightens the cream gap the two sections' 150px
     paddings would otherwise leave, while the feather still fades into that padding */
  margin-block: clamp(-72px, -6vw, -32px);
  -webkit-mask: linear-gradient(180deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
          mask: linear-gradient(180deg, transparent 0%, #000 14%, #000 86%, transparent 100%);
}
.cine-band-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  /* hidden until it is actually playing; initCineBand() adds .is-playing on the `playing`
     event, fading the footage in over the poster. Under reduced-motion it never plays, so it
     stays hidden and the poster background is all that shows. */
  opacity: 0; transition: opacity .8s cubic-bezier(0.22, 1, 0.36, 1);
}
.cine-band-video.is-playing { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .cine-band-video { transition: none; } }
/* warm gold-tinted vignette: darkens/warms toward the edges for palette cohesion,
   fades toward var(--bg) at very top/bottom to reinforce the seamless feather,
   and keeps the centre clear so the footage reads. Works in light + dark. */
.cine-band-veil {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--bg) 58%, transparent) 0%,
      color-mix(in srgb, #2a1c0e 26%, transparent) 30%,
      color-mix(in srgb, #2a1c0e 26%, transparent) 70%,
      color-mix(in srgb, var(--bg) 58%, transparent) 100%),
    radial-gradient(135% 92% at 50% 50%, transparent 44%,
      color-mix(in srgb, var(--gold-deep) 30%, transparent) 100%);
}
/* Luogo immersive full-screen video intro (Apple-style pinned reveal).
   .venue-immersive is a tall scroll runway; .vi-sticky pins the Darfo video full-screen while
   scrolling through it. #venue (opaque via its section-bg base, higher z-index, negative margin)
   then rises UP OVER the pinned video. main.js sets --vi (0→1) = scroll progress through the runway,
   which drives the video zoom, caption fade, and the bottom dissolve into the section's --bg. */
.venue-immersive { position: relative; height: 200vh; z-index: 0; --vi: 0; }
/* poster painted as the sticky's background so the immersive intro shows the still (never a
   native play button) before/while the video is blocked or under reduced-motion */
.vi-sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; background: #000 center/cover no-repeat; }
.vi-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scale(calc(1 + var(--vi) * 0.14)); transform-origin: center 40%;
  /* hidden until playing (initVenueImmersive() adds .is-playing); poster shows underneath meanwhile */
  opacity: 0; transition: opacity .8s cubic-bezier(0.22, 1, 0.36, 1); }
.vi-video.is-playing { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .vi-video { transition: none; } }
.vi-scrim { position: absolute; inset: 0; pointer-events: none;
  /* darken only enough for caption legibility + a soft vignette; the signature whitening lives on
     the rising section's feathered top edge (#venue::after), which is what stays visible. */
  background:
    radial-gradient(130% 92% at 50% 40%, transparent 44%, color-mix(in srgb, #140d04 48%, transparent) 100%),
    linear-gradient(180deg, color-mix(in srgb, #140d04 32%, transparent) 0%, transparent 28%); }
.vi-caption { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center;
  text-align: center; gap: 12px; padding: 24px; color: #fff; z-index: 2;
  opacity: clamp(0, calc(1 - var(--vi) * 1.7), 1); transform: translateY(calc(var(--vi) * -46px)); }
.vi-caption .eyebrow { color: var(--gold-glow, #ffd700); letter-spacing: .34em; }
.vi-title { font-family: var(--display); font-weight: 700; line-height: 1;
  font-size: clamp(3rem, 9vw, 7rem); color: #fff; text-shadow: 0 6px 40px rgba(0,0,0,.55); }
.vi-sub { font-family: var(--sans); font-size: clamp(1rem, 2.4vw, 1.45rem); color: rgba(255,255,255,.92);
  text-shadow: 0 2px 20px rgba(0,0,0,.5); }
.vi-hint { margin-top: 28px; display: grid; justify-items: center; gap: 6px;
  font-family: var(--sans); font-size: .74rem; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(255,255,255,.85); }
.vi-hint i { font-style: normal; font-size: 1.1rem; animation: viBounce 1.9s ease-in-out infinite; }
@keyframes viBounce { 0%, 100% { transform: translateY(0); opacity: .8; } 50% { transform: translateY(9px); opacity: 1; } }
/* the real Venue section rises up OVER the pinned video */
#venue { position: relative; z-index: 2; margin-top: -100vh; }
/* signature whitening: the section's top edge feathers the pinned video into --bg (theme-aware
   cream/dark) as the section climbs — so the video visibly melts into the section. It only appears
   once the section starts rising, so the full video reads cleanly first. */
#venue::after { content: ""; position: absolute; left: 0; right: 0; top: -24vh; height: 24vh; z-index: 1;
  pointer-events: none; background: linear-gradient(180deg, transparent 0%, var(--bg) 96%); }
@media (max-width: 760px) { .venue-immersive { height: 170vh; } #venue::after { top: -18vh; height: 18vh; } }
@media (prefers-reduced-motion: reduce) { #venue::after { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .venue-immersive { height: 100vh; }
  .vi-sticky { position: relative; }
  .vi-video { transform: none; }
  .vi-caption { opacity: 1; transform: none; }
  #venue { margin-top: 0; }
}

.section-head { text-align: center; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head h2 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  letter-spacing: -0.01em;
  /* gold shimmer sweep on hover (background-clip:text — theme-aware via --ink/--gold) */
  background-image: linear-gradient(100deg,
    var(--ink) 0%, var(--ink) 42%, var(--gold) 50%, var(--ink) 58%, var(--ink) 100%);
  background-size: 250% 100%;
  background-position: 120% 0;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  transition: background-position 1s cubic-bezier(.4, 0, .2, 1);
}
.section-head h2:hover { background-position: -20% 0; }
@media (prefers-reduced-motion: reduce) {
  .section-head h2 { transition: none; }
}
.section-head .rule {
  width: 64px; height: 2px; margin: 22px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform: scaleX(0); transform-origin: center;
  transition: transform 0.9s cubic-bezier(.2,.7,.2,1);
}
.in-view .section-head .rule, .section-head.in-view .rule { transform: scaleX(1); }

/* ============================================================
   Section-title gold icons (theme-aware via CSS mask — the icon
   takes the theme gold and lets the page show through its
   transparent interior; mirrors .brand-logo technique).
   Sits above the eyebrow, animates in with the section reveal.
   ============================================================ */
.section-head .sec-icon {
  display: block;
  width: clamp(38px, 4.4vw, 52px);
  height: clamp(38px, 4.4vw, 52px);
  margin: 0 auto clamp(14px, 1.6vw, 20px);
  /* solid theme gold with a brighter sheen band that sweeps on hover */
  background-image: linear-gradient(100deg,
    var(--gold) 0%, var(--gold) 42%,
    color-mix(in srgb, var(--gold) 55%, #fff) 50%,
    var(--gold) 58%, var(--gold) 100%);
  background-size: 250% 100%;
  background-position: 120% 0;
  -webkit-mask: var(--ico) center / contain no-repeat;
          mask: var(--ico) center / contain no-repeat;
  opacity: 0;
  transform: translateY(10px) scale(.82);
  transition:
    opacity .65s cubic-bezier(.22, 1, .36, 1),
    transform .65s cubic-bezier(.22, 1, .36, 1),
    background-position 1s cubic-bezier(.4, 0, .2, 1);
}
.section-head.in-view .sec-icon, .in-view .section-head .sec-icon {
  opacity: 1;
  transform: none;
}
/* soft gold sheen sweep across the icon on section-head hover
   (mirrors the h2 title shimmer) */
.section-head:hover .sec-icon { background-position: -20% 0; }
@media (prefers-reduced-motion: reduce) {
  .section-head .sec-icon {
    opacity: 1 !important;
    transform: none !important;
    transition: none;
  }
}

/* ============================================================
   Content hover treatments
   — smaller titles glow gold; content paragraphs get a subtle
     "highlighter" wash. Both are theme-aware and reduced-motion safe.
   (.acc-head glow is handled on its own rule to preserve its
    existing background transition.)
   ============================================================ */
.fac-head h3, .video-caption h4, .contact-card h4,
.rates-card h4, .cal-head h3, .status-open h3 {
  transition: color .3s ease, text-shadow .3s ease;
}
.fac-head h3:hover, .video-caption h4:hover, .contact-card h4:hover,
.rates-card h4:hover, .cal-head h3:hover, .status-open h3:hover {
  color: var(--gold-deep);
  text-shadow: 0 0 20px color-mix(in srgb, var(--gold) 35%, transparent);
}

/* subtle "highlighter" on content paragraphs — a faint gold wash,
   gentler than the title hover. No padding/margin change → no reflow. */
.about-lead p, .about-aside p, .rules-intro, .venue-grid p,
.contact-intro, .acc-body-inner p, .venue-note, .venue-convention-note {
  transition: color .3s ease, background-color .35s ease;
  border-radius: 4px;
}
.about-lead p:hover, .about-aside p:hover, .rules-intro:hover, .venue-grid p:hover,
.contact-intro:hover, .acc-body-inner p:hover, .venue-note:hover, .venue-convention-note:hover {
  color: var(--ink);
  background-color: color-mix(in srgb, var(--gold) 7%, transparent);
}

/* ============================================================
   Reveal system — reversible (driven by .in-view toggling)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(calc(34px * var(--motion)));
  transition:
    opacity calc(0.7s * var(--motion)) ease,
    transform calc(0.8s * var(--motion)) cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--d, 0s);
}
.in-view .reveal, .reveal.in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   Header / nav
   ============================================================ */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px;
  padding: 14px var(--pad);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid transparent;
  transition: border-color .4s, background .4s, padding .4s;
}
.site-header.scrolled {
  border-bottom-color: var(--line);
  padding-block: 9px;
  box-shadow: 0 12px 30px -24px rgba(93,64,55,.5);
}
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--display); white-space: nowrap; flex: none; }
.brand .logo-slot { width: 40px; height: 40px; flex: none; border-radius: 8px; overflow: visible;
  background: transparent; border: 0;
  transition: transform .3s; }
.brand:hover .logo-slot { transform: rotate(-3deg); }
.brand .logo-slot .media-slot { width: 100%; height: 100%; }
/* Brand mark (temple + pentagramma) — theme-aware gold via CSS mask, no extra request tint */
.brand .logo-slot .brand-logo {
  display: block; width: 100%; height: 100%;
  background: var(--gold);
  -webkit-mask: url(../images/brand/logo-mark-gold.svg) center / contain no-repeat;
          mask: url(../images/brand/logo-mark-gold.svg) center / contain no-repeat;
  transition: background .3s ease;
}
.brand:hover .logo-slot .brand-logo { background: var(--gold-deep); }
.brand-text { display: flex; align-items: baseline; gap: 9px; }
.brand .mark { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
.brand .yr { font-family: var(--sans); font-weight: 800; font-size: 0.78rem; letter-spacing: .12em; color: var(--gold); }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  font-family: var(--sans); font-size: 0.84rem; font-weight: 600; white-space: nowrap;
  letter-spacing: .02em; color: var(--ink-soft);
  padding: 8px 14px; border-radius: 999px; position: relative;
  transition: color .25s;
}
.nav a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 1.5px;
  background: var(--gold); transform: scaleX(0); transform-origin: left;
  transition: transform .3s ease;
}
.nav a:hover { color: var(--gold-deep); }
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }
.nav a.active { color: var(--gold-deep); }

.header-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--sans); font-size: 0.78rem; font-weight: 700;
  color: var(--ink-soft); background: transparent;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 11px; cursor: pointer; transition: all .25s;
}
.icon-btn:hover {
  color: var(--gold-deep);
  border-color: var(--gold-soft);
  background: color-mix(in srgb, var(--gold) 10%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent),
              0 0 12px color-mix(in srgb, var(--gold-glow) 18%, transparent);
}
.icon-btn svg { width: 15px; height: 15px; }

.btn-enroll {
  font-family: var(--sans); font-weight: 800; font-size: 0.8rem; letter-spacing: .02em;
  color: #fff; background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  border: none; border-radius: 999px; padding: 9px 18px; cursor: pointer;
  box-shadow: 0 8px 20px -10px var(--gold-deep); transition: transform .2s, box-shadow .2s;
  position: relative; overflow: hidden;
}
.btn-enroll:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -10px var(--gold-deep); }
.btn-enroll:active { transform: translateY(0); }

.lang-menu { position: relative; }
.lang-pop {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-sm); padding: 6px; min-width: 120px;
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: all .2s;
}
.lang-menu.open .lang-pop { opacity: 1; visibility: visible; transform: none; }
.lang-pop button {
  display: block; width: 100%; text-align: left; background: none; border: none;
  font-family: var(--sans); font-size: .82rem; font-weight: 600; color: var(--ink-soft);
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
}
.lang-pop button:hover { background: color-mix(in srgb, var(--gold) 14%, transparent); color: var(--gold-deep); }
.lang-pop button.active { color: var(--gold-deep); }

.menu-toggle { display: none; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative; min-height: 100svh;
  display: grid; place-items: center; text-align: center;
  padding: 120px var(--pad) 80px; overflow: hidden;
  isolation: isolate;
}
.hero-bg {
  position: absolute; inset: 0; z-index: -3;
  background:
    radial-gradient(120% 90% at 50% -10%, color-mix(in srgb, var(--gold-soft) 30%, transparent), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 70%);
}
/* rotating hero gallery (req #2) — sits ABOVE the abstract bg, BELOW hero text */
.hero-gallery { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.hg-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  /* dim/tint so the walnut hero text stays readable */
  filter: brightness(0.62) saturate(0.85) sepia(0.12);
  -webkit-mask-image: radial-gradient(120% 80% at 50% 35%, #000 30%, transparent 78%);
          mask-image: radial-gradient(120% 80% at 50% 35%, #000 30%, transparent 78%);
}
.hg-slide.active { opacity: 1; }
[data-theme="dark"] .hg-slide { filter: brightness(0.5); }

/* theme-aware readability veil over the gallery (concentrated behind the hero text) */
.hero-scrim {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 82% 72% at 50% 46%,
      color-mix(in srgb, var(--bg) 34%, transparent) 0%,
      color-mix(in srgb, var(--bg) 14%, transparent) 52%,
      transparent 84%),
    linear-gradient(180deg, transparent 52%, var(--bg) 100%);
}
[data-theme="dark"] .hero-scrim {
  background:
    radial-gradient(ellipse 88% 78% at 50% 46%,
      rgba(12, 9, 6, 0.32) 0%, rgba(12, 9, 6, 0.14) 58%, transparent 86%),
    linear-gradient(180deg, transparent 54%, var(--bg) 100%);
}
@media (prefers-reduced-motion: reduce) {
  .hg-slide { transition: opacity 0.35s ease; }
}

.hero-gallery-dots {
  position: absolute; left: 50%; bottom: 130px; transform: translateX(-50%);
  z-index: 4; display: flex; gap: 10px; transition: opacity .6s ease;
}
.hg-dot {
  width: 9px; height: 9px; padding: 0; border-radius: 50%; cursor: pointer;
  background: transparent; border: 1.5px solid var(--gold);
  opacity: .85; transition: transform .3s cubic-bezier(.2,.7,.2,1), background .3s, opacity .3s;
}
.hg-dot:hover { opacity: 1; }
.hg-dot.active { background: var(--gold); transform: scale(1.4); opacity: 1; }
/* dots fade out with the cue as the user scrolls past the hero */
body.gate-open .hero-gallery-dots { opacity: 0; pointer-events: none; }
@media (max-width: 560px) {
  .hero-gallery-dots { bottom: 118px; }
}

/* per-letter title spring (req #3) */
.hero h1 .hero-char {
  display: inline-block;
  background: linear-gradient(180deg, var(--ink), color-mix(in srgb, var(--ink) 70%, var(--gold-deep)));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  will-change: transform, opacity;
}
.hero h1 .hero-char.spring {
  opacity: 0;
  animation: charSpring 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55) both;
}
@keyframes charSpring {
  from { opacity: 0; transform: translateY(30px) scale(0.8); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .hero h1 .hero-char.spring { animation: none; opacity: 1; }
}

/* animated staff */
.staff { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); z-index: -1; height: 220px; opacity: .55; }
.staff line { stroke: var(--gold); stroke-width: 1.1; opacity: .35;
  stroke-dasharray: 2000; stroke-dashoffset: 2000;
  transition: stroke-dashoffset 2s ease; }
.staff.drawn line { stroke-dashoffset: 0; }
.staff .ledger { opacity: .18; }

.float-note { position: absolute; left: 0; top: 0; font-family: "Noto Music", var(--serif); color: var(--gold); opacity: .0;
  z-index: 1; will-change: transform; user-select: none; pointer-events: none;
  transition: color .4s ease, text-shadow .4s ease; }
.float-note.near { color: var(--gold-deep);
  text-shadow: 0 0 18px color-mix(in srgb, var(--gold) 65%, transparent), 0 0 4px color-mix(in srgb, var(--gold) 40%, transparent); }

/* frosted "playbill" panel behind the hero text — readability + a concert-program motif */
.hero-inner {
  position: relative; max-width: 812px; z-index: 2;
  padding: clamp(26px, 3.6vw, 42px) clamp(30px, 5vw, 62px) clamp(24px, 3.2vw, 36px);
  background: color-mix(in srgb, var(--paper) 56%, transparent);
  -webkit-backdrop-filter: blur(13px) saturate(1.2);
          backdrop-filter: blur(13px) saturate(1.2);
  border-radius: 26px;
  border: 1px solid color-mix(in srgb, var(--gold-soft) 50%, transparent);
  box-shadow: var(--shadow);
}
/* inner gold hairline frame (double-rule playbill elegance) */
.hero-inner::before {
  content: ""; position: absolute; inset: 9px; border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--gold) 34%, transparent);
  pointer-events: none;
}
/* handwritten treble clef: draws its outline, then inks in; exits above the playbill panel */
/* Animated hand-written G-clef (glowing gold on black clip, composited with
   mix-blend-mode:screen so the black vanishes and the gold glow adds light —
   works in every browser incl. iOS Safari, no alpha codec needed). */
.hero .gclef {
  position: absolute; left: 50%; top: clamp(60px, 9vh, 112px); transform: translateX(-50%);
  width: clamp(62px, 8vw, 100px); height: auto; margin: 0; z-index: 4; overflow: visible;
  mix-blend-mode: screen; pointer-events: none;
  /* no drop-shadow: it would shadow the opaque video box into a visible rectangle;
     the clip's own glow supplies the halo. */
}
/* On smaller screens the centred clef crowds the hero panel/title. Move it beside the <h1>:
   placeGclef() in main.js measures the title and sets left/top precisely (mirroring the hero
   parallax on scroll). This block sizes it down and gives a left-anchored fallback for the
   no-JS case; mix-blend-mode:screen keeps the black plate invisible in both themes. */
@media (max-width: 760px) {
  .hero .gclef { width: clamp(42px, 12vw, 60px); left: clamp(6px, 4vw, 22px); transform: none; }
}
/* Reduced motion: JS does not autoplay, so the poster (finished gold clef) shows. */
.hero h1 {
  font-size: clamp(1.9rem, 7vw, 5rem);
  letter-spacing: -0.02em; line-height: 1; max-width: 100%;
  white-space: nowrap;      /* single word — never wrap mid-title */
  background: linear-gradient(180deg, var(--ink), color-mix(in srgb, var(--ink) 70%, var(--gold-deep)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* keep the title invisible until JS splits it — no flash of the un-animated title */
.hero h1:not([data-split="1"]) { opacity: 0; }
.hero .title-rule {
  height: 2px; width: min(420px, 70%); margin: 22px auto 30px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  transform: scaleX(0); transition: transform 1.1s .3s cubic-bezier(.2,.7,.2,1);
}
.hero.lit .title-rule { transform: scaleX(1); }

.hero-meta { font-family: var(--sans); letter-spacing: .12em; font-size: .82rem;
  text-transform: uppercase; color: var(--ink-soft); font-weight: 700; }
.hero-dates { font-family: var(--display); font-size: clamp(1.3rem, 3vw, 1.9rem);
  color: var(--gold-deep); margin-top: 4px; letter-spacing: .01em; }

.directors { display: flex; gap: clamp(28px, 6vw, 72px); justify-content: center; margin-top: 38px; flex-wrap: wrap; }
.director { text-align: center; }
.director .dn { font-family: var(--display); font-size: 1.4rem; font-weight: 600; }
.director .dr { font-family: var(--sans); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); margin-top: 3px; }
.director .seal { display: block; width: 54px; height: 54px; margin: 0 auto 12px; }
.director .seal svg { width: 100%; height: 100%; overflow: visible; }
.director .seal .ring-o, .director .seal .ring-i { fill: none; stroke: var(--gold); }
.director .seal .ring-o { stroke-width: 1.2; opacity: .45;
  stroke-dasharray: 183; stroke-dashoffset: 183;
  transition: stroke-dashoffset 1.4s cubic-bezier(.2,.7,.2,1) .35s; }
.director .seal .ring-i { stroke-width: .7; opacity: .28; stroke-dasharray: 2 4; }
.director .seal .laurel { fill: none; stroke: var(--gold); stroke-width: 1.4; stroke-linecap: round; opacity: .55;
  stroke-dasharray: 34; stroke-dashoffset: 34; transition: stroke-dashoffset 1s ease .8s; }
.director .seal .ini { font-family: var(--display); font-size: 19px; font-weight: 600; fill: var(--gold-deep);
  letter-spacing: .04em; opacity: 0; transition: opacity .7s ease .7s; }
.hero.lit .director .seal .ring-o { stroke-dashoffset: 0; }
.hero.lit .director .seal .laurel { stroke-dashoffset: 0; }
.hero.lit .director .seal .ini { opacity: 1; }
.director .seal svg { transition: transform .45s cubic-bezier(.2,.7,.2,1); }
.director:hover .seal svg { transform: scale(1.08) rotate(4deg); }

/* One element serves BOTH roles: a wide "Scopri di più" pill (gate closed)
   that gracefully morphs into the compact round scroll cue (gate open). */
/* Centered via auto margins (a LAYOUT property) rather than left:50% + translateX(-50%).
   The pill's width animates (161px → ~46px) as it morphs into the compact cue; a
   percentage transform is resolved against that width by the compositor and CACHED on
   the GPU layer, so while the width shrinks on the main thread the cached -50% offset no
   longer matches — sliding the element visibly LEFT in Safari. Auto margins re-center
   against the live width every frame on the main thread, and the float animation below
   now touches translateY ONLY (a fixed px offset, safe to composite) — so there is no
   width-dependent transform left to desync. */
.scroll-cue {
  position: absolute; bottom: 30px; left: 0; right: 0;
  margin-inline: auto; width: max-content; max-width: calc(100% - 32px);
  z-index: 3; display: flex; flex-direction: row; align-items: center;
  gap: 13px; padding: 12px 24px 14px; border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 72%, transparent);
  border: 1px solid var(--line); backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition:
    padding .6s cubic-bezier(.22,1,.36,1),
    gap .6s cubic-bezier(.22,1,.36,1),
    transform .35s cubic-bezier(.2,.7,.2,1), border-color .3s, box-shadow .35s;
  animation: cueFloat 2.8s ease-in-out infinite;
}
.scroll-cue:hover { border-color: var(--gold); box-shadow: var(--shadow); animation-play-state: paused; transform: translateY(-4px); }
@keyframes cueFloat { 0%,100%{ transform: translateY(0) } 50%{ transform: translateY(7px) } }

/* the "Scopri di più" label — collapses away as the pill morphs to a cue */
.cue-label {
  font-family: var(--sans); font-weight: 800; font-size: .8rem; letter-spacing: .04em;
  color: var(--ink); white-space: nowrap; overflow: hidden;
  max-width: 180px; opacity: 1;
  transition:
    max-width .6s cubic-bezier(.22,1,.36,1),
    opacity .38s ease,
    margin .6s cubic-bezier(.22,1,.36,1);
}
/* refined double-chevron cue (replaces the mouse metaphor) */
.cue-chevs { display: grid; place-items: center; flex: none; width: 22px; height: 22px; }
.cue-chevs svg { width: 22px; height: 22px; fill: none; stroke: var(--gold-deep);
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  animation: cueBob 1.8s ease-in-out infinite; }
.cue-chevs svg path:last-child { opacity: .5; }
@keyframes cueBob {
  0%,100% { transform: translateY(-2.5px); }
  50%     { transform: translateY(2.5px); }
}
/* GATE CLOSED → prominent gold-accented Learn-More pill */
body.gate-closed .scroll-cue { border-color: var(--gold-soft); box-shadow: var(--shadow); }
/* GATE OPEN → collapse label + padding into a compact round cue around the chevron */
body.gate-open .scroll-cue { gap: 0; padding: 11px; }
body.gate-open .cue-label { max-width: 0; opacity: 0; margin: 0; }
/* returning visitors: no morph animation — cue is already compact */
body.gate-immediate .scroll-cue,
body.gate-immediate .cue-label { transition: none !important; }
@media (prefers-reduced-motion: reduce) { .cue-chevs svg { animation: none; } }
@media (prefers-reduced-motion: reduce) {
  .scroll-cue, .cue-wheel, .cue-chev { animation: none !important; }
}

/* ============================================================
   Status / stats strip
   ============================================================ */
/* media band placeholder bridging the hero→content separation (grayed until a real
   image/video is generated); the status card then floats over its lower edge */
.status-band { position: relative; height: clamp(140px, 22vw, 240px); margin-top: clamp(18px, 4vw, 40px);
  border-radius: 18px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  background: repeating-linear-gradient(45deg, var(--bg-2), var(--bg-2) 11px, var(--paper) 11px, var(--paper) 22px); }
.status-band .media-slot { position: absolute; inset: 0; }
/* generated banner/backdrop images filling the status band + cinema backdrop frames */
.band-img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- graceful image reveal ----------
   Content images stay hidden until fully loaded, then fade in (matching the prior design's
   polish). revealImage() in main.js adds .is-loaded on load/cache-hit/error, so nothing ever
   stays permanently invisible. Reduced-motion drops the transition (instant show). Selectors
   are class-specific so .is-loaded always wins the opacity cascade. */
.cv-img, .gtile img, .band-img { opacity: 0; transition: opacity .7s cubic-bezier(0.22, 1, 0.36, 1); }
.cv-img.is-loaded, .gtile img.is-loaded, .band-img.is-loaded { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .cv-img, .gtile img, .band-img { transition: none; }
}
/* soften the status-band photo into the page: a gentle overall veil + a fade to the
   theme base (cream in light / dark paper in dark) toward the bottom, so it "fades to
   white" and melts under the floating status card instead of being a hard-edged photo. */
.status-band::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, transparent 22%, var(--bg) 100%),
    linear-gradient(color-mix(in srgb, var(--bg) 20%, transparent),
                    color-mix(in srgb, var(--bg) 20%, transparent));
}
.status-strip { margin-top: -56px; position: relative; z-index: 5; padding-inline: clamp(0px, 3vw, 34px); }
.status-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); display: grid; grid-template-columns: 1.1fr 1fr;
  overflow: hidden;
}
.status-open { display: flex; align-items: center; gap: 16px; padding: 26px 30px; }
.status-open .check { width: 42px; height: 42px; flex: none; border-radius: 50%;
  background: color-mix(in srgb, var(--green) 16%, transparent); color: var(--green);
  display: grid; place-items: center; }
.status-open .check svg { width: 22px; height: 22px; }
.status-open .pulse { position: relative; }
.status-open .pulse::after { content:""; position:absolute; inset:0; border-radius:50%;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 50%, transparent); animation: pulse 2.4s infinite; }
@keyframes pulse { to { box-shadow: 0 0 0 16px transparent; } }
.status-open h3 { font-size: 1.5rem; }
.status-note { padding: 26px 30px; border-left: 1px solid var(--line);
  font-style: italic; color: var(--ink-soft); display: flex; align-items: center; }
/* registrations-closed state — the banner reflects the LIVE open/close state (getSiteStatus).
   Muted antique-amber (not alarming red), pulse removed in JS by dropping the .pulse class. */
.status-open .check.closed { background: color-mix(in srgb, var(--gold-deep) 18%, transparent); color: var(--gold-deep); }
.status-card.closed h3 { color: var(--ink-soft); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-top: 22px; }
.stat { background: var(--paper); padding: 28px 18px; text-align: center; }
.stat .num { font-family: var(--display); font-size: clamp(2.4rem, 5vw, 3.4rem); font-weight: 700; color: var(--gold-deep); line-height: 1; }
.stat .lbl { font-family: var(--sans); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); margin-top: 8px; }

/* ============================================================
   Chi siamo
   ============================================================ */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.about-grid p { margin: 0 0 18px; color: var(--ink-soft); font-size: 1.12rem; }
.about-lead p:first-child { font-size: 1.35rem; color: var(--ink); font-family: var(--display); line-height: 1.4; }
.about-aside { border-left: 2px solid var(--gold-soft); padding-left: 28px; }

/* ============================================================
   Presentation videos (section after Chi Siamo)
   ============================================================ */
.videos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 34px); }
.video-card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .35s, box-shadow .35s, border-color .35s; }
.video-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--gold-soft); }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: var(--bg-2); }
.video-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-caption { padding: 18px 22px; }
.video-caption h4 { font-size: 1.3rem; }
.video-caption p { font-family: var(--sans); font-size: .82rem; color: var(--ink-faint); margin: 6px 0 0; }

/* ============================================================
   Cinema treatment for #videos — a "movie theatre" that feathers
   in from the cream above and back out below, regardless of theme.
   ============================================================ */
.cinema {
  position: relative; overflow: hidden;
  min-height: 128vh;
  display: flex; flex-direction: column; justify-content: center;
  /* soft top-centre "projector" glow + deep warm dark that fades in/out at the edges */
  background:
    radial-gradient(120% 60% at 50% 34%, rgba(60, 44, 26, .55), transparent 60%),
    linear-gradient(180deg, transparent 0%, #16110b 11%, #16110b 89%, transparent 100%);
}
/* light text for contrast on the dark theatre backdrop */
.cinema .eyebrow { color: var(--gold); }
.cinema .section-head h2 {
  /* keep the shimmer sweep, but a light cream base so the title reads on dark */
  background-image: linear-gradient(100deg,
    #f3e9d4 0%, #f3e9d4 42%, var(--gold) 50%, #f3e9d4 58%, #f3e9d4 100%);
}
/* per-character projector flicker: JS splits the title into .cine-char spans, each
   carrying the same cream→gold gradient and a randomized delay/duration so individual
   letters flicker out of sync (like a projector/neon). */
.cinema .section-head h2 .cine-char {
  display: inline-block; white-space: pre;   /* preserve spaces between words */
  background-image: linear-gradient(100deg,
    #f3e9d4 0%, #f3e9d4 42%, var(--gold) 50%, #f3e9d4 58%, #f3e9d4 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: projectorFlicker 5.5s linear infinite;
  will-change: opacity, filter;
}
@media (prefers-reduced-motion: reduce) {
  .cinema .section-head h2 .cine-char { animation: none; opacity: 1; }
}
/* pronounced projector flicker: deeper dips + brightness swings + a gold-tinted glow so
   the letters visibly pulse like projected light against the dark theatre. */
@keyframes projectorFlicker {
  0%,   100% { opacity: 1;    filter: brightness(1);    text-shadow: 0 0 22px rgba(224,178,94,.22); }
  7%        { opacity: .70;  filter: brightness(1.28); text-shadow: 0 0 42px rgba(224,178,94,.55); }
  8%        { opacity: 1;    filter: brightness(1); }
  32%       { opacity: .82;  filter: brightness(1.20); text-shadow: 0 0 48px rgba(224,178,94,.62); }
  33%       { opacity: 1; }
  34%       { opacity: .88; }
  35%       { opacity: 1; }
  59%       { opacity: .68;  filter: brightness(1.32); text-shadow: 0 0 52px rgba(224,178,94,.68); }
  60%       { opacity: 1; }
  83%       { opacity: .80;  filter: brightness(1.22); text-shadow: 0 0 46px rgba(224,178,94,.55); }
  84%       { opacity: 1; }
  85%       { opacity: .9; }
  86%       { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .cinema .section-head h2 { animation: none; }
}
.cinema .rules-intro { color: #cdbf9f; }
.cinema .rules-intro:hover { color: #f3e9d4; }

/* the two videos as backlit "screens" */
.cinema .video-card {
  background: rgba(255, 255, 255, .04);
  border-color: color-mix(in srgb, var(--gold) 30%, transparent);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .03) inset;
}
.cinema .video-caption h4 { color: #f3e9d4; }
.cinema .video-caption p { color: #b6a888; }
/* keep the existing lift; layer on a gold glow */
.cinema .video-card:hover {
  border-color: color-mix(in srgb, var(--gold) 55%, transparent);
  box-shadow:
    0 50px 100px -28px rgba(0, 0, 0, .85),
    0 0 42px -6px color-mix(in srgb, var(--gold) 32%, transparent),
    0 0 0 1px rgba(255, 255, 255, .05) inset;
}

/* wide "locandina / backdrop" placeholder above the videos grid */
.cinema-backdrop {
  max-width: 900px; margin: 0 auto 34px;
  aspect-ratio: 21 / 7; border-radius: 14px; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--gold) 22%, transparent);
  background: rgba(255, 255, 255, .03);
}
.cinema-backdrop .media-slot { width: 100%; height: 100%; }
.cinema-backdrop .badge { color: rgba(243, 233, 212, .7); }

/* ============================================================
   Docenti
   ============================================================ */
.faculty-filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 44px; }
.chip {
  font-family: var(--sans); font-size: .82rem; font-weight: 700; letter-spacing: .02em;
  color: var(--ink-soft); background: var(--paper); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 16px; cursor: pointer; transition: all .22s;
  display: inline-flex; align-items: center; gap: 8px;
}
/* hover matches the Curriculum (.cv-toggle) pill: gold tint + border + lift, both themes */
.chip:hover {
  border-color: var(--gold); color: var(--gold-deep);
  background: color-mix(in srgb, var(--gold) 12%, var(--paper));
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 12%, transparent);
}
/* active fill stays distinct from hover and never lifts */
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); transform: none; box-shadow: none; }
[data-theme="dark"] .chip.active { background: var(--gold); color: #1a140b; border-color: var(--gold); }
@media (prefers-reduced-motion: reduce) { .chip:hover { transform: none; } }
.chip .ct { font-size: .7rem; opacity: .6; }

/* Masonry columns (not a 2-col grid): in a grid, every card stretched to the
   tallest card in its row, so a 1-teacher card (Clarinetto, Canto lirico, Flauto)
   next to a 3-teacher card (Violino) produced a large empty void. Columns let each
   card hug its own content and flow to fill both columns evenly — no dead space. */
.faculty-grid { column-count: 2; column-gap: 20px; }
.fac-group {
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
  padding: 26px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform .35s, box-shadow .35s, border-color .35s, opacity .4s;
  /* keep a card whole inside a column + provide the inter-card vertical rhythm
     that `gap` used to give in the old grid layout */
  break-inside: avoid; -webkit-column-break-inside: avoid; margin-bottom: 20px;
}
.fac-group:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--gold-soft); }
.fac-group.hide { display: none; }
.fac-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.fac-head h3 { font-size: 1.9rem; }
.fac-instrument { width: 76px; height: 76px; flex: none; border-radius: 12px;
  display: grid; place-items: center; overflow: hidden; }
.fac-instrument .media-slot { width: 100%; height: 100%; }
/* real instrument icon — theme-aware gold via CSS mask (transparent interior
   shows the page through; base gold takes the theme color) */
.fac-icon {
  display: block; width: 62px; height: 62px;
  background: var(--gold);
  -webkit-mask: var(--ico) center / contain no-repeat;
          mask: var(--ico) center / contain no-repeat;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), background .35s ease;
}
.fac-group:hover .fac-icon { transform: scale(1.08); background: var(--gold-deep); }
@media (prefers-reduced-motion: reduce) {
  .fac-icon { transition: none; }
  .fac-group:hover .fac-icon { transform: none; }
}
.fac-teachers { display: flex; flex-direction: column; gap: 14px; }
.teacher { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: baseline;
  padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.teacher:last-child { border-bottom: none; padding-bottom: 0; }
.teacher .tn { font-family: var(--display); font-size: 1.32rem; font-weight: 600; }
.teacher .td { font-family: var(--sans); font-size: .76rem; color: var(--ink-faint); letter-spacing: .04em; }
.teacher .tq { font-family: var(--sans); font-size: .82rem; font-weight: 800; color: var(--gold-deep); white-space: nowrap; }
/* row actions: Curriculum toggle + grayed Ascolto placeholder share a line */
.teacher-actions { grid-column: 1 / -1; margin-top: 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.teacher .listen {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--sans); font-size: .74rem; font-weight: 700; letter-spacing: .04em;
  color: var(--ink-soft); background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px 6px 8px; width: fit-content; transition: all .2s;
}
/* Ascolto is a grayed, non-interactive media placeholder until real recordings exist */
.teacher .listen.listen-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; font-style: italic; }
.teacher .listen .play { width: 22px; height: 22px; border-radius: 50%; background: var(--gold);
  color: #fff; display: grid; place-items: center; flex: none; }
.teacher .listen .play svg { width: 11px; height: 11px; }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { width: 2.5px; background: currentColor; height: 30%; border-radius: 2px; }

/* Curriculum toggle pill */
.teacher .cv-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: .74rem; font-weight: 700; letter-spacing: .04em;
  color: var(--ink-soft); background: var(--paper); border: 1px solid var(--gold-soft);
  border-radius: 999px; padding: 6px 12px 6px 11px; cursor: pointer; width: fit-content; transition: all .22s;
}
.teacher .cv-toggle:hover { border-color: var(--gold); color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 12%, transparent); }
.teacher .cv-toggle svg { width: 15px; height: 15px; flex: none; }
.teacher .cv-toggle .cv-chevron { width: 13px; height: 13px; transition: transform .35s ease; }
.teacher.cv-open .cv-toggle {
  color: var(--gold-deep); border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 10%, var(--paper));
}
.teacher.cv-open .cv-toggle .cv-chevron { transform: rotate(180deg); }

/* Expanding in-card curriculum panel (accordion — one open at a time) */
.cv-panel { grid-column: 1 / -1; max-height: 0; overflow: hidden;
  transition: max-height .45s cubic-bezier(.4, 0, .2, 1); }
.cv-inner { margin-top: 16px; padding-top: 18px; border-top: 1px solid var(--gold-soft); }
.cv-grid { display: flex; gap: 20px; align-items: flex-start; }
.cv-photo { width: 130px; height: 130px; flex: none; border-radius: 14px; overflow: hidden;
  position: relative; border: 1px solid var(--line); background: var(--bg-2); box-shadow: var(--shadow-sm); }
.cv-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cv-photo .cv-photo-ph { position: absolute; inset: 0; display: none; place-items: center; text-align: center; padding: 10px;
  background: repeating-linear-gradient(45deg, var(--bg-2), var(--bg-2) 8px, var(--paper) 8px, var(--paper) 16px); }
.cv-photo .cv-photo-ph span { font-family: var(--sans); font-size: .58rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); line-height: 1.4; }
.cv-photo.missing img { display: none; }
.cv-photo.missing .cv-photo-ph { display: grid; }
.cv-text { flex: 1 1 auto; min-width: 0; }
.cv-text p { margin: 0 0 12px; color: var(--ink-soft); font-size: .95rem; line-height: 1.62; }
.cv-text p:last-child { margin-bottom: 0; }
.cv-text strong { color: var(--ink); font-weight: 700; }
/* the intro hook — a gold-accented lead */
.cv-text .curriculum-intro { font-family: var(--display); font-size: 1.08rem; line-height: 1.45;
  color: var(--ink); font-weight: 600; margin-bottom: 15px; padding-left: 15px; border-left: 3px solid var(--gold); }
.cv-text .curriculum-intro strong { color: var(--gold-deep); font-weight: 700; }
.cv-text .cv-website { font-family: var(--sans); font-size: .86rem; margin-top: 14px; color: var(--ink-faint); }
.cv-text .cv-website a { color: var(--gold-deep); border-bottom: 1px solid var(--gold-soft); }
.cv-text .cv-website a:hover { color: var(--ink); }
.cv-text .cv-empty { font-style: italic; color: var(--ink-faint); }
@media (prefers-reduced-motion: reduce) { .cv-panel { transition: max-height .2s ease; } }
@media (max-width: 560px) {
  .cv-grid { flex-direction: column; }        /* photo stacks above text on narrow cards */
  .cv-photo { width: 100%; height: 190px; }
}

.faculty-foot { text-align: center; margin-top: 28px; font-family: var(--sans); font-size: .82rem; color: var(--ink-faint); letter-spacing: .04em; }

/* ---- "Solo edizione corrente" iOS-style pill switch (sits under the filter chips) ---- */
.faculty-toggle { display: flex; justify-content: center; margin: -22px 0 42px; }
.edition-switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.edition-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.es-track { position: relative; flex: none; width: 46px; height: 26px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--line);
  transition: background .3s ease, border-color .3s ease; }
.es-thumb { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--paper); box-shadow: var(--shadow-sm);
  transition: transform .32s cubic-bezier(.2,.7,.2,1); }
.edition-switch input:checked + .es-track { background: linear-gradient(180deg, var(--gold), var(--gold-deep)); border-color: var(--gold-deep); }
.edition-switch input:checked + .es-track .es-thumb { transform: translateX(20px); }
.edition-switch input:focus-visible + .es-track { box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 30%, transparent); }
.es-label { font-family: var(--sans); font-size: .82rem; font-weight: 700; letter-spacing: .02em; color: var(--ink-soft); transition: color .25s; }
.edition-switch:hover .es-label { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .es-thumb, .es-track, .es-label { transition: none; } }

/* ---- two distinct statuses ---- */
/* "Date da definire" — teacher IS in the edition, dates simply not fixed yet */
.teacher .td.td-tbd { font-style: italic; color: var(--ink-soft); }
/* "Non disponibile" — teacher NOT in the current edition (gold-outlined pill) */
.teacher .unavail-badge { grid-column: 1 / -1; width: fit-content; margin-top: 4px;
  display: none; align-items: center;
  font-family: var(--sans); font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold-deep); background: color-mix(in srgb, var(--gold) 9%, transparent);
  border: 1px solid var(--gold); border-radius: 999px; padding: 4px 12px; }
.teacher-unavail .unavail-badge { display: inline-flex; }
.teacher-unavail .tq, .teacher-unavail .td { display: none; }
/* grayed presentation, only in the "show all editions" (toggle OFF) state */
.faculty-grid.show-all .teacher-unavail { opacity: .55; filter: grayscale(.5); }

/* ============================================================
   Curriculum focus mode — the selected curriculum owns the section
   ============================================================ */
.faculty-focus { max-width: 900px; margin: 0 auto; }
.focus-back {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--sans); font-size: .8rem; font-weight: 800; letter-spacing: .02em;
  color: var(--ink-soft); background: var(--paper); border: 1px solid var(--gold-soft);
  border-radius: 999px; padding: 9px 18px 9px 15px; cursor: pointer; margin-bottom: 26px;
  transition: color .25s, border-color .25s, transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s;
}
.focus-back:hover { color: var(--ink); border-color: var(--gold); transform: translateX(-3px);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 12%, transparent); }
.focus-back svg { width: 16px; height: 16px; flex: none; }
@media (prefers-reduced-motion: reduce) { .focus-back:hover { transform: none; } }

.focus-card { background: var(--paper); border: 1px solid var(--line); border-radius: 20px;
  padding: clamp(26px, 4vw, 44px); box-shadow: var(--shadow); }
.focus-head { border-bottom: 1px solid var(--gold-soft); padding-bottom: 20px; margin-bottom: 28px; }
.focus-instrument { font-family: var(--sans); font-size: .74rem; font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase; color: var(--gold-deep); margin: 0 0 6px; }
.focus-name { font-family: var(--display); font-size: clamp(2rem, 4.4vw, 2.9rem); font-weight: 700; color: var(--ink); line-height: 1.05; }
.focus-meta { font-family: var(--sans); font-size: .96rem; color: var(--ink-soft);
  margin: 12px 0 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.focus-meta .focus-dates { letter-spacing: .03em; }
.focus-meta .focus-quota { font-weight: 800; color: var(--gold-deep); }
.focus-meta .unavail-badge { display: inline-flex; grid-column: auto; margin-top: 0; }
.focus-grid { gap: clamp(24px, 4vw, 40px); align-items: flex-start; }
.focus-photo { width: clamp(160px, 22vw, 210px); height: clamp(200px, 27vw, 260px); border-radius: 16px; }
.focus-text { max-width: 66ch; }
.focus-text p { font-size: 1.02rem; line-height: 1.72; margin-bottom: 15px; }
.focus-text .curriculum-intro { font-size: 1.22rem; line-height: 1.5; margin-bottom: 20px; padding-left: 18px; }
@media (max-width: 640px) {
  .focus-grid { flex-direction: column; }
  .focus-photo { width: 100%; height: 260px; }
  .focus-text { max-width: none; }
}

/* ============================================================
   Regolamento — accordion
   ============================================================ */
.rules-intro { max-width: 720px; margin: 0 auto 44px; text-align: center; color: var(--ink-soft); font-size: 1.15rem; }
.accordion { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.acc-item { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.acc-head { width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  display: flex; align-items: center; gap: 16px; padding: 22px 26px; font-family: var(--display);
  font-size: 1.5rem; color: var(--ink); transition: background .25s, color .3s ease, text-shadow .3s ease; }
.acc-head:hover { background: var(--bg-2); color: var(--gold-deep);
  text-shadow: 0 0 20px color-mix(in srgb, var(--gold) 35%, transparent); }
.acc-num { font-family: var(--sans); font-size: .8rem; font-weight: 800; color: var(--gold-deep); flex: none; }
.acc-icon { margin-left: auto; width: 26px; height: 26px; flex: none; position: relative; transition: transform .35s; }
.acc-icon::before, .acc-icon::after { content:""; position:absolute; top:50%; left:50%; background: var(--gold-deep); border-radius: 2px; transform: translate(-50%,-50%); }
.acc-icon::before { width: 14px; height: 2px; }
.acc-icon::after { width: 2px; height: 14px; transition: transform .35s; }
.acc-item.open .acc-icon::after { transform: translate(-50%,-50%) scaleY(0); }
.acc-body { max-height: 0; overflow: hidden; transition: max-height .45s ease; }
.acc-body-inner { padding: 0 26px 24px; color: var(--ink-soft); font-size: 1.05rem; }
.acc-body-inner p { margin: 0 0 12px; }
.acc-body-inner p:last-child { margin-bottom: 0; }

/* ---- Regolamento — structured content (items 01 & 04) ---- */
/* refined subheadings inside an accordion body */
.rules-subhead {
  font-family: var(--display);
  font-size: 1.16rem;
  color: var(--gold-deep);
  letter-spacing: .01em;
  margin: 28px 0 12px;
}

/* links inside the accordion body (enrol paragraph, "shown in Venue") */
.acc-body-inner a {
  color: var(--gold-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--gold-soft);
  transition: color .25s ease, border-color .25s ease;
  overflow-wrap: anywhere;
}
.acc-body-inner a:hover { color: var(--ink); border-color: var(--gold); }

/* registration-fee highlight card */
.reg-fee-card {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 20px;
  margin: 18px 0 8px;
  padding: 20px 24px;
  background: color-mix(in srgb, var(--gold) 9%, var(--paper));
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
}
.reg-fee-label {
  flex: 1 1 auto;
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.reg-fee-amount {
  flex: none;
  font-family: var(--display);
  font-size: 2.15rem;
  line-height: 1;
  color: var(--gold-deep);
}
.reg-fee-note {
  flex: 1 1 100%;
  margin: 10px 0 0 !important;
  font-size: .9rem;
  color: var(--ink-faint);
}

/* payment methods — numbered list with gold markers */
.pay-list {
  margin: 4px 0 20px;
  padding: 0;
  list-style: none;
  counter-reset: pay;
}
.pay-list > li {
  position: relative;
  padding: 12px 0 12px 42px;
  border-bottom: 1px solid var(--line-2);
  counter-increment: pay;
}
.pay-list > li:last-child { border-bottom: none; }
.pay-list > li::before {
  content: counter(pay, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 11px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 800;
  color: var(--gold-deep);
  background: color-mix(in srgb, var(--gold) 12%, transparent);
  border: 1px solid var(--gold-soft);
  border-radius: 50%;
}

/* highlighted, copyable IBAN block */
.iban-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  margin-top: 12px;
  padding: 9px 14px;
  background: color-mix(in srgb, var(--gold) 10%, var(--paper));
  border: 1px solid var(--gold-soft);
  border-radius: 8px;
}
.iban-label {
  flex: none;
  font-family: var(--sans);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.iban-box code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .95rem;
  letter-spacing: .06em;
  color: var(--ink);
  white-space: nowrap;
  overflow-x: auto;
}

/* hotel contacts — definition-style list (item 04) */
.hotel-contacts {
  margin: 10px 0 20px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
}
.hotel-contacts > li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-2);
}
.hotel-contacts > li:last-child { border-bottom: none; }
.hc-label {
  flex: 0 0 96px;
  font-family: var(--sans);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.hc-value { color: var(--ink-soft); overflow-wrap: anywhere; }

@media (max-width: 560px) {
  .reg-fee-amount { font-size: 1.9rem; }
  .hc-label { flex-basis: 100%; }
}

.rules-download { text-align: center; margin-top: 40px; }
.dl-btn { display: inline-flex; align-items: center; gap: 12px; font-family: var(--sans); font-weight: 800;
  color: var(--ink); background: var(--paper); border: 1px solid var(--gold-soft); border-radius: 999px;
  padding: 14px 26px; box-shadow: var(--shadow-sm); transition: all .25s; }
.dl-btn:hover { transform: translateY(-2px); border-color: var(--gold); }
.dl-btn .pdf { font-size: .68rem; letter-spacing: .1em; color: var(--gold-deep); }
/* grayed-out download when the PDF is not available yet */
.rules-download.document-unavailable .dl-btn { opacity: .5; border-color: var(--line);
  color: var(--ink-faint); cursor: not-allowed; pointer-events: none; box-shadow: none; font-style: italic; }
.rules-download.document-unavailable .dl-btn .pdf { color: var(--ink-faint); }

/* ============================================================
   Luogo — map + gallery + rates
   ============================================================ */
.venue-grid { display: grid; grid-template-columns: 0.92fr 1.28fr; gap: clamp(28px, 5vw, 56px); align-items: start; }
.venue-grid p { color: var(--ink-soft); font-size: 1.1rem; }
/* interactive antique map of Darfo Boario — a 3D "vintage sheet" that lies at a slight angle and
   flattens + enlarges on hover for a dynamic, tactile feel. The 3D lives on the inner .map-sheet
   (NOT the .reveal container, whose .in-view rule resets transform). background-size:100% 100%
   fills the sheet EXACTLY (sheet aspect == image aspect), so no crop shifts the %-positioned markers. */
.venue-map { position: relative; aspect-ratio: 1600 / 1062; perspective: 1600px; }
.map-sheet { position: absolute; inset: 0; transform-origin: center; will-change: transform;
  background-image: url(/images/venue/map-boario-light.jpg); background-size: 100% 100%; background-position: center;
  border: 1px solid var(--line); border-radius: 18px; overflow: hidden; backface-visibility: hidden;
  transform: rotateX(3deg) rotateY(-5.5deg) scale(.97);
  box-shadow: -20px 26px 46px -24px rgba(60,44,20,.5), var(--shadow-sm);
  transition: transform .55s cubic-bezier(.22,1,.36,1), box-shadow .55s cubic-bezier(.22,1,.36,1); }
[data-theme="dark"] .map-sheet { background-image: url(/images/venue/map-boario-dark.jpg); }
.map-sheet:hover, .map-sheet:focus-within { transform: rotateX(0) rotateY(0) scale(1.05); z-index: 5;
  box-shadow: -8px 30px 64px -22px rgba(40,28,12,.6), var(--shadow-sm); }
.map-markers { position: absolute; inset: 0; }
@media (prefers-reduced-motion: reduce) { .map-sheet { transform: none; transition: none; } }
@media (hover: none) { .map-sheet { transform: none; } }
.map-pin { position: absolute; transform: translate(-50%, -50%); z-index: 2;
  width: 18px; height: 18px; display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.map-pin .pin-head { position: absolute; inset: 0; margin: auto; width: 15px; height: 15px; border-radius: 50%;
  background: var(--gold); border: 2.5px solid var(--paper);
  box-shadow: 0 2px 6px rgba(0,0,0,.35), 0 0 0 1px color-mix(in srgb, var(--gold-deep) 55%, transparent);
  transition: transform .28s cubic-bezier(0.22,1,0.36,1), background .2s; }
.map-pin .pin-ring { position: absolute; inset: 0; margin: auto; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--gold); opacity: 0; pointer-events: none; }
.map-pin .pin-label { position: absolute; left: 50%; bottom: calc(100% + 9px); transform: translateX(-50%);
  white-space: nowrap; font-family: var(--sans); font-size: .74rem; font-weight: 700; color: var(--bg);
  background: var(--ink); padding: 5px 10px; border-radius: 7px; box-shadow: var(--shadow-sm);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 5; }
.map-pin .pin-label::after { content: ""; position: absolute; left: 50%; top: 100%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--ink); }
.map-pin:hover .pin-head, .map-pin:focus-visible .pin-head, .map-pin.active .pin-head { transform: scale(1.35); background: var(--gold-deep); }
.map-pin:hover .pin-label, .map-pin:focus-visible .pin-label, .map-pin.active .pin-label { opacity: 1; transform: translateX(-50%) translateY(-2px); }
.map-pin:hover .pin-ring, .map-pin:focus-visible .pin-ring, .map-pin.active .pin-ring { animation: pinPing 1.7s ease-out infinite; }
.map-pin.faded { opacity: .42; }
@keyframes pinPing { 0% { opacity: .7; transform: scale(1); } 100% { opacity: 0; transform: scale(3.4); } }
/* off-map "nearby" markers pinned to the edge (station south, Lago Moro up-valley) */
.map-pin.off { width: auto; height: auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--gold-deep); z-index: 3;
  background: color-mix(in srgb, var(--paper) 84%, var(--gold) 16%); box-shadow: var(--shadow-sm); }
.map-pin.off .pin-head, .map-pin.off .pin-ring { display: none; }
.map-pin.off::before { color: var(--gold-deep); font-weight: 900; font-size: .8rem; line-height: 1; }
.map-pin.off-down { transform: translate(-50%, -100%); }
.map-pin.off-down::before { content: "\2193"; }
.map-pin.off-left { transform: translate(0, -50%); }
.map-pin.off-left::before { content: "\2190"; }
.map-pin.off .pin-label { position: static; opacity: 1; transform: none; background: none; box-shadow: none;
  padding: 0; color: var(--ink); font-weight: 800; font-size: .72rem; }
.map-pin.off .pin-label::after { display: none; }
.map-pin.off:hover, .map-pin.off:focus-visible, .map-pin.off.active { border-color: var(--gold); background: var(--gold); }
.map-pin.off:hover .pin-label, .map-pin.off:focus-visible .pin-label, .map-pin.off.active .pin-label { color: var(--ink); }

.map-legend { display: flex; flex-direction: column; gap: 8px; margin-top: 22px; }
.leg-item { display: flex; align-items: center; gap: 12px; font-family: var(--sans); font-size: .9rem;
  cursor: pointer; text-decoration: none; padding: 5px 8px; border-radius: 8px; transition: background .2s, opacity .2s; }
.leg-item .swatch { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent); }
.leg-item .ln { color: var(--ink); font-weight: 700; }
.leg-item .ld { color: var(--ink-faint); }
.leg-item:hover, .leg-item.active { background: color-mix(in srgb, var(--gold) 12%, transparent); }
.leg-item.dim { opacity: .4; }
@media (prefers-reduced-motion: reduce) { .map-pin .pin-ring { animation: none !important; } }

.hospitality { margin-top: clamp(56px, 8vw, 96px); }
.venue-convention-note { max-width: 760px; margin: 0 auto 8px; padding: 14px 20px;
  font-style: italic; color: var(--ink-soft);
  background: color-mix(in srgb, var(--paper) 60%, transparent);
  border-left: 3px solid var(--gold-soft); border-radius: 8px; }
.venue-convention-note strong { color: var(--gold-deep); font-weight: 800; }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 150px; gap: 12px; }
.gtile { position: relative; overflow: hidden; border-radius: 12px;
  border: 1px solid var(--line);
  background: repeating-linear-gradient(45deg, var(--bg-2), var(--bg-2) 10px, var(--paper) 10px, var(--paper) 20px); }
.gtile .media-slot { position: absolute; inset: 0; width: 100%; height: 100%; }
.gtile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gtile .gnum { position: absolute; left: 10px; top: 9px; z-index: 3; pointer-events: none;
  font-family: var(--sans); font-size: .68rem; font-weight: 800; letter-spacing: .08em;
  color: var(--gold-deep); background: color-mix(in srgb, var(--paper) 80%, transparent);
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); }
.gtile .gcap { position: absolute; left: 10px; bottom: 9px; right: 10px; z-index: 3; pointer-events: none;
  font-family: var(--sans); font-size: .72rem; font-weight: 700; color: var(--ink-soft);
  background: color-mix(in srgb, var(--paper) 78%, transparent); backdrop-filter: blur(2px);
  padding: 4px 9px; border-radius: 8px; border: 1px solid var(--line); width: fit-content; max-width: 100%; }
.gtile.big { grid-column: span 2; grid-row: span 2; }

/* rates */
.rates { margin-top: clamp(40px, 6vw, 64px); display: grid; grid-template-columns: 1fr; max-width: 760px; }
.rates-card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); }
.rates-card header { padding: 22px 28px; border-bottom: 1px solid var(--line); }
.rates-card header h4 { font-size: 1.5rem; }
.rates-card header span { font-family: var(--sans); font-size: .8rem; color: var(--ink-faint); letter-spacing: .04em; }
.rate-row { display: grid; grid-template-columns: 1.3fr auto 1.2fr; gap: 14px; align-items: center; padding: 15px 28px; border-bottom: 1px solid var(--line-2); }
.rate-row:last-of-type { border-bottom: none; }
.rate-row .rc { font-family: var(--display); font-size: 1.2rem; }
.rate-row .rp { font-family: var(--sans); font-weight: 800; color: var(--gold-deep); font-size: 1.05rem; text-align: center; }
.rate-row .rt { font-family: var(--sans); font-size: .82rem; color: var(--ink-faint); text-align: right; }
.rate-head { border-bottom: 1px solid var(--line); }
.rate-head .rc, .rate-head .rp, .rate-head .rt { font-family: var(--sans); font-size: .7rem;
  font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
.rates-foot { padding: 16px 28px; background: var(--bg-2); font-family: var(--sans); font-size: .86rem; color: var(--ink-soft); display: flex; align-items: center; gap: 10px; }
.rates-foot .star { color: var(--gold); }
.venue-note { max-width: 760px; margin-top: 24px; color: var(--ink-soft); font-style: italic; }

/* ============================================================
   Contatti
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; max-width: 920px; margin: 0 auto; }
.contact-card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 34px; box-shadow: var(--shadow-sm); }
.contact-card .ic { width: 46px; height: 46px; border-radius: 12px; background: var(--bg-2); color: var(--gold-deep); display: grid; place-items: center; margin-bottom: 18px; }
.contact-card .ic svg { width: 22px; height: 22px; }
.contact-card h4 { font-size: 1.5rem; margin-bottom: 8px; }
.contact-card p { color: var(--ink-soft); font-size: 1rem; margin: 0 0 16px; }
.contact-card a.big { font-family: var(--display); font-size: 1.5rem; color: var(--gold-deep); border-bottom: 1px solid var(--gold-soft); }
.contact-card a.big:hover { color: var(--ink); }
.contact-intro { text-align: center; max-width: 680px; margin: 0 auto 44px; color: var(--ink-soft); font-size: 1.15rem; }
.contact-label { display: block; font-family: var(--sans); font-size: .72rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--line); padding-block: clamp(48px, 7vw, 80px); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; }
.footer-grid h5 { font-family: var(--sans); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 14px; }
.footer-grid p { margin: 0 0 6px; color: var(--ink-soft); font-size: .98rem; }
.footer-brand .mark { font-family: var(--display); font-size: 1.7rem; font-weight: 700; }
.footer-bottom { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-family: var(--sans); font-size: .8rem; color: var(--ink-faint); }
.footer-bottom .credit { color: var(--ink-soft); }
.footer-bottom .credit strong { color: var(--gold-deep); font-weight: 800; letter-spacing: .02em; }
.footer-bottom .credit em { font-style: normal; color: var(--ink-faint); }
.footer-bottom .heart { color: #c0453c; display: inline-block; animation: beat 2.4s ease-in-out infinite; }
@keyframes beat { 0%,100%{ transform: scale(1) } 14%{ transform: scale(1.28) } 28%{ transform: scale(1) } 42%{ transform: scale(1.18) } }
@media (prefers-reduced-motion: reduce) { .footer-bottom .heart { animation: none; } }

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(20,14,6,.9); backdrop-filter: blur(6px);
  display: grid; place-items: center; opacity: 0; visibility: hidden; transition: opacity .3s; padding: 30px; }
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img { max-width: min(1100px, 92vw); max-height: 86vh; border-radius: 10px; box-shadow: 0 40px 100px -30px #000; }
.lb-close, .lb-nav { position: absolute; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  color: #fff; width: 50px; height: 50px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; font-size: 1.4rem; transition: background .2s; }
.lb-close:hover, .lb-nav:hover { background: rgba(255,255,255,.22); }
.lb-close { top: 24px; right: 24px; }
.lb-nav.prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lb-nav.next { right: 24px; top: 50%; transform: translateY(-50%); }
.lb-cap { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); color: #fff; font-family: var(--sans); font-size: .86rem; opacity: .85; }

/* ============================================================
   July calendar (course dates → timeline)
   ============================================================ */
.calendar-block { margin-top: clamp(40px, 6vw, 64px); background: var(--paper);
  border: 1px solid var(--line); border-radius: 16px; padding: clamp(22px, 4vw, 34px); box-shadow: var(--shadow-sm); }
.cal-head { margin-bottom: 22px; }
.cal-head h3 { font-size: 1.9rem; }
.cal-head p { font-family: var(--sans); font-size: .82rem; color: var(--ink-faint); margin: 4px 0 0; letter-spacing: .03em; }
.calendar { display: flex; flex-direction: column; gap: 7px; }
.cal-row, .cal-axis { display: grid; grid-template-columns: 180px 1fr; gap: 16px; align-items: center; }
.cal-rl { display: flex; flex-direction: column; line-height: 1.2; }
.cal-rl strong { font-family: var(--display); font-size: 1.12rem; font-weight: 600; color: var(--ink); }
.cal-rl em { font-family: var(--sans); font-style: normal; font-size: .74rem; color: var(--ink-faint); }
.cal-track { position: relative; height: 26px; border-radius: 7px; background: var(--bg-2); overflow: hidden; }
.cal-ticks { background: transparent; height: 20px; }
.cal-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-2); }
.cal-tick.major { background: var(--line); }
.cal-tick.major span { position: absolute; top: 2px; left: 3px; font-family: var(--sans); font-size: .64rem; font-weight: 700; color: var(--ink-faint); }
.cal-row:hover .cal-track { background: color-mix(in srgb, var(--gold-soft) 24%, var(--bg-2)); }
.cbar { position: absolute; top: 3px; bottom: 3px; }
.cbar-fill { width: 100%; height: 100%; border-radius: 5px; display: flex; align-items: center; padding-left: 9px;
  transform: scaleX(0); transform-origin: left; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
  transition: transform calc(.85s * var(--motion)) cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); }
#calendarBlock.in-view .cbar-fill { transform: scaleX(1); }
.cbar-label { font-family: var(--sans); font-size: .68rem; font-weight: 800; color: #fff; white-space: nowrap;
  opacity: 0; transition: opacity .4s ease .5s; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
#calendarBlock.in-view .cbar-label { opacity: 1; }
.cbar.tbd { left: 0; right: 0; display: flex; align-items: center; justify-content: flex-start; padding-left: 10px; top: 3px; bottom: 3px; }
.cbar.tbd span { font-family: var(--sans); font-size: .68rem; font-weight: 700; color: var(--ink-soft); font-style: italic; white-space: nowrap; }
.cal-row[data-family] { opacity: 0; transform: translateX(calc(-12px * var(--motion))); transition: opacity .5s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
#calendarBlock.in-view .cal-row[data-family] { opacity: 1; transform: none; }

/* faculty as single-column list (unused default; masonry columns are the default) */
.faculty-grid.fac-list { column-count: 1; }

/* hide floating notes */
.no-notes .float-note { display: none !important; }

@media (max-width: 640px) {
  .cal-row, .cal-axis { grid-template-columns: 110px 1fr; gap: 10px; }
  .cal-rl strong { font-size: .95rem; }
  .cbar-label { display: none; }
}

/* scroll progress bar */
.scroll-prog { position: fixed; top: 0; left: 0; height: 2px; background: linear-gradient(90deg, var(--gold), var(--gold-deep)); z-index: 100; width: 0%; }

/* ============================================================
   Media placeholder (temporary — replaced with real assets / grayed badge in step 1B)
   ============================================================ */
.media-slot { display: block; }
.media-unavailable { display: grid; place-items: center; width: 100%; height: 100%;
  opacity: .6; }
.media-unavailable .badge { font-family: var(--sans); font-size: .62rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-faint); }

/* ============================================================
   Expand-gate (req #6): full-screen landing, reveals the rest on scroll/CTA
   ============================================================ */
/* Before expansion: the site chrome + content below the hero are hidden. */
body.gate-closed .site-header,
body.gate-closed #belowHero,
body.gate-closed .site-footer { opacity: 0; pointer-events: none; }
body.gate-closed .site-header { transform: translateY(-16px); }
body.gate-closed { overflow: hidden; height: 100svh; }
#belowHero, .site-footer { transition: opacity 1s ease; }
.site-header {
  transition: border-color .4s, background .4s, padding .4s,
    opacity .7s cubic-bezier(.22,1,.36,1), transform .7s cubic-bezier(.22,1,.36,1);
}
/* Expanding / expanded */
body.gate-open { overflow: auto; height: auto; }
body.gate-open .site-header,
body.gate-open #belowHero,
body.gate-open .site-footer { opacity: 1; pointer-events: auto; }
body.gate-open .site-header { transform: none; }

/* Header items make a staggered entrance as the top bar slides in (req #5) */
.site-header .brand,
.site-header .nav a,
.site-header .header-tools > * {
  transition: opacity .5s ease, transform .5s cubic-bezier(.22,1,.36,1);
}
body.gate-closed .site-header .brand,
body.gate-closed .site-header .nav a,
body.gate-closed .site-header .header-tools > * { opacity: 0; transform: translateY(-8px); }
body.gate-open .site-header .brand,
body.gate-open .site-header .nav a,
body.gate-open .site-header .header-tools > * { opacity: 1; transform: none; }
body.gate-open .site-header .brand { transition-delay: .18s; }
body.gate-open .site-header .nav a:nth-child(1) { transition-delay: .24s; }
body.gate-open .site-header .nav a:nth-child(2) { transition-delay: .30s; }
body.gate-open .site-header .nav a:nth-child(3) { transition-delay: .36s; }
body.gate-open .site-header .nav a:nth-child(4) { transition-delay: .42s; }
body.gate-open .site-header .nav a:nth-child(5) { transition-delay: .48s; }
body.gate-open .site-header .header-tools > *:nth-child(1) { transition-delay: .30s; }
body.gate-open .site-header .header-tools > *:nth-child(2) { transition-delay: .36s; }
body.gate-open .site-header .header-tools > *:nth-child(3) { transition-delay: .42s; }
body.gate-open .site-header .header-tools > *:nth-child(4) { transition-delay: .48s; }
body.gate-open .site-header .header-tools > *:nth-child(5) { transition-delay: .54s; }

/* returning users skip the gate with no transition */
body.gate-immediate .site-header,
body.gate-immediate #belowHero,
body.gate-immediate .site-footer,
body.gate-immediate .site-header .brand,
body.gate-immediate .site-header .nav a,
body.gate-immediate .site-header .header-tools > * { transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  body.gate-open .site-header .brand,
  body.gate-open .site-header .nav a,
  body.gate-open .site-header .header-tools > * { transition-delay: 0s; }
}

/* ============================================================
   Responsive
   ============================================================ */
/* single-column grids: let tracks shrink below item min-content (prevents mobile
   horizontal overflow from long phone/email/address strings blowing out the track) */
.about-grid > *, .videos-grid > *, .venue-grid > *, .contact-grid > *, .footer-grid > * { min-width: 0; }
.contact-card p, .contact-card a.big { overflow-wrap: anywhere; }

@media (max-width: 1024px) {
  .status-card { grid-template-columns: 1fr; }
  .status-note { border-left: none; border-top: 1px solid var(--line); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .about-grid, .venue-grid, .contact-grid, .footer-grid, .videos-grid { grid-template-columns: 1fr; }
  .faculty-grid { column-count: 1; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .nav { display: none; }
  .menu-toggle { display: inline-flex; }
}
@media (max-width: 560px) {
  .brand .mark { font-size: 1.15rem; }
  .brand .yr { display: none; }
  .footer-bottom { justify-content: flex-start; }
  .gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 120px; }
  .btn-enroll span.long { display: none; }
  .header-tools .icon-btn .label { display: none; }
}

/* mobile drawer */
.drawer { position: fixed; inset: 0; z-index: 80; background: var(--bg); transform: translateX(100%);
  transition: transform .4s cubic-bezier(.2,.7,.2,1); display: flex; flex-direction: column; padding: 90px var(--pad) 40px; gap: 6px; }
.drawer.open { transform: none; }
.drawer a { font-family: var(--display); font-size: 2rem; color: var(--ink); padding: 12px 0; border-bottom: 1px solid var(--line); }
.drawer-close { position: absolute; top: 22px; right: var(--pad); background: none; border: none; font-size: 2rem; color: var(--ink); cursor: pointer; }

/* ============================================================
   Iscriviti Ora — page dim + button spotlight when Regolamento is in view
   ============================================================ */
/* full-page dim; JS sets `top` to the header height so the header stays lit */
.page-overlay {
  position: fixed; left: 0; right: 0; bottom: 0; top: 0; z-index: 55;
  background: rgba(0, 0, 0, 0.68); pointer-events: none;
  opacity: 0; visibility: hidden;
  transition: opacity .6s ease, visibility .6s ease;
}
.page-overlay.active { opacity: 1; visibility: visible; }

/* the enroll CTA pops above the dimmed page (header stacking context keeps it lit) */
.btn-enroll.spotlight { z-index: 61; animation: buttonPulse 1.6s ease-in-out infinite; }
.btn-enroll.spotlight.pop {
  animation: buttonSpotlight .8s cubic-bezier(.68, -0.55, .27, 1.55) both,
             buttonPulse 1.6s ease-in-out infinite;
}
.btn-enroll.spotlight::after {   /* gold shimmer sweep */
  content: ""; position: absolute; inset: 0; border-radius: 999px;
  background: linear-gradient(110deg, transparent 30%, color-mix(in srgb, #fff 60%, transparent) 50%, transparent 70%);
  transform: translateX(-120%); animation: enrollShimmer 1.8s ease-in-out infinite;
}
@keyframes buttonSpotlight {   /* one-shot scale pop */
  0%   { transform: scale(1); }
  50%  { transform: scale(1.22); }
  100% { transform: scale(1); }
}
@keyframes buttonPulse {       /* continuing gold glow / border glow */
  0%,100% { box-shadow: 0 8px 20px -10px var(--gold-deep), 0 0 0 0 color-mix(in srgb, var(--gold-glow) 60%, transparent); }
  50%     { box-shadow: 0 10px 30px -8px var(--gold-deep), 0 0 22px 6px color-mix(in srgb, var(--gold-glow) 45%, transparent); }
}
@keyframes enrollShimmer { 0% { transform: translateX(-120%); } 60%,100% { transform: translateX(120%); } }
@media (prefers-reduced-motion: reduce) {
  /* keep a gentle dim + static glow, but drop the scale bounce and sweeps */
  .btn-enroll.spotlight, .btn-enroll.spotlight.pop { animation: none;
    box-shadow: 0 10px 26px -10px var(--gold-deep), 0 0 0 4px color-mix(in srgb, var(--gold-glow) 40%, transparent); }
  .btn-enroll.spotlight::after { animation: none; display: none; }
}

/* ============================================================
   Consent modal (before the registration form)
   ============================================================ */
body.modal-lock { overflow: hidden !important; }

.consent-modal { position: fixed; inset: 0; z-index: 210; display: grid; place-items: center; padding: 24px; }
.consent-modal[hidden] { display: none; }
.consent-backdrop { position: absolute; inset: 0; background: rgba(20, 14, 6, .62);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .35s ease; }
.consent-modal.open .consent-backdrop { opacity: 1; }
.consent-panel {
  position: relative; z-index: 1; width: min(520px, 100%);
  padding: clamp(28px, 5vw, 46px) clamp(26px, 5vw, 44px);
  text-align: center;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent);
  border-radius: 20px; box-shadow: var(--shadow);
  opacity: 0; transform: scale(.92) translateY(10px);
  transition: opacity .35s ease, transform .4s cubic-bezier(.2, .7, .2, 1);
}
.consent-modal.open .consent-panel { opacity: 1; transform: none; }
.consent-panel::before {   /* inner gold hairline frame (playbill motif) */
  content: ""; position: absolute; inset: 8px; border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); pointer-events: none;
}
.consent-title { font-family: var(--display); font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.4rem);
  color: var(--ink); margin-bottom: 14px; }
.consent-msg { font-family: var(--sans); color: var(--ink-soft); font-size: 1.02rem; line-height: 1.6;
  margin: 0 auto 30px; max-width: 44ch; }
.consent-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.consent-cancel {
  font-family: var(--sans); font-weight: 700; font-size: .84rem; letter-spacing: .02em;
  color: var(--ink-soft); background: transparent; border: 1px solid var(--line);
  border-radius: 999px; padding: 11px 26px; cursor: pointer; transition: all .25s;
}
.consent-cancel:hover { border-color: var(--gold-soft); color: var(--ink); }
.consent-accept { font-size: .9rem; padding: 12px 30px; }
@media (prefers-reduced-motion: reduce) {
  .consent-panel { transition: opacity .2s ease; transform: none; }
  .consent-backdrop { transition: opacity .2s ease; }
}

/* ============================================================
   COLLABORAZIONI (partners) — fills the gap between the cinema
   "Video di Presentazione" section and Docenti. Wordmark logos are
   supplied as white-on-transparent alpha PNGs and used as CSS masks,
   so they pick up the theme ink/gold (mirrors .sec-icon technique).
   Constrained by HEIGHT for a consistent visual size across the three
   differently-proportioned marks; width is generous with mask contain.
   ============================================================ */
.partners-band { padding-block: clamp(30px, 5vw, 62px); position: relative; }
.partners-label {
  text-align: center; font-family: var(--sans); font-weight: 700;
  font-size: 12px; letter-spacing: .28em; text-transform: uppercase;
  color: var(--gold-deep); margin: 0 0 clamp(16px, 2vw, 24px);
}
/* Compact partner strip on a paper card with vertical dividers between the marks. */
.partners-card {
  display: flex; align-items: stretch; justify-content: center; flex-wrap: wrap;
  width: fit-content; max-width: 100%; margin: 0 auto;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--shadow-sm);
  padding: clamp(16px, 2.2vw, 26px) clamp(8px, 1.6vw, 20px);
}
.partner {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; padding: 6px clamp(26px, 4.2vw, 56px);
  border-left: 1px solid var(--line);
}
.partners-card .partner:first-child { border-left: 0; }
.partner--static { cursor: default; }
.partner-logo {
  display: block;
  height: clamp(48px, 6vw, 70px);
  width: clamp(140px, 17vw, 230px);
  background: var(--ink-soft);
  -webkit-mask: var(--logo) center / contain no-repeat;
          mask: var(--logo) center / contain no-repeat;
  opacity: .8;
  transition: background .3s ease, opacity .3s ease, transform .3s cubic-bezier(.22, 1, .36, 1);
}
/* Interactive partners: hover lights the mark to full gold and lifts it. */
.partner:not(.partner--static):hover .partner-logo {
  background: var(--gold-deep); opacity: 1; transform: translateY(-3px);
}
.partner--static:hover .partner-logo { opacity: .95; }
@media (max-width: 640px) {
  .partners-card { flex-direction: column; padding: 8px clamp(20px, 6vw, 34px); }
  .partner { border-left: 0; padding: 16px 10px; }
  .partners-card .partner:not(:first-child) { border-top: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  .partner:not(.partner--static):hover .partner-logo { transform: none; }
}
