/* =====================================================================
   I SEGRETI DELLA VERITÀ — stile condiviso
   ===================================================================== */

:root {
  --ink: #04060a;
  --ink-2: #070b11;
  --panel: rgba(8, 13, 20, 0.6);
  --panel-solid: #080d14;
  --line: rgba(170, 200, 230, 0.13);
  --line-strong: rgba(74, 227, 255, 0.32);

  --silver: #eef2f6;
  --text: #cbd4de;
  --muted: #93a1b0;
  --dim: #6c7886;

  --cyan: #4ae3ff;
  --cyan-2: #9aefff;
  --glow: rgba(74, 227, 255, 0.35);

  --display: 'Cinzel', 'Trajan Pro', 'Times New Roman', serif;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius: 3px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter: clamp(1rem, 4vw, 2rem);
  --maxw: 1120px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
section[id] { scroll-margin-top: 64px; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; }
::selection { background: rgba(74, 227, 255, 0.3); color: #fff; }

.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;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--silver); color: var(--ink); padding: .6rem 1rem; border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

/* ---------------------------------------------------------------------
   SCENA DI SFONDO (opera d'arte + velo + nebbia + particelle)
   --------------------------------------------------------------------- */
.scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.scene-art {
  position: absolute; inset: -6%;
  background-image: url('../copertina.jpg');
  background-image: image-set(url('../copertina.webp') type('image/webp'), url('../copertina.jpg') type('image/jpeg'));
  background-size: cover;
  background-position: center 38%;
  filter: brightness(.92) contrast(1.08) saturate(.9);
  will-change: transform;
  transform: scale(1.04);
}
@media (max-width: 700px) {
  .scene-art {
    background-image: url('../copertina.jpg');
    background-image: image-set(url('../copertina-mobile.webp') type('image/webp'), url('../copertina.jpg') type('image/jpeg'));
    background-position: 50% 40%;
  }
}
.scene-veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 22%, rgba(4,6,10,0) 0%, rgba(4,6,10,.55) 62%, rgba(4,6,10,.92) 100%),
    linear-gradient(180deg, rgba(4,6,10,.35) 0%, rgba(4,6,10,0) 22%, rgba(4,6,10,0) 72%, rgba(4,6,10,.7) 100%);
}
.scene-dark { position: absolute; inset: 0; background: var(--ink); opacity: 0; will-change: opacity; }
.scene-fog {
  position: absolute; left: -20%; right: -20%; bottom: -10%; height: 55%;
  background:
    radial-gradient(ellipse 40% 30% at 30% 70%, rgba(160,180,205,.10), transparent 70%),
    radial-gradient(ellipse 35% 25% at 70% 60%, rgba(160,180,205,.08), transparent 70%);
  filter: blur(8px);
  animation: fog 38s ease-in-out infinite alternate;
}
.scene-fog.two { animation-duration: 54s; animation-direction: alternate-reverse; bottom: 5%; opacity: .7; }
@keyframes fog { from { transform: translateX(-6%); } to { transform: translateX(6%); } }
#motes { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Sigillo di vetro 3D (Three.js) */
#webgl-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 1; pointer-events: none; }

/* ---------------------------------------------------------------------
   TIPOGRAFIA
   --------------------------------------------------------------------- */
