/* ============================================================
   Cremeria delle Valli — Scroll-scrub hero (self-contained)
   Scroll drives a webp frame sequence on a canvas; the headline
   resolves over the final frame. Drop-in: needs only the markup
   in index.html + hero-scrub.js.
   ============================================================ */

/* Font auto-ospitati (regola 1.11: nessuna risorsa di terze parti) */
@font-face{font-family:'Marcellus';src:url('fonts/Marcellus-400.woff2') format('woff2');
  font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:'DM Mono';src:url('fonts/DMMono-400.woff2') format('woff2');
  font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:'DM Mono';src:url('fonts/DMMono-500.woff2') format('woff2');
  font-weight:500;font-style:normal;font-display:swap}
@font-face{font-family:'EB Garamond';src:url('fonts/EBGaramond-400.woff2') format('woff2');
  font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:'EB Garamond';src:url('fonts/EBGaramond-500.woff2') format('woff2');
  font-weight:500;font-style:normal;font-display:swap}

:root{
  /* ===== Cremeria delle Valli — sistema cromatico ===== */
  /* neutri — la tela (70/20) */
  --panna:      #FAF6F0;   /* fondo pagina, listini */
  --panna-alt:  #FEFCF8;   /* card, sfondi soft */
  --cacao:      #1F1512;   /* testo, nav, hero scuro */
  --cacao-soft: #6A4A33;   /* testo secondario */
  /* accenti — dosati (10) */
  --oro:        #A87B2E;   /* CTA, filetti, icone — MAI testo su panna */
  --oro-scuro:  #8C6522;   /* hover oro */
  --cipria:     #E8B7C0;   /* linea cerimonie/wedding */
  --cipria-ink: #5C2F3B;   /* testo su cipria */
  --caramello:  #6B4A2C;   /* prezzi, link */
  --amarena:    #8E2F3A;   /* stagionale, dettagli */

  /* ===== alias legacy → nuovi token (retro-compatibilità) ===== */
  --ink:var(--cacao);
  --paper:var(--panna);
  --cream:var(--panna-alt);
  --gold:var(--oro);
  --gold-deep:var(--oro-scuro);
  --muted:var(--cacao-soft);
  --line:rgba(31,21,18,.14);

  --mono:'DM Mono',ui-monospace,SFMono-Regular,Menlo,monospace;
  /* il testo lungo si legge in serif: il mono resta per dati, etichette e bottoni */
  --lettura:'EB Garamond',ui-serif,'Iowan Old Style',Palatino,Georgia,serif;
  --serif:'Marcellus',Georgia,'Times New Roman',serif;
}

*{box-sizing:border-box}

.chero{height:340vh;position:relative;background:var(--ink)}
.chero-stage{position:sticky;top:0;height:100vh;height:100lvh;overflow:hidden;background:var(--ink)}
.chero-poster,.chero-stage canvas{position:absolute;inset:0;width:100%;height:100%}
.chero-poster{object-fit:cover;object-position:center}
/* Il poster verticale e' gia' inquadrato in 9:16: niente spostamento a destra
   (serviva col vecchio ritaglio dal 16:9). Resto poco sopra la meta', come il
   fuoco del canvas in hero-scrub.js, per i formati piu' larghi del 9:16. */
@media (orientation:portrait){ .chero-poster{object-position:50% 42%} }
.chero-stage canvas{display:block}

.chero-shade{position:absolute;inset:0;z-index:4;opacity:0;transition:opacity .12s linear;
  background:radial-gradient(ellipse at 50% 56%, rgba(30,16,8,.45) 0%, rgba(20,10,4,.9) 74%)}

.chero-overlay{position:absolute;inset:0;z-index:5;display:flex;align-items:center;justify-content:center;
  text-align:center;padding:96px 24px 40px;opacity:0;pointer-events:none}
