/* =========================================================
   BIRRA FENICE — Home v1.12 «Dal fuoco, la Fenice»
   Solo la home carica questo file. Le altre pagine restano su
   styles.css; qui ci sono il teatro delle birre (apertura, cinque
   scene, finale) e le sezioni che seguono.

   Regole:
   - senza la classe .th--anim (niente JavaScript, o "riduci
     movimento") il teatro è una sequenza di sezioni normali;
   - con .th--anim la scena è fissata (sticky) e cambia con lo
     scorrimento; le variabili --hp/--lp/--fp arrivano da js/teatro.js;
   - mentre c'è la schermata dell'età (html[data-eta]) le animazioni
     d'ingresso restano ferme e partono quando la pagina si scopre.
   ========================================================= */

.home { --th-ease: cubic-bezier(.2, .8, .2, 1); --th-swipe: cubic-bezier(.75, 0, .2, 1); }
.home .reveal { transition-delay: calc(var(--d, 0) * 110ms); }
html[data-eta] .th-in,
html[data-eta] .th-logo-img,
html[data-eta] .th-sheen { animation-play-state: paused !important; }

/* ---------------------------------------------------------
   TEATRO — struttura
   --------------------------------------------------------- */
.th { position: relative; padding: 0; overflow: visible; background: #160205; color: var(--on-wine); }
.th-stage { position: relative; --cx: 50%; --cy: 51%; --gy: 27%; --sc-ink: var(--on-wine); --extra: 0px; }
.th-scene { position: relative; }
.th-scene--hero { height: calc(100svh - var(--header-h)); min-height: 560px; overflow: hidden; isolation: isolate; }

.th--anim .th-stage {
  position: sticky; top: var(--header-h);
  height: calc(100svh - var(--header-h)); min-height: 540px;
  overflow: hidden; isolation: isolate;
}
.th--anim .th-scene {
  position: absolute; inset: 0; z-index: 0; overflow: hidden; isolation: isolate;
  visibility: hidden; clip-path: circle(0% at var(--cx) var(--cy));
}
.th--anim .th-scene.is-active {
  z-index: 2; visibility: visible; clip-path: circle(150% at var(--cx) var(--cy));
  transition: clip-path .95s var(--th-swipe), visibility 0s;
}
.th--anim .th-scene.is-under { z-index: 1; visibility: visible; clip-path: circle(150% at var(--cx) var(--cy)); }
.th--anim .th-finale { clip-path: inset(0 0 0 100%); }
.th--anim .th-finale.is-active { clip-path: inset(0 0 0 0); }
.th--anim .th-finale.is-under { clip-path: inset(0 0 0 0); }
.th--anim .th-slot { display: none; }

/* Grana comune */
.th-scene::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: var(--grain); opacity: .05;
}

/* ---------------------------------------------------------
   APERTURA
   --------------------------------------------------------- */
.th-scene--hero {
  background:
    radial-gradient(60% 55% at 50% 64%, rgba(222, 120, 48, .30), transparent 70%),
    radial-gradient(120% 90% at 50% 105%, #8a1520 0%, #4a060f 38%, #1f0307 72%, #120104 100%);
}
.th-embers { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }


/* Apertura: tutto in colonna, al centro, con il logo protagonista */
.th-hero-center {
  position: absolute; z-index: 6; left: 0; right: 0; top: 0; bottom: var(--extra);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(12px, 2.2vh, 24px); padding: 3vh var(--gutter) 5vh; text-align: center;
}
.th-hero-text { transform: translate3d(0, calc(var(--hp, 0) * -36px), 0); opacity: clamp(0, calc(1 - var(--hp, 0) * 2.6), 1); }
.th-hero-center .eyebrow { color: var(--gold-300); margin: 0; justify-content: center; }
.th-hero-center .hero-title {
  color: var(--on-wine); margin: 0; max-width: 24ch;
  font-size: clamp(1.45rem, 1rem + 1.25vw, 2.25rem); line-height: 1.12; font-weight: 500; text-wrap: balance;
}
.th-hero-center .hero-title em { color: var(--gold-300); }
.th-hero-center .hero-actions { justify-content: center; margin: 4px 0 0; }

/* Il logo: immagine normale + tela WebGL sopra (quando c'è, l'immagine si nasconde) */
.th-logo {
  position: relative; flex: none;
  width: min(42vw, calc(48vh * 1.128), 560px); aspect-ratio: 1717 / 1522;
  transform: scale(calc(1 + var(--hp, 0) * .06));
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .45)) drop-shadow(0 0 60px rgba(214, 140, 60, .18));
}
.th-logo-img, .th-logo-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.th-logo-img { object-fit: contain; animation: th-rinasce 1.6s var(--th-ease) .3s both; opacity: calc(1 - var(--hp, 0) * 1.5); }
.th-logo.gl-on .th-logo-img { visibility: hidden; animation: none; }
.th-logo-gl { pointer-events: none; }
@keyframes th-rinasce { from { opacity: 0; filter: blur(14px) brightness(1.6); transform: translateY(18px) scale(.96); } to { opacity: 1; filter: none; transform: none; } }

