/* GT Angolo 50 — v4 "Angolo 50" layer, loaded after site.css.
   The whole site becomes the dark sala under the lamps; the badge yellow is the light.
   Idea: the 50-degree bank shot in the club's name is the trail a ball draws across the first screen,
   and the angled edge every picture is revealed with. Motion is transform/opacity (plus font-stretch on
   the variable Archivo), every move has a reduced-motion fallback that keeps the content. */

/* ---------- Paper objects stay paper on the dark site ---------- */
.wall > *, .board > *, .sheet, .mock, .channels a.chan, .board--notes > li {
  --ink: #021217; --ink-soft: #3a4a50; --paper: #f5f4f0; --paper-2: #e8e6df; --paper-3: #dad7ce; --surface: #ffffff;
  color: var(--ink);
}
.tag--titolo, .names li.is-lit, .bars summary::after, .steps li::before, .button--bone:hover, .wizard__steps li[aria-current="step"]::before, .album__zoom, .lb__close:hover { color: var(--black); }
.honours li:first-child, .wizard__done { --ink: #021217; --ink-soft: #3a4a50; color: var(--ink); }
.button--ink { background: var(--white); color: var(--black); }
.button--ink:hover { background: var(--yellow); }
.bis .button--ink { background: var(--black); color: var(--white); }
.bis .button--ink:hover { background: var(--black-3); }
.filters button[aria-pressed="true"] { background: var(--yellow); color: var(--black); }
.field input, .field textarea, .field select { background: var(--black); border-color: var(--paper-3); }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--yellow); box-shadow: none; } /* taste-skill-ignore: removes the v3 shadow */
.check input { accent-color: var(--yellow); }
.records > div { background: var(--surface); }
.records li { background: var(--paper); }
.tile--k { background: var(--surface); }
.trofeo { background: var(--surface); }
.figures > div { background: var(--black); }

/* ---------- Header: the scroll as a cue running along the bar ---------- */
.nav { --progress: 0; }
.nav::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; background: var(--yellow); transform-origin: 0 50%; transform: scaleX(var(--progress)); }
.nav.is-raised { box-shadow: none; background: #031b22; } /* taste-skill-ignore: removes the v3 shadow */

/* ---------- Buttons: press, lift, the arrow runs ---------- */
.button { transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform 220ms var(--ease-out); }
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0) scale(0.97); }

