/* ---------- Font (self-hosted, variabile: opsz 12–96, wdth 75–100, wght 200–800) ---------- */
@font-face {
  font-family: "Bricolage";
  src: url("../assets/fonts/bricolage-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: "Bricolage";
  src: url("../assets/fonts/bricolage-latin-ext.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0;
}

/* ---------- Token: il cielo dopo il tramonto ---------- */
:root {
  --night: #0A0F1C;
  --night-2: #121A2C;
  --line: #222C44;
  --paper: #ECE6DA;
  --dim: #8E97AA;
  --sun: #F3A53C;
  --horizon: #6FC7C0;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
  --step-3: clamp(2.25rem, 1.4rem + 3.5vw, 4rem);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--paper);
  font-family: "Bricolage", system-ui, sans-serif;
  font-size: var(--step-0);
  line-height: 1.55;
  font-variation-settings: "opsz" 14;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--horizon); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--sun); color: var(--night); }

.skip {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  background: var(--paper); color: var(--night); padding: .5rem .9rem; text-decoration: none;
}
.skip:focus { top: 12px; }

.h2 {
  font-size: var(--step-2);
  font-weight: 650;
  font-variation-settings: "opsz" 48;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 1.25rem;
}
.h3 {
  font-size: var(--step-1);
  font-weight: 600;
  margin: 2.75rem 0 .75rem;
}
.link {
  display: inline-block;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 2px;
  transition: color .25s, background-size .35s var(--ease);
}
.link:hover { color: var(--sun); background-size: 0% 1px; background-position: 100% 100%; }

/* ---------- Barra ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 2rem;
  padding: 18px var(--gutter);
  background: linear-gradient(var(--night) 55%, rgba(10, 15, 28, 0));
}
.mono {
  font-weight: 800; font-variation-settings: "opsz" 24, "wdth" 75;
  text-decoration: none; letter-spacing: .02em; font-size: 1.1rem;
}
.bar-nav { display: flex; gap: 1.5rem; margin-left: auto; font-size: var(--step--1); }
.bar-nav a { text-decoration: none; color: var(--dim); transition: color .2s; }
.bar-nav a:hover, .bar-nav a[aria-current="page"] { color: var(--paper); }
.bar-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--sun); text-underline-offset: 6px; text-decoration-thickness: 2px; }

.lang {
  position: relative; display: flex;
  border: 1px solid var(--line); border-radius: 999px; padding: 3px;
  font-size: .8rem; font-weight: 600;
}
.lang button { position: relative; z-index: 1; padding: .3rem .7rem; border-radius: 999px; color: var(--dim); transition: color .3s; }
.lang button[aria-pressed="true"] { color: var(--night); }
.lang-pill {
  position: absolute; top: 3px; bottom: 3px; left: 3px;
  width: calc(50% - 3px); border-radius: 999px; background: var(--paper);
  transition: transform .45s cubic-bezier(.5, 1.6, .4, 1);
}
.lang[data-lang="it"] .lang-pill { transform: translateX(100%); }
@media (max-width: 640px) { .bar-nav { display: none; } .lang { margin-left: auto; } }

/* ---------- Menu hamburger (telefono) ---------- */
.menu-btn { display: none; position: relative; width: 44px; height: 44px; margin: -6px -10px -6px -4px; border-radius: 50%; }
.menu-btn span {
  position: absolute; left: 12px; right: 12px; height: 2px; border-radius: 2px; background: var(--paper);
  transition: transform .45s cubic-bezier(.5, 1.6, .4, 1), top .3s var(--ease);
}
.menu-btn span:first-child { top: 18px; }
.menu-btn span:last-child { top: 25px; }
.menu-btn[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }
@media (max-width: 640px) { .menu-btn { display: block; } .bar { gap: 14px; } }