.th-in { animation: th-su .95s var(--th-ease) both; animation-delay: calc(.9s + var(--d, 0) * 120ms); }
/* filter: opacity() e non opacity: così la dissolvenza allo scorrimento (opacity) resta libera */
@keyframes th-su { from { filter: opacity(0); translate: 0 28px; } to { filter: opacity(1); translate: 0 0; } }

.th-cue {
  position: absolute; z-index: 6; right: max(var(--gutter), calc((100vw - var(--maxw)) / 2 + var(--gutter))); bottom: calc(7% + var(--extra));
  width: 116px; height: 116px; display: grid; place-items: center; color: var(--gold-200); border-radius: 50%;
  opacity: calc(1 - var(--hp, 0) * 2);
}
.th-cue-ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: th-gira 22s linear infinite; }
.th-cue-ring text { font-family: var(--font-body); font-size: 9.6px; letter-spacing: .2em; text-transform: uppercase; fill: currentColor; font-weight: 600; }
.th-cue-arrow { width: 26px; height: 26px; animation: th-ondeggia 2.4s var(--ease-in-out) infinite; }
.th-cue:hover { color: #fff; }
.th-cue:focus-visible { outline: 2px solid var(--gold-300); outline-offset: 4px; }
@keyframes th-gira { to { rotate: 360deg; } }
@keyframes th-ondeggia { 50% { translate: 0 6px; } }

/* ---------------------------------------------------------
   BOTTIGLIE (strato comune sopra le scene)
   --------------------------------------------------------- */
.th-bottles { position: absolute; z-index: 5; inset: 0; pointer-events: none; }
.th:not(.th--anim) .th-bottles { bottom: auto; height: calc(100svh - var(--header-h)); min-height: 560px; }
.th-bottle {
  position: absolute; left: var(--cx); top: var(--cy);
  height: 73%; aspect-ratio: 338 / 900; translate: -50% -50%;
  --acc: #e9a24c;
}
.th-float { position: absolute; inset: 0; display: block; }
/* Nell'apertura la Solita non c'è: sale mentre il logo brucia (--hp) */
.th:not(.th--anim) .th-scene--hero ~ .th-bottles .th-bottle,
.th:not(.th--anim) > .th-stage > .th-bottles { display: none; }
.th-bottle img { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 34px 26px rgba(0, 0, 0, .38)); }
.th-halo {
  /* resta dentro la colonna centrale: lo strato delle bottiglie sta sopra i testi */
  position: absolute; z-index: 0; inset: 10% -38% 6%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--acc) 55%, transparent), transparent 75%);
  opacity: .5; filter: blur(6px);
}
.th-bottles[data-pos="apertura"] .th-halo { background: radial-gradient(closest-side, rgba(255, 170, 80, .55), transparent 72%); opacity: .9; }
.th-bottles[data-pos="apertura"] .th-bottle.is-shine .th-sheen { animation: none; }
.th-sheen {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat;
  background: linear-gradient(102deg, transparent 38%, rgba(255, 246, 225, .65) 48%, rgba(255, 255, 255, .0) 58%);
  background-size: 280% 100%; background-position: 130% 0; opacity: 0; mix-blend-mode: screen;
}
.th-bottle.is-shine .th-sheen { animation: th-luce 1.6s cubic-bezier(.4, 0, .2, 1) .5s both; }
@keyframes th-luce { 0% { opacity: 0; background-position: 130% 0; } 18% { opacity: 1; } 100% { opacity: 0; background-position: -40% 0; } }
.th-floor {
  position: absolute; left: 50%; bottom: -3%; width: 150%; height: 8%; translate: -50% 0; z-index: 0;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .5), transparent); filter: blur(3px);
}