.eyebrow {
  font-family: var(--sans); font-size: .72rem; font-weight: 500;
  letter-spacing: .38em; text-transform: uppercase; color: var(--muted);
}
.eyebrow.cyan { color: var(--cyan); }
.title-metal {
  font-family: var(--display); font-weight: 600; text-transform: uppercase;
  background: linear-gradient(180deg, #ffffff 0%, #dfe6ee 38%, #9aa8b8 72%, #c9d3dd 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: #e6ebf0;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,.9));
}
h1.title-metal { font-size: clamp(2.1rem, 6.1vw, 4.6rem); line-height: 1.02; letter-spacing: .04em; }
h2.section-title {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.7rem, 4.2vw, 2.9rem); line-height: 1.12; letter-spacing: .03em;
  color: var(--silver); margin: .9rem 0 1.1rem;
  text-shadow: 0 4px 24px rgba(0,0,0,.9);
}
.lead { text-shadow: 0 2px 14px rgba(0,0,0,.85); font-size: clamp(1.02rem, 1.6vw, 1.15rem); color: var(--text); line-height: 1.75; max-width: 62ch; }
.lead strong, p strong { color: #fff; font-weight: 600; }
.center { text-align: center; }
.center .lead { margin-inline: auto; }

/* ---------------------------------------------------------------------
   BOTTONI
   --------------------------------------------------------------------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .65rem;
  min-height: 54px; padding: .95rem 1.7rem;
  font-family: var(--display); font-weight: 600; font-size: .92rem; letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; border-radius: var(--radius); border: 1px solid transparent;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .35s var(--ease), border-color .35s var(--ease), color .35s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 1.1em; height: 1.1em; flex-shrink: 0; }
.btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.btn-primary {
  color: #05080c;
  background: linear-gradient(180deg, #ffffff 0%, #d9eef5 55%, #9fdcee 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 12px 30px -8px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.08), 0 0 28px -6px var(--glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 16px 36px -10px rgba(0,0,0,.9), 0 0 46px -4px rgba(74,227,255,.65); }
.btn-ghost {
  color: var(--silver);
  background: rgba(10, 16, 24, .55);
  border-color: rgba(200, 225, 245, .28);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.btn-ghost:hover { border-color: var(--cyan); background: rgba(74,227,255,.10); transform: translateY(-2px); box-shadow: 0 0 30px -6px var(--glow); }
.btn-block { width: 100%; }
.btn[aria-disabled="true"] { opacity: .42; pointer-events: none; }
.btn .sub { font-family: var(--sans); font-size: .68rem; letter-spacing: .1em; opacity: .7; text-transform: none; font-weight: 500; }

.text-link { color: var(--cyan); text-decoration: none; border-bottom: 1px solid rgba(74,227,255,.35); transition: border-color .3s; }
.text-link:hover { border-bottom-color: var(--cyan); }

/* ---------------------------------------------------------------------
   STRUTTURA
   --------------------------------------------------------------------- */
.page { position: relative; z-index: 2; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.section { position: relative; padding: clamp(5rem, 11vw, 8.5rem) 0; }
.section.tight { padding: clamp(3.5rem, 7vw, 5rem) 0; }
.panel {
  background: linear-gradient(160deg, rgba(14, 22, 32, .62) 0%, rgba(6, 10, 16, .74) 100%);
  border: 1px solid rgba(74, 227, 255, .22);
  border-radius: var(--radius);
  backdrop-filter: blur(20px) saturate(1.15); -webkit-backdrop-filter: blur(20px) saturate(1.15);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.06), inset 0 0 18px rgba(74,227,255,.05);
}
.rule { width: 64px; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); margin: 1.4rem auto; border: 0; }

/* ---------------------------------------------------------------------
   BARRA SUPERIORE
   --------------------------------------------------------------------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem var(--gutter);
  border-bottom: 1px solid transparent;
  transition: background .45s var(--ease), border-color .45s var(--ease), padding .45s var(--ease);
}
.topbar.scrolled {
  background: rgba(4, 6, 10, .78);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--line);
  padding-top: .6rem; padding-bottom: .6rem;
}
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand-name { font-family: var(--display); font-weight: 600; font-size: .86rem; letter-spacing: .16em; color: var(--silver); text-transform: uppercase; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 1.8rem; }
.nav a.nav-link { font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); text-decoration: none; transition: color .3s; }
.nav a.nav-link:hover { color: var(--silver); }
.topbar .btn .short { display: none; }
.topbar .btn { min-height: 40px; padding: .55rem 1rem; font-size: .74rem; letter-spacing: .14em; }
@media (max-width: 900px) { .nav a.nav-link { display: none; } }
@media (max-width: 480px) {
  .topbar .btn .long { display: none; } .topbar .btn .short { display: inline; }
  .eyebrow { letter-spacing: .26em; }
  .brand-name { font-size: .7rem; letter-spacing: .1em; }
  .topbar .btn { padding: .5rem .75rem; font-size: .66rem; letter-spacing: .1em; }
}
@media (max-width: 360px) { .brand-name { display: none; } }

/* ---------------------------------------------------------------------
   BARRA FISSA MOBILE
   --------------------------------------------------------------------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 49;
  display: none; gap: .6rem; padding: .7rem var(--gutter) calc(.7rem + env(safe-area-inset-bottom));
  background: rgba(4, 6, 10, .9); border-top: 1px solid var(--line);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transform: translateY(110%); transition: transform .45s var(--ease);
}
.dock .btn { flex: 1; min-height: 48px; padding: .7rem .8rem; font-size: .72rem; letter-spacing: .1em; }
.dock.show { transform: none; }
@media (max-width: 760px) { .dock { display: flex; } }

/* ---------------------------------------------------------------------
   COMPARSA PROGRESSIVA
   --------------------------------------------------------------------- */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------------------------------------------------------------------
   LIBRO 3D (copertina vera)
   --------------------------------------------------------------------- */
