/* ═══════════════════════════════════════════════════════════════
   Terre di Creta · Agricazzaro
   Palette "creta": il nome della cantina è letteralmente l'argilla
   delle rive del Sile; calce, cotto e inchiostro vengono dal brand
   (logo B/N geometrico, etichette illustrate), non da un default.
   Type: Cormorant Garamond (racconto) + Jost (geometrico, eco del logo).
   ═══════════════════════════════════════════════════════════════ */

@font-face { font-family: 'Zodiak'; src: url('../fonts/Zodiak-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Zodiak'; src: url('../fonts/Zodiak-Italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Zodiak'; src: url('../fonts/Zodiak-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Jost'; src: url('../fonts/jost-v20-latin-300.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Jost'; src: url('../fonts/jost-v20-latin-regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Jost'; src: url('../fonts/jost-v20-latin-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --paper: #F1EEE7;
  --paper-deep: #E9E5DB;
  --ink: #211F1B;
  --stone: #6E695F;
  --cotto: #A4522E;
  --line: #D8D2C4;
  --dark: #1D1B18;
  --dark-text: #EDE8DC;
  --serif: 'Zodiak', 'Georgia', serif;
  --sans: 'Jost', 'Avenir Next', 'Helvetica Neue', sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 72px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
em { font-style: italic; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.06; letter-spacing: -0.015em; }
h2 { font-size: clamp(2.4rem, 5.2vw, 4.2rem); }
h2 em, h1 em { font-weight: 400; }

.eyebrow {
  font-family: var(--sans); font-weight: 400; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.22em; color: var(--cotto);
}

/* ── Bottoni ─────────────────────────────────────── */
.btn {
  display: inline-block;
  font-family: var(--sans); font-weight: 400; font-size: 0.82rem;
  text-transform: uppercase; letter-spacing: 0.16em;
  text-decoration: none;
  padding: 1.05em 2.4em;
  border: 1px solid currentColor;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-light { color: #F6F3EC; }
.btn-light:hover { background: #F6F3EC; color: var(--ink); }
.btn-dark { color: var(--dark-text); }
.btn-dark:hover { background: var(--dark-text); color: var(--dark); }

/* ── Nav ─────────────────────────────────────────── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  transition: background 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.nav.is-solid {
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line);
}
.nav-brand {
  font-family: var(--sans); font-weight: 500; font-size: 0.85rem;
  text-transform: uppercase; letter-spacing: 0.28em; text-decoration: none;
  color: #F6F3EC; transition: color 0.5s var(--ease);
}
.nav.is-solid .nav-brand, .nav.menu-open .nav-brand { color: var(--ink); }
.nav-links { display: flex; gap: 2.4rem; }
.nav-links a {
  font-size: 0.8rem; font-weight: 400; text-transform: uppercase;
  letter-spacing: 0.14em; text-decoration: none;
  color: #F6F3EC; transition: color 0.5s var(--ease), opacity 0.3s;
}
.nav.is-solid .nav-links a { color: var(--ink); }
.nav-links a:hover { opacity: 0.55; }

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  width: 44px; height: 44px; position: relative; z-index: 60;
}
.nav-toggle span {
  position: absolute; left: 10px; right: 10px; height: 1.5px;
  background: #F6F3EC; transition: transform 0.45s var(--ease), background 0.45s, top 0.45s;
}
.nav.is-solid .nav-toggle span, .nav.menu-open .nav-toggle span { background: var(--ink); }
.nav-toggle span:nth-child(1) { top: 18px; }
.nav-toggle span:nth-child(2) { top: 26px; }
.nav.menu-open .nav-toggle span:nth-child(1) { top: 22px; transform: rotate(45deg); }
.nav.menu-open .nav-toggle span:nth-child(2) { top: 22px; transform: rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 50;
  background: var(--paper);
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 clamp(1.5rem, 8vw, 4rem);
  visibility: hidden; opacity: 0;
  transition: opacity 0.5s var(--ease), visibility 0s 0.5s;
}
.menu.is-open { visibility: visible; opacity: 1; transition: opacity 0.5s var(--ease); }
.menu-links { display: flex; flex-direction: column; gap: 0.4em; }
.menu-links a {
  font-family: var(--serif); font-size: clamp(2.4rem, 10vw, 3.6rem);
  font-weight: 500; text-decoration: none; line-height: 1.25;
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.menu.is-open .menu-links a { opacity: 1; transform: none; }
.menu.is-open .menu-links a:nth-child(2) { transition-delay: 0.06s; }
.menu.is-open .menu-links a:nth-child(3) { transition-delay: 0.12s; }
.menu.is-open .menu-links a:nth-child(4) { transition-delay: 0.18s; }
.menu-foot { margin-top: 3rem; color: var(--stone); font-size: 0.9rem; }

/* ── Hero ────────────────────────────────────────── */
.hero { position: relative; min-height: 100dvh; display: flex; align-items: flex-end; overflow: hidden; }
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 115%; object-fit: cover; will-change: transform; }
.hero-media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,16,12,0.28) 0%, rgba(20,16,12,0.05) 40%, rgba(20,16,12,0.62) 100%);
}
.hero-inner {
  position: relative; z-index: 2;
  padding: 0 clamp(1.25rem, 4vw, 3rem) clamp(3rem, 8vh, 5.5rem);
  color: #F6F3EC; max-width: 1400px; width: 100%; margin: 0 auto;
}
.hero-title {
  font-size: clamp(3.4rem, 11vw, 8.5rem);
  font-weight: 500; line-height: 0.98; letter-spacing: -0.015em;
  margin-bottom: 1.2rem;
}
.hero-title em { font-size: 0.55em; vertical-align: 0.14em; margin-right: 0.06em; }
.hero-sub { font-size: clamp(1.1rem, 1.6vw, 1.35rem); font-weight: 300; max-width: 34ch; margin-bottom: 2.2rem; }
.line { display: block; overflow: hidden; padding-bottom: 0.08em; }
.line > span { display: inline-block; will-change: transform; }

/* ── Manifesto ───────────────────────────────────── */
.manifesto {
  padding: clamp(7rem, 16vh, 12rem) clamp(1.25rem, 4vw, 3rem);
  max-width: 62rem; margin: 0 auto; text-align: center;
}
.manifesto-motto {
  font-family: var(--serif); font-style: italic; font-size: 1.15rem;
  color: var(--cotto); margin-bottom: 1.6rem;
}
.manifesto-title { margin-bottom: 2.2rem; }
.manifesto-body { max-width: 46rem; margin: 0 auto; font-size: 1.3rem; line-height: 1.7; color: var(--stone); }

/* ── Storia ──────────────────────────────────────── */
.storia { padding: clamp(4rem, 10vh, 8rem) clamp(1.25rem, 4vw, 3rem) clamp(6rem, 14vh, 10rem); }
.storia-grid {
  max-width: 1400px; margin: 0 auto;
  display: grid; grid-template-columns: 1.15fr 1fr 0.7fr;
  gap: clamp(1.5rem, 4vw, 4rem); align-items: start;
}
.storia-text { padding-top: clamp(1rem, 6vh, 4rem); }
.storia-text h2 { margin-bottom: 1.6rem; }
.storia-text p { max-width: 42ch; color: var(--stone); font-size: 1.18rem; line-height: 1.65; }
.storia-facts { margin-top: 3rem; display: grid; gap: 1.4rem; }
.storia-facts dt {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--stone); margin-bottom: 0.15rem;
}
.storia-facts dd { font-family: var(--serif); font-size: 1.5rem; font-weight: 500; }
.storia-photo { overflow: hidden; }
.storia-photo img { width: 100%; height: auto; transform: scale(1.06); will-change: transform; }
.storia-photo-b { margin-top: clamp(4rem, 14vh, 9rem); }

/* ── Terra ───────────────────────────────────────── */
.terra { position: relative; min-height: 92vh; display: flex; align-items: center; overflow: hidden; }
.terra-media { position: absolute; inset: 0; }
.terra-media img { position: relative; top: -15%; width: 100%; height: 132%; object-fit: cover; will-change: transform; }
.terra-media::after { content: ''; position: absolute; inset: 0; background: rgba(24,18,12,0.45); }
.terra-inner {
  position: relative; z-index: 2; color: #F6F3EC;
  max-width: 1400px; width: 100%; margin: 0 auto;
  padding: clamp(6rem, 14vh, 9rem) clamp(1.25rem, 4vw, 3rem);
}
.terra-title { font-size: clamp(2.4rem, 6vw, 5rem); margin-bottom: 1.6rem; }
.terra-body { max-width: 44ch; font-size: 1.18rem; opacity: 0.88; }

/* ── Vini — "dentro l'etichetta" ─────────────────── */
.vini-head {
  max-width: 1400px; margin: 0 auto;
  padding: clamp(6rem, 14vh, 9rem) clamp(1.25rem, 4vw, 3rem) clamp(2.5rem, 6vh, 4rem);
}
.vini-head .eyebrow { margin-bottom: 1rem; }

.vini-stage { position: relative; background: #201D19; color: var(--dark-text); }
.vino { position: relative; }

/* fondale unico a tutto schermo: foto sfocata + velo colore + gradienti
   (layer generati da main.js sui colori del vino; crossfade in opacity) */
.vino-fondo { position: absolute; inset: 0; z-index: 0; pointer-events: none; will-change: opacity; }
.vino-blur { position: absolute; inset: 0; background-size: cover; background-position: center; }
.vino-blur::after { content: ''; position: absolute; inset: 0; background: var(--wine-bg, #3A3417); opacity: 0.5; }
.vino-grad { position: absolute; inset: 0; opacity: 0.55; }

/* scena grafica dell'etichetta */
.vino-scene { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; color: var(--wine-accent, #C9A94C); will-change: opacity; }
.vino-scene svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; fill: none; stroke: currentColor; stroke-width: 1.3; will-change: transform; }
.vino-scene .scene-deep { opacity: 0.08; }
.vino-scene .scene-near { opacity: 0.13; }

.vino-info { position: relative; z-index: 3; }
.vino-linea {
  font-size: 0.75rem; font-weight: 400; text-transform: uppercase;
  letter-spacing: 0.2em; color: var(--wine-accent, #C9A94C); margin-bottom: 1rem;
}
.vino-nome { font-size: clamp(2.8rem, 5.2vw, 4.4rem); font-weight: 400; margin-bottom: 0.9rem; color: #F3EFE5; }
.vino-storia {
  font-family: var(--serif); font-style: italic; font-size: 1.22rem;
  color: rgba(240, 235, 222, 0.68); max-width: 38ch; margin-bottom: 1.8rem;
}
.vino-note { list-style: none; margin-bottom: 1.8rem; }
.vino-note li { padding: 0.28em 0; font-size: 1rem; color: rgba(243, 239, 229, 0.92); }
.vino-note li::before {
  content: ''; display: inline-block; width: 1.6em; height: 1px;
  background: var(--wine-accent, #C9A94C); vertical-align: middle; margin-right: 0.8em;
}
.vino-temp { font-size: 0.85rem; color: rgba(240, 235, 222, 0.55); }

/* bottiglia: intera, in "contain", appoggiata sulla scena unica */
.vino-photo { position: relative; z-index: 2; will-change: transform; }
.vino-photo img { width: 100%; height: 100%; object-fit: contain; display: block; }

.vini-progress { display: none; }

/* Desktop con motion: layer sovrapposti nello stage pinnato */
@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
  .vini-stage { height: 100vh; }
  .vini-track { position: relative; height: 100%; }
  .vino { position: absolute; inset: 0; opacity: 0; visibility: hidden; }
  .vino:first-child { opacity: 1; visibility: visible; }
  .vino-info {
    position: absolute; top: 50%; transform: translateY(-50%);
    left: clamp(2rem, 7vw, 7.5rem); width: min(38vw, 33rem);
  }
  .vino-photo {
    position: absolute; top: 6vh; right: clamp(2rem, 8vw, 10rem);
    height: 88vh; width: min(42vw, 62vh);
  }
  .vino-scene { right: 34%; }

  .vini-progress {
    display: flex; align-items: center; gap: 1rem;
    position: absolute; z-index: 5;
    left: clamp(2rem, 7vw, 7.5rem); bottom: 2.4rem;
  }
  .vini-count { font-family: var(--serif); font-size: 0.95rem; color: rgba(240,235,222,0.6); letter-spacing: 0.06em; }
  .vini-count b { font-weight: 700; font-size: 1.35rem; color: #F3EFE5; }
  .vini-bar { position: relative; width: 130px; height: 1px; background: rgba(240,235,222,0.22); }
  .vini-bar i { position: absolute; inset: 0; transform-origin: left center; transform: scaleX(0); background: var(--wine-accent, #C9A94C); will-change: transform; }
}

/* Mobile e reduced-motion: capitoli impilati, foto piena in alto */
@media (max-width: 899px), (prefers-reduced-motion: reduce) {
  .vini-stage { background: none; }
  .vini-track { display: flex; flex-direction: column; }
  .vino {
    overflow: hidden; padding: 0 0 clamp(3.5rem, 8vh, 5rem);
    display: flex; flex-direction: column-reverse; gap: 1.2rem;
  }
  .vino-photo { width: 100%; height: 52vh; }
  .vino-info { padding: 0.5rem 1.5rem 0; }
  .vino-scene { top: 40%; }
}

/* ── Vendemmia ───────────────────────────────────── */
.vendemmia { padding: clamp(7rem, 16vh, 11rem) 0 clamp(6rem, 14vh, 9rem); background: var(--paper); overflow: hidden; }
.vendemmia-title {
  max-width: 1400px; margin: 0 auto clamp(3rem, 7vh, 5rem);
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  font-size: clamp(2.2rem, 5vw, 4rem);
}
.vendemmia-title em { display: inline; }
.vendemmia-strip { display: flex; gap: clamp(1rem, 2.5vw, 2rem); width: max-content; padding-left: clamp(1.25rem, 4vw, 3rem); will-change: transform; }
.vendemmia-strip figure { flex: 0 0 auto; }
.vendemmia-strip img { height: clamp(300px, 48vh, 460px); width: auto; filter: contrast(1.02); }

/* ── Footer ──────────────────────────────────────── */
.footer { background: var(--dark); color: var(--dark-text); padding: clamp(6rem, 14vh, 10rem) clamp(1.25rem, 4vw, 3rem) 2.5rem; }
.footer-main { max-width: 1400px; margin: 0 auto clamp(5rem, 10vh, 7rem); }
.footer-title { font-size: clamp(2.6rem, 6vw, 5rem); margin-bottom: 2.4rem; }
.footer-grid {
  max-width: 1400px; margin: 0 auto;
  display: grid; grid-template-columns: auto 1fr 1fr auto; gap: clamp(2rem, 5vw, 5rem);
  align-items: start; padding-top: 3rem; border-top: 1px solid rgba(237,232,220,0.16);
  font-size: 0.95rem; line-height: 1.8;
}
.footer-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.2em; opacity: 0.55; margin-bottom: 0.6rem; }
.footer-grid a { text-decoration: none; border-bottom: 1px solid rgba(237,232,220,0.3); transition: border-color 0.3s; }
.footer-grid a:hover { border-color: var(--dark-text); }
.footer-logo-tdc { width: 170px; }
.footer-logo-agri { width: 130px; opacity: 0.9; }
.footer-col-agri { justify-self: end; }
.footer-fine {
  max-width: 1400px; margin: 4rem auto 0; font-size: 0.78rem; opacity: 0.45; letter-spacing: 0.04em;
}

/* ── Reveal di base (gestito da GSAP, fallback visibile) ── */
.reveal { opacity: 0; transform: translateY(28px); }
.no-js .reveal, .reduced .reveal { opacity: 1; transform: none; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 899px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .manifesto { padding-top: clamp(5rem, 12vh, 8rem); padding-bottom: clamp(5rem, 12vh, 8rem); }
  .storia { padding-top: 2rem; }
  .storia-grid { grid-template-columns: 1fr 1fr; }
  .storia-text { grid-column: 1 / -1; padding-top: 0; }
  .storia-photo-b { margin-top: 3rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-col-agri { justify-self: start; }
}
@media (max-width: 560px) {
  .storia-grid { grid-template-columns: 1fr; }
  .storia-photo-b { width: 62%; margin-left: auto; margin-top: -3rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 2.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; }
  .line > span { transform: none !important; }
  .hero-media img, .terra-media img, .storia-photo img { transform: none !important; }
}

/* ── Hero a sequenza (variante scroll.html) ─────────── */
.hero-seq { position: relative; height: 420vh; background: #0B0705; }
.hero-seq-sticky { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.hero-seq-sticky canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-seq-shade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(11,7,5,0.38) 0%, transparent 32%, transparent 66%, rgba(11,7,5,0.5) 100%);
}
.seq-step {
  position: absolute; left: 50%; transform: translate(-50%, 14px);
  width: 100%; max-width: 1400px;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  color: #F6F3EC; opacity: 0; pointer-events: none;
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.45);
}
.seq-step.attiva { opacity: 1; transform: translate(-50%, 0); }
.seq-step--alto { top: 16vh; }
.seq-step--basso { bottom: 13vh; }
.seq-title {
  font-size: clamp(3.4rem, 11vw, 8.5rem);
  font-weight: 400; line-height: 0.98; letter-spacing: -0.015em;
}
.seq-title em { font-size: 0.55em; vertical-align: 0.14em; margin-right: 0.06em; }
.seq-h { font-size: clamp(2.4rem, 5.5vw, 4.6rem); font-weight: 400; }
.seq-sub {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.15rem, 1.8vw, 1.55rem);
  max-width: 40ch; margin-top: 0.9rem; opacity: 0.94;
}
.seq-step--cta .btn { pointer-events: auto; margin-top: 1.8rem; }
.seq-load {
  position: absolute; right: clamp(1.25rem, 4vw, 3rem); bottom: 2rem;
  font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: rgba(246, 243, 236, 0.5); transition: opacity 0.5s;
}
.seq-load.via { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .hero-seq { height: 100vh; }
  .hero-seq-sticky { position: relative; }
  .seq-step:first-of-type { opacity: 1; transform: translate(-50%, 0); }
}
