:root {
  --navy-950: #03091f;
  --navy-900: #06123d;
  --navy-800: #0a1d5d;
  --blue: #1688dc;
  --red: #f51b43;
  --green: #00b75b;
  --white: #f7f9ff;
  --muted: #aeb8d4;
  --surface: rgba(18, 37, 91, 0.76);
  --focus: #ffffff;
  --safe-x: 64px;
  --safe-x: clamp(44px, 4.7vw, 90px);
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--navy-950);
  color: var(--white);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 8%, rgba(22, 136, 220, 0.24), transparent 33%),
    linear-gradient(145deg, var(--navy-900), var(--navy-950) 68%);
}

button { font: inherit; }

.app-shell { min-height: 100vh; }

.topbar {
  height: 118px;
  height: clamp(104px, 11vh, 142px);
  padding: 18px var(--safe-x);
  display: flex;
  align-items: center;
  gap: 52px;
  gap: clamp(34px, 4vw, 76px);
  background: linear-gradient(180deg, rgba(2, 7, 26, 0.86), transparent);
}

.brand {
  width: 190px;
  width: clamp(148px, 12.5vw, 240px);
  height: 96px;
  height: clamp(72px, 7.8vw, 132px);
  object-fit: contain;
}

nav { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; }
nav::-webkit-scrollbar { display: none; }

.nav-item {
  appearance: none;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 12px 18px;
  color: var(--muted);
  background: transparent;
  font-size: 21px;
  font-size: clamp(17px, 1.35vw, 25px);
  font-weight: 650;
  cursor: pointer;
}

.nav-item.is-active { color: var(--white); background: rgba(255, 255, 255, 0.1); }
.clock { margin-left: auto; font-size: 21px; font-size: clamp(18px, 1.35vw, 25px); color: var(--muted); font-variant-numeric: tabular-nums; }

main { padding-bottom: 52px; }

.hero {
  position: relative;
  min-height: 480px;
  min-height: clamp(400px, 49vh, 570px);
  margin: 0 var(--safe-x);
  padding: 68px;
  padding: clamp(48px, 5vw, 92px);
  overflow: hidden;
  display: flex;
  align-items: center;
  border: 1px solid rgba(116, 154, 255, 0.23);
  border-radius: 36px;
  border-radius: clamp(28px, 2.4vw, 46px);
  background:
    linear-gradient(90deg, rgba(5, 16, 57, 0.99) 0%, rgba(7, 25, 77, 0.9) 50%, rgba(8, 29, 91, 0.2) 100%),
    radial-gradient(circle at 86% 52%, rgba(245, 27, 67, 0.33), transparent 30%),
    #071a54;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.35);
}

.hero::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 56%, rgba(255, 255, 255, 0.06));
}

.hero-copy { position: relative; z-index: 2; width: 58%; max-width: 760px; }

.eyebrow {
  margin: 0 0 16px;
  color: #d9e1f7;
  font-weight: 800;
  font-size: 18px;
  font-size: clamp(15px, 1.2vw, 22px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.live-dot {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(245, 27, 67, 0.75);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 27, 67, 0.72); }
  70% { box-shadow: 0 0 0 13px rgba(245, 27, 67, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 27, 67, 0); }
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: 70px;
  font-size: clamp(48px, 5.2vw, 94px);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.hero p {
  max-width: 650px;
  margin: 25px 0 34px;
  color: #cad3ed;
  font-size: 23px;
  font-size: clamp(19px, 1.55vw, 29px);
  line-height: 1.45;
}

.primary-button,
.close-button {
  appearance: none;
  border: 3px solid transparent;
  border-radius: 999px;
  color: white;
  background: var(--red);
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 90px;
  min-width: 90px;
  padding: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.76);
  box-shadow: none;
}

.play-icon {
  display: inline-block;
  width: 0;
  height: 0;
  transform: translateX(3px);
  border-top: 16px solid transparent;
  border-bottom: 16px solid transparent;
  border-left: 26px solid white;
}

.hero-art {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  bottom: 0;
  width: 48%;
  display: flex;
  align-items: center;
  justify-content: center;
  display: grid;
  place-items: center;
}

.hero-art img {
  position: relative;
  z-index: 2;
  width: 440px;
  width: min(33vw, 520px);
  height: 440px;
  height: min(33vw, 520px);
  object-fit: contain;
  filter: drop-shadow(0 28px 55px rgba(0, 0, 0, 0.44));
}

