/* site.css — stili condivisi da tutte le pagine (font, transizione, topbar, mobile, video) */

/* ── Font self-hosted (variabili: un file per tutti i pesi) ── */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url('assets/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url('assets/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url('assets/fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url('assets/fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Transizione tra pagine: landing + wipe nero ── */
html { background: #000; }
body.landing { animation: landing 560ms cubic-bezier(.16,1,.3,1) both; transform-origin: 50% 50%; will-change: transform, opacity; }
@keyframes landing { from { transform: scale(1.15); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.wipe { position: fixed; left: 50%; top: 50%; width: 26vmax; height: 26vmax; margin: -13vmax 0 0 -13vmax; border-radius: 50%; background: #000; transform: scale(0); pointer-events: none; z-index: 9999; }
.wipe.on { animation: wipeOut 400ms cubic-bezier(.5,0,.85,.3) forwards; }
@keyframes wipeOut { from { transform: scale(0); } to { transform: scale(9); } }
@media (prefers-reduced-motion: reduce) { body.landing { animation: none; } .wipe.on { animation-duration: 150ms; } }

/* ── Link di servizio (ex style="" inline) ── */
.crumb-link { color: inherit; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 1px; opacity: .85; }
.plain-link { color: inherit; text-decoration: none; }
.chapter.flush { margin: 0; }
.chapter.tight { margin-top: 0; }

/* ── Logo in topbar ── */
.tb-logo { display: inline-flex; align-items: center; flex: 0 0 auto; padding: 8px; margin: -8px; } /* area di tap ~42px */
.tb-logo img { height: 26px; width: auto; display: block; }
.tb-logo:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

/* ── Video YouTube: facade (miniatura + play), l'iframe si carica solo al click ── */
.yt { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 2px; overflow: hidden; }
.yt-btn { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; display: block; }
.yt-btn img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 600ms cubic-bezier(.2,.7,.3,1); }
.yt-btn:hover img { transform: scale(1.02); }
.yt-play { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; transform: translate(-50%, -50%); background: rgba(10,10,10,.82); border-radius: 12px; transition: background 160ms; }
.yt-play::after { content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-40%, -50%); border-style: solid; border-width: 10px 0 10px 18px; border-color: transparent transparent transparent #fff; }
.yt-btn:hover .yt-play, .yt-btn:focus-visible .yt-play { background: #e62117; }
.yt-btn:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ── Mobile chrome: topbar + strip, no horizontal overflow ── */
html, body { max-width: 100%; overflow-x: hidden; }
.topbar > * { min-width: 0; }
.topbar .left { flex: 1 1 auto; min-width: 0; }
.back { white-space: nowrap; flex: 0 0 auto; }
.crumb { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) {
  .topbar { gap: 10px; }
  .topbar .crumb { display: none; }
  .topbar .right { flex: 0 0 auto; gap: 10px; min-width: 0; }
  .topbar .right .me { display: none; }
  .strip { flex-wrap: wrap; row-gap: 12px; justify-content: center; gap: 12px; }
  .strip .dots { flex: 1 1 100%; justify-content: center; gap: 10px; }
  .strip .dot::after { width: 30px; }
  .strip .counter { min-width: 0; }
  .strip .counter img { height: 54px; }
  .strip .open-btn { white-space: nowrap; padding: 12px 14px; }
  .open-btn .btn-word { display: none; }
}
@media (max-width: 380px) {
  .topbar { font-size: 9px; }
  .strip .dots { gap: 8px; }
  .strip .counter img { height: 46px; }
}
