/* ============================================================
   Comfortables — Landing (hero scroll-driven "mise-en-place")
   Portato dal prototipo design `Comfortables Hero.dc.html`.

   Un coperto (tovagliolo, sottopiatto, piatto, piattino, briciole,
   forchetta/coltello/cucchiaio) si ricompone dal caos all'ordine mentre
   si scrolla. Tutto DOM/CSS/SVG: nessun canvas/WebGL, si scrubba sullo
   scroll dell'utente e degrada da solo (senza scroll resta il primo beat).

   Questo foglio è iniettato da Landing.vue solo mentre la route è montata.
   NON ridefinisce i token globali: la landing eredita l'identità dell'app
   (superfici, accento --ac, light+dark). Il font del design (Plus Jakarta Sans)
   è caricato da Landing.vue e applicato SOLO ai
   contenuti della landing (non alla navbar condivisa).
   ============================================================ */

/* ---------- font del design, scoped alla landing ---------- */
.landing-view {
  --lf-display: 'Plus Jakarta Sans', var(--f-display);
  --lf-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  /* palette scena (light) - brand board */
  --stage-1: #ffffff;
  --stage-2: #f3f4f6;
  --stage-3: #c5f6f0;
  --contact-shadow: rgba(31, 31, 31, 0.08);
}
[data-theme="dark"] .landing-view {
  /* palette scena (dark) - brand board */
  --stage-1: #263235;
  --stage-2: #1f1f1f;
  --stage-3: #0d1012;
  --contact-shadow: rgba(0, 0, 0, 0.5);
}

/* ============================================================
   HERO — stage sticky + stanza di scroll
   ============================================================ */
.hero-scroll {
  position: relative;
  width: 100%;
  height: 560vh;
}
.hero-stage {
  position: -webkit-sticky; /* WebKit/Safari vecchi (iOS ≤12) supportano sticky solo col prefisso */
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: radial-gradient(125% 95% at 50% 32%, var(--stage-1) 0%, var(--stage-2) 58%, var(--stage-3) 100%);
}

/* Fallback per browser SENZA position:sticky (IE11, vecchi WebKit): lo scrub scroll-driven
   richiede la sticky, quindi qui degrada a una schermata statica centrata col coperto (poster,
   frame finale) + messaggio e CTA finali. Gated da .no-sticky (rilevata in JS) perché IE11 non
   supporta @supports. Non tocca il path modern/responsive. */
.hero-scroll.no-sticky { height: auto; }
.hero-scroll.no-sticky .hero-stage { position: relative; height: 100vh; }
.hero-scroll.no-sticky .hero-canvas { display: none; }
.hero-scroll.no-sticky .hero-poster { opacity: 1 !important; }
.hero-scroll.no-sticky .beat-line,
.hero-scroll.no-sticky .scroll-hint,
.hero-scroll.no-sticky .timecode { display: none; }
/* !important: la copia finale deve restare visibile anche se per qualunque motivo
   l'overlay avesse scritto stili inline (nel path no-sticky l'engine non parte). */
.hero-scroll.no-sticky .final-head,
.hero-scroll.no-sticky .final-sub { opacity: 1 !important; transform: none !important; }
.hero-scroll.no-sticky .final-cta { opacity: 1 !important; transform: translateX(-50%) !important; }

/* ombra di contatto morbida sotto il coperto */
.contact-shadow {
  position: absolute;
  left: 50%;
  top: 55%;
  width: 700px;
  height: 540px;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, var(--contact-shadow), transparent 70%);
  filter: blur(10px);
  z-index: 0;
}

/* piano tavolo: dolly camera + DOF sul wrapper interno */
.table-layer {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 760px;
  height: 680px;
  transform: translate(-50%, -50%);
  z-index: 1;
}
.table-inner {
  position: absolute;
  inset: 0;
}

/* ---------- coperto fotorealistico (frame Blender scrubbate) ----------
   canvas e poster quadrati, centrati e sovrapposti: crossfade dal poster
   (placeholder/fallback) al canvas quando la prima frame è pronta. */
.hero-canvas,
.hero-poster {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 680px;
  height: 680px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.hero-poster {
  object-fit: contain;
  opacity: 1;
  transition: opacity 0.5s ease;
}
.hero-poster.is-hidden { opacity: 0; }
.hero-canvas {
  opacity: 0;
  transition: opacity 0.5s ease;
  will-change: opacity;
}
.hero-canvas.is-ready { opacity: 1; }

/* ============================================================
   OVERLAY — copy scrubbata
   ============================================================ */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  font-family: var(--lf-body);
}

