:root {
  --bg: #F5E7C6;
  --ink: #072415;          /* verde di stampa dell'astuccio */
  --ink-soft: #2f4a3b;
  --gold: #B8924A;
  --balm: #F2B518;
  --frames-vh: 1.5;        /* altezza di scroll per frame della timeline, in svh */
  --serif: "Antic Didone", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: var(--sans); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }

#scene {
  position: fixed; inset: 0;
  width: 100vw; height: 100svh;
  display: block;
  z-index: 0;
}

/* --- header e menu --------------------------------------------------------------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 6;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top)) clamp(20px, 6vw, 96px) 18px;
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }
.brand {
  font-family: var(--serif); font-size: 1.35rem; letter-spacing: .32em; padding-left: .32em;
  color: var(--ink); text-decoration: none;
}
.burger {
  width: 44px; height: 44px; border: 0; background: none; cursor: pointer;
  display: grid; place-content: center; gap: 7px; padding: 0; color: var(--ink);
}
.burger span { display: block; width: 26px; height: 1.5px; background: currentColor; transition: transform .35s ease, opacity .35s ease; }
.burger[aria-expanded="true"] span:first-child { transform: translateY(4.25px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-4.25px) rotate(-45deg); }
.burger:focus-visible, .brand:focus-visible, .menu a:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.menu {
  position: fixed; inset: 0; z-index: 5;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 clamp(28px, 10vw, 160px);
  background: rgba(245, 231, 198, .9);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  opacity: 0; transition: opacity .35s ease;
}
.menu.open { opacity: 1; }
.menu[hidden] { display: none; }
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu li { border-top: 1px solid rgba(7, 36, 21, .15); }
.menu li:last-child { border-bottom: 1px solid rgba(7, 36, 21, .15); }
.menu a {
  display: block; padding: .9rem 0;
  font-family: var(--serif); font-size: clamp(1.8rem, 4.5vw, 3rem); line-height: 1.1;
  color: var(--ink); text-decoration: none;
  transition: color .25s ease, padding-left .25s ease;
}
.menu a:hover { color: var(--gold); padding-left: .4rem; }
.menu-foot { margin-top: 2rem; font-size: .72rem; letter-spacing: .26em; text-transform: uppercase; color: var(--ink-soft); }

/* --- capitoli -------------------------------------------------------------------- */
#story { position: relative; z-index: 1; }
.chapter { position: relative; height: calc(var(--frames) * var(--frames-vh) * 1svh); }
.stick {
  position: fixed; inset: 0;          /* tutti i testi nello stesso punto: entrano/escono in base al frame */
  height: 100svh;
  display: flex; align-items: center;
  padding: 0 clamp(20px, 6vw, 96px);
  pointer-events: none;
}
.card {
  max-width: 30rem;
  opacity: 0;
  visibility: hidden;
  will-change: opacity, transform;
}
.card.on { pointer-events: auto; }
.eyebrow {
  margin: 0 0 .6rem;
  font-size: .72rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}
h1, h2 { font-family: var(--serif); font-weight: 400; margin: 0 0 .9rem; line-height: 1.08; }
h1 { font-size: clamp(3.2rem, 8vw, 6.5rem); letter-spacing: .14em; }
h2 { font-size: clamp(2rem, 3.6vw, 3.1rem); }
p { margin: 0 0 .8rem; color: var(--ink-soft); }
.lead { font-size: 1.12rem; max-width: 26rem; }
.hint { margin-top: 2.2rem; font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; color: var(--ink-soft); opacity: .7; }

.ingredients { list-style: none; margin: 1rem 0 0; padding: 0; }
.ingredients li { padding: .55rem 0; border-top: 1px solid rgba(7, 36, 21, .18); }
.ingredients strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.3rem; }
.ingredients span { font-size: .82rem; color: var(--ink-soft); }

.card-on-balm p, .card-on-balm .ingredients span { color: var(--ink); }
.card-on-balm .eyebrow { color: var(--ink); opacity: .75; }

.tiers { list-style: none; margin: .6rem 0 1.5rem; padding: 0; }
.tiers li { border-top: 1px solid rgba(7, 36, 21, .18); }
.tiers a { display: flex; align-items: baseline; gap: .8rem; padding: .5rem 0; color: inherit; text-decoration: none; }
.tiers a:hover strong, .tiers a:focus-visible strong { color: var(--gold); }
.tiers span { min-width: 4.8rem; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.tiers strong { font-family: var(--serif); font-weight: 400; font-size: 1.55rem; color: var(--ink); white-space: nowrap; }
.tiers em { font-style: normal; font-size: .78rem; color: var(--gold); font-weight: 600; }
.btn {
  display: inline-block;
  padding: .95rem 2.4rem;
  background: var(--ink); color: #F3EFE8;
  font-size: .78rem; letter-spacing: .26em; text-transform: uppercase; text-decoration: none;
  border-radius: 999px;
  transition: background .25s ease, transform .25s ease;
}
.btn:hover, .btn:focus-visible { background: #0d3a22; transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* --- verticale: prodotto al centro, testi in basso ----------------------------------- */
@media (max-aspect-ratio: 1/1) {
  .stick { align-items: flex-end; padding-bottom: calc(5svh + env(safe-area-inset-bottom)); }
  .card {
    max-width: none; width: 100%;
    padding: 1.4rem 1.3rem 1.2rem;
    background: rgba(247, 236, 208, .82);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-radius: 18px;
  }
  .card-on-balm { background: rgba(250, 214, 120, .55); }
  .card-hero { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; text-align: center; }
  .card-hero .lead { margin: 0 auto; }
  h1 { font-size: clamp(2.8rem, 14vw, 4rem); }
  h2 { font-size: clamp(1.6rem, 7vw, 2.2rem); }
  p { font-size: .95rem; }
  .ingredients li { padding: .35rem 0; }
  .tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: .5rem 0 1rem; }
  .tiers a { flex-direction: column; align-items: flex-start; gap: .1rem; padding: .5rem 0 0; }
  .tiers span { min-width: 0; font-size: .66rem; }
  .tiers strong { font-size: 1.2rem; white-space: nowrap; }
  .tiers em { font-size: .64rem; line-height: 1.2; }
  .ingredients strong { font-size: 1.1rem; }
}

/* --- loader --------------------------------------------------------------------------- */
#loader {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.1rem;
  background: var(--bg);
  transition: opacity .8s ease, visibility .8s ease;
}
#loader.done { opacity: 0; visibility: hidden; }
.loader-logo { font-family: var(--serif); font-size: 2.2rem; letter-spacing: .3em; padding-left: .3em; }
.loader-bar { width: 160px; height: 1px; background: rgba(7, 36, 21, .15); overflow: hidden; }
.loader-bar span { display: block; height: 100%; width: 0; background: var(--gold); transition: width .3s ease; }
.loader-pct { font-size: .7rem; letter-spacing: .25em; color: var(--ink-soft); }

.noscript { position: fixed; bottom: 1rem; left: 1rem; right: 1rem; z-index: 5; }

@media (prefers-reduced-motion: reduce) {
  .btn, #loader, .loader-bar span, .menu, .menu a, .burger span { transition: none; }
}
