/* The wine page with the tasting notes opening on scroll. Colours in :root (the Playground palette): a warm paper,
   the ink of the words and one accent, the red of the wine. The page is drawn at its own size and scaled to fit the
   stage (the scale goes on .pagina, set by the script; GSAP never animates it). */
:root {
  --fondo: #f3eee6;          /* the paper */
  --fondo-alto: #f8f4ee;     /* the soft light on the paper */
  --inchiostro: #1f1b18;     /* the words */
  --tenue: #7b736a;          /* the small words */
  --linea: rgba(31, 27, 24, 0.12); /* hairlines and the empty bars */
  --vino: #7c1f2c;           /* the accent: the bars, the button, the arch line */
  --vino-scuro: #5a1520;     /* the shadow of the wine */
  --oro: #d9b98a;            /* the thin light on the arch edge */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--fondo); }
html, body { overflow-x: clip; }
body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: 'Mona Sans Variable', 'Mona Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.corsa { position: relative; height: 520vh; }
.palco {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(70% 60% at 30% 40%, var(--fondo-alto), transparent 70%),
    var(--fondo);
}
@supports (height: 100lvh) { .palco { height: 100lvh; } }
.grana {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0.08;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* ================================================================ the page, wide */
.pagina {
  position: relative;
  flex: none;
  width: 960px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 76px;
  align-items: center;
  transform-origin: 50% 50%;
}

/* the arched frame */
.quadro { position: relative; }
.quadro__cornice { position: relative; }
@media (hover: hover) {
  .quadro__filo { transition: inset 0.7s cubic-bezier(.34, 1.56, .64, 1), border-color 0.5s; }
  .quadro:hover .quadro__filo { inset: -15px; border-color: rgba(124, 31, 44, 0.28); }
}
.quadro__filo {
  position: absolute;
  inset: -11px;
  border: 1px solid var(--linea);
  border-radius: 999px 999px 4px 4px;
  pointer-events: none;
}
.arco {
  position: relative;
  aspect-ratio: 380 / 520;
  border-radius: 999px 999px 4px 4px;
  overflow: hidden;
  background: #d8cfc3;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 30px 60px -28px rgba(60, 30, 20, 0.35),
    0 12px 24px -14px rgba(60, 30, 20, 0.22);
  isolation: isolate;
}
.scatto { position: absolute; inset: 0; }
.scatto img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
}
.scatto--bottiglia img { object-position: 50% 60%; }
.scatto--vigna img { object-position: 50% 100%; transform-origin: 50% 88%; }
.scatto--vigna { clip-path: inset(100% 50% 0 50% round 999px 999px 0 0); }
/* the thin golden line that rides the edge of the opening arch (placed by the script) */
.arco__luce {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 0;
  height: 0;
  border: 1px solid var(--oro);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 -6px 18px -6px rgba(217, 185, 138, 0.55);
}
.arco__ombra {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), transparent 30%, transparent 70%, rgba(20, 8, 6, 0.22));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.didascalia {
  margin-top: 22px;
  font-size: 12px;
  font-stretch: 112%;
  letter-spacing: 0.02em;
  color: var(--tenue);
  text-align: center;
}
.didascalia__riga {
  position: relative;
  display: inline-grid;
  overflow: hidden;
  height: 1.4em;
  min-width: 16em;
}
.didascalia__riga > span { grid-area: 1 / 1; line-height: 1.4em; }

/* the sheet */
.scheda { min-width: 0; }
.cantina {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 560;
  font-stretch: 110%;
  letter-spacing: 0.01em;
}
.cantina__segno { width: 17px; height: 17px; fill: none; stroke: var(--vino); stroke-width: 1.3; stroke-linecap: round; }
.cantina__ruolo {
  margin-left: 4px;
  padding-left: 10px;
  border-left: 1px solid var(--linea);
  color: var(--tenue);
  font-weight: 440;
}
.nome {
  margin-top: 18px;
  font-family: 'Fraunces Variable', Georgia, serif;
  font-size: 72px;
  line-height: 0.96;
  font-weight: 380;
  letter-spacing: -0.035em;
  font-variation-settings: 'opsz' 144, 'SOFT' 60, 'WONK' 0;
}
.dati {
  display: flex;
  gap: 34px;
  margin-top: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--linea);
}
.dato dt {
  font-size: 11px;
  font-stretch: 112%;
  letter-spacing: 0.04em;
  color: var(--tenue);
}
.dato dd {
  margin-top: 5px;
  font-size: 15px;
  font-weight: 520;
  font-variant-numeric: tabular-nums;
}

.schede { display: none; }