.beat-line {
  position: absolute;
  left: 50%;
  width: 90%;
  margin: 0;
  text-align: center;
  font-family: var(--lf-display);
  color: var(--ink);
  text-wrap: balance;
  opacity: 0; /* stato p=0: evita il flash prima che applyOverlay() scriva lo stile */
  will-change: opacity, transform;
}
.beat-h1 {
  top: 13%;
  max-width: 820px;
  font-weight: 700;
  font-size: clamp(30px, 4.6vw, 62px);
  line-height: 1.04;
  letter-spacing: 0;
}
.beat-step {
  top: 14%;
  max-width: 760px;
  font-weight: 600;
  font-size: clamp(26px, 3.8vw, 50px);
  line-height: 1.05;
  letter-spacing: 0;
}

.final-head {
  position: absolute;
  left: 0;
  right: 0;
  top: 11.5%;
  margin: 0;
  text-align: center;
  font-family: var(--lf-display);
  font-weight: 700;
  font-size: clamp(32px, 4.8vw, 64px);
  line-height: 1.03;
  letter-spacing: 0;
  color: var(--ink);
  opacity: 0; /* stato p=0: evita il flash prima che applyOverlay() scriva lo stile */
  will-change: opacity, transform;
}
.final-sub {
  position: absolute;
  left: 0;
  right: 0;
  top: 20.5%;
  margin: 0;
  text-align: center;
  font-size: clamp(15px, 1.55vw, 20px);
  font-weight: 500;
  color: var(--ink-3);
  opacity: 0; /* stato p=0: evita il flash prima che applyOverlay() scriva lo stile */
  will-change: opacity, transform;
}
.final-cta {
  position: absolute;
  left: 50%;
  bottom: 11%;
  pointer-events: auto;
  opacity: 0; /* stato p=0: evita il flash prima che applyOverlay() scriva lo stile */
  will-change: opacity, transform;
}
.final-cta .arrow { transition: transform var(--dur) var(--ease); }
.final-cta:hover .arrow { transform: translateX(3px); }

/* hint di scroll */
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%);
  text-align: center;
  will-change: opacity;
}
.scroll-hint-label {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 600;
}
.scroll-hint-arrow {
  margin-top: 8px;
  font-size: 20px;
  color: var(--ink-4);
  animation: ctFloat 1.8s ease-in-out infinite;
}
@keyframes ctFloat {
  0%, 100% { transform: translateY(0); opacity: 0.9; }
  50% { transform: translateY(6px); opacity: 0.4; }
}

/* timecode */
.timecode {
  position: absolute;
  left: 30px;
  bottom: 26px;
  font-family: var(--lf-body);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-4);
  font-weight: 600;
}

/* scena più compatta sui piccoli schermi (px fissi del prototipo) */
@media (max-width: 860px) {
  .table-layer { transform: translate(-50%, -50%) scale(0.78); }
}
@media (max-width: 560px) {
  .table-layer { transform: translate(-50%, -50%) scale(0.58); }
  .timecode { left: 18px; bottom: 18px; }
  .scroll-hint { bottom: 30px; }
}

/* ============================================================
   CONTENUTO GROUNDED (sotto l'hero) — sezioni reali, ristilizzate
   ============================================================ */
.landing-content {
  position: relative;
  z-index: 5;
  background: var(--bg);
  font-family: var(--lf-body);
}
.landing-content .wrap { max-width: 1280px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 56px); }
.landing-content .section { padding: clamp(72px, 10vw, 130px) 0; }

.sec-head { max-width: 760px; margin: 0 auto; text-align: center; }
.sec-head h2 { font-family: var(--lf-display); font-size: clamp(30px, 4vw, 50px); font-weight: 700; letter-spacing: 0; margin: 16px 0 14px; }
.sec-head p { font-size: clamp(15px, 1.2vw, 18px); color: var(--ink-2); max-width: 56ch; margin: 0 auto; text-wrap: pretty; }

/* trust strip */
.trust-strip { list-style: none; display: flex; gap: 28px; margin-top: 34px; flex-wrap: wrap; padding: 0; }
.trust-strip li { display: flex; flex-direction: column; gap: 2px; }
.trust-strip--band { justify-content: center; text-align: center; gap: clamp(28px, 6vw, 72px); margin: 40px auto 0; }
.trust-strip--band li { align-items: center; }
.trust-num { font-family: var(--lf-display); font-size: var(--t-xl); font-weight: 700; letter-spacing: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.trust-lbl { font-size: var(--t-xs); color: var(--ink-3); max-width: 18ch; line-height: 1.3; }

/* feature ledger — righe pulite, niente card */
.ledger { max-width: 940px; margin: 56px auto 0; border-top: 1px solid var(--line); }
.ledger-row {
  display: grid; grid-template-columns: 56px 1fr; gap: 24px; align-items: start;
  padding: 30px 8px; border-bottom: 1px solid var(--line);
  transition: background var(--dur);
}
.ledger-row:hover { background: var(--bg-sunk); }
.ledger-ic {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--ac-soft); color: var(--ac-ink);
  display: grid; place-items: center; font-size: 19px;
}
.ledger-body h3 { font-family: var(--lf-display); font-size: var(--t-2xl); font-weight: 700; letter-spacing: 0; }
.ledger-body p { color: var(--ink-2); font-size: var(--t-md); margin-top: 8px; max-width: 60ch; line-height: 1.6; }
.ledger-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ledger-tags span {
  font-size: var(--t-xs); font-weight: 600; color: var(--ink-3);
  padding: 4px 10px; border: 1px solid var(--line); border-radius: var(--r-full);
}