.book-stage { perspective: 1400px; display: flex; justify-content: center; }
.book {
  --w: 260px; --depth: 26px;
  position: relative; width: var(--w); aspect-ratio: 1738 / 2253;
  transform-style: preserve-3d;
  transform: rotateY(-26deg) rotateX(5deg);
  transition: transform 1s var(--ease);
}
.book:hover { transform: rotateY(-10deg) rotateX(2deg); }
.book-face, .book-spine, .book-pages, .book-back { position: absolute; }
.book-face { inset: 0; transform: translateZ(calc(var(--depth) / 2)); border-radius: 1px 4px 4px 1px; overflow: hidden; }
.book-face img { width: 100%; height: 100%; object-fit: cover; }
.book-face::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.14) 18%, rgba(255,255,255,0) 34%),
              linear-gradient(90deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 6%);
}
.book-spine {
  top: 0; left: 0; width: var(--depth); height: 100%;
  background: linear-gradient(90deg, #05080c, #1a2532 50%, #0a0f15);
  transform-origin: left center;
  transform: translateZ(calc(var(--depth) / -2)) rotateY(-90deg);
}
.book-pages {
  top: 3px; left: 0; width: var(--depth); height: calc(100% - 6px);
  background: repeating-linear-gradient(90deg, #e9e4d8 0 1px, #c9c2b2 1px 2px);
  transform-origin: left center;
  transform: translateX(calc(var(--w) - 2px)) translateZ(calc(var(--depth) / -2)) rotateY(-90deg);
}
.book-back { inset: 0; background: #070b10; transform: translateZ(calc(var(--depth) / -2)); border-radius: 1px 4px 4px 1px; }
.book-shadow {
  position: absolute; left: 8%; right: -6%; bottom: -26px; height: 40px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,.85), transparent 70%);
  filter: blur(6px); transform: translateZ(-40px);
}
.book-halo { position: absolute; inset: -18%; background: radial-gradient(circle, rgba(74,227,255,.16), transparent 62%); filter: blur(10px); transform: translateZ(-60px); }

/* ---------------------------------------------------------------------
   FORM
   --------------------------------------------------------------------- */
.field {
  width: 100%; min-height: 56px;
  background: rgba(3, 6, 10, .82);
  border: 1px solid rgba(190, 215, 240, .22);
  border-radius: var(--radius);
  padding: 1rem 1.2rem; color: #fff;
  font-family: var(--sans); font-size: 1rem;
  transition: border-color .3s, box-shadow .3s, background .3s;
}
.field::placeholder { color: #6f7b88; }
.field:focus { outline: none; border-color: var(--cyan); background: rgba(3,6,10,.95); box-shadow: 0 0 0 3px rgba(74,227,255,.14), 0 0 28px -6px var(--glow); }
.field[aria-invalid="true"] { border-color: #ff8f8f; }
.consent { display: flex; gap: .75rem; align-items: flex-start; font-size: .8rem; line-height: 1.55; color: var(--muted); cursor: pointer; }
.consent input { appearance: none; -webkit-appearance: none; flex-shrink: 0; width: 18px; height: 18px; margin-top: .12rem; border: 1px solid rgba(190,215,240,.4); border-radius: 2px; background: rgba(3,6,10,.8); display: grid; place-content: center; cursor: pointer; transition: border-color .2s, background .2s; }
.consent input::after { content: ""; width: 9px; height: 5px; border-left: 2px solid #05080c; border-bottom: 2px solid #05080c; transform: rotate(-45deg) translate(1px,-1px); opacity: 0; }
.consent input:checked { background: var(--cyan); border-color: var(--cyan); }
.consent input:checked::after { opacity: 1; }
.consent input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.consent a { color: var(--text); }
.form-msg { min-height: 1.3em; font-size: .85rem; color: #ffa5a5; }
.hp { position: absolute; left: -9999px; }

/* ---------------------------------------------------------------------
   OFFERTA DI LANCIO (compare solo se configurata)
   --------------------------------------------------------------------- */
.launch { display: none; }
.launch.on { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: .4rem .9rem; padding: .55rem 1rem; border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(74,227,255,.07); font-size: .8rem; color: var(--text); }
.launch .lp-label { color: var(--cyan); letter-spacing: .16em; text-transform: uppercase; font-size: .68rem; font-weight: 600; }
.launch .lp-price { color: #fff; font-weight: 600; }
.launch .lp-full { text-decoration: line-through; color: var(--dim); }
.launch .lp-time { font-variant-numeric: tabular-nums; color: var(--muted); }

/* ---------------------------------------------------------------------
   FOOTER
   --------------------------------------------------------------------- */
.footer { position: relative; z-index: 2; border-top: 1px solid var(--line); background: rgba(4,6,10,.92); padding: 2.6rem 0 calc(2.6rem + env(safe-area-inset-bottom)); font-size: .76rem; color: var(--dim); }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--silver); }
.footer-links { display: flex; gap: 1.4rem; flex-wrap: wrap; }
@media (max-width: 760px) { .footer { padding-bottom: calc(6rem + env(safe-area-inset-bottom)); } }

/* ---------------------------------------------------------------------
   MOVIMENTO RIDOTTO
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