/* ---------- Home: the monument ---------- */
.mono { --word: calc((min(100vw, calc(var(--container) + 2 * var(--pad))) - 2 * var(--pad)) / 5.8); position: relative; isolation: isolate; overflow: hidden; background: var(--black); color: var(--on-dark); min-height: calc(100svh - var(--nav-h)); display: grid; grid-template-rows: 1fr auto; --p: 0; }
.mono__trail { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.mono__grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(2rem, 5vw, 5rem); align-items: center; padding-block: clamp(2rem, 4vw, 3.5rem) 0; }
.mono__text { display: grid; gap: 2rem; align-content: center; max-width: 40rem; }
.mono__lead { font-size: clamp(1.25rem, 1rem + 0.9vw, 1.75rem); line-height: 1.35; max-width: 30ch; }
.mono__hud { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 6px; }
.mono__hud > div { display: flex; flex-direction: column-reverse; gap: 0.2rem; padding: 0.9rem 1.25rem 0.8rem; background: var(--black-2); min-width: 9.5rem; }
.mono__hud dt { font-size: var(--step-small); color: var(--on-dark-soft); }
.mono__hud dd { font-weight: 800; font-stretch: 72%; font-size: clamp(2.25rem, 1.6rem + 2vw, 3.5rem); line-height: 1; color: var(--yellow); }
.mono__reel { position: relative; display: grid; gap: 0.75rem; justify-items: end; margin: 0; transform: translate3d(0, calc(var(--p) * -60px), 0); }
.mono__video { width: auto; height: clamp(22rem, calc(100svh - var(--nav-h) - var(--word) * 0.62 - 6rem), 40rem); aspect-ratio: 9 / 16; background: var(--black-2); outline: var(--ring) solid var(--yellow); outline-offset: 0; }
.mono__reel figcaption { font-size: var(--step-small); color: var(--on-dark-soft); }
.mono__word { position: relative; z-index: 2; margin: 0; padding-inline: var(--pad); width: 100%; max-width: calc(var(--container) + 2 * var(--pad)); margin-inline: auto; font-weight: 800; font-stretch: 72%; text-transform: uppercase; color: var(--yellow); line-height: 0.8; letter-spacing: -0.01em; white-space: nowrap; font-size: var(--word); margin-top: calc(var(--word) * -0.28); padding-bottom: clamp(0.75rem, 1.5vw, 1.5rem); transform-origin: 50% 100%; transform: scale(calc(1 - var(--p) * 0.08)) translate3d(0, calc(var(--p) * 30px), 0); }
.mono__line { display: block; overflow: hidden; padding-top: 0.04em; }
.mono__ch, .mono__sp { display: inline-block; }
.mono__sp { width: 0.2em; }
@media (max-width: 900px) {
  .mono { min-height: 0; }
  .mono__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); grid-template-areas: "lead lead" "act act" "hud reel"; align-items: end; gap: 1.5rem var(--gap); padding-top: 2rem; }
  .mono__text { display: contents; }
  .mono__lead { grid-area: lead; }
  .mono__text .hero__actions { grid-area: act; margin: 0; }
  .mono__hud { grid-area: hud; grid-template-columns: 1fr; align-self: start; }
  .mono__hud > div { min-width: 0; }
  .mono__reel { grid-area: reel; justify-items: stretch; }
  .mono__video { width: 100%; height: auto; }
  .mono__reel figcaption { display: none; }
  .mono__word { margin-top: 0.5rem; }
}
@media (max-width: 480px) { .mono__text .hero__actions .button { flex: 1 1 100%; } }

/* ---------- Home: scudetto bis — the photo whole, in its own format ---------- */
.bis__photo img { aspect-ratio: auto; object-fit: initial; border-radius: 0; outline: var(--ring) solid var(--black); }

/* ---------- Home: numbers as a scoreboard ---------- */
.stats { background: var(--black-2); }
.stats dl { gap: 0; }
.stats dl > div, .stats dl > div:first-child { background: transparent; color: var(--on-dark); min-height: 0; padding: 1.5rem clamp(1rem, 2vw, 2rem) 0 0; }
.stats dd { color: var(--yellow); font-size: clamp(4.5rem, 2.5rem + 7vw, 10rem); line-height: 0.85; }
.stats dt { margin-top: 1rem; color: var(--on-dark-soft); }

