/* PROXIMA px-reader.css — versione: READER-2026-11-26 */
/* ══════════════════════════════════════════════════════════════════════════
   Il lettore del Proxima Report (report.html, indirizzo /report).

   Una pagina sola usa questo foglio. Va caricato PRIMA di px-site.css, che
   resta l'ultimo come su tutte le pagine interne. Lo script è
   js/px-reader.js.

   Indice
     1. Base e token            5. Note interattive e scheda della nota
     2. Barra in alto           6. Lente
     3. Palco e libro           7. Barra in basso
     4. Fogli che girano        8. Pannello (indice, pagine, ricerca)
                                9. Sotto il lettore, schermi piccoli

   Si animano solo transform e opacity. Il mono non scende sotto i 12px.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── 1 · Base e token ─────────────────────────────────────────────────── */
body.pxs-reader{ background: #13111a; }
.rd{
  --r-night: #13111a; --r-night-2: #1d1929; --r-violet: #6a45ff; --r-violet-600: #5533e6; --r-violet-300: #b3a0ff;
  --r-amber: #f5a524; --r-line: rgba(255,255,255,.12); --r-t2: rgba(251,250,253,.78); --r-t3: rgba(251,250,253,.64);
  --r-sans: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --r-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --r-mono: 'Space Mono', ui-monospace, Menlo, monospace;
  --r-ease: cubic-bezier(.34, .04, .16, 1); --r-out: cubic-bezier(.22, 1, .36, 1);
  display: block; color: #fff; font-family: var(--r-sans); -webkit-font-smoothing: antialiased;
}
.rd *, .rd *::before, .rd *::after{ box-sizing: border-box; }
.rd :where(h1, h2, p, ol, ul, li){ margin: 0; padding: 0; }
.rd :where(ol, ul){ list-style: none; }
.rd :where(button, input){ font-family: inherit; }
.rd :where(a){ color: inherit; }
.rd :focus-visible{ outline: 2px solid var(--r-violet-300); outline-offset: 2px; }
.rd-sr{ position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.rd [hidden]{ display: none !important; }

.rd-app{
  position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden;
  height: calc(100vh - var(--pxs-head-h, 64px)); height: calc(100svh - var(--pxs-head-h, 64px)); min-height: 520px;
  background:
    radial-gradient(46% 60% at 50% 46%, rgba(106,69,255,.3), rgba(106,69,255,0) 72%),
    radial-gradient(40% 46% at 0% 100%, rgba(63,35,189,.34), rgba(63,35,189,0) 70%),
    linear-gradient(160deg, #211c30 0%, var(--r-night) 60%);
}
.rd-app:fullscreen{ height: 100vh; }

/* pulsanti del lettore */
.rd-btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none;
  height: 42px; min-width: 42px; padding: 0 12px; border-radius: 12px; cursor: pointer; text-decoration: none; white-space: nowrap;
  border: 1px solid rgba(255,255,255,.17); background: rgba(255,255,255,.05); color: #fff;
  font: 500 14.5px/1 var(--r-sans); letter-spacing: -.005em;
  transition: background-color .18s, border-color .18s, transform .18s;
}
.rd-btn:hover{ background: rgba(255,255,255,.14); }
.rd-btn:active{ transform: scale(.95); }
.rd-btn[aria-pressed="true"]{ background: var(--r-violet-600); border-color: var(--r-violet-600); }
.rd-btn:disabled{ opacity: .35; cursor: default; }
.rd-btn svg{ flex: none; }
.rd-btn.is-main{ background: var(--r-violet); border-color: var(--r-violet); font-weight: 600; }
.rd-btn.is-main:hover{ background: var(--r-violet-600); }

/* ── 2 · Barra in alto ────────────────────────────────────────────────── */
.rd-top{
  position: relative; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 10px 20px;
  padding: 10px clamp(12px, 2.2vw, 28px); border-bottom: 1px solid rgba(255,255,255,.08); background: rgba(19,17,26,.5);
}
.rd-id{ min-width: 0; }
.rd-kicker{ font: 400 12.5px/1.3 var(--r-mono); letter-spacing: .09em; text-transform: uppercase; color: var(--r-violet-300); }
.rd-title{ margin-top: 2px; font: 600 clamp(18px, 1.6vw, 22px)/1.15 var(--r-sans); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-tools{ display: flex; align-items: center; gap: 6px; }

/* ── 3 · Palco e libro ────────────────────────────────────────────────── */
.rd-stage{
  position: relative; overflow: hidden; display: grid; place-items: center; min-height: 0;
  touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.rd-stage.is-zoomed{ touch-action: none; cursor: grab; }
.rd-stage.is-drag{ cursor: grabbing; }
.rd-stage.has-loupe{ cursor: crosshair; }
.rd-cam{ grid-area: 1 / 1; transform-origin: 50% 50%; transition: transform .6s var(--r-out); }
.rd-cam.is-live{ transition: none; }
.rd-book{ position: relative; width: var(--bw, 800px); height: var(--bh, 566px); perspective: 2800px; }
.rd-sheets{ position: absolute; inset: 0; transform-style: preserve-3d; }
/* ombra sotto le due metà: c'è solo dove ci sono pagine */
.rd-shadow{ position: absolute; top: 0; width: 50%; height: 100%; opacity: 0; transition: opacity .3s; box-shadow: 0 40px 70px -30px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.06); }
.rd-shadow.is-l{ left: 0; border-radius: 7px 2px 2px 7px; }
.rd-shadow.is-r{ left: 50%; border-radius: 2px 7px 7px 2px; }
.rd-shadow.has{ opacity: 1; }
/* senza JavaScript: la copertina, che apre il PDF */
.rd-static{ grid-area: 1 / 1; display: block; height: min(100% - 40px, 760px); aspect-ratio: 595 / 842; border-radius: 3px 8px 8px 3px; overflow: hidden; box-shadow: 0 40px 70px -30px rgba(0,0,0,.85); }
.rd-static img{ display: block; width: 100%; height: 100%; object-fit: cover; }

.rd-edge{
  position: absolute; top: 50%; z-index: 4; display: grid; place-items: center; width: 48px; height: 48px; margin-top: -24px; padding: 0;
  border-radius: 14px; border: 1px solid rgba(255,255,255,.2); background: rgba(19,17,26,.55); color: #fff; cursor: pointer;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: background-color .18s, transform .18s, opacity .2s;
}
.rd-edge:hover{ background: rgba(106,69,255,.7); }
.rd-edge:active{ transform: scale(.94); }
.rd-edge:disabled{ opacity: 0; pointer-events: none; }
.rd-edge.is-prev{ left: clamp(8px, 1.6vw, 22px); }
.rd-edge.is-next{ right: clamp(8px, 1.6vw, 22px); }

/* ── 4 · Fogli che girano ─────────────────────────────────────────────── */
.rd-sheet{
  position: absolute; top: 0; left: 50%; width: 50%; height: 100%;
  transform-origin: 0 50%; transform-style: preserve-3d; transition: transform var(--dur, 800ms) var(--r-ease);
}
.rd-face{
  position: absolute; inset: 0; overflow: hidden; background: #f1eff6; border-radius: 2px 6px 6px 2px;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
}
.rd-face.is-b{ transform: rotateY(180deg); border-radius: 6px 2px 2px 6px; }
.rd-face img{ position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; pointer-events: none; transition: opacity .3s; }
.rd-face img.is-on{ opacity: 1; }
.rd-face::after{
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(19,17,26,.26) 0%, rgba(19,17,26,.07) 3.5%, rgba(19,17,26,0) 11%);
}
.rd-face.is-b::after{ background: linear-gradient(270deg, rgba(19,17,26,.26) 0%, rgba(19,17,26,.07) 3.5%, rgba(19,17,26,0) 11%); }
.rd-face::before{
  content: ""; position: absolute; inset: -2px -30%; z-index: 2; pointer-events: none; opacity: 0;
  background: linear-gradient(100deg, rgba(19,17,26,.5) 0%, rgba(19,17,26,0) 36%, rgba(255,255,255,.26) 54%, rgba(255,255,255,0) 70%);
}
.rd-sheet.is-turning .rd-face::before{ animation: rd-shade var(--dur, 800ms) ease-in-out both; }
@keyframes rd-shade{ 0%{ opacity: 0; transform: translateX(-22%); } 46%{ opacity: 1; } 100%{ opacity: 0; transform: translateX(22%); } }

/* ── 5 · Note interattive ─────────────────────────────────────────────── */
/* Due strati piatti sopra le due pagine aperte. Le posizioni sono in
   millesimi della pagina (vedi il blocco JSON in fondo a report.html). */
.rd-hot{ position: absolute; top: 0; width: 50%; height: 100%; z-index: 3; opacity: 1; transition: opacity .25s; pointer-events: none; }
.rd-hot.is-l{ left: 0; }
.rd-hot.is-r{ left: 50%; }
.rd-book.is-flying .rd-hot, .rd-app.no-notes .rd-hot .rd-h{ opacity: 0; pointer-events: none; }
.rd-h{ position: absolute; display: block; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; pointer-events: auto; text-decoration: none; -webkit-tap-highlight-color: transparent; }
/* rimandi e indirizzi: un'area che si accende */
.rd-h.is-j, .rd-h.is-u{ border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(106,69,255,0); transition: background-color .18s, box-shadow .18s; }
.rd-h.is-j::after{
  content: ""; position: absolute; right: 3%; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%;
  background: var(--r-violet); box-shadow: 0 0 0 3px rgba(106,69,255,.22); opacity: .9; transform: scale(var(--inv, 1)); transition: transform .25s var(--r-out);
}
.rd-h.is-j:hover, .rd-h.is-j:focus-visible, .rd-h.is-u:hover, .rd-h.is-u:focus-visible{ background: rgba(106,69,255,.16); box-shadow: inset 0 0 0 1.5px rgba(106,69,255,.75); }
.rd-h.is-j:hover::after{ transform: scale(calc(var(--inv, 1) * 1.5)); }
.rd-h.is-u{ box-shadow: inset 0 -1.5px 0 rgba(106,69,255,.7); }
/* spille: l'analisi sul sito (ambra), le fonti (viola) */
/* --inv (1 / ingrandimento, la scrive lo script): a schermo restano sempre uguali */
.rd-h.is-pin{ transform: translate(-50%, -50%) scale(var(--inv, 1)); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--r-violet); color: #fff; box-shadow: 0 0 0 2px #fff, 0 6px 14px -4px rgba(19,17,26,.6); transition: transform .2s var(--r-out); }
.rd-h.is-pin.is-a{ background: var(--r-amber); color: var(--r-night); }
.rd-h.is-pin svg{ width: 13px; height: 13px; }
.rd-h.is-pin::before{ content: ""; position: absolute; inset: -2px; border-radius: 50%; box-shadow: 0 0 0 0 currentColor; color: rgba(106,69,255,.55); animation: rd-pulse 2.4s ease-out infinite; }
.rd-h.is-pin.is-a::before{ color: rgba(245,165,36,.6); }
.rd-h.is-pin:hover, .rd-h.is-pin:focus-visible, .rd-h.is-pin.is-open{ transform: translate(-50%, -50%) scale(calc(var(--inv, 1) * 1.22)); }
@keyframes rd-pulse{ 0%{ box-shadow: 0 0 0 0 currentColor; opacity: 1; } 70%, 100%{ box-shadow: 0 0 0 11px currentColor; opacity: 0; } }
/* risultati della ricerca, evidenziati sulla pagina */
.rd-find{ position: absolute; border-radius: 3px; background: rgba(245,165,36,.36); box-shadow: 0 0 0 1.5px rgba(245,165,36,.9); pointer-events: none; }

/* la scheda di una nota */
.rd-pop{
  position: absolute; z-index: 8; width: min(320px, calc(100% - 24px)); padding: 16px 16px 14px; border-radius: 16px;
  background: #fff; color: #2a2733; box-shadow: 0 30px 60px -20px rgba(0,0,0,.7), 0 0 0 1px rgba(19,17,26,.08);
  animation: rd-pop .22s var(--r-out) both;
}
@keyframes rd-pop{ from{ opacity: 0; transform: translateY(8px) scale(.97); } to{ opacity: 1; transform: none; } }
.rd-pop-k{ font: 400 12px/1.3 var(--r-mono); letter-spacing: .09em; text-transform: uppercase; color: #3f23bd; }
.rd-pop-t{ margin-top: 6px; font: 600 17.5px/1.25 var(--r-sans); letter-spacing: -.015em; }
.rd-pop-x{ margin-top: 8px; font: 400 16px/1.5 var(--r-serif); color: #4a4558; max-height: 220px; overflow: auto; }
.rd-pop a.rd-btn{ margin-top: 12px; }
.rd-pop-close{ position: absolute; right: 6px; top: 6px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: #625d72; cursor: pointer; display: grid; place-items: center; }
.rd-pop-close:hover{ background: #f3f1f8; }
.rd-pop :focus-visible{ outline-color: #5533e6; }

/* ── 6 · Lente ────────────────────────────────────────────────────────── */
.rd-loupe{
  position: absolute; left: 0; top: 0; z-index: 7; width: 240px; height: 240px; margin: -120px 0 0 -120px; border-radius: 50%; pointer-events: none;
  background-color: #f1eff6; background-repeat: no-repeat; opacity: 0; transition: opacity .15s;
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px rgba(19,17,26,.3), 0 26px 50px -14px rgba(0,0,0,.75);
}
.rd-loupe.is-on{ opacity: 1; }

/* ── 7 · Barra in basso ───────────────────────────────────────────────── */
.rd-bar{
  position: relative; z-index: 6; display: grid; grid-template-columns: minmax(150px, 280px) minmax(0, 1fr) auto; align-items: center; gap: 10px 22px;
  padding: 10px clamp(12px, 2.2vw, 28px); border-top: 1px solid rgba(255,255,255,.08); background: rgba(19,17,26,.5);
}
.rd-where{ min-width: 0; }
.rd-where b{ display: block; font: 400 12.5px/1.3 var(--r-mono); letter-spacing: .09em; text-transform: uppercase; color: var(--r-t2); }
.rd-where span{ display: block; margin-top: 1px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: italic 400 17.5px/1.25 var(--r-serif); }
.rd-range{ -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: 0; background: none; cursor: pointer; }
.rd-range::-webkit-slider-runnable-track{ height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--r-violet-300) var(--fill, 0%), rgba(255,255,255,.18) var(--fill, 0%)); }
.rd-range::-moz-range-track{ height: 4px; border-radius: 4px; background: rgba(255,255,255,.18); }
.rd-range::-moz-range-progress{ height: 4px; border-radius: 4px; background: var(--r-violet-300); }
.rd-range::-webkit-slider-thumb{ -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; border: 0; background: #fff; box-shadow: 0 0 0 4px rgba(106,69,255,.45); }
.rd-range::-moz-range-thumb{ width: 18px; height: 18px; border-radius: 50%; border: 0; background: #fff; box-shadow: 0 0 0 4px rgba(106,69,255,.45); }
.rd-zoom{ display: flex; align-items: center; gap: 6px; }
.rd-zoom .rd-btn.is-val{ min-width: 64px; font: 400 13px/1 var(--r-mono); }

/* ── 8 · Pannello ─────────────────────────────────────────────────────── */
.rd-panel{
  position: absolute; z-index: 9; right: 0; top: 0; bottom: 0; width: min(380px, 100%); display: grid; grid-template-rows: auto minmax(0, 1fr);
  background: rgba(24,21,34,.97); border-left: 1px solid var(--r-line); box-shadow: -30px 0 60px -30px rgba(0,0,0,.7);
  animation: rd-panel .3s var(--r-out) both;
}
@keyframes rd-panel{ from{ transform: translateX(24px); opacity: 0; } to{ transform: none; opacity: 1; } }
.rd-panel-top{ display: flex; align-items: center; gap: 6px; padding: 12px 12px 10px; border-bottom: 1px solid rgba(255,255,255,.08); }
.rd-tabs{ display: flex; gap: 4px; flex: 1; padding: 4px; border-radius: 14px; background: rgba(255,255,255,.06); }
.rd-tab{ flex: 1; height: 38px; border: 0; border-radius: 10px; background: none; color: var(--r-t2); font: 500 14.5px/1 var(--r-sans); cursor: pointer; }
.rd-tab[aria-selected="true"]{ background: #fff; color: var(--r-night); font-weight: 600; }
.rd-pane{ overflow: auto; padding: 8px 14px 20px; overscroll-behavior: contain; }
.rd-index li{ border-bottom: 1px solid rgba(255,255,255,.08); }
.rd-index button{
  display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 6px 10px; margin: 0;
  border: 0; border-radius: 10px; background: none; color: var(--r-t2); text-align: left; cursor: pointer; font: 500 16px/1.25 var(--r-sans);
}
.rd-index button b{ font: 400 13px/1 var(--r-mono); color: var(--r-violet-300); }
.rd-index button:hover, .rd-index button.is-on{ background: rgba(255,255,255,.08); color: #fff; }
.rd-thumbs{ display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 14px 10px; padding-top: 8px; }
.rd-thumbs button{ display: block; width: 100%; padding: 0; border: 0; background: none; color: var(--r-t3); cursor: pointer; font: 400 12px/1 var(--r-mono); }
.rd-thumbs img{ display: block; width: 100%; height: auto; aspect-ratio: 200 / 283; border-radius: 4px; background: #2a2440; box-shadow: 0 0 0 1px rgba(255,255,255,.1); transition: transform .2s var(--r-out), box-shadow .2s; }
.rd-thumbs span{ display: block; margin-top: 6px; }
.rd-thumbs button:hover img{ transform: translateY(-3px); }
.rd-thumbs button.is-on img{ box-shadow: 0 0 0 3px var(--r-violet-300); }
.rd-thumbs button.is-on{ color: #fff; }
.rd-q{ width: 100%; height: 48px; margin-top: 8px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); color: #fff; font: 400 16.5px/1 var(--r-sans); }
.rd-q::placeholder{ color: var(--r-t3); }
.rd-count{ margin: 12px 2px 4px; font: 400 12.5px/1.4 var(--r-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--r-t3); }
.rd-results button{ display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; width: 100%; padding: 10px; border: 0; border-bottom: 1px solid rgba(255,255,255,.08); border-radius: 10px; background: none; color: var(--r-t2); text-align: left; cursor: pointer; font: 400 15.5px/1.4 var(--r-serif); }
.rd-results button b{ font: 400 13px/1.5 var(--r-mono); color: var(--r-violet-300); }
.rd-results button:hover{ background: rgba(255,255,255,.08); color: #fff; }
.rd-results mark{ background: rgba(245,165,36,.9); color: var(--r-night); border-radius: 2px; padding: 0 1px; }

/* ── 9 · Sotto il lettore, schermi piccoli ────────────────────────────── */
.rd-after{ padding: clamp(40px, 6vw, 80px) clamp(20px, 4vw, 40px); background: var(--r-night); border-top: 1px solid rgba(255,255,255,.08); }
.rd-after-in{ max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 40px; align-items: center; }
.rd-after h2{ font: 600 clamp(24px, 2.6vw, 34px)/1.1 var(--r-sans); letter-spacing: -.03em; }
.rd-after p{ margin-top: 12px; max-width: 58ch; font: 400 18.5px/1.55 var(--r-serif); color: var(--r-t2); }
.rd-after-act{ display: flex; flex-wrap: wrap; gap: 10px; }
.rd-after .rd-btn{ height: 52px; padding: 0 20px; border-radius: 14px; font-size: 16px; }

@media (max-width: 1180px){ .rd-tools .rd-btn span{ display: none; } }
@media (hover: none){ .rd-btn[data-act="loupe"]{ display: none; } }
@media (max-width: 760px){
  .rd-top{ flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .rd-id{ flex: 1 1 100%; }
  .rd-kicker{ display: none; }
  .rd-title{ font-size: 17px; }
  .rd-tools{ flex: 1; justify-content: space-between; gap: 4px; }
  .rd-btn{ height: 40px; min-width: 40px; padding: 0 9px; }
  .rd-edge{ display: none; }
  .rd-bar{ grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .rd-range{ grid-column: 1 / -1; grid-row: 1; }
  .rd-zoom .rd-btn.is-val{ min-width: 54px; }
  .rd-panel{ top: auto; left: 0; width: 100%; height: min(72%, 560px); border-left: 0; border-top: 1px solid var(--r-line); border-radius: 20px 20px 0 0; box-shadow: 0 -30px 60px -30px rgba(0,0,0,.8); animation-name: rd-panel-m; }
  .rd-after-in{ grid-template-columns: minmax(0, 1fr); }
  .rd-after .rd-btn{ flex: 1 1 100%; }
}
@keyframes rd-panel-m{ from{ transform: translateY(24px); opacity: 0; } to{ transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce){
  .rd *, .rd *::before, .rd *::after{ animation: none !important; transition: none !important; }
}
