/* EMSOPEDIA — pagina "work in progress" (una sola schermata, nessuno scroll) */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-latin.woff2") format("woff2");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --night: #04070f;
  --night-2: #0a1122;
  --ink: #eef2fb;
  --ink-soft: #c9d0e0;
  --muted: #8e99b5;
  --line: rgba(160, 180, 255, .12);
  --cyan: #00c2d1;
  --cyan-soft: #7fe7f0;
  --blue: #2d5bff;
  --violet: #8b5cf6;
  --magenta: #e2468f;
  --amber: #f0b429;
  --green: #22d3a6;
  --grad: linear-gradient(100deg, #00c2d1 0%, #2d5bff 34%, #8b5cf6 62%, #e2468f 82%, #00c2d1 100%);
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  /* le lingue non latine ricadono su caratteri di sistema adatti */
  --display: "Space Grotesk", "Inter", ui-sans-serif, system-ui, "Segoe UI", "Noto Sans", "Hiragino Sans", "Yu Gothic UI", "Meiryo", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans JP", "Noto Sans KR", "Noto Sans Arabic", "Segoe UI Arabic", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --pad-x: clamp(20px, 5vw, 76px);
  --px: 0;           /* parallasse del cursore, -1..1 (impostati da app.js) */
  --py: 0;
  --hs: 1;           /* fattore di adattamento del titolo, per non uscire mai dallo schermo */
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--cyan-soft); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.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; }

/* ================================================================== sfondo */
.bg-aurora, .bg-grid, #field, .bg-glow, .bg-scrim, .bg-grain, .frame { position: fixed; pointer-events: none; }

.bg-aurora { inset: 0; z-index: 0; overflow: hidden; transform: translate3d(calc(var(--px) * -18px), calc(var(--py) * -14px), 0); }
.bg-aurora i { position: absolute; border-radius: 50%; mix-blend-mode: screen; will-change: transform; }
.bg-aurora i:nth-child(1) { width: 75vmax; height: 75vmax; top: -38vmax; right: -24vmax; background: radial-gradient(circle, rgba(45, 91, 255, .42), rgba(45, 91, 255, 0) 62%); animation: drift-a 26s ease-in-out infinite alternate; }
.bg-aurora i:nth-child(2) { width: 62vmax; height: 62vmax; bottom: -34vmax; left: -20vmax; background: radial-gradient(circle, rgba(0, 194, 209, .28), rgba(0, 194, 209, 0) 62%); animation: drift-b 30s ease-in-out infinite alternate; }
.bg-aurora i:nth-child(3) { width: 48vmax; height: 48vmax; top: 22%; right: 4%; background: radial-gradient(circle, rgba(139, 92, 246, .30), rgba(139, 92, 246, 0) 62%); animation: drift-c 22s ease-in-out infinite alternate; }
.bg-aurora i:nth-child(4) { width: 34vmax; height: 34vmax; bottom: -6vmax; right: 18%; background: radial-gradient(circle, rgba(226, 70, 143, .20), rgba(226, 70, 143, 0) 62%); animation: drift-b 34s ease-in-out -8s infinite alternate-reverse; }
@keyframes drift-a { to { transform: translate3d(-12vmax, 10vmax, 0) scale(1.12); } }
@keyframes drift-b { to { transform: translate3d(14vmax, -8vmax, 0) scale(1.18); } }
@keyframes drift-c { 0% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(-10vmax, 6vmax, 0) scale(.86); } 100% { transform: translate3d(6vmax, -8vmax, 0) scale(1.1); } }