.signal {
  position: absolute;
  border: 2px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
}
.signal-one { width: 27vw; height: 27vw; }
.signal-two { width: 35vw; height: 35vw; }
.signal-three { width: 44vw; height: 44vw; }

.sponsor-billboard {
  margin: 38px var(--safe-x) 0;
  margin: clamp(30px, 3vw, 50px) var(--safe-x) 0;
}
.sponsor-billboard[hidden] { display: none; }
.sponsor-label {
  display: block;
  margin: 0 0 10px 4px;
  color: var(--muted);
  font-size: 15px;
  font-size: clamp(13px, .9vw, 17px);
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.sponsor-link {
  position: relative;
  height: 0;
  padding-top: 20%;
  display: block;
  overflow: hidden;
  border: 3px solid transparent;
  border-radius: 24px;
  background: rgba(255, 255, 255, .055);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .24);
}
.sponsor-link[href] { cursor: pointer; }
.sponsor-link img {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}
.sponsor-link.focusable:focus { transform: scale(1.01); }

.rail-section { padding: 60px var(--safe-x) 0; padding: clamp(48px, 5vw, 76px) var(--safe-x) 0; }
.quick-section { padding: clamp(48px, 5vw, 76px) var(--safe-x) 0; }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 25px; }
.section-heading h2 { margin: 0; font-size: 44px; font-size: clamp(34px, 3vw, 56px); letter-spacing: -0.035em; }
.section-status { margin: 0 0 7px; color: var(--muted); font-size: 18px; font-size: clamp(15px, 1.15vw, 21px); }

.video-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(290px, 22vw);
  gap: 24px;
  gap: clamp(18px, 1.6vw, 30px);
  overflow-x: auto;
  padding: 7px 7px 30px;
  margin: -7px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.video-rail::-webkit-scrollbar { display: none; }

.video-card {
  appearance: none;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  text-align: left;
  color: var(--white);
  border: 3px solid transparent;
  border-radius: 23px;
  background: var(--surface);
  box-shadow: 0 17px 36px rgba(0, 0, 0, 0.2);
  scroll-snap-align: start;
  cursor: pointer;
}

.video-thumb { position: relative; height: 0; padding-top: 56.25%; overflow: hidden; background: #101b3d; }
.video-thumb img { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 180ms ease; }
.video-card:focus .video-thumb img { transform: scale(1.045); }
.card-play {
  position: absolute;
  left: 17px;
  bottom: 15px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(245, 27, 67, 0.96);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.card-play::after { content: ""; margin-left: 4px; border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-left: 11px solid white; }
.video-meta { min-height: 130px; padding: 20px 21px 22px; }
.video-date { color: var(--blue); font-size: 16px; font-size: clamp(14px, 1vw, 18px); font-weight: 750; text-transform: uppercase; letter-spacing: 0.055em; }
.video-title { margin: 9px 0 0; font-size: 21px; font-size: clamp(18px, 1.35vw, 25px); line-height: 1.28; font-weight: 720; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-card .video-meta { min-height: 150px; }
.news-card .video-title { -webkit-line-clamp: 3; }

.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 1.4vw, 26px); }
.quick-card {
  min-height: 300px;
  padding: 0;
  display: block;
  overflow: hidden;
  text-align: left;
  color: var(--white);
  border: 3px solid transparent;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(17, 54, 139, .96), rgba(8, 25, 76, .96));
  cursor: pointer;
}
.quick-thumb { position: relative; display: block; width: 100%; height: 0; padding-top: 56.25%; overflow: hidden; background: #101b3d; }
.quick-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 180ms ease; }
.quick-card:focus .quick-thumb img { transform: scale(1.045); }
.quick-copy { min-height: 132px; padding: 20px 22px 23px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.quick-label { color: #6fc2ff; font-size: clamp(16px, 1.15vw, 21px); font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.quick-card strong { max-width: 100%; font-size: clamp(20px, 1.55vw, 29px); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.quick-card:disabled { opacity: .62; cursor: default; }

.catalog-heading { margin-bottom: 18px; }
.catalog-search { display: grid; grid-template-columns: minmax(280px, 1fr) auto auto; gap: 14px; margin-bottom: 28px; }
.viaggio-search { margin-top: 22px; }
.search-input,
.search-button,
.clear-button,
.load-more {
  min-height: 62px;
  padding: 12px 22px;
  color: var(--white);
  border: 3px solid transparent;
  border-radius: 16px;
  background: rgba(18, 37, 91, .9);
  font-size: clamp(18px, 1.3vw, 24px);
}
.search-input { width: 100%; outline: none; border-color: rgba(255,255,255,.18); }
.search-input::placeholder { color: #7f8aaa; }
.search-button { min-width: 142px; background: var(--blue); font-weight: 800; cursor: pointer; }
.clear-button { min-width: 142px; background: rgba(255,255,255,.08); font-weight: 700; cursor: pointer; }
.clear-button[hidden] { display: none; }
.catalog-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(18px, 1.6vw, 30px); padding: 7px; margin: -7px; }
.catalog-grid .video-meta { min-height: 128px; }
.archive-prompt { grid-column: 1 / -1; min-height: 190px; display: grid; place-items: center; padding: 34px; color: var(--muted); border: 1px dashed rgba(255,255,255,.2); border-radius: 22px; background: rgba(255,255,255,.035); font-size: clamp(18px, 1.35vw, 25px); text-align: center; }
.load-more-wrap { display: flex; justify-content: center; padding-top: 34px; }
.load-more { min-width: 260px; background: var(--red); font-weight: 800; cursor: pointer; }
.load-more[hidden] { display: none; }

.skeleton-card { height: 250px; border-radius: 23px; background: linear-gradient(110deg, rgba(255,255,255,.05) 20%, rgba(255,255,255,.11) 35%, rgba(255,255,255,.05) 50%); background-size: 220% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position-x: -220%; } }

.focusable:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 5px rgba(22, 136, 220, 0.72), 0 18px 44px rgba(0, 0, 0, 0.35);
  transform: scale(1.035);
}