.menu {
  position: fixed; inset: 0; z-index: 45; overflow: hidden;
  display: flex; align-items: center; padding: 96px var(--gutter) 48px;
  background: var(--night);
}
.menu[hidden] { display: none; }
/* il sole che sorge dietro le voci, come nell'hero */
.menu::before {
  content: ""; position: absolute; z-index: -1; left: 50%; bottom: -60vmax; width: 120vmax; aspect-ratio: 1; margin-left: -60vmax;
  border-radius: 50%; background: radial-gradient(circle, rgba(243, 165, 60, .38), rgba(111, 199, 192, .08) 35%, transparent 60%);
  transition: transform 1s var(--ease); transform: translateY(20%);
}
.menu.is-open::before { transform: none; }
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu li { opacity: 0; translate: 0 28px; }
.menu.is-open li { animation: menu-in .6s var(--ease) forwards; animation-delay: calc(var(--i) * 70ms + 60ms); }
@keyframes menu-in { to { opacity: 1; translate: 0 0; } }
.menu-link {
  display: block; padding: .08em 0; text-decoration: none; color: var(--paper);
  font-size: clamp(3rem, 16vw, 5rem); line-height: 1.02; letter-spacing: -0.02em;
  font-variation-settings: "opsz" 96, "wdth" 75, "wght" 320;
  transition: font-variation-settings .5s var(--ease), color .3s;
}
.menu-link:hover, .menu-link:active, .menu-link:focus-visible { font-variation-settings: "opsz" 96, "wdth" 100, "wght" 780; }
.menu-link[aria-current="page"] { color: var(--sun); }
html.menu-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .menu li { opacity: 1; translate: none; } }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 120px var(--gutter) clamp(40px, 8vh, 96px);
  overflow: hidden;
  isolation: isolate;
}
/* il cielo sfuma verso il basso: niente taglio netto tra hero e progetti */
.sky {
  position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.sun {
  position: absolute; left: 0; top: 0;
  width: 110vmax; height: 110vmax;
  margin: -55vmax 0 0 -55vmax;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(243, 165, 60, .55) 0%,
    rgba(243, 165, 60, .22) 12%,
    rgba(111, 199, 192, .10) 30%,
    rgba(10, 15, 28, 0) 55%);
  pointer-events: none;
  will-change: transform;
  transform: translate3d(50vw, 130vh, 0);
}
.name {
  margin: 0;
  font-size: clamp(3.4rem, 15vw, 16rem);
  line-height: .86;
  letter-spacing: -0.035em;
  font-weight: 300;
}
.name-line { display: block; white-space: nowrap; }
.name .ch {
  --t: 0;
  display: inline-block;
  font-variation-settings: "opsz" 96, "wdth" calc(75 + var(--t) * 25), "wght" calc(260 + var(--t) * 540);
  color: color-mix(in oklab, var(--sun) calc(var(--t) * 55%), var(--paper));
}
.hero-links { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 20px 0 0; font-size: var(--step-0); }
.hero-lede {
  max-width: 34ch;
  margin: clamp(24px, 4vh, 40px) 0 0;
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--dim);
}

/* ---------- Strip: Machu Picchu, 21:9, scura, parallasse ---------- */
.strip {
  position: relative; margin: 0;
  height: min(42.8vw, 78svh); min-height: 320px;
  overflow: hidden;
}
.strip picture { position: absolute; inset: -12% 0; }
.strip img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%;
  filter: brightness(.72) saturate(.8) contrast(1.05);
  transform: translate3d(0, calc(var(--py, 0) * 1%), 0);
  will-change: transform;
}
/* sfuma in alto e in basso nel blu-notte */
.strip::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(var(--night), rgba(10, 15, 28, 0) 22%, rgba(10, 15, 28, 0) 70%, var(--night));
}
.strip figcaption {
  position: absolute; z-index: 1; right: var(--gutter); bottom: clamp(16px, 3vw, 32px);
  font-size: var(--step--1); color: var(--dim);
}
@media (max-width: 700px) {
  .strip { height: 110vw; }
  .strip img { object-position: 30% 50%; }
}

/* Tabs */
.tab-list { position: relative; display: flex; gap: 1.75rem; border-bottom: 1px solid var(--line); }
.tab-list [role="tab"] { padding: .6rem 0; color: var(--dim); transition: color .25s; }
.tab-list [role="tab"][aria-selected="true"] { color: var(--paper); }
.tab-ink {
  position: absolute; bottom: -1px; left: 0; height: 2px; width: 0;
  background: var(--sun);
  transition: transform .45s var(--ease), width .45s var(--ease);
}
.tab-panel { padding-top: 1.25rem; min-height: 7.5rem; }
.tab-panel p { margin: 0 0 .9rem; }
.tab-panel.is-in { animation: panel-in .4s var(--ease); }
@keyframes panel-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Work: sezione pinnata + track orizzontale ---------- */
.work { position: relative; }
.work-pin {
  display: flex; flex-direction: column; justify-content: center;
  padding: 96px 0 48px;
  overflow: hidden;
}
.work-head {
  display: flex; align-items: baseline; justify-content: space-between;
  width: 100%; max-width: var(--max); margin: 0 auto;
  padding: 0 var(--gutter);
}
.work-count { margin: 0; color: var(--dim); font-variant-numeric: tabular-nums; font-size: var(--step--1); }
.work-now { color: var(--paper); }