.th--anim .th-bottle {
  opacity: 0; transform: translate3d(0, 18%, 0) rotate(7deg) scale(.9);
  transition: transform 1s var(--th-ease) .1s, opacity .55s ease .1s, translate .95s var(--th-swipe), scale .95s var(--th-swipe);
}
.th--anim .th-bottle.da-sopra { transform: translate3d(0, -18%, 0) rotate(-7deg) scale(.9); transition: none; }
.th--anim .th-bottle.da-sotto { transition: none; }
.th--anim .th-bottle.is-active { opacity: 1; transform: none; }
.th--anim .th-bottle.is-gone { opacity: 0; transform: translate3d(0, -14%, 0) rotate(-5deg) scale(.94); transition: transform .65s cubic-bezier(.5, 0, .75, 0), opacity .45s ease; }
.th--anim .th-bottle.is-gone.is-gone-giu { transform: translate3d(0, 16%, 0) rotate(5deg) scale(.94); }
.th--anim .th-float { transform: translate3d(0, calc((var(--lp, 0) - .5) * -3.5%), 0) rotate(calc((var(--lp, 0) - .5) * -2.2deg)); }
.th--anim .th-bottles[data-pos="apertura"] .th-float {
  transform: translate3d(0, calc((1 - var(--hp, 0)) * 55%), 0) scale(calc(.9 + var(--hp, 0) * .1));
  opacity: clamp(0, calc((var(--hp, 0) - .18) * 1.8), 1);
}

/* ---------------------------------------------------------
   SCENE DELLE BIRRE
   --------------------------------------------------------- */
.th-beer {
  background-color: var(--bg); color: var(--ink);
  background-image:
    radial-gradient(42% 58% at var(--cx) var(--cy), rgba(255, 255, 255, .24), transparent 70%),
    radial-gradient(130% 100% at 50% 50%, transparent 52%, rgba(0, 0, 0, .26));
}
.th-ghost {
  position: absolute; left: 0; right: 0; top: var(--gy); z-index: 0;
  display: flex; justify-content: center; white-space: nowrap; pointer-events: none;
  font-family: var(--font-display); font-weight: 800; line-height: .8; letter-spacing: -.035em;
  font-size: min(19vw, calc(132vw / var(--len, 6)), 22rem);
  color: color-mix(in srgb, var(--ink) 7%, transparent);
  -webkit-text-stroke: 1.2px color-mix(in srgb, var(--ink) 26%, transparent);
  transform: translate3d(calc((.5 - var(--lp, .5)) * 12vw), -50%, 0);
}
.th-ghost span { display: inline-block; }
.th--anim .th-ghost span { opacity: 0; translate: 0 32%; transition: opacity .6s ease, translate 1s var(--th-ease); transition-delay: calc(.22s + var(--k, 0) * 45ms); }
.th--anim .is-active .th-ghost span { opacity: 1; translate: 0 0; }

/* Cornice a capsula con il doppio filetto delle etichette */
.th-frame {
  position: absolute; left: var(--cx); top: var(--cy); z-index: 1; translate: -50% -50%;
  height: 86%; aspect-ratio: .5; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent);
  outline: 1px solid color-mix(in srgb, var(--ink) 16%, transparent); outline-offset: -9px;
  pointer-events: none;
}
.th--anim .th-frame { opacity: 0; scale: .92; transition: opacity .8s ease .35s, scale 1.1s var(--th-ease) .3s; }
.th--anim .is-active .th-frame { opacity: 1; scale: 1; }