.bg-grid {
  inset: -40px; z-index: 0;
  background-image:
    linear-gradient(rgba(130, 160, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(130, 160, 255, .055) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 65% at 68% 50%, #000 15%, transparent 78%);
          mask-image: radial-gradient(ellipse 70% 65% at 68% 50%, #000 15%, transparent 78%);
  transform: translate3d(calc(var(--px) * -8px), calc(var(--py) * -6px), 0);
}

#field { inset: 0; width: 100%; height: 100%; z-index: 1; }

.bg-glow {
  left: 0; top: 0; z-index: 2; width: 640px; height: 640px; margin: -320px 0 0 -320px;
  border-radius: 50%; mix-blend-mode: screen; opacity: 0; transition: opacity .6s;
  background: radial-gradient(circle, rgba(45, 91, 255, .16), rgba(139, 92, 246, .06) 38%, transparent 66%);
  will-change: transform;
}
.bg-glow.is-on { opacity: 1; }

/* velo per la leggibilità del testo sul lato sinistro e vignettatura dei bordi */
.bg-scrim {
  inset: 0; z-index: 3;
  background:
    radial-gradient(ellipse 120% 90% at 60% 50%, transparent 55%, rgba(2, 4, 10, .75) 100%),
    linear-gradient(90deg, rgba(4, 7, 15, .72) 0%, rgba(4, 7, 15, .35) 38%, rgba(4, 7, 15, 0) 62%);
}

.bg-grain {
  inset: -100%; z-index: 4; opacity: .075; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.1s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate3d(0, 0, 0); } 17% { transform: translate3d(-4%, 3%, 0); } 33% { transform: translate3d(3%, -5%, 0); }
  50% { transform: translate3d(-6%, -2%, 0); } 67% { transform: translate3d(5%, 4%, 0); } 83% { transform: translate3d(-2%, 6%, 0); } 100% { transform: translate3d(0, 0, 0); }
}

/* ================================================================== cornice HUD */
.frame { inset: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); z-index: 5; }
.corner { position: absolute; width: 22px; height: 22px; border: 0 solid rgba(127, 231, 240, .5); animation: corner-in 1.1s var(--ease) .15s both; }
.corner.tl { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; --cx: 40px; --cy: 40px; }
.corner.tr { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; --cx: -40px; --cy: 40px; }
.corner.bl { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; --cx: 40px; --cy: -40px; }
.corner.br { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; --cx: -40px; --cy: -40px; }
@keyframes corner-in { from { opacity: 0; transform: translate(var(--cx), var(--cy)); } to { opacity: 1; transform: none; } }
.edge { position: absolute; top: 50%; font: 500 10px/1 var(--mono); letter-spacing: .32em; text-transform: uppercase; color: rgba(154, 165, 192, .42); white-space: nowrap; writing-mode: vertical-rl; animation: fade 1.4s ease 1.4s both; }
.edge-r { right: 2px; transform: translateY(-50%); }
.edge-l { left: 2px; transform: translateY(-50%) rotate(180deg); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ================================================================== impaginazione */
.page {
  position: relative; z-index: 6;
  height: 100vh; height: 100dvh;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: max(26px, calc(env(safe-area-inset-top) + 16px)) max(var(--pad-x), calc(env(safe-area-inset-right) + 20px)) max(22px, calc(env(safe-area-inset-bottom) + 14px)) max(var(--pad-x), calc(env(safe-area-inset-left) + 20px));
  overflow: hidden;
}

/* ------------------------------------------------------------------ barra superiore */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; animation: rise .9s var(--ease) .35s both; }
.brand { display: inline-flex; align-items: center; gap: 12px; font: 700 18px/1 var(--display); letter-spacing: .06em; color: var(--ink); }
.brand-mark { position: relative; width: 36px; height: 36px; flex-shrink: 0; }
.brand-mark svg { width: 100%; height: 100%; overflow: visible; display: block; }
.brand-mark::after {   /* impulso radar periodico attorno al logo */
  content: ""; position: absolute; inset: -2px; border-radius: 50%;
  border: 1px solid rgba(127, 231, 240, .55); opacity: 0;
  animation: ping 3.6s ease-out 2.2s infinite;
}
@keyframes ping { 0% { transform: scale(.7); opacity: .9; } 70%, 100% { transform: scale(2.3); opacity: 0; } }
.bm-hex { fill: none; stroke: #7fa0ff; stroke-width: .9; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s ease .2s forwards; }
.bm-fill { opacity: 0; animation: fade .6s ease 1.05s forwards; }
.bm-wave { fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw .8s ease 1.2s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.brand-word { font-weight: 500; white-space: nowrap; }
.brand-word b { font-weight: 700; }
.brand-word span { opacity: .72; }

.top-tools { display: flex; align-items: center; gap: 18px; }
.clock { font: 500 11.5px/1 var(--mono); letter-spacing: .14em; color: var(--muted); font-variant-numeric: tabular-nums; }
.status {
  display: inline-flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 14px 0 12px; border-radius: 999px;
  font: 600 11.5px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft);
  background: rgba(10, 17, 34, .55); border: 1px solid rgba(240, 180, 41, .28);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.status-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.status-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--amber); animation: dot-ping 1.6s ease-out infinite; }
@keyframes dot-ping { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(3.2); opacity: 0; } }
.status-bar { position: relative; width: 38px; height: 3px; border-radius: 3px; overflow: hidden; background: rgba(240, 180, 41, .18); }
.status-bar i { position: absolute; inset: 0; width: 40%; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--amber), transparent); animation: indet 1.5s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-110%); } to { transform: translateX(260%); } }