.track {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: clamp(16px, 3vw, 40px);
}
/* spazio prima della prima e dopo l'ultima card: come margini, così lo scroll arriva fino in fondo */
.track > .card:first-child { margin-left: var(--track-pad, var(--gutter)); }
.track > .card:last-child { margin-right: var(--track-pad, var(--gutter)); }
.card {
  --focus: 1;
  flex: 0 0 var(--card-w, min(78vw, 560px));
  display: flex; flex-direction: column;
  background: var(--night-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transform: scale(calc(.86 + var(--focus) * .14));
  opacity: calc(.35 + var(--focus) * .65);
  transform-origin: 50% 60%;
}
.card-media {
  aspect-ratio: 16 / 9;
  background: radial-gradient(120% 120% at 20% 110%, rgba(243,165,60,.35), transparent 55%), var(--night);
  overflow: hidden;
  display: grid; place-items: center;
}
.card-media img {
  width: 100%; height: 100%; object-fit: cover;
  transform: translateX(calc(var(--shift, 0) * 1%)) scale(1.12);
  filter: grayscale(calc(1 - var(--focus)));
}
/* loghi: su fondo chiaro, interi, senza parallasse */
.card-media--logo { background: #FDE6EF; }
.card-media--logo img { width: 42%; height: auto; object-fit: contain; transform: none; }
.card-initial {
  font-size: clamp(5rem, 12vw, 9rem); line-height: 1;
  font-variation-settings: "opsz" 96, "wdth" 75, "wght" 800;
  color: color-mix(in oklab, var(--paper) 14%, transparent);
}
.card-body { padding: clamp(18px, 2.4vw, 28px); display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card-meta { margin: 0; color: var(--dim); font-size: var(--step--1); }
.card-name {
  margin: 0; font-size: var(--step-2); line-height: 1.05; letter-spacing: -0.02em;
  font-variation-settings: "opsz" 48, "wght" 650;
}
.card-desc { margin: 0 0 .5rem; color: color-mix(in oklab, var(--paper) 80%, var(--dim)); max-width: 46ch; }
.card .link { margin-top: auto; align-self: flex-start; }
.card-badge {
  margin-top: auto; align-self: flex-start;
  padding: .2rem .7rem; border-radius: 999px;
  border: 1px solid var(--sun); color: var(--sun); font-size: var(--step--1);
}

.work-progress {
  width: calc(100% - 2 * var(--gutter)); max-width: calc(var(--max) - 2 * var(--gutter));
  margin: 32px auto 0; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden;
}
.work-progress span {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--horizon), var(--sun));
  transform-origin: 0 50%; transform: scaleX(var(--p, 0));
}

/* Desktop con motion: la sezione è alta, il contenuto resta fermo (sticky) */
.work.is-pinned .work-pin { position: sticky; top: 0; height: 100svh; }

/* Telefono / reduced motion: carosello nativo con snap */
.work:not(.is-pinned) .track {
  overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; padding-bottom: 8px;
}
.work:not(.is-pinned) .track::-webkit-scrollbar { display: none; }
.work:not(.is-pinned) .card { scroll-snap-align: center; }

/* ---------- Contact ---------- */
.contact {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(96px, 16vh, 180px) var(--gutter) clamp(64px, 10vh, 120px);
}
.contact-title {
  margin: 0 0 1.25rem;
  font-size: var(--step-3); line-height: 1.02; letter-spacing: -0.02em;
  font-variation-settings: "opsz" 96, "wght" 700, "wdth" 92;
  max-width: 14ch;
}
.contact > p { max-width: 44ch; color: var(--dim); font-size: var(--step-1); margin: 0; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 1.4rem; border-radius: 999px;
  border: 1px solid var(--line); text-decoration: none; font-weight: 600;
  transition: border-color .25s, background-color .25s, transform .2s var(--ease);
}
.btn:hover { border-color: var(--dim); }
.btn:active { transform: scale(.97); }
.btn-sun { background: var(--sun); color: var(--night); border-color: var(--sun); }
.btn-sun:hover { background: #F7B45A; border-color: #F7B45A; }
.btn-sun.is-done { background: var(--horizon); border-color: var(--horizon); }
.copy-status { min-height: 1.5em; margin: .75rem 0 0; font-size: var(--step--1); color: var(--horizon); }

.foot { border-top: 1px solid var(--line); }
.foot-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: var(--max); margin: 0 auto;
  padding: 20px var(--gutter) 28px;
  color: var(--dim); font-size: var(--step--1);
}
.socials { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.socials a {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  color: var(--dim);
  transition: color .25s, background-color .25s, transform .35s cubic-bezier(.5, 1.6, .4, 1);
}
.socials a:hover { color: var(--night); background: var(--paper); transform: translateY(-3px) rotate(-6deg); }
.socials svg { width: 20px; height: 20px; }

/* ---------- Timeline ---------- */
.timeline {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(32px, 6vh, 64px) var(--gutter) clamp(64px, 10vh, 120px);
}
main > .timeline:first-child { padding-top: clamp(120px, 18vh, 180px); } /* la About parte direttamente dalla timeline */
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 32px; margin-bottom: clamp(32px, 6vh, 64px); }
.tl-head .h2 { margin: 0; }
.tl-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: var(--step--1); color: var(--dim); }
.tl-legend li { display: flex; align-items: center; gap: 8px; }
.tl-key { width: 9px; height: 9px; border-radius: 50%; background: var(--kind); }