.th-meta, .th-text { position: absolute; z-index: 6; }
.th-beer p, .th-beer dd, .th-beer dt { color: inherit; } /* styles.css colora i paragrafi con l'inchiostro scuro */
.th-meta {
  left: max(var(--gutter), calc((100vw - var(--maxw)) / 2 + var(--gutter)));
  top: var(--cy); translate: 0 -50%; width: min(31vw, 420px);
}
.th-count { margin: 0 0 6px; display: flex; align-items: baseline; gap: 10px; font-family: var(--font-display); font-size: clamp(2.6rem, 1.6rem + 3vw, 5.2rem); line-height: .9; font-weight: 300; font-variant-numeric: tabular-nums; }
.th-count small { font-family: var(--font-body); font-size: .8rem; letter-spacing: .18em; opacity: .7; font-weight: 600; }
.th-name { margin: 0; color: inherit; font-size: clamp(2.6rem, 1.4rem + 4.2vw, 6rem); line-height: .92; font-weight: 600; letter-spacing: -.02em; }
.th-style { margin: 14px 0 0; font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 600; opacity: .88; }
.th-style i { font-style: normal; opacity: .6; padding-inline: 4px; }
.th-note { margin: 10px 0 0; font-family: var(--font-display); font-style: italic; font-size: 1.2rem; opacity: .95; }
.th-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 0; min-height: 0; }
.th-tags:empty { display: none; }
.th-tag {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700;
  padding: 6px 10px; border-radius: var(--r-pill); border: 1px solid currentColor;
}
.th-tag--esaurita { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.th-line { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.th-line > span { display: inline-block; }
.th-count .th-line { display: inline-block; }
.th--anim .th-line > span { translate: 0 112%; transition: translate .95s var(--th-ease); transition-delay: calc(.3s + var(--i, 0) * 75ms); }
.th--anim .is-active .th-line > span { translate: 0 0; }
.th-count { --i: 0; } .th-name { --i: 1; } .th-style { --i: 2; } .th-note { --i: 3; }

.th-text {
  right: max(var(--gutter), calc((100vw - var(--maxw)) / 2 + var(--gutter)));
  top: var(--cy); translate: 0 -50%; width: min(27vw, 370px);
}
.th--anim .th-text { opacity: 0; transform: translate3d(0, 26px, 0); transition: opacity .7s ease .5s, transform 1s var(--th-ease) .45s; }
.th--anim .is-active .th-text { opacity: 1; transform: none; }
.th-beer .th-desc { margin: 0 0 22px; font-size: 1rem; line-height: 1.65; color: color-mix(in srgb, var(--ink) 90%, transparent); }
.th-breve { display: none; }
.th-facts { margin: 0 0 26px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; border-top: 1px solid color-mix(in srgb, var(--ink) 28%, transparent); }
.th-facts div { padding: 12px 0; border-bottom: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); }
.th-facts .th-facts-wide { grid-column: 1 / -1; }
.th-facts dt { font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; opacity: .72; margin-bottom: 4px; }
.th-facts dd { margin: 0; font-size: .95rem; }
.th-link {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px;
  border-radius: var(--r-pill); border: 1.5px solid var(--ink); color: var(--ink);
  font-weight: 600; font-size: .92rem; text-decoration: none;
  transition: background-color .3s, color .3s, gap .3s var(--ease);
}
.th-link svg { width: 18px; height: 18px; }
.th-link:hover { background: var(--ink); color: var(--bg); gap: 14px; }
.th-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Indice delle birre */
.th-rail {
  position: absolute; z-index: 7; left: 50%; bottom: 14px; translate: -50% 0;
  display: flex; gap: 4px; color: var(--sc-ink);
  transition: opacity .5s ease, color .6s ease;
}
.th--anim .th-rail { opacity: 0; pointer-events: none; }
.th--anim .th-rail.is-on { opacity: 1; pointer-events: auto; }
.th:not(.th--anim) .th-rail { display: none; }
.th-rail-btn {
  position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 8px;
  min-height: 44px; min-width: 96px; padding: 8px 10px 10px; border: 0; background: none; color: inherit;
  font: 600 .74rem/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; cursor: pointer;
  opacity: .62; transition: opacity .3s;
}
.th-rail-btn:hover, .th-rail-btn[aria-current="true"] { opacity: 1; }
.th-rail-num { font-family: var(--font-display); font-weight: 400; letter-spacing: 0; font-size: .9rem; opacity: .75; }
.th-rail-name { text-align: left; }
.th-rail-bar { grid-column: 1 / -1; position: relative; height: 2px; margin-top: 8px; background: color-mix(in srgb, currentColor 26%, transparent); border-radius: 2px; overflow: hidden; }
.th-rail-bar span { position: absolute; inset: 0; background: currentColor; transform-origin: 0 50%; transform: scaleX(var(--fill, 0)); }
.th-rail-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 6px; }

/* ---------------------------------------------------------
   FINALE: la famiglia in fila
   --------------------------------------------------------- */
