/* The tasting menu of Osteria Brina, a made-up trattoria, on warm paper. A tall section holds a sticky stage; inside
   it one card: the photo of the dish on the left, the course on the right (on a phone the photo sits on top). Every
   photo is a layer of its own, opened by a circle in clip-path; the words of every course are stacked in one grid
   cell, so the card never changes height. */
:root {
  --page: #f2ede4;          /* the page, warm paper */
  --card: #fbf8f2;          /* the body of the card */
  --edge: rgba(60, 40, 20, 0.1); /* its 1px edge */
  --ink: #1f1a15;           /* the words */
  --muted: #8a8075;         /* the small words */
  --accent: #b84a2a;        /* terracotta: the rail, the course word, the price */
  --olive: #6d6a3c;         /* the second colour: the wine line */
  --plate: #e9e3d8;         /* behind the photos, before they open */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

body {
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  font-variation-settings: 'wdth' 100;
  -webkit-font-smoothing: antialiased;
}

.nascosto {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- the top and the end */
.apertura {
  min-height: min(100vh, 760px);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: clamp(10px, 2.4vh, 22px);
  padding: 6vh 6vw;
  text-align: center;
}

.apertura--fine {
  min-height: min(90vh, 640px);
}

.piccolo {
  margin: 0;
  font-size: clamp(11px, 1.6vh, 13px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variation-settings: 'wdth' 112;
  font-weight: 560;
  color: var(--accent);
}

.piccolo--tenue {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 480;
}

.giu {
  width: 10px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: giu 2.4s cubic-bezier(0.6, 0, 0.3, 1) infinite;
}

@keyframes giu {
  0%, 100% { transform: translateY(-2px); }
  50% { transform: translateY(3px); }
}

.titolo {
  margin: 0;
  max-width: 14ch;
  font-size: clamp(32px, min(8.4vw, 9vh), 84px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 640;
  font-variation-settings: 'wdth' 88;
  text-wrap: balance;
}

.titolo em {
  font-family: 'Fraunces Variable', Georgia, serif;
  font-style: italic;
  font-weight: 380;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.titolo--medio {
  font-size: clamp(28px, min(6.4vw, 7vh), 60px);
}

.pulsante {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--card);
  font-size: 15px;
  font-weight: 560;
  font-variation-settings: 'wdth' 100;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 10px 24px -12px rgba(31, 26, 21, 0.6);
  transition: font-variation-settings 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s;
}

.pulsante svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pulsante:active {
  transform: scale(0.97);
}

@media (hover: hover) {
  .card:hover .card__luce {
    opacity: 1;
  }

  .binario__tappe button:hover span {
    color: var(--ink);
  }

  .binario__tappe button:hover i {
    transform: scaleY(1.6);
  }

  .pulsante:hover {
    font-variation-settings: 'wdth' 118;
    background: var(--accent);
    transform: scale(1.03);
  }

  .pulsante:hover svg {
    transform: translateX(3px);
  }
}

/* ---------------------------------------------------------------- the stage */
.menu {
  position: relative;
  height: 640vh;
}

.palco {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100lvh;
  display: grid;
  place-items: center;
  padding: 3vh 3vw;
  overflow: hidden;
}

.card {
  position: relative;
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  gap: clamp(14px, 2.4vw, 30px);
  width: min(960px, 94vw);
  height: min(580px, 86vh);
  padding: clamp(10px, 1.4vw, 14px);
  border-radius: clamp(18px, 2.4vw, 28px);
  background: var(--card);
  box-shadow:
    inset 0 0 0 1px var(--edge),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(60, 40, 20, 0.06),
    0 8px 18px -8px rgba(60, 40, 20, 0.14),
    0 40px 80px -36px rgba(60, 40, 20, 0.38);
  isolation: isolate;
}

/* a soft warm light that follows the pointer over the card */
.card__luce {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  background: radial-gradient(420px circle at var(--lx, 70%) var(--ly, 20%), rgba(255, 214, 170, 0.32), transparent 60%);
  transition: opacity 0.6s;
}


/* ---------------------------------------------------------------- the photo */
.foto {
  position: relative;
  margin: 0;
  min-height: 0;
  z-index: 1;
}

.foto__vetro {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: clamp(12px, 1.6vw, 18px);
  background: var(--plate);
  box-shadow: inset 0 0 0 1px rgba(60, 40, 20, 0.08);
}

/* a breath of film grain over every photo, so the five read as one shoot */
.foto__vetro::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background-image: var(--grana, none);
  background-size: 160px 160px;
  mix-blend-mode: overlay;
  opacity: var(--grana-forza, 0.06);
}

/* a soft vignette and a 1px highlight on the top edge, like glass over the print */
.foto__vetro::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(40, 22, 10, 0.22));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.piatto {
  position: absolute;
  inset: 0;
  visibility: hidden;
}

.piatto__maschera {
  position: absolute;
  inset: 0;
  overflow: hidden;
  will-change: clip-path;
}

.piatto img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
}

/* the thin light ring that rides the edge of the opening circle */
.anello {
  position: absolute;
  left: 0;
  top: 0;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 0 0 1px rgba(255, 246, 232, 0.85), 0 0 18px 2px rgba(255, 220, 180, 0.35);
}

/* the glass chip with the Italian name of the course */
.gettone {
  position: absolute;
  left: clamp(10px, 1.4vw, 16px);
  bottom: clamp(10px, 1.4vw, 16px);
  z-index: 4;
  margin: 0;
  padding: 7px 12px 7px;
  border-radius: 999px;
  background: rgba(251, 248, 242, 0.62);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6), 0 6px 16px -8px rgba(40, 22, 10, 0.45);
  font-size: 12px;
  font-weight: 580;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.gettone__finestra {
  display: block;
  white-space: nowrap;
  height: 1.25em;
  overflow: hidden;
  line-height: 1.25;
}

.gettone__striscia,
.portata__striscia {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  will-change: transform;
}

/* ---------------------------------------------------------------- the words */
.testo {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  align-content: start;
  min-height: 0;
  padding: clamp(10px, 2.6vh, 26px) clamp(6px, 1.6vw, 20px) clamp(6px, 1.4vh, 14px) 0;
}

.testa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: clamp(8px, 1.8vh, 16px);
  border-bottom: 1px solid var(--edge);
}