[data-kind="build"] { --kind: var(--sun); }
[data-kind="work"] { --kind: var(--paper); }
[data-kind="study"] { --kind: var(--horizon); }
[data-kind="community"] { --kind: #B79CF0; }
[data-kind="sport"] { --kind: #F2876B; }
[data-kind="life"] { --kind: #7FA7E8; }

.tl-wrap { --years: 9.5rem; --rail: 40px; position: relative; }
.tl-rail {
  position: absolute; top: 8px; bottom: 8px;
  left: calc(var(--years) + var(--rail) / 2 - 1px); width: 2px;
  background: var(--line); border-radius: 2px; overflow: hidden;
}
.tl-fill {
  --p: 0;
  position: absolute; inset: 0;
  background: linear-gradient(var(--sun), var(--horizon));
  transform-origin: 50% 0; transform: scaleY(var(--p));
}
.tl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(36px, 6vh, 64px); }
.tl-item {
  display: grid; grid-template-columns: var(--years) var(--rail) minmax(0, 1fr);
  align-items: start;
}
.tl-years {
  margin: 0; padding-top: .15rem;
  font-variant-numeric: tabular-nums; font-size: var(--step--1); color: var(--dim);
  white-space: nowrap;
}
.tl-dot {
  justify-self: center; margin-top: .5rem;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--night); border: 2px solid var(--line);
  position: relative; z-index: 1;
  transition: background-color .4s, border-color .4s, box-shadow .4s, transform .5s cubic-bezier(.5, 1.6, .4, 1);
}
.tl-body { max-width: 60ch; opacity: .38; transform: translateX(-6px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.tl-org { margin: 0; font-size: var(--step-1); font-variation-settings: "opsz" 32, "wght" 650; line-height: 1.25; }
/* marchio al posto del nome (BLACK.OUT) */
.tl-wordmark { display: block; height: 1.15em; width: auto; margin: .15em 0 .1em; }
.stage-org .tl-wordmark { height: 1.5em; margin: .25em 0 0; }
.tl-role { margin: .15rem 0 .5rem; color: var(--kind); font-size: var(--step--1); }
.tl-desc { margin: 0; color: color-mix(in oklab, var(--paper) 80%, var(--dim)); }
.tl-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: .75rem 0 0; }
/* player Spotify: widget ufficiale, due affiancati */
.tl-embeds { display: grid; gap: 8px; margin-top: 12px; max-width: 380px; }
.tl-embeds iframe {
  display: block; width: 100%; height: 80px; border: 0; border-radius: 12px;
  background: var(--night-2);
}
/* titolo in borsa (Ifis, Mediolanum): stesso formato del player Spotify, dati da /api/quote */
.ticker:empty { display: none; }
.ticker {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  height: 80px; padding: 0 16px; border-radius: 12px; background: var(--night-2);
  color: var(--paper); text-decoration: none; transition: background .2s;
}
.ticker:hover { background: color-mix(in oklab, var(--night-2) 85%, var(--paper)); }
.tk-id, .tk-px { display: grid; gap: 2px; line-height: 1.2; }
.tk-px { text-align: right; }
.tk-name { font-weight: 600; }
.tk-sym, .tk-date { font-size: var(--step--1); color: var(--dim); }
.tk-price { font-variant-numeric: tabular-nums; font-weight: 600; }
.tk-chg { font-size: var(--step--1); font-variant-numeric: tabular-nums; }
.ticker.is-up { --tk: var(--horizon); }
.ticker.is-down { --tk: #F2876B; }
.tk-chg { color: var(--tk); }
.tk-spark { width: 100%; height: 36px; min-width: 0; }
.tk-spark path { fill: none; stroke: var(--tk); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
/* carosello foto stile Instagram: 4:5, swipe con snap, contatore e pallini */
.tl-media { margin-top: 1rem; }
.tl-gallery { position: relative; max-width: 420px; }
.g-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  border-radius: 12px; background: var(--night-2);
  scrollbar-width: none; overscroll-behavior-x: contain;
  align-items: flex-start;
  transition: height .45s var(--ease); /* il riquadro prende l'altezza della foto corrente */
}
.g-track::-webkit-scrollbar { display: none; }
/* ogni foto con le sue proporzioni (limitate tra 4:5 e 16:9, come IG) */
.g-slide { flex: 0 0 100%; margin: 0; scroll-snap-align: start; aspect-ratio: var(--r, .8); max-height: var(--gmax, 72svh); }
.g-slide img { width: 100%; height: 100%; object-fit: cover; }
.g-fixed .g-slide { aspect-ratio: var(--r0, .8); } /* telefono: tutte le foto nel riquadro della prima */
.g-fixed.g-contain .g-slide { aspect-ratio: 1; }
/* loghi/grafiche: interi, su nero, quadrati */
.g-contain { max-width: 240px; }
.g-contain .g-track { background: #000; }
.g-contain .g-slide { aspect-ratio: 1; }
.g-contain .g-slide img { object-fit: contain; }
.g-count {
  position: absolute; top: 12px; right: 12px;
  padding: 2px 9px; border-radius: 999px;
  background: rgba(10, 15, 28, .7); color: var(--paper);
  font-size: .75rem; font-variant-numeric: tabular-nums; pointer-events: none;
}
.g-btn {
  position: absolute; top: calc(50% - 20px); width: 30px; height: 30px; margin-top: -15px;
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(236, 230, 218, .9); color: var(--night);
  opacity: 0; transition: opacity .2s, transform .2s var(--ease);
}
.g-btn svg { width: 14px; height: 14px; }
.g-prev { left: 10px; }
.g-next { right: 10px; }
.tl-gallery:hover .g-btn:not([disabled]), .g-btn:focus-visible { opacity: 1; }
.g-btn:active { transform: scale(.9); }
.g-btn[disabled] { visibility: hidden; }
.g-dots { display: flex; justify-content: center; gap: 5px; margin-top: 10px; }
.g-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: background-color .25s, transform .25s; }
.g-dots span.is-on { background: var(--paper); transform: scale(1.15); }
@media (hover: none) { .g-btn { display: none; } }

/* ---------- Palco (desktop): anno grande + foto/playlist della tappa corrente ---------- */
.tl-stage { display: none; }
@media (min-width: 1100px) {
  .tl-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 380px; column-gap: clamp(40px, 5vw, 88px); }
  .tl-stage {
    display: flex; flex-direction: column;
    position: sticky; top: 96px; align-self: start;
    isolation: isolate;
  }
  /* il "sole" della tappa: bagliore nel colore della categoria */
  .tl-stage::before {
    content: ""; position: absolute; z-index: -1; left: -30%; top: -20%;
    width: 120%; aspect-ratio: 1; border-radius: 50%;
    background: radial-gradient(circle, color-mix(in oklab, var(--kind, var(--sun)) 30%, transparent), transparent 62%);
    opacity: 0;
    transition: background .6s, opacity .5s var(--ease);
    pointer-events: none;
  }
  .tl-stage.has-media::before { opacity: 1; }
  .stage-year {
    margin: 0; line-height: .9; letter-spacing: -0.03em; white-space: nowrap;
    font-size: clamp(2.75rem, 4vw, 4.25rem);
    font-variation-settings: "opsz" 96, "wdth" 75, "wght" 750;
    color: var(--paper);
  }
  .stage-org { margin: .4rem 0 1rem; color: var(--kind, var(--dim)); min-height: 1.5em; transition: color .4s; }
  .stage-head.is-new { animation: stage-in .5s var(--ease); }
  @keyframes stage-in { from { opacity: 0; transform: translateY(14px); font-variation-settings: "opsz" 96, "wdth" 100, "wght" 300; } }
  .stage-slot { position: relative; }
  .stage-slot .tl-media {
    position: absolute; inset: 0 auto auto 0; width: 100%; margin: 0;
    opacity: 0; visibility: hidden; transform: translateY(16px) scale(.98);
    transition: opacity .45s var(--ease), transform .55s var(--ease), visibility 0s .45s;
  }
  /* la tappa attiva occupa spazio (il palco è alto quanto serve), le altre sfumano sopra */
  .stage-slot .tl-media.is-on {
    position: relative;
    opacity: 1; visibility: visible; transform: none;
    transition: opacity .45s var(--ease), transform .55s var(--ease), visibility 0s;
  }
  .stage-slot .tl-gallery { max-width: none; --gmax: calc(100svh - 400px); }
  .stage-slot .tl-embeds { max-width: none; }
  .stage-slot .g-contain { max-width: 220px; }
}

.tl-item.is-lit .tl-dot { background: var(--kind); border-color: var(--kind); box-shadow: 0 0 0 5px color-mix(in oklab, var(--kind) 22%, transparent); transform: scale(1.1); }
.tl-item.is-lit .tl-body { opacity: 1; transform: none; }
.tl-item.is-lit .tl-years { color: var(--paper); }

@media (max-width: 700px) {
  .tl-wrap { --years: 0px; --rail: 28px; }
  .tl-item { grid-template-columns: var(--rail) minmax(0, 1fr); grid-template-areas: "dot years" ". body"; }
  .tl-years { grid-area: years; margin-bottom: .25rem; }
  .tl-dot { grid-area: dot; margin-top: .3rem; }
  .tl-body { grid-area: body; }
}

/* ================= More ================= */
.more-head { max-width: var(--max); margin: 0 auto; padding: clamp(120px, 18vh, 180px) var(--gutter) 24px; }
.more-head p { max-width: 52ch; color: var(--dim); font-size: var(--step-1); margin: 0; }

/* sotto-menu fisso con indicatore che scorre */
.subnav {
  position: sticky; top: 64px; z-index: 40; isolation: isolate;
  display: flex; gap: 4px; width: max-content; max-width: calc(100% - 2 * var(--gutter));
  margin: 16px var(--gutter) 0; padding: 4px;
  border: 1px solid var(--line); border-radius: 999px;
}
@media (min-width: 1248px) { .subnav { margin-left: calc((100% - var(--max)) / 2 + var(--gutter)); } }
/* fascia a tutta larghezza dietro il sotto-menu: il testo che scorre non si vede */
.subnav::before {
  content: ""; position: absolute; z-index: -2; inset: -14px -100vmax -18px;
  background: linear-gradient(var(--night) 70%, rgba(10, 15, 28, 0));
  pointer-events: none;
}
.subnav::after { content: ""; position: absolute; z-index: -1; inset: 0; border-radius: inherit; background: rgba(10, 15, 28, .9); }
.subnav a {
  position: relative; z-index: 1; padding: .45rem 1rem; border-radius: 999px;
  text-decoration: none; font-size: var(--step--1); color: var(--dim); white-space: nowrap; transition: color .3s;
}
.subnav a.is-on { color: var(--night); }
.subnav-ink {
  position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; border-radius: 999px;
  background: var(--kind, var(--paper));
  transition: transform .5s cubic-bezier(.5, 1.4, .4, 1), width .5s cubic-bezier(.5, 1.4, .4, 1), background-color .4s;
}

.more-sec { max-width: var(--max); margin: 0 auto; padding: clamp(72px, 12vh, 140px) var(--gutter) 0; scroll-margin-top: 110px; }
.more-sec:last-of-type { padding-bottom: clamp(80px, 14vh, 160px); }
.more-title {
  margin: 0; font-size: var(--step-3); line-height: 1; letter-spacing: -0.03em;
  font-variation-settings: "opsz" 96, "wdth" 80, "wght" 700;
}
.more-title::after { content: ""; display: block; width: 48px; height: 3px; margin-top: 18px; border-radius: 2px; background: var(--kind); }
.more-lede { margin: 1.25rem 0 0; max-width: 52ch; color: var(--dim); font-size: var(--step-1); }

/* Sport: righe grandi, le lettere si allargano in onda */
.sport-list { list-style: none; margin: 2rem 0 0; padding: 0; border-top: 1px solid var(--line); }
.sport-row {
  display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); align-items: baseline; gap: 8px 32px;
  padding: clamp(16px, 2.6vw, 26px) 0; border-bottom: 1px solid var(--line); outline: none;
}
.sport-row:focus-visible { box-shadow: inset 0 0 0 2px var(--horizon); border-radius: 4px; }
.sport-word { font-size: clamp(2.2rem, 6.5vw, 5.25rem); line-height: 1; letter-spacing: -0.02em; white-space: nowrap; }
.sport-word .ch {
  --t: 0; display: inline-block;
  font-variation-settings: "opsz" 96, "wdth" calc(75 + var(--t) * 25), "wght" calc(280 + var(--t) * 520);
  color: color-mix(in oklab, var(--kind) calc(var(--t) * 100%), var(--paper));
  transition: font-variation-settings .55s var(--ease), color .55s var(--ease);
  transition-delay: calc(var(--i) * 22ms);
}
.sport-row.is-on .ch { --t: 1; }
.sport-note { color: var(--dim); max-width: 36ch; }
@media (max-width: 700px) { .sport-row { grid-template-columns: 1fr; } }

/* Giochi: una mano di carte a ventaglio; al passaggio la carta si solleva */
.games-lede { margin-top: 2.5rem; }
.games { list-style: none; margin: 1.5rem 0 0; padding: 12px 0 8px; display: flex; justify-content: flex-start; }
.game {
  --rot: calc((var(--i) - (var(--n) - 1) / 2) * 7deg);
  position: relative; flex: 0 0 auto; width: 108px; aspect-ratio: 5 / 7; margin-right: -26px;
  display: flex; flex-direction: column; justify-content: space-between; padding: 12px 12px 10px;
  border-radius: 10px; background: var(--paper); color: var(--night);
  box-shadow: -6px 8px 18px rgba(0, 0, 0, .45);
  transform-origin: 50% 120%; transform: rotate(var(--rot));
  transition: transform .45s cubic-bezier(.3, 1.5, .4, 1), box-shadow .45s;
}
.game:hover { transform: rotate(0deg) translateY(-22px) scale(1.06); z-index: 2; box-shadow: 0 22px 30px rgba(0, 0, 0, .5); }
.game-sym { font-size: 2.1rem; line-height: 1; font-family: "Apple Symbols", "Segoe UI Symbol", system-ui, sans-serif; font-weight: 700; }
.game:nth-child(5) .game-sym { color: #D1442F; }
.game-name { font-size: .85rem; font-weight: 600; font-variation-settings: "opsz" 14, "wght" 650; }
@media (hover: none), (max-width: 640px) {
  .games { flex-wrap: wrap; gap: 12px; }
  .game { margin-right: 0; width: calc((100% - 24px) / 3); transform: none; }
}

/* Food: striscia di foto che scorre da sola */
.food-strip { margin-top: 2rem; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.food-track { display: flex; gap: 14px; width: max-content; animation: food-roll var(--roll, 60s) linear infinite; }
.food-strip:hover .food-track { animation-play-state: paused; }
.food-shot { margin: 0; flex: 0 0 auto; height: clamp(180px, 26vw, 280px); border-radius: 12px; overflow: hidden; transition: transform .4s var(--ease); }
.food-shot:hover { transform: translateY(-6px) rotate(-1deg); }
.food-shot img { height: 100%; width: auto; }
@keyframes food-roll { to { transform: translateX(-50%); } }

/* Mappa */
.map-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: 2.5rem; }
.map-count { margin: 0; color: var(--dim); }
.map-num { color: var(--paper); font-size: var(--step-2); font-variation-settings: "opsz" 48, "wght" 700; font-variant-numeric: tabular-nums; margin-right: .2em; }
.map-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.map-chips button {
  padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--line);
  font-size: var(--step--1); color: var(--dim); transition: color .25s, background-color .25s, border-color .25s;
}
.map-chips button:hover { color: var(--paper); border-color: var(--dim); }
.map-chips button[aria-pressed="true"] { background: var(--paper); border-color: var(--paper); color: var(--night); }
.map-wrap { position: relative; margin-top: 16px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
#map { height: clamp(360px, 62vh, 620px); background: #0B1322; }
/* tile scure virate sul blu-notte del sito */
#map .leaflet-tile { filter: brightness(.75) sepia(.55) hue-rotate(185deg) saturate(1.9); }
#map .leaflet-overlay-pane img { opacity: .55; }
.map-foot { margin: 14px 0 0; }
/* i punti si accendono uno dopo l'altro (ritardo impostato da JS) e restano accesi */
.pin { fill: var(--sun); stroke: rgba(243, 165, 60, .35); stroke-width: 6; filter: drop-shadow(0 0 4px rgba(243, 165, 60, .9)); opacity: 0; transition: opacity .7s var(--ease); }
.pin.is-in { opacity: 1; }
.pin:hover { fill: var(--paper); }
.leaflet-container { font-family: inherit; }
.leaflet-tooltip { background: var(--night-2); color: var(--paper); border: 1px solid var(--line); box-shadow: none; font-size: .8rem; }
.leaflet-tooltip-top::before { border-top-color: var(--line); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--night-2); color: var(--paper); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.leaflet-popup-content { margin: 12px 14px; font-size: .9rem; line-height: 1.4; }
.leaflet-popup-content strong { display: block; font-size: 1rem; margin-bottom: 2px; }
.leaflet-popup-content .pop-addr { color: var(--dim); display: block; margin-bottom: 8px; }
.leaflet-popup-content a { color: var(--sun); }
.leaflet-container a.leaflet-popup-close-button { color: var(--dim); }
.leaflet-bar a { background: var(--night-2); color: var(--paper); border-color: var(--line); }
.leaflet-bar a:hover { background: var(--line); }
.leaflet-bar a.leaflet-disabled { background: var(--night-2); color: var(--line); }
.leaflet-control-attribution { background: rgba(10, 15, 28, .7) !important; color: var(--dim); }
.leaflet-control-attribution a { color: var(--dim); }
@media (prefers-reduced-motion: reduce) { .pin { opacity: 1; } .food-track { animation: none; } }

/* ---------- More / Read, watch & listen ---------- */
.media-group { margin-top: clamp(40px, 7vh, 72px); }
.media-h { margin: 0 0 18px; font-size: var(--step-1); font-variation-settings: "opsz" 32, "wght" 650; }
.shelf, .films, .chans, .pods { list-style: none; margin: 0; padding: 0; }
.m-title { display: block; margin: 10px 0 0; font-size: .92rem; line-height: 1.3; color: var(--paper); }
.m-sub { display: block; margin: 2px 0 0; font-size: .8rem; color: var(--dim); }
.media-group a { text-decoration: none; color: inherit; display: block; }

/* righe che scorrono in orizzontale (libri, film) */
.shelf, .films {
  display: flex; gap: clamp(16px, 2vw, 26px); overflow-x: auto; scroll-snap-type: x proximity;
  padding: 14px 4px 18px; margin: 0 -4px; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent);
}
.shelf::-webkit-scrollbar, .films::-webkit-scrollbar { display: none; }
.shelf > li, .films > li { scroll-snap-align: start; flex: 0 0 auto; }

/* Libri: sullo scaffale, ruotati in prospettiva; al passaggio escono e si raddrizzano */
.shelf { perspective: 900px; padding-bottom: 26px; background: linear-gradient(transparent calc(100% - 14px), var(--line) calc(100% - 14px), var(--line) calc(100% - 12px), transparent calc(100% - 12px)); }
.book { width: clamp(112px, 12vw, 140px); }
.book img {
  width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px 6px 6px 2px;
  box-shadow: inset 4px 0 6px rgba(0, 0, 0, .35), 8px 10px 18px rgba(0, 0, 0, .45);
  transform-origin: 0 50%; transform: rotateY(-18deg);
  transition: transform .5s cubic-bezier(.3, 1.4, .4, 1), box-shadow .5s;
}
.book:hover img { transform: rotateY(0) translateY(-10px) scale(1.04); box-shadow: 0 18px 30px rgba(0, 0, 0, .5); }

/* Film e serie: locandine che si sollevano */
.film { width: clamp(128px, 13vw, 168px); }
.film img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 8px; transition: transform .4s var(--ease), box-shadow .4s; }
.film a:hover img, .film a:focus-visible img { transform: translateY(-8px) scale(1.03); box-shadow: 0 16px 28px rgba(0, 0, 0, .5), 0 0 0 1px var(--horizon); }