footer {
  min-height: 86px;
  padding: 25px var(--safe-x) 34px;
  display: flex;
  justify-content: space-between;
  color: #8490b1;
  font-size: 16px;
  font-size: clamp(14px, 1vw, 18px);
}

.player-layer {
  position: fixed;
  z-index: 1000;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  background: #000;
}
.player-layer[hidden] { display: none; }
.media-player { width: 100%; height: 100%; border: 0; background: #000; object-fit: contain; }
.media-player[hidden] { display: none; }
.player-chrome {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  right: 0;
  min-height: 125px;
  padding: 32px var(--safe-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(0,0,0,.92), transparent);
  opacity: 0;
  transition: opacity 180ms ease;
}
.player-layer:hover .player-chrome,
.player-layer.controls-visible .player-chrome,
.player-chrome:focus-within { opacity: 1; }
.player-brand { font-size: 23px; font-size: clamp(20px, 1.5vw, 28px); font-weight: 800; }
.close-button { padding: 14px 24px; font-size: 19px; font-size: clamp(17px, 1.2vw, 22px); background: rgba(12, 20, 46, 0.9); }
.player-message { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; display: grid; place-content: center; justify-items: center; gap: 18px; background: #000; font-size: 24px; }
.player-message[hidden] { display: none; }
.spinner { width: 58px; height: 58px; border: 6px solid rgba(255,255,255,.22); border-top-color: var(--red); border-radius: 50%; animation: spin .85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.offline-card { padding: 28px; color: var(--muted); border: 1px solid rgba(255,255,255,.12); border-radius: 20px; background: rgba(255,255,255,.05); }

@media (max-width: 1100px) {
  .hero { min-height: 390px; }
  .hero-copy { width: 66%; }
  .hero-art { width: 43%; opacity: 0.78; }
  .video-rail { grid-auto-columns: minmax(275px, 30vw); }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .clock { display: none; }
}

@media (max-width: 700px) {
  .quick-grid,
  .catalog-grid { grid-template-columns: 1fr; }
}

/* Vega usa una viewport TV 16:9: manteniamo topbar, hero e prima riga
   nella title-safe area senza ridurre la tipografia da visione a distanza. */
.platform-vega {
  --safe-x: clamp(56px, 4.4vw, 84px);
}

.platform-vega .topbar {
  height: clamp(76px, 10.5vh, 113px);
  padding: clamp(8px, 1.1vh, 12px) var(--safe-x);
  gap: clamp(20px, 1.6vw, 31px);
}

.platform-vega .brand {
  flex: 0 0 auto;
  width: clamp(160px, 12.5vw, 240px);
  height: clamp(56px, 7.8vh, 84px);
}

.platform-vega nav {
  flex: 1;
  min-width: 0;
  gap: clamp(6px, .48vw, 9px);
  padding: 7px;
  margin: -7px;
}

.platform-vega .nav-item {
  flex: 0 0 auto;
  min-height: clamp(46px, 6.4vh, 69px);
  padding: clamp(8px, 1.1vh, 12px) clamp(12px, .95vw, 18px);
  white-space: nowrap;
  font-size: clamp(19px, 2.65vh, 29px);
}

.platform-vega .nav-program-shortcut,
.platform-vega .clock { display: none; }

.platform-vega .hero {
  min-height: clamp(230px, 31.95vh, 345px);
  height: clamp(230px, 31.95vh, 345px);
  padding: clamp(17px, 2.35vh, 25px) clamp(38px, 3vw, 58px);
  border-radius: clamp(24px, 1.9vw, 36px);
}

.platform-vega .hero-copy { width: 62%; }
.platform-vega .eyebrow {
  margin-bottom: clamp(5px, .7vh, 8px);
  font-size: clamp(16px, 2.2vh, 24px);
}
.platform-vega h1 {
  font-size: clamp(46px, 6.4vh, 69px);
  line-height: 1;
}
.platform-vega .hero p {
  max-width: 680px;
  margin: clamp(8px, 1.1vh, 12px) 0 clamp(10px, 1.4vh, 15px);
  font-size: clamp(19px, 2.65vh, 29px);
  line-height: 1.22;
}
.platform-vega .primary-button {
  width: clamp(58px, 8vh, 86px);
  height: clamp(58px, 8vh, 86px);
  min-width: clamp(58px, 8vh, 86px);
}
.platform-vega .hero-art { width: 40%; }
.platform-vega .hero-art img {
  width: clamp(430px, 35vw, 640px);
  height: auto;
  max-width: 92%;
}

.platform-vega .quick-section {
  padding-top: clamp(16px, 2.2vh, 24px);
}
.platform-vega .rail-section {
  padding-top: clamp(22px, 3.05vh, 33px);
}
.platform-vega .section-heading {
  margin-bottom: clamp(8px, 1.1vh, 12px);
}
.platform-vega .section-heading h2 {
  font-size: clamp(36px, 5vh, 54px);
  line-height: 1.08;
}
.platform-vega .quick-grid {
  gap: clamp(16px, 1.25vw, 24px);
}
.platform-vega .quick-card {
  position: relative;
  min-height: 0;
}
.platform-vega .quick-copy {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 0;
  padding: clamp(38px, 5.3vh, 57px) clamp(16px, 1.25vw, 24px) clamp(12px, 1.7vh, 18px);
  justify-content: flex-end;
  gap: clamp(4px, .55vh, 6px);
  background: linear-gradient(180deg, transparent 0%, rgba(3, 9, 31, .76) 32%, rgba(3, 9, 31, .97) 72%, #03091f 100%);
}
.platform-vega .quick-label {
  color: #88d0ff;
  font-size: clamp(18px, 2.5vh, 27px);
  line-height: 1.1;
  text-shadow: 0 2px 8px #000;
}
.platform-vega .quick-card strong {
  font-size: clamp(22px, 3.05vh, 33px);
  line-height: 1.17;
  text-shadow: 0 2px 10px #000;
}
.platform-vega .video-rail {
  grid-auto-columns: clamp(300px, 24vw, 460px);
  padding: 12px 12px 28px;
  margin: -12px;
}
.platform-vega .video-meta {
  min-height: clamp(112px, 15.5vh, 168px);
  padding: clamp(16px, 2.2vh, 24px) clamp(18px, 1.4vw, 27px);
}
.platform-vega .video-date {
  font-size: clamp(18px, 2.5vh, 27px);
}
.platform-vega .video-title {
  font-size: clamp(22px, 3.05vh, 33px);
}
.platform-vega .focusable:focus {
  position: relative;
  z-index: 5;
  box-shadow: 0 0 0 6px rgba(22, 136, 220, .82), 0 18px 44px rgba(0, 0, 0, .4);
}
.platform-vega .focusable { scroll-margin: 16px; }

.continue-cue { display: none; }
.continue-cue[hidden] { display: none; }
.platform-vega .continue-cue {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: clamp(14px, 1.95vh, 21px);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(40px, 5.55vh, 60px);
  padding: clamp(7px, 1vh, 11px) clamp(18px, 1.4vw, 27px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  background: rgba(2, 7, 26, .9);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .55);
  font-size: clamp(17px, 2.35vh, 25px);
  font-weight: 800;
  letter-spacing: .01em;
  pointer-events: none;
  transform: translateX(-50%);
  animation: continue-cue 1.8s ease-in-out infinite;
}
.platform-vega .continue-cue[hidden] { display: none; }

@keyframes continue-cue {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 5px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