/* ---------- Home: sponsors as a wall of logos on white plates ---------- */
.logos { grid-column: 1 / 9; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.75rem; }
.logo { position: relative; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); aspect-ratio: 3 / 2; padding: 1rem 1.15rem; border-radius: 0.5rem; background: #fff; overflow: hidden; isolation: isolate; }
.logo img { width: 100%; height: 100%; min-height: 0; object-fit: contain; background: none; transition: transform 380ms var(--ease-out); }
/* On hover the 50-degree wedge of the club comes in from the corner. */
.logo--link::before { content: ""; position: absolute; inset: auto 0 0 auto; width: 3.25rem; height: 3.25rem; background: var(--yellow); clip-path: polygon(100% 16%, 100% 100%, 30% 100%); transform: translate(100%, 100%); transition: transform 380ms var(--ease-out); z-index: -1; }
.logo__go { position: absolute; right: 0.4rem; bottom: 0.2rem; font-weight: 800; font-size: 0.95rem; color: var(--black); opacity: 0; transition: opacity 240ms ease 80ms; }
.logo--link:hover::before, .logo--link:focus-visible::before { transform: none; }
.logo--link:hover .logo__go, .logo--link:focus-visible .logo__go { opacity: 1; }
.logo--link:hover img, .logo--link:focus-visible img { transform: scale(1.05); }
.logo--link:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.also, .partners { grid-column: 1 / 9; }
.also { display: grid; gap: 0.75rem; }
.also__title, .partner__role { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }
.also__list { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; }
.also__name { display: grid; place-items: center; min-height: 4.5rem; padding: 0.75rem 1rem; border-radius: 0.5rem; text-align: center; font-weight: 800; font-stretch: 72%; text-transform: uppercase; font-size: clamp(1.05rem, 0.9rem + 0.5vw, 1.35rem); line-height: 1.05; color: var(--ink); text-wrap: balance; }
/* Media partner and federation: their own row, with the role written above the plate. */
.partners { display: grid; grid-template-columns: 3fr 2fr; gap: 0.75rem; margin-top: 1rem; padding-top: 1rem; }
.partner { display: grid; grid-template-rows: auto auto 1fr; gap: 0.6rem; align-content: start; }
.partner__plate { aspect-ratio: auto; height: 8.5rem; padding: 1.5rem 2rem; }
.partner__plate--round { padding: 1rem; }
.partner__note { font-size: 0.9rem; color: var(--ink-soft); }
/* The team's name sponsor gets the double plate: 2x2 plus 21 singles fill five rows of five. */
.logos__main { grid-column: span 2; grid-row: span 2; }
.logos__main .logo { height: 100%; aspect-ratio: auto; grid-template: minmax(0, 1fr) auto / minmax(0, 1fr); padding: 1.5rem 1.5rem 1rem; }
.logo__note { font-size: 0.875rem; font-weight: 700; color: var(--black); text-align: center; padding-top: 0.75rem; }
@media (min-width: 901px) { .logos { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 900px) { .logos, .also, .partners { grid-column: 1 / -1; } }
@media (max-width: 480px) {
  .logos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .logo { padding: 0.75rem 0.85rem; }
  /* Two columns: the name sponsor takes a full row, and so does the last plate (Zamberletti, a wide mark) so no tile sits alone. */
  .logos__main { grid-row: auto; }
  .logos__main .logo { aspect-ratio: 3 / 2; }
  .logos li:last-child { grid-column: span 2; }
  .logos li:last-child .logo { aspect-ratio: 4 / 1; }
  .also__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .partners { grid-template-columns: minmax(0, 1fr); }
  .partner__plate { height: 7rem; }
}

/* ---------- Cards: they lift ---------- */
.card { transition: transform 320ms var(--ease-out); }
.card:hover { transform: translateY(-6px); }
.tag { background: var(--paper-3); }

/* ---------- Footer: the name returns and settles ---------- */
.footer { --f: 1; }
.footer__word { transform-origin: 0 100%; transform: scale(calc(0.9 + var(--f) * 0.1)); }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .mono__ch { animation: chIn 1100ms var(--ease-out) both; animation-delay: calc(250ms + var(--c) * 55ms); }
  @keyframes chIn { from { transform: translateY(105%); font-stretch: 125%; } 60% { font-stretch: 62%; } to { transform: none; font-stretch: 72%; } }
  .js .mono__reel[data-reveal] { transform: translate3d(0, calc(var(--p) * -60px + 40px), 0); }
  .js .mono__reel[data-reveal].is-in { transform: translate3d(0, calc(var(--p) * -60px), 0); }

  /* Headings settle into the badge cut as they arrive. */
  .js .head[data-reveal], .js .bis__title[data-reveal] { font-stretch: 62%; transition: opacity 650ms var(--ease-out), transform 800ms var(--ease-out), font-stretch 1100ms var(--ease-out); }
  .js .head[data-reveal].is-in, .js .bis__title[data-reveal].is-in { font-stretch: 72%; }

  /* Pictures open on a 50-degree edge. */
  .js .shutter[data-reveal], .js .bis__photo[data-reveal], .js .card[data-reveal] .card__pic { clip-path: polygon(-20% 0, -20% 0, -45% 100%, -45% 100%); transition: clip-path 1200ms var(--ease-out), opacity 650ms var(--ease-out), transform 800ms var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms); }
  .js .shutter[data-reveal].is-in, .js .bis__photo[data-reveal].is-in, .js .card[data-reveal].is-in .card__pic { clip-path: polygon(-20% 0, 145% 0, 120% 100%, -45% 100%); }


  .band img { animation: drift 24s ease-in-out infinite alternate; }
}
@media (prefers-reduced-motion: reduce) {
  .mono__word, .mono__reel, .footer__word { transform: none; }
}