/* ------------------------------------------------------------------ contenuto centrale */
.hero {
  align-self: center;
  display: flex; flex-direction: column; align-items: flex-start;
  gap: clamp(14px, 2.6vh, 30px);
  max-width: 1120px;
  padding-block: clamp(16px, 3vh, 40px);
  transform: translate3d(calc(var(--px) * 7px), calc(var(--py) * 5px), 0);
}

.eyebrow {
  margin: 0; display: inline-flex; align-items: center; gap: 12px;
  font: 600 12px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--cyan-soft);
  animation: rise .9s var(--ease) .65s both;
}
.eyebrow::before { content: ""; flex-shrink: 0; width: 30px; height: 2px; border-radius: 2px; background: var(--grad); background-size: 200% 100%; animation: flow 4s linear infinite; }

/* testi che cambiano lingua: le copie invisibili di tutte le traduzioni (.ghost, create da app.js)
   stanno nella stessa cella della versione visibile, così le misure non cambiano mai */
.stk { display: grid; }
.stk > * { grid-area: 1 / 1; min-width: 0; }
.stk > .ghost { visibility: hidden; }
.eyebrow :lang(ar), .status :lang(ar) { letter-spacing: 0; }      /* la spaziatura spezzerebbe le legature arabe */
.eyebrow :lang(ja), .eyebrow :lang(ko) { letter-spacing: .08em; }
.eyebrow .stk > * { text-align: left; }                            /* anche in arabo resta accanto alla lineetta */
.status .stk { justify-items: center; text-align: center; }        /* le parole corte (制作中) stanno al centro della pillola */
.status .stk > * { white-space: nowrap; }
.lede :lang(ja) { word-break: auto-phrase; }
.lede :lang(ko) { word-break: keep-all; }
.fx-fade { transition: opacity .28s ease; }
.fx-fade.out { opacity: 0; }

.headline {
  margin: 0; width: 100%;
  font: 700 calc(var(--hs) * clamp(34px, min(6vw, 9.6vh), 108px))/1.02 var(--display);
  letter-spacing: -.035em;
  color: #f4f7fe;
}
/* tutte le traduzioni (invisibili) occupano la stessa cella: l'altezza resta quella della frase più lunga e nulla sotto si sposta */
.hl { position: relative; display: grid; max-width: 15.5ch; }
.hl > .hl-ghost { grid-area: 1 / 1; visibility: hidden; }
.js .hl-live { position: absolute; left: 0; right: 0; top: 0; visibility: hidden; }
.js .hl-live.is-on { visibility: visible; }
.hl-live, .hl-ghost { display: block; }
.hl-live:lang(ja), .hl-live:lang(ko), .hl-ghost:lang(ja), .hl-ghost:lang(ko) { letter-spacing: -.01em; line-height: 1.16; }
.hl-live:lang(ko), .hl-ghost:lang(ko) { word-break: keep-all; }
.hl-live:lang(ja), .hl-ghost:lang(ja) { word-break: auto-phrase; }   /* a capo tra frasi, non dentro le parole */
.hl-live:lang(ar), .hl-ghost:lang(ar) { letter-spacing: 0; line-height: 1.25; }
.hl-live[dir="rtl"], .hl-ghost[dir="rtl"] { text-align: left; }   /* stesso filo sinistro dell'impaginazione */
.hl-live:lang(el), .hl-ghost:lang(el) { letter-spacing: -.02em; }
.hl-hi {
  background: var(--grad); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  animation: flow 7s linear infinite;
}
@keyframes flow { from { background-position: 0% 50%; } to { background-position: 220% 50%; } }
.hl-scr { color: var(--cyan-soft); text-shadow: 0 0 22px rgba(0, 194, 209, .7); opacity: .9; }
/* cursore lampeggiante, "lavori in corso" */
.hl-live::after, .hl-ghost::after {
  content: ""; display: inline-block; width: .085em; height: .76em; margin-inline-start: .07em; vertical-align: -.04em;
  border-radius: 2px; background: linear-gradient(var(--cyan-soft), var(--blue));
}
.hl-live::after { box-shadow: 0 0 18px rgba(0, 194, 209, .8); animation: caret 1.05s steps(1) infinite; }
.hl-live.is-typing::after { animation: none; }
@keyframes caret { 50% { opacity: 0; } }

