/* Patisserie menu, with the photo arriving through a diagonal cut: the counter card of Maison Ondine, a made-up
   patisserie. A soft warm white page, one card of paper with a deep shadow, ink words and one raspberry accent for
   the pastry under the pointer. Every moving position is written by the script. */
:root {
  --fondo: #f3eee6;        /* the page, warm white */
  --carta: #fffcf7;        /* the card */
  --inchiostro: #1d1916;   /* the words */
  --tenue: #8c8279;        /* the small words */
  --sottile: rgba(29, 25, 22, 0.09); /* the hairlines between the pastries */
  --accento: #c23a52;      /* raspberry: the mark, the price, the blade light */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  background:
    radial-gradient(70% 60% at 80% 0%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 70%),
    radial-gradient(60% 50% at 0% 100%, rgba(214, 196, 176, 0.35) 0%, rgba(214, 196, 176, 0) 70%),
    var(--fondo);
  color: var(--inchiostro);
  font-family: 'Mona Sans Variable', 'Mona Sans', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.palco {
  height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(10px, 4vmin, 48px);
}

/* ------------------------------------------------------------ the card */
.carta {
  position: relative;
  width: min(1000px, 100%);
  height: min(560px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(12px, 2.4vw, 28px);
  padding: clamp(10px, 1.6vw, 16px);
  border-radius: clamp(18px, 2.4vw, 28px);
  background: linear-gradient(180deg, #fffefb 0%, var(--carta) 60%, #fbf6ee 100%);
  box-shadow:
    0 0 0 1px rgba(29, 25, 22, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 2px 4px rgba(60, 40, 20, 0.04),
    0 12px 24px -8px rgba(60, 40, 20, 0.08),
    0 40px 80px -24px rgba(60, 40, 20, 0.18);
}

/* ------------------------------------------------------------ the list */
.lista {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: clamp(8px, 2.4vh, 26px) clamp(6px, 1.4vw, 18px) clamp(6px, 1.6vh, 16px) clamp(10px, 2vw, 26px);
}

.testa {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: clamp(6px, 2.6vh, 28px);
}

.marchio {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: clamp(11px, 1.15vw, 13px);
  font-weight: 620;
  font-stretch: 112%;
  letter-spacing: 0.01em;
}

.marchio__segno {
  width: 1.5em;
  height: 1.5em;
  fill: none;
  stroke: var(--accento);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.testa__giorno {
  margin: 0;
  font-size: clamp(10px, 1vw, 12px);
  color: var(--tenue);
  font-stretch: 104%;
}

.testa__giorno em {
  font-family: 'Fraunces Variable', Georgia, serif;
  font-style: italic;
  color: var(--inchiostro);
}

.dolci {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.dolce {
  border-top: 1px solid var(--sottile);
}

.dolce:last-child {
  border-bottom: 1px solid var(--sottile);
}

.dolce__tasto {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 12px;
  row-gap: 2px;
  padding: clamp(5px, 1.9vh, 16px) 0 clamp(5px, 1.9vh, 16px) clamp(14px, 1.6vw, 20px);
  -webkit-tap-highlight-color: transparent;
}

.dolce__tasto:focus-visible {
  outline: 2px solid var(--accento);
  outline-offset: 2px;
  border-radius: 6px;
}

/* the name: one element for GSAP (it moves and takes weight) */
.dolce__nome {
  font-family: 'Fraunces Variable', Georgia, serif;
  font-size: clamp(15px, min(2.3vw, 3.9vh), 26px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  font-variation-settings: 'opsz' 72, 'wght' var(--w, 380);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.42;
}

.dolce__prezzo {
  align-self: baseline;
  font-size: clamp(11px, 1.15vw, 13px);
  font-weight: 560;
  font-variant-numeric: tabular-nums;
  color: var(--tenue);
}

.dolce__nota {
  grid-column: 1 / -1;
  font-size: clamp(10px, 1.05vw, 12px);
  color: var(--tenue);
  font-stretch: 100%;
  opacity: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* the raspberry mark that slides on a spring next to the pastry under the pointer */
.segno {
  position: absolute;
  left: clamp(10px, 2vw, 26px);
  top: 0;
  width: 2px;
  height: 20px;
  border-radius: 2px;
  background: var(--accento);
  box-shadow: 0 0 10px rgba(194, 58, 82, 0.35);
  transform-origin: 50% 0;
  pointer-events: none;
}

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

.foto__cornice {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: clamp(12px, 1.6vw, 18px);
  background: #2a211b;
  box-shadow:
    0 0 0 1px rgba(29, 25, 22, 0.08),
    0 18px 36px -18px rgba(60, 30, 10, 0.4);
  isolation: isolate;
}

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

.scatto img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* the hairline of light along the blade of the cut */
.lama {
  position: absolute;
  left: 0;
  top: 0;
  width: 60px;
  height: 100px;
  z-index: 9000;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, rgba(255, 220, 226, 0) 0%, rgba(255, 210, 220, 0.26) 46%, rgba(255, 210, 220, 0.26) 54%, rgba(255, 220, 226, 0) 100%);
  mix-blend-mode: screen;
}

.lama__filo {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1.5px;
  margin-left: -0.75px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 30%, #ffe3e8 70%, rgba(255, 255, 255, 0) 100%);
  box-shadow: 0 0 8px rgba(255, 190, 205, 0.9), 0 0 2px #fff;
}

/* the soft sheen across the top of the photo, like a glass over it */
.foto__riflesso {
  position: absolute;
  inset: 0;
  z-index: 9001;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 32%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* the glass label with the hour the batch left the oven */
.vetro {
  position: absolute;
  left: clamp(8px, 1.4vw, 16px);
  bottom: clamp(8px, 1.4vw, 16px);
  z-index: 9002;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px 7px 12px;
  border-radius: 999px;
  color: #fff;
  background: rgba(30, 22, 18, 0.32);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 6px 18px -8px rgba(0, 0, 0, 0.5);
  font-size: clamp(10px, 1.05vw, 12px);
  white-space: nowrap;
}

.vetro__nome {
  opacity: 0.78;
  font-stretch: 106%;
}

.vetro__ora {
  display: inline-flex;
  font-weight: 640;
  font-variant-numeric: tabular-nums;
  height: 1.25em;
  line-height: 1.25em;
  overflow: hidden;
}

.cifra {
  display: inline-block;
  height: 1.25em;
  overflow: hidden;
}

.cifra__rullo {
  display: flex;
  flex-direction: column;
}

.cifra__rullo span {
  height: 1.25em;
}

/* the drawn pointer of the autopilot */
.puntatore {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 20;
  width: 22px;
  height: 22px;
  margin: -3px 0 0 -5px;
  pointer-events: none;
  opacity: 0;
  fill: #fff;
  stroke: var(--inchiostro);
  stroke-width: 1.3;
  stroke-linejoin: round;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.22));
}

/* ------------------------------------------------------------ phone: the photo on top, the list under it */
@media (max-width: 640px) {
  .carta {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 0.9fr) auto;
    height: min(560px, 100%);
    gap: 4px;
  }

  .foto {
    order: -1;
  }

  .lista {
    padding: 6px 4px 2px 6px;
  }

  .testa {
    margin-bottom: 4px;
  }

  .segno {
    left: 6px;
  }

  .dolce__tasto {
    padding: clamp(3px, 1.2vh, 9px) 0 clamp(3px, 1.2vh, 9px) 12px;
  }

  .dolce__nome {
    font-size: clamp(14px, min(4.6vw, 3.6vh), 19px);
  }

  .dolce__nota {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lama {
    display: none;
  }
}