.note { list-style: none; margin-top: 6px; }
.nota {
  position: relative;
  padding: 15px 0 14px;
}
.nota__filo {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--linea);
  transform-origin: 0 50%;
}
.nota__testa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nota__nome {
  font-family: 'Fraunces Variable', Georgia, serif;
  font-size: 21px;
  font-weight: 420;
  letter-spacing: -0.015em;
  font-variation-settings: 'opsz' 48, 'SOFT' 40;
}
.nota__misura { display: flex; align-items: center; gap: 12px; }
.nota__parola {
  min-width: 78px;
  font-size: 11px;
  font-stretch: 112%;
  letter-spacing: 0.03em;
  color: var(--tenue);
}
.nota__testo {
  margin-top: 6px;
  max-width: 34em;
  font-size: 14px;
  line-height: 1.5;
  color: #4a433d;
  font-variant-numeric: tabular-nums;
}

/* the intensity bar: a hairline track with five ticks, a wine fill and a small tip */
.barra {
  position: relative;
  display: block;
  width: 96px;
  height: 7px;
}
.barra::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 3px;
  height: 1px;
  background: var(--linea);
}
.barra::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--linea) 0 1px, transparent 1px) 0 0 / 24px 100% repeat-x;
  width: calc(100% + 1px);
}
.barra__pieno {
  position: absolute;
  left: 0;
  top: 2px;
  height: 3px;
  width: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #a3434f, var(--vino));
  transform-origin: 0 50%;
  transform: scaleX(0);
}
.barra__punta {
  position: absolute;
  left: 0;
  top: -1px;
  width: 1px;
  height: 9px;
  background: var(--vino);
  opacity: 0;
}

/* the button */
.compra {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
}
.carrello {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 50px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--tenue);
  font: inherit;
  font-size: 15px;
  font-weight: 560;
  font-stretch: 100%;
  letter-spacing: 0.005em;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  transition: font-stretch 0.5s cubic-bezier(.34, 1.56, .64, 1);
}
.carrello__fondo {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--linea);
}
.carrello__vino {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, #8f2735, var(--vino) 55%, var(--vino-scuro));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  transform-origin: 0 50%;
  transform: scaleX(0);
}
.carrello__lampo {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 240, 220, 0.38), transparent);
  transform: translateX(-120%) skewX(-18deg);
}
.carrello__testo {
  position: relative;
  display: grid;
  overflow: hidden;
  height: 1.4em;
}
.carrello__riga {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4em;
  white-space: nowrap;
}
.carrello__punto { opacity: 0.6; }
.carrello__riga--fatto { justify-content: center; transform: translateY(110%); }
.carrello__riga--fatto svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.carrello.acceso { color: #fbf4ec; cursor: pointer; }
.carrello.acceso .carrello__fondo { box-shadow: 0 14px 26px -14px rgba(124, 31, 44, 0.7), 0 2px 6px -2px rgba(124, 31, 44, 0.35); }
.carrello:focus-visible { outline: 2px solid var(--vino); outline-offset: 3px; }
@media (hover: hover) {
  .carrello.acceso:hover { font-stretch: 118%; }
}
.compra__nota {
  font-size: 12px;
  font-stretch: 110%;
  color: var(--tenue);
}

/* ================================================================ the page, narrow: the photo above, the notes below */
.stretta .pagina {
  width: 340px;
  grid-template-columns: 128px 1fr;
  grid-template-rows: auto auto;
  column-gap: 20px;
  row-gap: 18px;
  align-items: end;
}
.stretta .quadro { grid-row: 1; grid-column: 1; }
.stretta .quadro__filo { inset: -6px; }
.stretta .didascalia { display: none; }
.stretta .scheda { display: contents; }
.stretta .scheda__testa { grid-row: 1; grid-column: 2; align-self: center; }
.stretta .cantina { font-size: 12px; }
.stretta .cantina__ruolo { display: none; }
.stretta .nome { margin-top: 10px; font-size: 36px; }
.stretta .dati {
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 14px;
  padding-bottom: 0;
  border-bottom: 0;
}
.stretta .dato:nth-child(2) { order: 3; flex-basis: 100%; }
.stretta .dato dd { font-size: 13px; margin-top: 2px; }
.stretta .schede {
  grid-row: 2;
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--linea);
  font-size: 11px;
  font-stretch: 112%;
  letter-spacing: 0.03em;
  color: var(--tenue);
}
.stretta .schede span { transition: color 0.4s; }
.stretta .schede span.su { color: var(--inchiostro); }
.stretta .note {
  grid-row: 3;
  grid-column: 1 / -1;
  display: grid;
  margin-top: -6px;
}
.stretta .nota { grid-area: 1 / 1; padding: 0; }
.stretta .nota__filo { display: none; }
.stretta .nota__nome { font-size: 19px; }
.stretta .nota__testo { font-size: 13px; margin-top: 4px; }
.stretta .compra { grid-row: 4; grid-column: 1 / -1; margin-top: 0; justify-content: space-between; }
.stretta .carrello { height: 44px; padding: 0 22px; font-size: 14px; }
