/* Chibri Orbyx - pagina di attesa (conto alla rovescia fino al lancio). Si appoggia a esperienza.css. */

body.attesa .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
body.attesa .btn[hidden] { display: none; }
body.attesa { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; background: var(--bg); }

/* ---------- sfondo ---------- */
.at-scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.at-veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 50% 38%, transparent 0%, rgba(2, 13, 18, .35) 55%, rgba(2, 13, 18, .92) 100%),
    linear-gradient(180deg, rgba(2, 13, 18, .55) 0%, transparent 22%, transparent 70%, rgba(2, 13, 18, .95) 100%);
}
.at-grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .06; mix-blend-mode: overlay;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.5) 0 1px, transparent 1px 3px);
}

/* ---------- testata ---------- */
.at-top { position: relative; z-index: 3; }
.at-top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 76px; }
.at-brand-word { letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.at-live {
  display: inline-flex; align-items: center; gap: 9px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(4, 22, 28, .6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font: 600 .8rem/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap;
}
.at-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 0 rgba(251,191,36,.7); animation: at-beacon 1.8s ease-out infinite; }
@keyframes at-beacon { 0% { box-shadow: 0 0 0 0 rgba(251,191,36,.7); } 80%, 100% { box-shadow: 0 0 0 10px rgba(251,191,36,0); } }

/* ---------- impaginazione ---------- */
.at-main { position: relative; z-index: 2; flex: 1; padding: 8px 0 40px; }
.at-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 980px) {
  .at-grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 56px; min-height: calc(100svh - 76px - 150px); }
}