.th-finale {
  background: radial-gradient(80% 60% at 50% 100%, var(--paper-3), var(--paper) 60%);
  color: var(--ink); text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(14px, 3vh, 34px);
  padding: 3vh var(--gutter);
}
.th-fin-head .eyebrow { justify-content: center; }
.th-fin-head h2 { margin: 0 0 10px; font-size: clamp(2.1rem, 1.3rem + 3vw, 4rem); }
.th-fin-head .lede { margin: 0 auto; }
.th-fin-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 190px)); align-items: start; justify-content: center; gap: clamp(6px, 2vw, 32px); }
.th-fin-row a { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 4px; color: var(--ink); text-decoration: none; border-radius: var(--r-md); padding: 6px 4px; }
.th-fin-bottle { position: relative; display: block; height: clamp(150px, 38vh, 380px); aspect-ratio: 338 / 900; transition: translate .5s var(--th-ease), rotate .5s var(--th-ease); }
.th-fin-bottle::before {
  content: ""; position: absolute; left: 50%; bottom: -2%; width: 170%; aspect-ratio: 3.2; translate: -50% 40%;
  border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--bg) 70%, transparent), transparent);
}
.th-fin-bottle img { position: relative; width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 18px 16px rgba(51, 4, 9, .28)); }
.th-fin-name { margin-top: 14px; font-family: var(--font-display); font-size: clamp(1rem, .8rem + .7vw, 1.4rem); font-weight: 600; color: var(--wine-700); }
.th-fin-style { font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.th-fin-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; min-height: 22px; }
.th-fin-tags .th-tag { font-size: 11px; padding: 4px 8px; letter-spacing: .08em; color: var(--wine-700); }
.th-fin-tags .th-tag--esaurita { background: var(--wine-700); color: var(--on-wine); border-color: var(--wine-700); }
.th-fin-row a:hover .th-fin-bottle, .th-fin-row a:focus-visible .th-fin-bottle { translate: 0 -12px; rotate: -2.5deg; }
.th-fin-row a:focus-visible { outline: 2px solid var(--wine-700); outline-offset: 2px; }
.th--anim .th-fin-row li { opacity: 0; translate: 0 60px; transition: opacity .6s ease, translate 1.05s var(--th-ease); transition-delay: calc(.4s + var(--k, 0) * 90ms); }
.th--anim .th-finale.is-active li { opacity: 1; translate: 0 0; }
.th--anim .th-fin-head, .th--anim .th-fin-cta { opacity: 0; translate: 0 22px; transition: opacity .7s ease .3s, translate .9s var(--th-ease) .25s; }
.th--anim .th-finale.is-active .th-fin-head, .th--anim .th-finale.is-active .th-fin-cta { opacity: 1; translate: 0 0; }
.th--anim .th-finale.is-active .th-fin-cta { transition-delay: .9s; }

/* ---------------------------------------------------------
   Intestazione mentre si è nel teatro: prende il colore della scena
   --------------------------------------------------------- */