.chero-inner{max-width:780px}
.chero-eyebrow{display:inline-flex;align-items:center;gap:12px;font-family:var(--mono);font-size:11px;
  letter-spacing:.32em;text-transform:uppercase;color:#f6dfa4;margin-bottom:22px}
.chero-eyebrow::before,.chero-eyebrow::after{content:'';width:30px;height:1px;background:rgba(246,223,164,.7)}
.chero-h1{font-family:var(--serif);font-weight:400;font-size:clamp(40px,7.4vw,86px);line-height:1.02;
  letter-spacing:-.01em;color:#fff;text-shadow:0 4px 40px rgba(0,0,0,.5)}
.chero-h1 em{color:#f4c968;font-style:italic}
.chero-lead{max-width:600px;margin:24px auto 0;font-size:clamp(15px,2.3vw,19px);font-weight:300;line-height:1.6;
  color:rgba(255,255,255,.92);text-shadow:0 2px 20px rgba(0,0,0,.5)}
.chero-lead strong{color:#f4d488;font-weight:500}
.chero-ctas{display:flex;gap:14px;justify-content:center;flex-wrap:wrap;margin-top:34px}
.chero-btn{padding:14px 28px;border-radius:100px;font-size:14px;font-weight:600;text-decoration:none;
  display:inline-flex;align-items:center;gap:9px;
  transition:transform .2s,background .2s,border-color .2s;font-family:inherit;cursor:pointer}
.chero-btn svg{width:17px;height:17px;flex:none}
.chero-btn-primary{background:var(--gold);color:#2a1a12;border:1px solid var(--gold)}
.chero-btn-primary:hover{background:#dcab3d;border-color:#dcab3d;transform:translateY(-2px)}
.chero-btn-ghost{background:rgba(255,255,255,.06);color:#fff;border:1px solid rgba(255,255,255,.45)}
.chero-btn-ghost:hover{background:#fff;color:#2a1a12;transform:translateY(-2px)}

.chero-meta{margin:22px auto 0;font-family:var(--mono);font-size:12px;letter-spacing:.04em;line-height:1.6;
  color:rgba(255,255,255,.78);text-shadow:0 2px 14px rgba(0,0,0,.5);max-width:520px}
@media (max-width:600px){.chero-meta{font-size:11px}}

.chero-hint{position:absolute;bottom:30px;left:50%;transform:translateX(-50%);z-index:6;display:flex;flex-direction:column;
  align-items:center;gap:8px;color:#fff;opacity:.85;transition:opacity .4s;font-family:var(--mono)}
.chero-hint.hidden{opacity:0;pointer-events:none}
.chero-hint span:first-child{font-size:10px;letter-spacing:.3em;text-transform:uppercase}
.chero-chevron{width:14px;height:14px;border-right:2px solid var(--gold);border-bottom:2px solid var(--gold);
  transform:rotate(45deg);animation:cheroBob 1.6s infinite}
@keyframes cheroBob{0%,100%{transform:rotate(45deg) translate(0,0);opacity:.5}50%{transform:rotate(45deg) translate(4px,4px);opacity:1}}

.chero-skip{position:absolute;right:18px;bottom:26px;z-index:6;background:rgba(20,10,4,.55);color:rgba(255,255,255,.75);
  border:1px solid rgba(255,255,255,.28);border-radius:100px;padding:9px 16px;font-size:12px;font-weight:600;cursor:pointer;
  font-family:inherit;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);transition:color .2s,border-color .2s,opacity .4s}
.chero-skip:hover{color:#fff;border-color:var(--gold)}
.chero-skip.hidden{opacity:0;pointer-events:none}

.chero-load{position:absolute;left:0;right:0;bottom:0;height:2px;z-index:7;background:rgba(255,255,255,.08);opacity:1;transition:opacity .6s}
.chero-load.done{opacity:0}
.chero-load div{height:100%;width:0%;background:var(--gold);transition:width .25s}

/* static fallback: first frame + headline immediately */
.chero-static .chero{height:100vh;height:100svh}
.chero-static .chero-stage canvas,
.chero-static .chero-hint,.chero-static .chero-skip,.chero-static .chero-load{display:none}
.chero-static .chero-shade{opacity:.55}
.chero-static .chero-overlay{opacity:1;pointer-events:auto;transform:none}
.chero-stalled .chero-shade{opacity:.6}
.chero-stalled .chero-overlay{opacity:1!important;pointer-events:auto;transform:none!important}

@media (max-width:900px){.chero{height:320vh}}
@media (max-width:600px){.chero{height:280vh}.chero-overlay{padding:88px 20px 36px}.chero-eyebrow{letter-spacing:.24em}}
