/* Today's menu of Gelso, a made-up kitchen and wine bar, on a warm near black. A tall section holds a sticky stage;
   inside it a row of four narrow cards, one per dish, each holding a real photo. The widths are written by the
   script in pixels: the card of the dish on the table opens into a wide window, the others shrink to strips. The
   words of every dish are stacked in one grid cell beside the row (under it on a phone), so nothing jumps. */
:root {
  --page: #13110e;          /* the page, warm near black */
  --panel: #1b1814;         /* behind the photos, before they load */
  --edge: rgba(255, 236, 205, 0.1); /* the 1px edges that catch the light */
  --ink: #f2ebdf;           /* the words, warm cream */
  --muted: #8f8676;         /* the small words */
  --accent: #e0a64f;        /* saffron: the course, the price, the drawn rule */
}

* {
  box-sizing: border-box;
}

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

body {
  background:
    radial-gradient(120% 70% at 70% 0%, rgba(224, 166, 79, 0.07), transparent 60%),
    var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  font-variation-settings: 'wdth' 100;
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------- the top and the end */
.apertura {
  min-height: 62vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: clamp(8px, 2vh, 18px);
  padding: 6vh 6vw;
  text-align: center;
}

.piccolo {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-variation-settings: 'wdth' 112;
  font-weight: 560;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.giu {
  width: 10px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.titolo {
  margin: 0;
  font-family: 'Newsreader Variable', Georgia, serif;
  font-weight: 340;
  font-size: clamp(30px, min(7vw, 9vh), 76px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  max-width: 14ch;
}

.titolo em {
  font-style: italic;
  color: var(--accent);
}

.titolo--medio {
  font-size: clamp(26px, min(5.4vw, 7vh), 58px);
}

.pulsante {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  color: #1a140c;
  background: linear-gradient(180deg, #f0c27d, var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 10px 24px -10px rgba(224, 166, 79, 0.6);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), font-variation-settings 0.5s;
}

.pulsante svg {
  width: 14px;
  height: 14px;
  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);
}

@media (hover: hover) {
  .pulsante:hover {
    transform: scale(1.04);
    font-variation-settings: 'wdth' 118;
  }

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

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

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

.palco {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100lvh;
  display: grid;
  place-items: center;
  padding: clamp(12px, 4vh, 40px) clamp(12px, 4vw, 48px);
  overflow: hidden;
}

.carta {
  width: min(1060px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.6fr);
  grid-template-rows: auto auto;
  column-gap: clamp(20px, 4vw, 56px);
  row-gap: clamp(12px, 3vh, 28px);
  align-items: center;
}

/* the head of the menu: the house, the day and a hairline */
.testa {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: clamp(8px, 1.6vh, 14px);
  border-bottom: 1px solid var(--edge);
}

.marchio {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Newsreader Variable', Georgia, serif;
  font-size: clamp(17px, 2.6vh, 22px);
  font-weight: 450;
  letter-spacing: -0.01em;
}

.marchio__segno {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.3;
  stroke-linecap: round;
  align-self: center;
}

.testa__giorno {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-variation-settings: 'wdth' 112;
  font-weight: 560;
  color: var(--muted);
  white-space: nowrap;
}

.testa__giorno b {
  color: var(--ink);
  font-weight: 600;
}

/* ---------------------------------------------------------------- the words beside the row */
.parole {
  display: grid;
  align-self: stretch;
  align-content: center;
  min-width: 0;
}

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

.voce:first-child {
  visibility: visible;
}

.finestra {
  display: block;
  overflow: hidden;
  padding: 0.12em 0 0.1em;
  margin: -0.12em 0 -0.1em;
}

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

.voce__portata {
  margin: 0 0 clamp(6px, 1.4vh, 14px);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-variation-settings: 'wdth' 112;
  font-weight: 600;
  color: var(--accent);
}

.voce__nome {
  margin: 0;
  font-family: 'Newsreader Variable', Georgia, serif;
  font-weight: 360;
  font-size: clamp(24px, min(3.6vw, 5.6vh), 44px);
  line-height: 1.04;
  letter-spacing: -0.018em;
}

.voce__nome em {
  font-style: italic;
  color: #e9dcc6;
}

.voce__righe {
  margin: clamp(8px, 1.8vh, 16px) 0 0;
  font-size: clamp(12px, 1.8vh, 14px);
  line-height: 1.5;
  color: var(--muted);
  max-width: 30ch;
}

.conto {
  margin-top: clamp(10px, 2.4vh, 22px);
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.conto__prezzo {
  margin: 0;
  font-family: 'Newsreader Variable', Georgia, serif;
  font-size: clamp(22px, 4vh, 34px);
  font-weight: 400;
  color: var(--accent);
  font-variant-numeric: lining-nums tabular-nums;
}

.conto__regola {
  flex: 1;
  height: 1px;
  max-width: 120px;
  background: linear-gradient(90deg, rgba(224, 166, 79, 0.6), rgba(224, 166, 79, 0));
  transform-origin: left center;
  align-self: center;
}

.conto__vino {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.conto__vino b {
  color: var(--ink);
  font-weight: 560;
}

/* ---------------------------------------------------------------- the row of cards */
.fila {
  position: relative;
  display: flex;
  gap: var(--gap, 8px);
  height: clamp(220px, 58vh, 560px);
  min-width: 0;
}

.piatto {
  position: relative;
  flex: none;
  width: 25%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: clamp(14px, 2vh, 22px);
  overflow: hidden;
  background: var(--panel);
  color: inherit;
  font: inherit;
  cursor: pointer;
  isolation: isolate;
  box-shadow:
    0 1px 0 rgba(255, 240, 215, 0.06),
    0 18px 40px -22px rgba(0, 0, 0, 0.9),
    0 4px 10px -4px rgba(0, 0, 0, 0.5);
  -webkit-tap-highlight-color: transparent;
}

.piatto__in {
  position: absolute;
  inset: 0;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.piatto:active .piatto__in {
  transform: scale(0.975);
}

/* the photo always has the width of the wide window, centred: a narrow card shows a slice of it, never squashed */
.piatto img {
  position: absolute;
  top: 0;
  left: 50%;
  width: var(--larga, 100%);
  height: 100%;
  max-width: none;
  object-fit: cover;
  transform-origin: 50% 55%;
  will-change: transform;
}

/* the film of grain and the soft vignette */
.piatto__velo {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 8, 6, 0.3), transparent 26%, transparent 62%, rgba(10, 8, 6, 0.55));
  pointer-events: none;
}

.piatto__grana {
  position: absolute;
  inset: 0;
  background-image: var(--grana, none);
  background-size: 160px 160px;
  opacity: var(--grana-forza, 0.06);
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* the shade that falls on the cards that are not on the table */
.piatto__ombra {
  position: absolute;
  inset: 0;
  background: #0d0b08;
  opacity: 0;
  pointer-events: none;
}

/* a warm light that follows the pointer on the open card */
.piatto__luce {
  position: absolute;
  inset: 0;
  background: radial-gradient(260px circle at var(--lx, 50%) var(--ly, 30%), rgba(255, 226, 180, 0.2), transparent 65%);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}

/* the edge: 1px, brighter on top, where the room light falls */
.piatto__bordo {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--edge), inset 0 1px 0 rgba(255, 240, 215, 0.16);
  pointer-events: none;
}

/* the name of the dish standing up in a narrow card */
.piatto__dorso {
  position: absolute;
  left: 50%;
  bottom: clamp(10px, 2vh, 18px);
  writing-mode: vertical-rl;
  transform: translateX(-50%) rotate(180deg);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-variation-settings: 'wdth' 108;
  font-weight: 600;
  color: rgba(242, 235, 223, 0.86);
  white-space: nowrap;
  pointer-events: none;
}

/* the frosted chip on the open card: the course */
.gettone {
  position: absolute;
  top: clamp(10px, 1.8vh, 16px);
  left: clamp(10px, 1.8vh, 16px);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 560;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: rgba(30, 24, 18, 0.38);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  backdrop-filter: blur(10px) saturate(1.3);
  box-shadow: inset 0 0 0 1px rgba(255, 240, 215, 0.16), inset 0 1px 0 rgba(255, 240, 215, 0.2);
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
  will-change: transform;
}

.gettone__finestra {
  display: inline-block;
  height: 1.3em;
  line-height: 1.3;
  overflow: hidden;
}

.gettone__striscia {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.gettone svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (hover: hover) {
  .piatto.aperto:hover .piatto__luce {
    opacity: 1;
  }

  .piatto:not(.aperto):hover .piatto__in {
    transform: scale(0.985);
  }

  .piatto:not(.aperto):hover .piatto__dorso {
    color: var(--accent);
  }
}

.piatto:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------- the phone: the row on top, the words under it */
@media (max-width: 700px) {
  .carta {
    grid-template-columns: minmax(0, 1fr);
    row-gap: clamp(8px, 2vh, 16px);
  }

  .fila {
    order: 2;
    height: clamp(150px, 42vh, 420px);
  }

  .parole {
    order: 3;
    align-content: start;
  }

  .testa {
    order: 1;
  }

  .voce__nome {
    font-size: clamp(20px, min(6.4vw, 5vh), 30px);
  }

  .voce__righe {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.4;
  }

  .conto {
    margin-top: 8px;
  }

  .conto__prezzo {
    font-size: clamp(19px, 3.6vh, 26px);
  }

  .voce__portata {
    margin-bottom: 4px;
  }
}

@media (max-height: 470px) and (max-width: 700px) {
  .voce__righe {
    display: none;
  }

  .testa__giorno span {
    display: none;
  }
}

/* the open card's edge takes a breath of saffron, the room light on a warm plate */
.piatto__bordo {
  transition: box-shadow 0.8s;
}

.piatto.aperto .piatto__bordo {
  box-shadow: inset 0 0 0 1px rgba(224, 166, 79, 0.22), inset 0 1px 0 rgba(255, 240, 215, 0.22);
}