/* uscita del vecchio testo: interferenza */
.hl-live.out { animation: glitch-out .34s steps(7) forwards; }
@keyframes glitch-out {
  0%   { opacity: 1; transform: none; clip-path: inset(0 0 0 0); text-shadow: none; }
  15%  { transform: translate3d(-7px, 0, 0) skewX(-9deg); clip-path: inset(8% 0 46% 0); text-shadow: 4px 0 rgba(226, 70, 143, .9), -4px 0 rgba(0, 194, 209, .9); }
  30%  { transform: translate3d(10px, 0, 0); clip-path: inset(52% 0 6% 0); }
  45%  { transform: translate3d(-4px, 0, 0) skewX(7deg); clip-path: inset(0 0 72% 0); text-shadow: -6px 0 rgba(226, 70, 143, .9), 6px 0 rgba(0, 194, 209, .9); }
  60%  { transform: translate3d(14px, 0, 0); clip-path: inset(34% 0 34% 0); opacity: .7; }
  80%  { transform: translate3d(-18px, 0, 0) scaleY(.4); clip-path: inset(48% 0 48% 0); opacity: .5; }
  100% { transform: translate3d(0, 0, 0) scaleY(.02); clip-path: inset(50% 0 50% 0); opacity: 0; }
}

.lede {
  margin: 0; max-width: 54ch;
  font-size: clamp(15px, 1.05vw + 5px, 18.5px); line-height: 1.6; color: var(--muted);
  animation: rise 1s var(--ease) 1.25s both;
}
.lede p { margin: 0; }
.lede strong {
  color: var(--ink); font-weight: 600; white-space: nowrap;
  background: linear-gradient(90deg, var(--cyan), var(--violet)) 0 100% / 100% 2px no-repeat;
  padding-bottom: 2px;
}
/* cambio lingua: il vecchio testo sfuma, il nuovo compare parola per parola, prima ciano poi a riposo */
.lede .live { transition: opacity .28s ease, filter .28s ease; }
.lede .live.out { opacity: 0; filter: blur(6px); }
.lede .w { animation: word-in .8s var(--ease) both; animation-delay: calc(var(--w) * 16ms); }
@keyframes word-in {
  0%  { opacity: 0; filter: blur(8px); color: var(--cyan-soft); }
  55% { opacity: 1; filter: blur(0); color: var(--cyan-soft); }
}

/* ------------------------------------------------------------------ sintonia (lingue come canali) */
.tuner { width: min(660px, 100%); margin-top: clamp(0px, 1.2vh, 14px); animation: rise 1s var(--ease) 1.45s both; }
.tuner-head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 8px;
  font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tuner-head b { color: var(--ink); font-weight: 600; }