/* Canali YouTube: tondi con anello rosso al passaggio */
.chans { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 24px 12px; }
.chan a { text-align: center; }
.chan img {
  width: 84px; height: 84px; margin: 0 auto; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 0 #FF3B30; transition: transform .45s cubic-bezier(.3, 1.6, .4, 1), box-shadow .3s;
}
.chan a:hover img, .chan a:focus-visible img { transform: scale(1.12); box-shadow: 0 0 0 3px var(--night), 0 0 0 5px #FF3B30; }

/* Podcast: copertine quadrate che si inclinano, con equalizzatore */
.pods { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 24px 18px; }
.pod-art { position: relative; display: block; border-radius: 10px; overflow: hidden; transition: transform .45s cubic-bezier(.3, 1.4, .4, 1), box-shadow .45s; }
.pod-art img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.pod a:hover .pod-art, .pod a:focus-visible .pod-art { transform: translateY(-6px) rotate(-2deg); box-shadow: 0 16px 28px rgba(0, 0, 0, .5); }
.eq {
  position: absolute; left: 10px; bottom: 10px; display: flex; align-items: flex-end; gap: 3px;
  height: 22px; padding: 5px 6px; border-radius: 6px; background: rgba(10, 15, 28, .75);
  opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s var(--ease);
}
.eq i { width: 3px; height: 30%; border-radius: 2px; background: var(--sun); }
.pod a:hover .eq, .pod a:focus-visible .eq { opacity: 1; transform: none; }
.pod a:hover .eq i, .pod a:focus-visible .eq i { animation: eq .9s ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-delay: -.3s !important; }
.eq i:nth-child(3) { animation-delay: -.6s !important; }
.eq i:nth-child(4) { animation-delay: -.15s !important; }
@keyframes eq { 0% { height: 20%; } 50% { height: 95%; } 100% { height: 45%; } }

/* entrata a cascata di ogni gruppo quando ci arrivi */
.reveal li { opacity: 0; translate: 0 18px; transition: opacity .6s var(--ease), translate .6s var(--ease); transition-delay: var(--d, 0s); }
.reveal.is-in li { opacity: 1; translate: 0 0; }
@media (prefers-reduced-motion: reduce) { .reveal li { opacity: 1; translate: none; } .book img { transform: none; } }

/* Passaggio tra pagine: dissolvenza, la barra resta ferma */
@view-transition { navigation: auto; }
.bar { view-transition-name: bar; }
::view-transition-old(root) { animation: .25s var(--ease) both vt-out; }
::view-transition-new(root) { animation: .35s var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }

/* Cambio lingua: dissolvenza breve */
[data-i18n] { transition: opacity .18s; }
html.is-swapping [data-i18n] { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