/* ---------- testo ---------- */
.at-eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px;
  font: 600 .78rem/1 var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--teal);
}
.at-eyebrow::before { content: ''; width: 34px; height: 1px; background: linear-gradient(90deg, transparent, var(--teal)); }
.at-title { font-size: clamp(2.5rem, 7.2vw, 5.1rem); font-weight: 700; line-height: .98; letter-spacing: -.035em; margin: 0 0 22px; text-wrap: balance; }
.at-title .grad { display: inline-block; filter: drop-shadow(0 0 26px rgba(34, 211, 238, .28)); }
.at-title .at-cipher { font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.at-lead { font-size: clamp(1.05rem, 1.7vw, 1.22rem); color: var(--ink-2); max-width: 36em; margin: 0 0 30px; }
.at-lead strong { color: #fff; font-weight: 600; }

/* ---------- conto alla rovescia ---------- */
.at-count { display: flex; align-items: flex-start; gap: clamp(6px, 1.4vw, 14px); margin: 0 0 18px; }
.at-cell {
  position: relative; flex: 1 1 0; max-width: 128px; min-width: 0;
  padding: 16px 6px 12px; border-radius: 18px; text-align: center;
  background: linear-gradient(180deg, rgba(12, 58, 64, .55), rgba(4, 22, 28, .75));
  border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(165, 243, 252, .08), 0 18px 40px rgba(0, 0, 0, .35);
  overflow: hidden;
}
.at-cell::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(2, 13, 18, .55); }
.at-num {
  display: block; font: 700 clamp(2rem, 6vw, 3.6rem)/1 var(--display); font-variant-numeric: tabular-nums;
  color: #fff; letter-spacing: -.02em; text-shadow: 0 0 22px rgba(94, 234, 212, .35);
}
.at-num.tick { animation: at-tick .5s cubic-bezier(.2, .8, .2, 1); }
@keyframes at-tick { 0% { transform: translateY(-38%); opacity: 0; filter: blur(4px); } 100% { transform: none; opacity: 1; filter: none; } }
.at-unit { display: block; margin-top: 8px; font: 600 .68rem/1 var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }
.at-sep { font: 700 clamp(1.6rem, 4vw, 2.6rem)/1 var(--display); color: var(--line-2); padding-top: 18px; animation: at-blink 1s steps(2) infinite; }
@keyframes at-blink { 50% { opacity: .25; } }
.at-when { margin: 0 0 26px; color: var(--ink-2); }
.at-when strong { color: var(--amber); font-weight: 600; }

.at-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.at-actions .btn b { color: var(--amber); font-weight: 700; margin: 0 .2em; }
.at-hint { margin: 14px 0 0; font-size: .88rem; color: var(--ink-3); }
.at-hint.ok { color: var(--ok); }

/* ---------- schermo col video ---------- */
.at-stage { position: relative; display: grid; place-items: center; padding: 26px 0 0; }
.at-orbit { position: absolute; width: min(118%, 640px); aspect-ratio: 1; top: 50%; left: 50%; transform: translate(-50%, -54%); pointer-events: none; }
.at-ring { width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); }
.at-ring-bg { fill: none; stroke: rgba(94, 234, 212, .12); stroke-width: .6; stroke-dasharray: 2 3; }
.at-ring-fg { fill: none; stroke: url(#at-ring-g); stroke-width: 1.2; stroke-linecap: round; stroke-dasharray: 0 1000; filter: drop-shadow(0 0 3px rgba(34, 211, 238, .8)); transition: stroke-dasharray 1s linear; }
.at-ring-dot {
  position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; left: 50%; top: 0;
  background: #fff7d6; box-shadow: 0 0 10px 3px rgba(251, 191, 36, .85), 0 0 30px 8px rgba(251, 191, 36, .35);
}
.at-screen {
  position: relative; margin: 0; width: min(100%, 440px); aspect-ratio: 4 / 5; border-radius: 26px; overflow: hidden;
  background: #01090c; border: 1px solid var(--line-2);
  box-shadow: 0 0 0 6px rgba(4, 22, 28, .7), 0 0 0 7px rgba(94, 234, 212, .14), 0 40px 90px rgba(0, 0, 0, .6), 0 0 80px rgba(34, 211, 238, .18);
  animation: at-float 7s ease-in-out infinite;
}
@keyframes at-float { 50% { transform: translateY(-8px); } }
.at-screen video { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity .45s ease; }
.at-screen.swap video { opacity: 0; }
.at-scan {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(165, 243, 252, .07) 50%, transparent 52%);
  background-size: 100% 280%; animation: at-scan 6s linear infinite;
}
@keyframes at-scan { from { background-position: 0 -100%; } to { background-position: 0 200%; } }
.at-cap {
  position: absolute; left: 14px; top: 14px; display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px; background: rgba(2, 13, 18, .62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line); font: 600 .74rem/1 var(--display); letter-spacing: .06em;
}
.at-cap-tag { color: var(--amber); text-transform: uppercase; letter-spacing: .14em; }
.at-cap-title { color: #fff; }
.at-sound {
  position: absolute; right: 14px; bottom: 14px; display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); cursor: pointer;
  background: rgba(2, 13, 18, .68); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: #fff; font: 600 .82rem/1 var(--display);
}
.at-sound:hover { border-color: var(--teal); }
.at-sound .at-snd-on { display: none; }
.at-sound[aria-pressed="true"] .at-snd-on { display: inline; }
.at-sound[aria-pressed="true"] .at-snd-off { display: none; }
.at-play {
  position: absolute; inset: 0; margin: auto; width: 78px; height: 78px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #022c2b; background: linear-gradient(135deg, #5eead4, #22d3ee);
  box-shadow: 0 0 0 10px rgba(34, 211, 238, .16), 0 16px 40px rgba(0, 0, 0, .5);
}
.at-play[hidden] { display: none; }
.at-progress { margin: 22px 0 0; font: 600 .74rem/1 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- elenco delle trasmissioni ---------- */
.at-episodes { position: relative; z-index: 2; margin-top: 46px; }
.at-ep-title { font-size: .8rem; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin: 0 0 14px; }
.at-ep-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .at-ep-list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.at-ep {
  width: 100%; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 4px;
  align-items: center; text-align: left; padding: 14px 16px; border-radius: 16px; cursor: pointer;
  background: rgba(4, 22, 28, .62); border: 1px solid var(--line); color: var(--ink); font: inherit;
  transition: border-color .2s, background .2s, transform .2s;
}
.at-ep:hover:not(:disabled) { border-color: var(--teal); transform: translateY(-2px); }
.at-ep[aria-current="true"] { border-color: var(--teal); background: rgba(13, 148, 136, .16); box-shadow: 0 0 30px rgba(45, 212, 191, .12); }
.at-ep-n { grid-row: span 2; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font: 700 1.05rem/1 var(--display); color: var(--teal); background: rgba(45, 212, 191, .1); border: 1px solid var(--line); }
.at-ep-name { font: 600 .98rem/1.2 var(--display); color: #fff; }
.at-ep-state { font-size: .78rem; color: var(--ink-3); }
.at-ep:disabled { cursor: not-allowed; opacity: .6; }
.at-ep:disabled .at-ep-name { color: var(--ink-2); }
.at-ep:disabled .at-ep-n { color: var(--ink-3); }
.at-ep.is-final .at-ep-n { color: var(--amber); border-color: rgba(251, 191, 36, .35); background: rgba(251, 191, 36, .08); }
.at-ep.is-locked .at-ep-name { filter: blur(3px); user-select: none; }

/* ---------- accensione (a zero) ---------- */
.at-ignite {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 50%, #ffffff 0%, #a5f3fc 18%, #0d9488 45%, #020d12 80%);
}
.at-ignite span { font: 700 clamp(2rem, 7vw, 4.6rem)/1 var(--display); color: #022c2b; letter-spacing: -.03em; opacity: 0; transform: scale(.9); }
.at-ignite.on { animation: at-ign 2.6s ease forwards; }
.at-ignite.on span { animation: at-ign-t 2.6s ease forwards; }
@keyframes at-ign { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 1; } }
@keyframes at-ign-t { 0%, 30% { opacity: 0; transform: scale(.9); } 55%, 100% { opacity: 1; transform: none; } }

/* ---------- piè di pagina ---------- */
.at-foot { position: relative; z-index: 2; padding: 22px 0 28px; font-size: .85rem; color: var(--ink-3); }
.at-foot .wrap { display: flex; gap: 18px; justify-content: space-between; flex-wrap: wrap; }
.at-foot a { color: var(--ink-3); }
.at-foot a:hover { color: #fff; }

/* ---------- telefono ---------- */
@media (max-width: 979px) {
  .at-copy { text-align: center; }
  .at-eyebrow { justify-content: center; }
  .at-lead { margin-left: auto; margin-right: auto; }
  .at-count { justify-content: center; }
  .at-actions { justify-content: center; }
  /* sul telefono: titolo e conto alla rovescia subito, poi il video, poi il resto */
  .at-grid { gap: 0; }
  .at-copy { display: contents; }
  .at-eyebrow { order: 1; margin-top: 6px; }
  .at-title { order: 2; }
  .at-count { order: 3; }
  .at-when { order: 4; }
  .at-stage { order: 5; padding: 18px 0 30px; }
  .at-lead { order: 6; }
  .at-actions { order: 7; }
  .at-hint { order: 8; }
  .at-screen { width: min(80vw, 360px); }
}
@media (max-width: 420px) {
  .at-sep { display: none; }
  .at-cell { padding: 12px 2px 10px; border-radius: 14px; }
  .at-live { font-size: .7rem; padding: 7px 10px; }
  .at-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .at-screen, .at-scan, .at-sep, .at-live i, .btn-glow::after { animation: none !important; }
  .at-num.tick { animation: none; }
  .at-ring-fg { transition: none; }
}

/* telefono prima di tutto (27/09/2026): trasmissioni leggibili anche a 360 px */
.at-ep { min-width: 0; }
.at-ep-name { overflow-wrap: anywhere; }
@media (max-width: 420px) {
  .at-ep-list { grid-template-columns: 1fr; gap: 8px; }
  .at-ep-n { width: 38px; height: 38px; }
  .at-ep-state { font-size: .8rem; }
  .at-orbit { width: min(100%, 640px); }
}