.state { display: inline-flex; align-items: center; gap: 7px; color: var(--amber); }
.state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.state.lock { color: var(--green); }
.state:not(.lock)::before { animation: caret .45s steps(1) infinite; }
.state.off { color: #ff4d6d; }
.state.off::before { animation: none; box-shadow: none; opacity: .7; }

/* selettore della lingua: globo + frecce, nessuna parola da tradurre */
.tuner-pick { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.tuner-pick .globe { width: 15px; height: 15px; color: var(--cyan-soft); opacity: .8; margin-right: 4px; }
.step {
  display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border-radius: 50%;
  border: 1px solid rgba(160, 180, 255, .22); background: rgba(10, 17, 34, .5); color: var(--cyan-soft); cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s;
}
.step svg { width: 13px; height: 13px; }
.step:hover { background: rgba(0, 194, 209, .16); border-color: rgba(127, 231, 240, .6); }
.step:active { transform: scale(.9); }
.tuner-name { min-width: 6.6em; text-align: center; font: 600 15px/1 var(--display); letter-spacing: .01em; text-transform: none; color: var(--ink); }
.tuner-freq { min-width: 10.5ch; text-align: right; }

.scale { position: relative; height: 58px; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
/* ago fantasma: anteprima del canale sotto il cursore (o durante il trascinamento) */
.needle-ghost {
  position: absolute; top: 25px; height: 21px; width: 0; left: var(--gpos, 4%);
  border-left: 1px dashed rgba(127, 231, 240, .75); opacity: 0; transition: opacity .2s;
  pointer-events: none;
}
.needle-ghost::before { content: ""; position: absolute; top: -4px; left: -4px; width: 6px; height: 6px; transform: rotate(45deg); border: 1px solid rgba(127, 231, 240, .85); }
.scale.is-hover .needle-ghost { opacity: 1; }
.scale-ticks {
  position: absolute; left: 0; right: 0; top: 26px; height: 14px;
  background:
    linear-gradient(90deg, rgba(154, 165, 192, .55) 1px, transparent 1px) 0 0 / 12.5% 100% repeat-x,
    linear-gradient(90deg, rgba(154, 165, 192, .28) 1px, transparent 1px) 0 100% / 1.5625% 55% repeat-x;
  border-right: 1px solid rgba(154, 165, 192, .55);
}
.scale-ticks::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, rgba(0, 194, 209, .1), rgba(0, 194, 209, .6) 50%, rgba(139, 92, 246, .1)); }
.scale-nums span { position: absolute; top: 46px; transform: translateX(-50%); font: 500 9.5px/1 var(--mono); color: rgba(154, 165, 192, .55); }
.scale-band {   /* alone della banda sintonizzata */
  position: absolute; top: 10px; height: 36px; width: 120px; margin-left: -60px; left: var(--pos, 4%);
  background: radial-gradient(ellipse at center, rgba(0, 194, 209, .28), transparent 70%);
  transition: left 1s cubic-bezier(.7, 0, .2, 1);
}
.needle {
  position: absolute; top: 25px; height: 21px; width: 2px; margin-left: -1px; left: var(--pos, 4%);
  border-radius: 2px; background: linear-gradient(var(--cyan-soft), var(--blue));
  box-shadow: 0 0 10px rgba(0, 194, 209, .9), 0 0 28px rgba(45, 91, 255, .8);
  transition: left 1s cubic-bezier(.7, 0, .2, 1);
}
.needle::before { content: ""; position: absolute; top: -5px; left: 50%; width: 8px; height: 8px; margin-left: -4px; transform: rotate(45deg); background: var(--cyan-soft); box-shadow: 0 0 12px var(--cyan); }

.ch-btn {
  position: absolute; top: 0; transform: translateX(-50%);
  padding: 2px 4px 12px; margin: 0; border: 0; background: none; cursor: pointer;
  font: 600 10.5px/1 var(--mono); letter-spacing: .06em; color: rgba(154, 165, 192, .62);
  transition: color .3s;
  animation: tick-in .6s var(--ease) both; animation-delay: calc(1.55s + var(--i) * 45ms);
}
.ch-btn::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 3px; height: 3px; margin-left: -1.5px; border-radius: 50%; background: currentColor; transition: transform .3s, background .3s, box-shadow .3s; }
.ch-btn:hover, .ch-btn.is-hover { color: #d4dcff; }
.ch-btn.is-hover::after { transform: scale(1.8); background: var(--cyan-soft); box-shadow: 0 0 8px var(--cyan); }
.ch-btn[aria-pressed="true"] { color: #fff; }
.ch-btn[aria-pressed="true"]::after { opacity: 0; }   /* il rombo dell'ago prende il posto del punto */
.ch-btn[aria-pressed="true"] { text-shadow: 0 0 12px rgba(0, 194, 209, .9); }
@keyframes tick-in { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
/* suggerimento "tocca qui": due cerchi che si allargano sul canale successivo, finché l'utente non interagisce */
.ch-btn.hint::before {
  content: ""; position: absolute; left: 50%; bottom: 4.5px; width: 22px; height: 22px; margin: 0 0 -11px -11px;
  border-radius: 50%; border: 1.5px solid var(--cyan-soft); box-shadow: 0 0 12px rgba(0, 194, 209, .6);
  animation: tap 1s cubic-bezier(.2, .7, .3, 1) 2; pointer-events: none;
}
.ch-btn.hint { color: #fff; }
@keyframes tap { 0% { transform: scale(.15); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }

/* ------------------------------------------------------------------ interruttore dell'antenna */
.power {
  position: fixed; z-index: 8; left: 0; top: 0; width: 38px; height: 38px; margin: -19px 0 0 -19px; padding: 0;
  display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  color: var(--cyan-soft); border: 1px solid rgba(127, 231, 240, .5);
  background: radial-gradient(circle at 35% 28%, rgba(46, 66, 122, .98), rgba(8, 12, 28, .98) 70%);
  box-shadow: 0 8px 22px -8px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .14), 0 0 18px -4px rgba(0, 194, 209, .6);
  opacity: 0; transform: scale(.5);
  transition: opacity .5s ease, transform .5s var(--ease), color .35s, border-color .35s, box-shadow .35s;
}
.power.is-ready { opacity: 1; transform: none; }
.power.is-ready:hover { transform: scale(1.08); }
.power.is-ready:active { transform: scale(.92); }
.power svg { width: 17px; height: 17px; filter: drop-shadow(0 0 5px currentColor); }
.power::before {   /* anello che "respira": invita a premere */
  content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid currentColor;
  opacity: 0; animation: breathe 2.8s ease-out infinite;
}
@keyframes breathe { 0% { transform: scale(.85); opacity: .7; } 70%, 100% { transform: scale(1.35); opacity: 0; } }
.power[aria-pressed="false"] { color: #ff4d6d; border-color: rgba(255, 77, 109, .5); box-shadow: 0 8px 22px -8px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .1), 0 0 16px -4px rgba(255, 77, 109, .6); }
.power.is-small { width: 30px; height: 30px; margin: -15px 0 0 -15px; }
.power.is-small svg { width: 14px; height: 14px; }

/* ------------------------------------------------------------------ mirino: l'antenna insegue il cursore */
.can-track .page { cursor: crosshair; }
.reticle {
  position: fixed; left: 0; top: 0; z-index: 9; width: 0; height: 0; pointer-events: none;
  color: var(--cyan-soft); opacity: 0; transition: opacity .3s, color .3s;
}
.reticle.is-on { opacity: 1; }
.ret-box { position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; transition: transform .45s var(--ease); }
.ret-box i { position: absolute; width: 9px; height: 9px; border: 0 solid currentColor; filter: drop-shadow(0 0 4px currentColor); }
.ret-box i:nth-child(1) { left: 0; top: 0; border-top-width: 1.5px; border-left-width: 1.5px; }
.ret-box i:nth-child(2) { right: 0; top: 0; border-top-width: 1.5px; border-right-width: 1.5px; }
.ret-box i:nth-child(3) { right: 0; bottom: 0; border-bottom-width: 1.5px; border-right-width: 1.5px; }
.ret-box i:nth-child(4) { left: 0; bottom: 0; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.ret-box::after { content: ""; position: absolute; left: 50%; top: 50%; width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
.ret-read {
  position: absolute; left: 30px; top: -26px; white-space: nowrap;
  font: 500 10px/1.4 var(--mono); letter-spacing: .08em; text-shadow: 0 0 8px rgba(0, 194, 209, .55);
  transition: transform .45s var(--ease);
}
.reticle.is-lock { color: var(--green); }
.reticle.is-lock .ret-box { transform: rotate(45deg) scale(.68); }
.reticle.is-lock .ret-read { transform: translateX(-6px); text-shadow: 0 0 8px rgba(34, 211, 166, .55); }
.reticle.is-fire .ret-box i { animation: ret-fire .4s ease-out; }
@keyframes ret-fire { 0% { filter: brightness(3) drop-shadow(0 0 10px currentColor); } 100% { filter: drop-shadow(0 0 4px currentColor); } }

/* ------------------------------------------------------------------ antenna spenta: niente trasmissione, niente messaggio */
.bg-aurora { transition: opacity 1.2s ease; }
.is-off .bg-aurora { opacity: .45; }
.is-off .needle { background: rgba(154, 165, 192, .55); box-shadow: none; }
.is-off .needle::before { background: rgba(154, 165, 192, .7); box-shadow: none; }
.is-off .scale-band { opacity: 0; }
.hl-live.crt-off { animation: crt-off .55s cubic-bezier(.6, 0, .9, .4) forwards; transform-origin: 32% 50%; }
@keyframes crt-off {   /* come un vecchio televisore a tubo che si spegne */
  0%   { transform: none; filter: brightness(1); opacity: 1; }
  35%  { transform: scale(1.02, .06); filter: brightness(2.6); opacity: 1; }
  75%  { transform: scale(.22, .03); filter: brightness(3); opacity: .9; }
  100% { transform: scale(0, .02); opacity: 0; }
}
.hl-live.is-noise { color: rgba(140, 155, 195, .3); animation: fade .8s ease both; }
.hl-live.is-noise::after { opacity: 0; animation: none; }

/* ------------------------------------------------------------------ piè di pagina */
.foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
  padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
  animation: rise 1s var(--ease) 1.7s both;
}
.elt {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  height: 38px; padding-block: 0; padding-inline: 16px 8px; border-radius: 999px;
  background: rgba(10, 17, 34, .6); border: 1px solid rgba(160, 180, 255, .16);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--ink-soft); transition: border-color .3s, color .3s, box-shadow .3s;
  isolation: isolate;
}
.elt::before {   /* bordo a gradiente che compare al passaggio */
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; z-index: -1;
  background: var(--grad); background-size: 220% 100%; animation: flow 5s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .35s;
}
.elt:hover, .elt:focus-visible { color: #fff; border-color: transparent; box-shadow: 0 10px 40px -12px rgba(45, 91, 255, .7); }
.elt:hover::before, .elt:focus-visible::before { opacity: 1; }
.elt > * { white-space: nowrap; }
.elt-label { font-size: 12.5px; color: var(--muted); }
.elt b { font: 700 13.5px/1 var(--display); letter-spacing: .04em; color: var(--ink); }
.elt-url {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
  font: 500 11.5px/1 var(--mono); color: var(--cyan-soft); background: rgba(0, 194, 209, .1);
}
.elt-url svg { width: 13px; height: 13px; transition: transform .3s var(--ease); }
.elt:hover .elt-url svg { transform: translate(2px, -2px); }

@keyframes rise { from { opacity: 0; transform: translate3d(0, 16px, 0); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }

/* ================================================================== adattamento */
@media (max-width: 900px) {
  .bg-scrim { background: radial-gradient(ellipse 120% 90% at 50% 50%, transparent 45%, rgba(2, 4, 10, .8) 100%), linear-gradient(180deg, rgba(4, 7, 15, .15), rgba(4, 7, 15, .42) 40%, rgba(4, 7, 15, .42) 70%, rgba(4, 7, 15, .15)); }
  .edge { display: none; }
  .headline { font-size: calc(var(--hs) * clamp(32px, min(9.6vw, 8.6vh), 76px)); }
  .hl { max-width: none; }
}
@media (max-width: 640px) {
  .clock { display: none; }
  .status { height: 30px; padding: 0 11px 0 10px; font-size: 10.5px; letter-spacing: .1em; }
  .status-bar { display: none; }
  .brand { font-size: 16px; gap: 10px; }
  .brand-mark { width: 30px; height: 30px; }
  .tuner-head { gap: 10px; }
  .eyebrow { letter-spacing: .14em; gap: 10px; }
  .eyebrow::before { width: 22px; }
  .tuner-head > span:first-child { display: none; }
  .ch-btn { font-size: 9px; padding-inline: 2px; letter-spacing: 0; }
  .foot { justify-content: center; text-align: center; }
  .foot-tag { display: none; }
}
@media (max-width: 400px) {
  .ch-btn { color: transparent; }                   /* restano i punti, il nome è nella testata */
  .ch-btn[aria-pressed="true"] { color: #fff; }
  .status { font-size: 9.5px; letter-spacing: .06em; gap: 8px; padding-inline: 9px 11px; }
  .elt { gap: 8px; height: 36px; padding-inline: 12px 6px; }
  .elt-label { font-size: 11px; }
  .elt b { font-size: 12.5px; }
  .elt-url { font-size: 10.5px; padding: 0 8px; }
}
@media (max-width: 340px) { .elt-label { display: none; } }
@media (max-height: 560px) {
  .lede { display: none; }
  .eyebrow { display: none; }
  .hero { gap: 12px; padding-block: 6px; }
  .page { padding-top: 16px; padding-bottom: 12px; }
  .foot { padding-top: 10px; }
  .hl { max-width: 24ch; }
}

/* movimento ridotto (impostazione del sistema; ?motion=1 nell'URL la ignora, utile per le demo) */
.reduce *, .reduce *::before, .reduce *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
.reduce .bg-grain, .reduce .brand-mark::after { display: none; }
.reduce .hl-live, .reduce .lede .live, .reduce .fx-fade { transition: opacity .25s ease !important; }
.reduce .lede .live.out { filter: none; }
.hl-live.fade { opacity: 0; }