/* ---------- Inner pages: the page's own picture or clip beside a title that enters letter by letter ---------- */
.phead, .event-hero { --p: 0; }
.phead__title .mono__line { display: block; overflow: hidden; padding-block: 0.08em 0.02em; }
.mono__w { display: inline-block; white-space: nowrap; }
.phead--media .phead__inner { align-items: start; row-gap: 1.5rem; grid-template-rows: 1fr repeat(4, auto); }
.phead--media .phead__title, .phead--media .phead__lead, .phead--media .mono__hud, .phead--media .crumbs, .phead--media .phead__extra { grid-column: 1 / 8; }
.phead--media .phead__title { align-self: end; padding-top: clamp(1rem, 4vw, 4rem); }
.phead__media { grid-column: 8 / 13; grid-row: 1 / -1; justify-self: end; margin: 0; display: grid; gap: 0.75rem; transform: translate3d(0, calc(var(--p) * -50px), 0); }
.phead__media img, .phead__media video { display: block; width: 100%; height: auto; outline: var(--ring) solid var(--yellow); }
.phead__media--video video { width: auto; height: clamp(22rem, 62svh, 36rem); aspect-ratio: 9 / 16; }
.phead__media figcaption { font-size: var(--step-small); color: var(--on-dark-soft); }
@media (max-width: 900px) {
  .phead--media .phead__inner { grid-template-rows: none; }
  .phead--media .phead__title, .phead--media .phead__lead, .phead--media .mono__hud, .phead--media .crumbs, .phead--media .phead__extra, .phead__media { grid-column: 1 / -1; grid-row: auto; }
  .phead__media { justify-self: stretch; order: 3; margin-top: 0.5rem; }
  .phead__media--video { justify-self: start; }
  .phead__media--video video { height: min(70svh, 30rem); }
}
@media (prefers-reduced-motion: no-preference) {
  .js .phead__title .mono__ch { animation: chIn 1000ms var(--ease-out) both; animation-delay: calc(120ms + var(--c) * 40ms); }
  .js .phead__lead { animation: rise 900ms var(--ease-out) both 350ms; }
  @keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
  .js .phead__media[data-reveal] { clip-path: polygon(-20% 0, -20% 0, -45% 100%, -45% 100%); transition: clip-path 1000ms var(--ease-out) 150ms, opacity 400ms ease; transform: translate3d(0, calc(var(--p) * -50px), 0); }
  .js .phead__media[data-reveal].is-in { clip-path: polygon(-20% 0, 145% 0, 120% 100%, -45% 100%); transform: translate3d(0, calc(var(--p) * -50px), 0); }

  /* Page to page: the header stays, the page slides in under it. */
  @view-transition { navigation: auto; }
  .nav { view-transition-name: nav; }
  ::view-transition-old(root) { animation: vtOut 260ms var(--ease-out) both; }
  ::view-transition-new(root) { animation: vtIn 520ms var(--ease-out) both; }
  @keyframes vtOut { to { opacity: 0; transform: translateY(-24px); } }
  @keyframes vtIn { from { opacity: 0; transform: translateY(40px); } }
}
@media (prefers-reduced-motion: reduce) { .phead__media { transform: none; } }

/* ---------- Scoreboard row in page heads ---------- */
.phead .mono__hud { grid-column: 1 / -1; margin-top: 1rem; }
@media (max-width: 760px) { .phead .mono__hud, .event-hud { grid-template-columns: 1fr 1fr; } .mono__hud > div { min-width: 0; } }