.site-header { transition: background-color .6s ease, border-color .25s, box-shadow .25s; }
.site-header.th-head {
  background: color-mix(in srgb, var(--th-bg, #1a0306) 94%, transparent);
  border-bottom-color: color-mix(in srgb, var(--th-ink, #fff) 14%, transparent); box-shadow: none;
}
.site-header.th-head .brand-name,
.site-header.th-head .brand-sub,
.site-header.th-head .main-nav a,
.site-header.th-head .main-nav a[aria-current="page"],
.site-header.th-head .nav-toggle,
.site-header.th-head .cart-btn { color: var(--th-ink); transition: color .6s ease; }
.site-header.th-head .brand-sub { opacity: .75; }
.site-header.th-head .cart-btn { border-color: color-mix(in srgb, var(--th-ink) 40%, transparent); }
.site-header.th-head .cart-btn:hover { background: color-mix(in srgb, var(--th-ink) 12%, transparent); }
.site-header.th-head .cart-badge { border-color: var(--th-bg); }
.site-header.th-head[data-scuro="1"] .brand-mark { filter: brightness(0) invert(.93) sepia(.25); }

/* ---------------------------------------------------------
   Teatro statico (niente JavaScript, o "riduci movimento")
   --------------------------------------------------------- */
.th:not(.th--anim) .th-beer {
  display: grid; gap: 28px; align-items: center; overflow: hidden;
  padding: clamp(56px, 8vw, 96px) var(--gutter);
}
.th:not(.th--anim) .th-meta, .th:not(.th--anim) .th-text { position: relative; left: auto; right: auto; top: auto; translate: none; width: auto; }
.th:not(.th--anim) .th-frame { display: none; }
.th:not(.th--anim) .th-ghost { top: 50%; }
.th-slot { position: relative; z-index: 4; justify-self: center; }
.th:not(.th--anim) .th-slot .th-bottle { position: relative; left: auto; top: auto; translate: none; height: clamp(340px, 52vh, 520px); }
.th:not(.th--anim) .th-finale { padding-block: clamp(64px, 9vw, 110px); }
@media (min-width: 960px) {
  .th:not(.th--anim) .th-beer { grid-template-columns: 1fr auto 1fr; max-width: calc(var(--maxw) + 2 * var(--gutter)); margin-inline: auto; }
  .th:not(.th--anim) .th-beer { max-width: none; padding-inline: max(var(--gutter), calc((100vw - var(--maxw)) / 2 + var(--gutter))); }
  .th:not(.th--anim) .th-meta { grid-column: 1; }
  .th:not(.th--anim) .th-slot { grid-column: 2; grid-row: 1; }
  .th:not(.th--anim) .th-text { grid-column: 3; grid-row: 1; }
}

/* ---------------------------------------------------------
   TABLET E SMARTPHONE: impaginazione pensata in verticale
   --------------------------------------------------------- */
@media (max-width: 959.98px) {
  .th-stage { --cy: 58%; --gy: 52%; }
  .th-logo { width: min(80vw, calc(42vh * 1.128), 460px); }
  .th-hero-center .hero-title { font-size: clamp(1.35rem, .9rem + 3vw, 1.9rem); }
  .th-hero-center .hero-actions { gap: 10px; }
  .th-hero-center .hero-actions .btn { min-height: 46px; padding-inline: 18px; }
  .th-cue { display: none; }

  .th-bottle { height: 46%; }
  .th-frame { height: 55%; }
  .th-ghost { font-size: min(30vw, calc(150vw / var(--len, 6))); }
  .th-meta { left: var(--gutter); right: var(--gutter); top: 64px; translate: none; width: auto; }
  .th-count { font-size: 1.9rem; margin-bottom: 2px; }
  .th-name { font-size: clamp(2.2rem, 1.2rem + 6vw, 3.6rem); }
  .th-style { margin-top: 8px; font-size: 11px; letter-spacing: .14em; }
  .th-note { font-size: 1rem; margin-top: 4px; }
  .th-tags { position: absolute; right: 0; top: 0; margin: 0; flex-direction: column; align-items: flex-end; }
  .th-text { left: var(--gutter); right: var(--gutter); top: auto; bottom: 18px; translate: none; width: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
  .th-desc, .th-facts { display: none; }
  .th-breve { display: block; margin: 0; flex: 1 1 100%; font-size: .92rem; line-height: 1.5; text-wrap: pretty; }
  .th-link { min-height: 44px; padding: 0 18px; font-size: .86rem; }

  .th-rail { left: var(--gutter); right: var(--gutter); bottom: auto; top: 10px; translate: none; gap: 6px; }
  .th-rail-btn { flex: 1; min-width: 0; padding: 6px 0 8px; grid-template-columns: 1fr; font-size: 11px; letter-spacing: .02em; }
  .th-rail-num { display: none; }
  .th-rail-name { text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .th-rail-bar { margin-top: 6px; }

  .th-fin-row { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; width: 100%; }
  .th-fin-row li { min-width: 0; }
  .th-fin-row a { padding-inline: 0; }
  .th-fin-bottle { height: auto; width: min(100%, 15vh); }
  .th-fin-name { font-size: .92rem; margin-top: 10px; }
  .th-fin-style { display: none; }
  .th-fin-tags { flex-direction: column; align-items: center; }
  .th-fin-tags .th-tag { font-size: 11px; line-height: 1.1; padding: 3px 5px; letter-spacing: 0; text-transform: none; font-weight: 600; max-width: 100%; }

  .th:not(.th--anim) .th-beer { grid-template-columns: 1fr; text-align: left; }
  .th:not(.th--anim) .th-tags { position: static; flex-direction: row; margin-top: 12px; }
  .th:not(.th--anim) .th-slot .th-bottle { height: clamp(300px, 46vh, 420px); }
}
@media (max-width: 959.98px) and (max-height: 700px) {
  .th-stage { --cy: 55%; }
  .th-bottle { height: 38%; }
  .th-frame { height: 46%; }
  .th-note { display: none; }
}
/* Tablet in verticale: più spazio, testi più ampi */
@media (min-width: 600px) and (max-width: 959.98px) {
  .th-text { right: auto; width: min(520px, 80vw); }
  .th-rail-btn { font-size: .7rem; letter-spacing: .1em; }
}
@media (max-width: 380px) {
  .th-hero-center .hero-actions .btn { padding-inline: 14px; font-size: .86rem; }
}

/* ---------------------------------------------------------
   NASTRO
   --------------------------------------------------------- */
.home-ribbon { background: var(--wine-800); color: var(--gold-200); border-block-color: var(--wine-700); }
.home-ribbon span { font-size: clamp(1.6rem, 1rem + 2.4vw, 3rem); padding: 18px 28px; font-weight: 400; }
.home-ribbon i { color: var(--gold-500); }

/* ---------------------------------------------------------
   MANIFESTO
   --------------------------------------------------------- */
.hm-manifesto { padding-block: clamp(84px, 13vw, 180px) clamp(72px, 10vw, 140px); background: var(--paper); }
.hm-manifesto-title { font-size: clamp(1.1rem, 1rem + .6vw, 1.5rem); font-weight: 500; color: var(--ink-2); margin: 10px 0 26px; }
.hm-manifesto-title em { color: var(--gold-700); }
.hm-words {
  margin: 0 0 clamp(56px, 8vw, 104px); max-width: 21ch;
  font-family: var(--font-display); font-weight: 500; letter-spacing: -.02em;
  font-size: clamp(2.1rem, 1.1rem + 4.4vw, 5.4rem); line-height: 1.04; color: var(--wine-800);
}
.hm-words em { color: var(--gold-700); }
/* Parole "spente": attenuate ma sempre leggibili (contrasto ≥ 3:1, testo grande) */
.hm-words.is-split .hm-w { color: color-mix(in srgb, var(--wine-800) 50%, var(--paper)); transition: color .45s ease; }
.hm-words.is-split em .hm-w { color: color-mix(in srgb, var(--gold-800) 66%, var(--paper)); }
.hm-words.is-split .hm-w.is-lit { color: var(--wine-800); }
.hm-words.is-split em .hm-w.is-lit { color: var(--gold-700); }
.hm-pillars { list-style: none; margin: 0 0 40px; padding: 0; display: grid; gap: 0; }
.hm-pillar { position: relative; padding: 26px 0 28px; display: grid; grid-template-columns: 56px 1fr; gap: 6px 18px; }
.hm-pillar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line-strong); transform-origin: 0 50%; transform: scaleX(0); transition: transform 1.2s var(--th-ease) calc(var(--d, 0) * 120ms); }
.hm-pillar.is-visible::before { transform: scaleX(1); }
.hm-pillar-num { grid-row: span 2; font-family: var(--font-display); font-style: italic; font-size: 2.2rem; line-height: 1; color: var(--gold-600); }
.hm-pillar h3 { margin: 0; font-size: 1.25rem; }
.hm-pillar p { margin: 0; color: var(--ink-2); font-size: .97rem; }
@media (min-width: 900px) {
  .hm-pillars { grid-template-columns: repeat(3, 1fr); gap: 0 40px; }
  .hm-pillar { grid-template-columns: 1fr; padding-top: 30px; }
  .hm-pillar-num { grid-row: auto; font-size: 3rem; margin-bottom: 14px; }
}

/* ---------------------------------------------------------
   CONFEZIONI
   --------------------------------------------------------- */
.hm-packs {
  position: relative; isolation: isolate; color: var(--on-wine);
  padding-block: clamp(84px, 12vw, 160px);
  background: radial-gradient(90% 70% at 85% 0%, var(--wine-600), var(--wine-800) 50%, var(--wine-950));
}
.hm-packs.grain::after { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--grain); opacity: .08; mix-blend-mode: overlay; pointer-events: none; }
.hm-head { margin-bottom: clamp(36px, 5vw, 64px); }
.hm-packs .eyebrow { color: var(--gold-300); }
.hm-packs h2 { color: var(--on-wine); }
.hm-packs h2 em { color: var(--gold-300); }
.hm-packs .lede { color: var(--on-wine-2); }
.hm-pack-grid { display: grid; gap: 18px; }
.hm-pack.pack {
  padding: 0; overflow: hidden; display: grid; grid-template-rows: auto 1fr; gap: 0;
  border-radius: 28px; outline-offset: -10px; text-decoration: none; color: var(--on-wine);
  background: linear-gradient(170deg, rgba(248, 238, 223, .09), rgba(248, 238, 223, .015) 70%);
}
.hm-pack.pack:hover { transform: translateY(-4px); border-color: var(--gold-400); }
.hm-fan { position: relative; display: block; height: 250px; margin-top: 18px; }
.hm-fan::after { content: ""; position: absolute; left: 50%; bottom: 6px; width: 62%; height: 26px; translate: -50% 0; border-radius: 50%; background: radial-gradient(closest-side, rgba(0, 0, 0, .45), transparent); }
.hm-fan img {
  position: absolute; z-index: 1; left: 50%; bottom: 14px; height: 224px; width: auto; translate: -50% 0;
  transform-origin: 50% 100%; filter: drop-shadow(0 14px 12px rgba(0, 0, 0, .4));
  transition: transform 1.1s var(--th-ease), opacity .6s ease; transition-delay: calc(.25s + var(--j, 0) * 90ms);
  opacity: 0; transform: translateY(30px);
}
.hm-fan img:nth-child(1) { --j: 0; } .hm-fan img:nth-child(2) { --j: 1; z-index: 2; } .hm-fan img:nth-child(3) { --j: 2; }
.hm-pack.is-visible .hm-fan img { opacity: 1; }
.hm-pack.is-visible .hm-fan img:nth-child(1) { transform: translateX(-58%) rotate(-13deg); }
.hm-pack.is-visible .hm-fan img:nth-child(2) { transform: translateY(-10px); }
.hm-pack.is-visible .hm-fan img:nth-child(3) { transform: translateX(58%) rotate(13deg); }
.hm-pack.is-visible:hover .hm-fan img { transition-delay: 0s; transition-duration: .6s; }
.hm-pack.is-visible:hover .hm-fan img:nth-child(1) { transform: translateX(-78%) rotate(-19deg); }
.hm-pack.is-visible:hover .hm-fan img:nth-child(2) { transform: translateY(-22px); }
.hm-pack.is-visible:hover .hm-fan img:nth-child(3) { transform: translateX(78%) rotate(19deg); }
.hm-fan--cassa img:nth-child(1), .hm-fan--cassa img:nth-child(3) { filter: drop-shadow(0 14px 12px rgba(0, 0, 0, .4)) brightness(.86); }
.hm-pack-body { display: grid; gap: 10px; align-content: end; padding: 22px 28px 30px; }
.hm-pack-body h3 { margin: 0; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); color: var(--on-wine); }
.hm-pack-body p { margin: 0; color: var(--on-wine-2); }
.hm-pack-go { display: inline-flex; align-items: center; gap: 10px; margin-top: 8px; color: var(--gold-300); font-weight: 600; font-size: .95rem; }
.hm-pack-go svg { width: 18px; height: 18px; transition: translate .35s var(--th-ease); }
.hm-pack:hover .hm-pack-go svg { translate: 6px 0; }
@media (min-width: 768px) {
  .hm-pack-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .hm-fan { height: 300px; }
  .hm-fan img { height: 270px; }
  .hm-pack-body { padding: 24px 36px 36px; }
}

/* ---------------------------------------------------------
   COLLABORAZIONI
   --------------------------------------------------------- */
.hm-collab { padding-block: clamp(84px, 12vw, 160px); background: var(--paper-2); }
.hm-head--split { display: grid; gap: 18px; align-items: end; }
.hm-head--split h2 { margin: 0; }
.hm-head--split .lede { margin: 0; }
@media (min-width: 960px) { .hm-head--split { grid-template-columns: 1fr 1fr; gap: 64px; } }
.hm-rows { list-style: none; margin: 0 0 36px; padding: 0; border-top: 1px solid var(--line-strong); }
.hm-row a {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: 44px 1fr 28px; gap: 6px 14px; align-items: center;
  padding: 24px 6px; border-bottom: 1px solid var(--line-strong); color: var(--ink); text-decoration: none;
  transition: color .45s ease;
}
.hm-row a::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--wine-700); transform: scaleY(0); transform-origin: 50% 100%; transition: transform .55s var(--th-swipe); }
.hm-row a:hover, .hm-row a:focus-visible { color: var(--on-wine); }
.hm-row a:hover::before, .hm-row a:focus-visible::before { transform: scaleY(1); }
.hm-row a:focus-visible { outline: 2px solid var(--gold-500); outline-offset: -2px; }
.hm-row-num { font-family: var(--font-display); font-style: italic; font-size: 1.5rem; color: var(--gold-600); grid-row: span 2; align-self: start; }
.hm-row-title { font-family: var(--font-display); font-size: clamp(1.35rem, 1rem + 1.5vw, 2.3rem); font-weight: 500; line-height: 1.1; }
.hm-row-text { grid-column: 2; font-size: .95rem; color: inherit; opacity: .78; }
.hm-row-arrow { grid-column: 3; grid-row: 1 / span 2; width: 26px; height: 26px; transition: rotate .45s var(--th-ease); }
.hm-row a:hover .hm-row-arrow { rotate: 45deg; }
.hm-row a:hover .hm-row-num { color: var(--gold-300); }
@media (min-width: 960px) {
  .hm-row a { grid-template-columns: 72px 1.1fr 1fr 40px; padding: 30px 12px; gap: 28px; }
  .hm-row-num { grid-row: auto; align-self: center; font-size: 1.9rem; }
  .hm-row-text { grid-column: 3; }
  .hm-row-arrow { grid-column: 4; grid-row: auto; }
}

/* Soci */
.hm-soci { background: var(--paper-2); padding-top: 0; }

/* ---------------------------------------------------------
   Riduci movimento: tutto fermo e visibile
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .th-in, .th-logo-img, .th-cue-ring, .th-cue-arrow { animation: none !important; }
  .th-hero-text, .th-logo, .th-logo-img, .th-cue { transform: none !important; opacity: 1 !important; }
  .th-sheen { display: none; }
  .hm-fan img { transition: none; opacity: 1; }
  .hm-pillar::before { transform: scaleX(1); transition: none; }
  .hm-row a::before, .hm-row-arrow { transition: none; }
}