/* pricing (le UNICHE card)
   Scoping sotto .price-grid: design-system.css ha un proprio .price-card
   (display:flex + border-bottom sulle li) che altrimenti si sovrappone. */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 1040px; margin: 56px auto 0; align-items: stretch; }
.price-grid .price-card {
  position: relative; padding: 32px; border: 1px solid var(--line); border-radius: var(--r-xl);
  background: var(--bg-elev); display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow-sm); transition: transform var(--dur), border-color var(--dur), box-shadow var(--dur);
}
.price-grid .price-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }

/* card "più scelto": superficie ink token-aware (inverte light/dark) */
.price-grid .price-card.most {
  background: var(--ink); border-color: var(--ink);
  box-shadow: var(--shadow-lg); transform: translateY(-10px);
}
.price-grid .price-card.most:hover { transform: translateY(-13px); }
.price-grid .price-card.most .pc-name,
.price-grid .price-card.most .pc-price,
.price-grid .price-card.most .pc-desc { color: var(--bg); }
.price-grid .price-card.most .pc-sub,
.price-grid .price-card.most ul li { color: var(--line-strong); }

.price-grid .price-card .ribbon {
  position: absolute; top: -11px; left: 28px; padding: 4px 12px; border-radius: var(--r-full);
  background: var(--ac); color: var(--ac-contrast); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.price-grid .price-card .pc-name { font-family: var(--lf-display); font-size: var(--t-lg); font-weight: 700; }
.price-grid .price-card .pc-price { font-family: var(--lf-display); font-size: clamp(34px, 4vw, 46px); font-weight: 700; letter-spacing: var(--tracking-tighter); font-variant-numeric: tabular-nums; }
.price-grid .price-card .pc-sub { font-size: var(--t-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.price-grid .price-card .pc-desc { color: var(--ink-2); font-size: var(--t-base); line-height: 1.55; }
.price-grid .price-card ul { list-style: none; display: flex; flex-direction: column; gap: 10px; flex: 1; margin: 4px 0 8px; padding: 0; }
.price-grid .price-card ul li {
  position: relative; display: block; padding: 0 0 0 26px; border-bottom: 0;
  font-size: var(--t-base); color: var(--ink-2); line-height: 1.4;
}
.price-grid .price-card ul li::before {
  content: ""; position: absolute; left: 2px; top: 5px; width: 13px; height: 7px;
  border-left: 2px solid var(--ac); border-bottom: 2px solid var(--ac); transform: rotate(-45deg);
}
.price-grid .price-card .btn { width: 100%; }
@media (max-width: 920px) { .price-grid { grid-template-columns: 1fr; max-width: 460px; } .price-grid .price-card.most { transform: none; } .price-grid .price-card.most:hover { transform: translateY(-3px); } }

.price-note { text-align: center; color: var(--ink-3); font-size: var(--t-sm); margin-top: 28px; }

/* footer */
.foot { border-top: 1px solid var(--line); background: var(--bg); position: relative; z-index: 5; padding: 72px 0 36px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; }
.foot .brand { display: flex; align-items: center; gap: 10px; font-family: var(--lf-display); font-weight: 600; font-size: 17px; letter-spacing: 0; color: var(--ink); }
.foot .brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--ac); color: var(--ac-contrast); display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.foot .brand b { font-weight: 700; }
.foot h4 { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-3); margin-bottom: 14px; font-weight: 700; }
.foot ul { list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: var(--t-sm); color: var(--ink-2); padding: 0; }
.foot ul a { color: inherit; text-decoration: none; transition: color var(--dur); }
.foot ul a:hover { color: var(--ink); }
.foot .about p { color: var(--ink-2); font-size: var(--t-sm); max-width: 320px; margin-top: 12px; line-height: 1.6; }
.foot-bottom {
  border-top: 1px solid var(--line); margin-top: 48px; padding-top: 22px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font-size: var(--t-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3);
}
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; gap: 28px; } }

/* reveal per il contenuto grounded */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   Reduced motion: hint statico e reveal immediati. Lo scrub della
   scena è guidato dallo scroll dell'utente (esente).
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .scroll-hint-arrow { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