/* ---------- Trofeo: the word as a monument, the albo as a scoreboard ---------- */
.event-hero { position: relative; isolation: isolate; overflow: hidden; }
.event-title span { color: var(--white); font-size: 0.42em; line-height: 1; }
.event-title .event-title__big { display: block; color: var(--yellow); font-size: min(3.2em, 30cqi); line-height: 0.8; letter-spacing: -0.015em; }
.event-hero__text { container-type: inline-size; }
.event-hud { margin-top: 2rem; }
.event-hero__photo img { outline: var(--ring) solid var(--yellow); }
.honours li { grid-template-columns: minmax(7rem, 11rem) 1fr; align-items: center; padding: 1.5rem; transition: transform 320ms var(--ease-out), background-color 200ms ease; }
.honours li:hover { transform: translateX(8px); }
.honours .ed { font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.4rem); color: var(--yellow); line-height: 0.95; }
.honours li:first-child .ed { color: var(--black); }
.honours .who { font-weight: 800; font-stretch: 72%; text-transform: uppercase; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.6rem); line-height: 1; }
.prizes td { border-bottom-color: transparent; } /* taste-skill-ignore: rows told apart by tone */
.prizes tr:nth-child(odd) td { background: rgba(255, 255, 255, 0.04); }
.prizes td:first-child { padding-left: 0.75rem; }
.prizes td:last-child { padding-right: 0.75rem; }
.prizes tr:first-child td:nth-child(2) { font-size: 1.6rem; font-weight: 800; }

/* ---------- Risultati: years stick while their results run past, a cue draws the timeline ---------- */
.timeline { position: relative; --t: 0; }
.timeline::before { content: ""; position: absolute; left: var(--pad); top: 0; bottom: var(--section); width: 4px; background: var(--paper-2); }
.timeline::after { content: ""; position: absolute; left: var(--pad); top: 0; width: 4px; height: calc(100% - var(--section)); background: var(--yellow); transform-origin: 50% 0; transform: scaleY(var(--t)); }
.timeline .year { padding-left: 1.5rem; }
.year__n { color: var(--yellow); }
@media (min-width: 901px) { .year__n { position: sticky; top: calc(var(--nav-h) + 1.5rem); align-self: start; } }
.res { transition: transform 320ms var(--ease-out); }
.res:hover { transform: translateX(6px); }
.res--titolo { background: var(--surface); outline: 3px solid var(--yellow); outline-offset: -3px; }

@media (prefers-reduced-motion: no-preference) {
  .js .event-title__big .mono__ch { animation: chIn 1100ms var(--ease-out) both; animation-delay: calc(200ms + var(--c) * 60ms); }
  .js .honours li[data-reveal], .js .res[data-reveal] { transform: translateX(-32px); }
  .js .honours li[data-reveal].is-in, .js .res[data-reveal].is-in { transform: none; }
  .js .year__n { transition: font-stretch 1000ms var(--ease-out); }
}
@media (prefers-reduced-motion: reduce) { .timeline::after { transform: none; } }
.event-title .event-title__big .mono__line { display: block; font-size: 1em; color: inherit; line-height: inherit; }
.event-title .event-title__big .mono__ch, .event-title .event-title__big .mono__sp { display: inline-block; font-size: 1em; color: inherit; line-height: inherit; }
.phead .mono__hud { grid-area: auto; grid-column: 1 / -1; grid-template-columns: repeat(4, auto); }
.event-hud { grid-area: auto; }
@media (max-width: 760px) { .phead .mono__hud { grid-template-columns: 1fr 1fr; } }
.honours .ed { display: grid; gap: 0.2rem; }
.honours .ed__n { font-size: clamp(2.6rem, 2rem + 2vw, 4rem); line-height: 0.85; }
.honours .ed__y { font-size: var(--step-small); font-weight: 600; font-stretch: 100%; text-transform: none; }