.marchio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: 'Fraunces Variable', Georgia, serif;
  font-style: italic;
  font-weight: 460;
  font-size: clamp(14px, 2.2vh, 17px);
}

.marchio__segno {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
}

.testa__nota {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 540;
  font-variation-settings: 'wdth' 112;
  color: var(--muted);
}

.portata {
  display: flex;
  align-items: baseline;
  gap: 0.36em;
  margin: clamp(12px, 3.2vh, 30px) 0 clamp(4px, 1vh, 10px);
  font-size: clamp(11px, 1.8vh, 13px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 560;
  font-variation-settings: 'wdth' 112;
  color: var(--muted);
}

.gettone__striscia span,
.portata__striscia span {
  white-space: nowrap;
}

.portata__finestra {
  display: inline-block;
  height: 1.3em;
  overflow: hidden;
  line-height: 1.3;
  color: var(--accent);
  vertical-align: bottom;
}

.portata__di {
  color: var(--muted);
}

.piatti {
  display: grid;
  min-height: 0;
}

.voce {
  grid-area: 1 / 1;
  visibility: hidden;
}

.voce__nome {
  margin: 0 0 clamp(8px, 2vh, 18px);
  font-family: 'Fraunces Variable', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(24px, min(4.2vw, 6.6vh), 50px);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variation-settings: 'opsz' 96, 'SOFT' 50;
}

.voce__righe {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: clamp(12px, 2.1vh, 15px);
  line-height: 1.5;
  color: #4a4139;
}

.voce__righe li,
.voce__vino {
  overflow: hidden;
}

.voce__vino .riga {
  display: flex;
  align-items: center;
  gap: 8px;
}

.riga {
  display: block;
  will-change: transform;
}

.calice {
  width: 10px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.voce__nome {
  overflow: hidden;
  padding: 0.06em 0 0.12em;
}

.voce__vino {
  display: block;
  gap: 8px;
  margin: clamp(6px, 1.6vh, 14px) 0 0;
  font-size: clamp(11px, 1.8vh, 13px);
  color: var(--olive);
  font-weight: 520;
}

.voce__nota {
  max-width: 30ch;
  margin: clamp(10px, 2.6vh, 24px) 0 0;
  padding-left: 12px;
  border-left: 1px solid rgba(184, 74, 42, 0.35);
  overflow: hidden;
  font-family: 'Fraunces Variable', Georgia, serif;
  font-style: italic;
  font-size: clamp(12px, 1.9vh, 14px);
  line-height: 1.45;
  color: var(--muted);
}

.voce__nota .riga {
  padding-bottom: 0.1em;
}

/* the rail between the courses: a thin line that fills up to the course on the table */
.binario {
  position: relative;
  margin-top: clamp(8px, 2vh, 18px);
  padding-top: 6px;
}

.binario__linea {
  position: relative;
  height: 1px;
  margin: 0 4px;
  background: var(--edge);
}

.binario__pieno {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.binario__tappe {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  height: 0;
}

.binario__tappe li {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
}

.binario__tappe button {
  display: block;
  padding: 0 0 4px;
  margin: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.binario__tappe button:active i {
  transform: scaleY(1.2);
}

.binario__tappe i {
  display: block;
  width: 1px;
  height: 7px;
  margin: -3px auto 0;
  background: rgba(60, 40, 20, 0.28);
  transform-origin: 50% 50%;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s;
}

.binario__tappe span {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: var(--muted);
  transition: color 0.3s;
}

.binario__tappe li:first-child {
  transform: none;
}

.binario__tappe li:last-child {
  transform: translateX(-100%);
}

.binario__tappe li:last-child i {
  margin-left: auto;
  margin-right: 0;
}

.binario__tappe li:first-child i {
  margin-left: 0;
}

.binario__tappe .fatta i {
  background: var(--accent);
}

.binario__tappe .ora i {
  background: var(--accent);
  transform: scaleY(1.9);
}

.binario__tappe .ora span {
  color: var(--ink);
}

.conto {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: clamp(26px, 5vh, 44px);
  padding-top: clamp(8px, 1.6vh, 14px);
  border-top: 1px solid var(--edge);
}

.conto p {
  margin: 0;
  font-size: clamp(11px, 1.8vh, 13px);
  color: var(--muted);
}

.conto__cifra {
  font-family: 'Fraunces Variable', Georgia, serif;
  font-style: italic;
  font-size: clamp(18px, 3vh, 24px);
  color: var(--accent);
  margin-right: 2px;
}

.conto__vini strong {
  color: var(--olive);
  font-weight: 600;
}

/* ---------------------------------------------------------------- phone: the photo on top */
@media (max-width: 640px), (max-aspect-ratio: 4/5) {
  .card {
    grid-template-columns: 1fr;
    grid-template-rows: 40% 1fr;
    gap: clamp(6px, 1.6vh, 12px);
    width: min(520px, 94vw);
    height: min(640px, 92vh);
  }

  .testo {
    padding: 0 6px 4px;
  }

  .testa {
    padding-bottom: clamp(5px, 1vh, 10px);
  }

  .portata {
    margin: clamp(6px, 1.6vh, 16px) 0 clamp(2px, 0.6vh, 6px);
  }

  .voce__nome {
    font-size: clamp(20px, min(6.4vw, 6vh), 34px);
    margin-bottom: clamp(4px, 1vh, 10px);
  }

  .voce__righe {
    font-size: clamp(11px, 1.9vh, 14px);
    line-height: 1.4;
  }

  .voce__vino {
    margin-top: clamp(3px, 0.8vh, 8px);
  }

  .binario__tappe span,
  .voce__nota {
    display: none;
  }

  .binario {
    margin-top: clamp(4px, 1vh, 10px);
  }

  .conto {
    margin-top: clamp(8px, 1.8vh, 18px);
    padding-top: clamp(5px, 1vh, 10px);
  }

  .gettone {
    font-size: 11px;
    padding: 5px 10px;
  }
}

/* a tall phone has room for the chef's note and the names on the rail */
@media (max-aspect-ratio: 4/5) and (min-height: 700px) {
  .voce__nota {
    display: block;
  }

  .binario__tappe span {
    display: block;
    font-size: 9.5px;
  }

  .binario {
    margin-bottom: 14px;
  }
}

@media (max-height: 460px) and (max-aspect-ratio: 4/5) {
  .voce__righe li:nth-child(3) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .giu {
    animation: none;
  }

  .pulsante,
  .pulsante svg,
  .binario__tappe i {
    transition: none;
  }
}