/* ---------- Notizie: an editorial index, the cover follows the pointer ---------- */
.cards--feature { margin-bottom: clamp(3rem, 6vw, 5rem); }
.cards--feature .card:first-child { grid-column: 1 / -1; }
.rows { list-style: none; display: grid; gap: 4px; }
.row[hidden] { display: none; }
.row a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.5rem 2rem; padding: 1.4rem 1.25rem; text-decoration: none; background: var(--surface); transition: background-color 200ms ease; }
.row__meta { display: grid; justify-items: end; gap: 0.15rem; text-align: right; }
.row__date { font-size: var(--step-small); color: var(--on-dark-soft); font-variant-numeric: tabular-nums; }
.row__title { font-weight: 800; font-stretch: 72%; text-transform: uppercase; font-size: clamp(1.6rem, 1.1rem + 1.6vw, 2.75rem); line-height: 0.95; transition: transform 320ms var(--ease-out), color 200ms ease; }
.row__cat { font-size: var(--step-small); font-weight: 600; color: var(--yellow); white-space: nowrap; }
.row__pic { position: fixed; left: 0; top: 0; z-index: 30; width: 340px; pointer-events: none; opacity: 0; transform: translate3d(var(--mx, -999px), var(--my, -999px), 0) rotate(-4deg) scale(0.9); transition: opacity 200ms ease, transform 420ms var(--ease-out); }
.row__pic img { width: 100%; height: auto; outline: var(--ring) solid var(--yellow); }
@media (hover: hover) and (pointer: fine) {
  .row a:hover { background: var(--paper-2); }
  .row a:hover .row__title { transform: translateX(14px); color: var(--yellow); }
  .row a:hover .row__pic { opacity: 1; transform: translate3d(var(--mx, -999px), var(--my, -999px), 0) rotate(-2deg) scale(1); }
}
@media (hover: none), (pointer: coarse), (max-width: 760px) {
  .row a { grid-template-columns: minmax(0, 1fr) 28vw; gap: 0.4rem 1rem; align-items: start; }
  .row__title { grid-column: 1; font-size: clamp(1.4rem, 1rem + 2vw, 2rem); }
  .row__meta { grid-column: 1; justify-items: start; text-align: left; }
  .row__pic { position: static; grid-column: 2; grid-row: 1 / span 3; width: 100%; opacity: 1; transform: none; z-index: auto; }
  .row__pic img { outline-width: 4px; }
}
@media (prefers-reduced-motion: reduce) { .row__pic, .row__title { transition: none; } }
.cards--feature { display: block; }
.cards--feature .card { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); grid-template-rows: 1fr auto auto auto; column-gap: clamp(1.5rem, 4vw, 3.5rem); row-gap: 0.75rem; }
.cards--feature .card__pic { grid-column: 1; grid-row: 1 / -1; margin: 0; }
.cards--feature .card__title, .cards--feature .card__meta, .cards--feature .card__text { grid-column: 2; }
.cards--feature .card__title { grid-row: 2; font-weight: 800; font-stretch: 72%; text-transform: uppercase; font-size: clamp(2.5rem, 1.5rem + 3vw, 4.75rem); line-height: 0.9; }
.cards--feature .card:first-child .card__title { font-size: clamp(2.5rem, 1.5rem + 3vw, 4.75rem); line-height: 0.9; }
.cards--feature .card__text { -webkit-line-clamp: 5; font-size: var(--step-lead); line-height: 1.4; }
@media (max-width: 900px) { .cards--feature .card { grid-template-columns: 1fr; grid-template-rows: none; } .cards--feature .card__pic, .cards--feature .card__title, .cards--feature .card__meta, .cards--feature .card__text { grid-column: 1; grid-row: auto; } }
.cards--feature .card__meta { grid-row: 3; }
.cards--feature .card__text { grid-row: 4; }
.cards--feature .card__pic, .cards--lead.cards--feature .card:first-child .card__pic { aspect-ratio: auto; display: block; align-self: start; background: none; }
.cards--feature .card__pic .pic__blur { display: none; }
.cards--feature .card__pic img:not(.pic__blur), .cards--lead.cards--feature .card:first-child .card__pic img:not(.pic__blur) { height: auto; aspect-ratio: auto; outline: var(--ring) solid var(--yellow); outline-offset: 0; }
.cards--feature .card__pic { overflow: visible; margin: var(--ring); }
@media (max-width: 900px) { .cards--feature .card__meta, .cards--feature .card__text { grid-row: auto; } }

/* ---------- Galleria as an exhibition: each album is a wall the scroll walks along ---------- */
.gal .album--rail { padding-top: clamp(3rem, 6vw, 5rem); }
.rail { --rail-h: min(64svh, 40rem); position: relative; margin-inline: calc(50% - 50vw); }
.rail__sticky { overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none; }
.rail__sticky::-webkit-scrollbar { display: none; }
.rail__track { display: flex; align-items: flex-end; gap: clamp(1rem, 2vw, 2rem); width: max-content; padding-inline: max(var(--pad), calc((100vw - var(--container)) / 2)); }
.rail__intro { flex: none; width: clamp(16rem, 26vw, 24rem); align-self: stretch; display: flex; flex-direction: column; justify-content: flex-end; gap: 1rem; padding-bottom: 2.6rem; scroll-snap-align: start; }
.rail__title { font-weight: 800; font-stretch: 72%; text-transform: uppercase; color: var(--yellow); font-size: clamp(3rem, 2rem + 4vw, 6.5rem); line-height: 0.85; }
.rail__intro p { color: var(--on-dark-soft); max-width: 30ch; }
.rail__n { font-weight: 700; color: var(--white) !important; }
.rail__n .nums { font-weight: 800; font-stretch: 72%; font-size: 2.5rem; color: var(--yellow); margin-right: 0.3rem; }
.rail__pic { flex: none; width: calc(var(--rail-h) * var(--r)); margin: 0; scroll-snap-align: center; }
.rail__pic button { display: block; width: 100%; position: relative; overflow: hidden; }
.rail__pic img { width: 100%; height: auto; display: block; transition: transform 600ms var(--ease-out); }
.rail__pic button:hover img { transform: scale(1.03); }
.rail__pic figcaption { padding-top: 0.75rem; font-size: var(--step-small); color: var(--on-dark-soft); }
/* Pinned on desktop: the page scrolls, the wall slides sideways. */
.rail.is-pinned { height: var(--rail-len); }
.rail.is-pinned .rail__sticky { position: sticky; top: calc(50svh - var(--rail-h) / 2 - 2rem); overflow: visible; }
.rail.is-pinned .rail__track { transform: translate3d(calc(var(--rail-x, 0) * -1px), 0, 0); will-change: transform; }
@media (max-width: 760px) { .rail { --rail-h: 52svh; } .rail__intro { width: 70vw; } }
@media (prefers-reduced-motion: no-preference) {
  .js .rail__pic { opacity: 0; transform: translateY(30px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); }
  .js .rail.is-seen .rail__pic { opacity: 1; transform: none; }
  .js .rail.is-seen .rail__pic:nth-child(n) { transition-delay: calc(var(--k, 0) * 70ms); }
}

/* ---------- Sala stampa: the notes are pinned to the felt one by one ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .board > [data-reveal], .js .board--notes > li[data-reveal] { opacity: 0; transform: translateY(-36px) rotate(calc(var(--tilt, 0deg) + 7deg)) scale(1.04); transition: opacity 500ms ease, transform 750ms cubic-bezier(0.34, 1.4, 0.64, 1); transition-delay: calc(var(--i, 0) * 90ms); }
  .js .board > [data-reveal].is-in, .js .board--notes > li[data-reveal].is-in { opacity: 1; transform: rotate(var(--tilt, 0deg)); }
}

/* ---------- Moduli: choices light up in the badge yellow, the field you are in is lit ---------- */
.choices input:checked + span { background: var(--yellow); color: var(--black); }
.choices span { transition: background-color 180ms ease, color 180ms ease, transform 220ms var(--ease-out); }
.choices input:checked + span { animation: pick 360ms var(--ease-out); }
@keyframes pick { 40% { transform: scale(1.08); } }
.field:focus-within label, .field:focus-within > span:first-child { color: var(--yellow); }
.formpage__form, .portal__form { outline: 2px solid var(--paper-3); outline-offset: -2px; }
.formpage__form:focus-within, .portal__form:focus-within { outline-color: var(--yellow); transition: outline-color 300ms ease; }
@media (prefers-reduced-motion: reduce) { .choices input:checked + span { animation: none; } }

/* ---------- The table in 3D: WebGL behind, the transparent 2D canvas on top keeps pointer, keys and focus ---------- */
.table__canvas { position: relative; isolation: isolate; }
.table__gl { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }
.table__canvas.is-3d canvas#biliardo { background: transparent; }

/* Tilted sheets and the gallery rails never push the page sideways (clip keeps sticky working). */
main, .rail { overflow-x: clip; }
