/* The warm stone ritual, the photo reframing as you scroll: the ritual page of Lerra, a made-up bathhouse and spa. A
   warm stone-white page with a fine grain, dark ink, one amber accent for what is happening now. In a tall section a
   stage stays still: the framed photo on the left (on top on a phone) and the booking card of the ritual beside it.
   Every position of the frame and of the photos is written by the script. */
:root {
  --carta: #f1ece4;        /* the stone-white paper of the page */
  --luce: #fbf8f3;         /* the soft light on the paper */
  --carta-scheda: #fffdfa; /* the booking card */
  --inchiostro: #1b1815;   /* the words, the button and the numbers */
  --tenue: #8d857a;        /* the small words */
  --sottile: #e3dcd1;      /* the empty bars and the hairlines */
  --accento: #b8642f;      /* amber: the moment being told, the bars that fill, the ticks */
  --crema: #fbf3e8;        /* the words on the dark button */
}

* {
  box-sizing: border-box;
}

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

body {
  background:
    radial-gradient(110% 80% at 10% -10%, var(--luce) 0%, rgba(251, 248, 243, 0) 60%),
    radial-gradient(80% 60% at 100% 105%, rgba(184, 100, 47, 0.07), rgba(184, 100, 47, 0) 70%),
    var(--carta);
  background-attachment: fixed;
  color: var(--inchiostro);
  font-family: 'Mona Sans Variable', 'Mona Sans', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* the fine grain over the whole page, so the paper is never flat */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.28;
  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='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.4 0 0 0 0 0.33 0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

/* ------------------------------------------------------------ the bar at the top */
.barra {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(10px, 2.6vh, 24px) clamp(16px, 4.4vw, 56px);
}

.marchio {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 16px;
  font-weight: 660;
  font-variation-settings: 'wdth' 108;
  letter-spacing: -0.02em;
}

.marchio__segno {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--accento);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.barra__voci {
  display: flex;
  gap: clamp(14px, 2.4vw, 30px);
  font-size: 13px;
}

.barra__voci a {
  color: var(--tenue);
  text-decoration: none;
  transition: color 0.3s ease;
}

.barra__voci a[aria-current] {
  color: var(--inchiostro);
}

@media (hover: hover) {
  .barra__voci a:hover {
    color: var(--inchiostro);
  }
}

/* ------------------------------------------------------------ the opening and the end */
.apertura {
  display: grid;
  align-content: center;
  gap: clamp(10px, 2.6vh, 20px);
  height: 86vh;
  height: 86lvh;
  padding: 64px clamp(16px, 5vw, 72px) 24px;
}

.piccolo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
}

.piccolo--tenue {
  color: var(--tenue);
}

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

.titolo {
  margin: 0;
  font-family: 'Fraunces Variable', Georgia, serif;
  font-size: clamp(40px, min(9vw, 14vh), 120px);
  font-weight: 340;
  font-variation-settings: 'opsz' 144, 'SOFT' 60;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.titolo em {
  font-style: normal;
  color: var(--accento);
}

.coda {
  display: grid;
  place-items: center;
  height: 16vh;
}

/* ------------------------------------------------------------ the stage */
.racconto {
  position: relative;
  height: 560vh;
}

.palco {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100lvh;
  overflow: hidden;
}

.scena {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
  height: 100%;
  padding: clamp(60px, 11vh, 96px) clamp(16px, 5vw, 72px) clamp(20px, 5vh, 48px);
}

/* ------------------------------------------------------------ the frame and its photos */
.finestra {
  position: relative;
  height: min(100%, 640px);
  min-height: 0;
}

.cornice,
.cornice__ombra {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  border-radius: 16px;
}

.cornice {
  overflow: hidden;
  background: #2a231d;
  isolation: isolate;
}

/* the soft shadow under the frame lives outside it, so the frame's overflow never cuts it */
.cornice__ombra {
  box-shadow:
    0 1px 1px rgba(40, 28, 18, 0.08),
    0 6px 14px -4px rgba(40, 28, 18, 0.14),
    0 26px 50px -18px rgba(60, 36, 18, 0.32);
}

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

.strato img {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  max-width: none;
  transform-origin: 0 0;
  will-change: transform;
  filter: saturate(0.92) sepia(0.08);
}

/* the stones were shot in a cooler light: warmed a little so the three photos read as one room */
.strato--fresca img {
  filter: saturate(0.8) sepia(0.24) brightness(1.02);
}

/* the grain of film over the photos, and the warm light along the edge of the photo rising in */
.cornice__grana {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: var(--grana-forza, 0.08);
  mix-blend-mode: overlay;
  background-image: var(--grana);
  background-size: 160px 160px;
}

.cornice__luce {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 4;
  height: 1px;
  opacity: 0;
  background: linear-gradient(90deg, rgba(255, 236, 210, 0), #fff1dd 18%, #fff7ec 50%, #fff1dd 82%, rgba(255, 236, 210, 0));
  box-shadow: 0 0 12px 2px rgba(255, 214, 160, 0.55);
}

/* the frosted note inside the frame */
.vetrino {
  position: absolute;
  left: clamp(10px, 1.6vw, 16px);
  bottom: clamp(10px, 1.6vw, 16px);
  z-index: 5;
  margin: 0;
  padding: 7px 11px;
  border-radius: 999px;
  color: #fffaf3;
  font-size: 12px;
  font-weight: 540;
  letter-spacing: 0.005em;
  white-space: nowrap;
  background: rgba(32, 24, 18, 0.26);
  border: 1px solid rgba(255, 244, 228, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 6px 18px -8px rgba(20, 12, 6, 0.5);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  backdrop-filter: blur(10px) saturate(1.3);
}

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

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

.vetrino__striscia span {
  display: block;
  height: 1.3em;
}

/* the four corner marks of a viewfinder, outside the frame */
.tacca {
  position: absolute;
  left: 0;
  top: 0;
  width: 12px;
  height: 12px;
  border: 0 solid var(--inchiostro);
  opacity: 0.55;
}

.tacca--a { border-width: 1px 0 0 1px; }
.tacca--b { border-width: 1px 1px 0 0; }
.tacca--c { border-width: 0 0 1px 1px; }
.tacca--d { border-width: 0 1px 1px 0; }

/* ------------------------------------------------------------ the booking card */
.scheda {
  position: relative;
  display: grid;
  gap: clamp(10px, 2.2vh, 18px);
  padding: clamp(16px, 3vh, 26px) clamp(16px, 2vw, 24px);
  border-radius: 22px;
  background: linear-gradient(180deg, #fffefc 0%, var(--carta-scheda) 100%);
  box-shadow:
    0 1px 1px rgba(40, 28, 18, 0.05),
    0 8px 20px -8px rgba(40, 28, 18, 0.12),
    0 30px 60px -28px rgba(70, 40, 18, 0.26);
}

/* a 1px edge that catches the light at the top and fades towards the bottom */
.scheda__bordo {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(214, 202, 186, 0.7) 40%, rgba(214, 202, 186, 0.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

.scheda__testa {
  display: grid;
  gap: 4px;
}

.etichetta {
  margin: 0;
  color: var(--accento);
  font-size: 11px;
  font-weight: 620;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scheda__titolo {
  margin: 0;
  font-family: 'Fraunces Variable', Georgia, serif;
  font-size: clamp(24px, min(3vw, 5vh), 34px);
  font-weight: 380;
  font-variation-settings: 'opsz' 96, 'SOFT' 50;
  letter-spacing: -0.025em;
  line-height: 1;
}

.momenti {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.momento {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 16px;
  column-gap: 10px;
  row-gap: 2px;
  align-items: baseline;
  padding: clamp(7px, 1.5vh, 12px) 0;
  color: var(--tenue);
}

.momento__nome {
  font-size: 15px;
  font-weight: 560;
  font-variation-settings: 'wdth' 100;
  letter-spacing: -0.01em;
  color: var(--inchiostro);
  opacity: var(--vivo, 0.45);
}

.momento__frase {
  grid-column: 1 / -1;
  grid-row: 2;
  font-size: 12.5px;
  line-height: 1.4;
  opacity: calc(0.5 + var(--vivo, 0.45) * 0.5);
}

.momento__min {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--inchiostro);
  opacity: var(--vivo, 0.45);
}

.momento__fatto {
  width: 16px;
  height: 16px;
  align-self: center;
  fill: none;
  stroke: var(--accento);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.momento__filo {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--sottile);
}

.momento__filo i {
  position: absolute;
  inset: 0;
  background: var(--accento);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.barra-tempo {
  display: flex;
  gap: 3px;
  height: 6px;
}

.barra-tempo__pezzo {
  position: relative;
  flex: 1 1 0;
  overflow: hidden;
  border-radius: 3px;
  background: var(--sottile);
}

.barra-tempo__pezzo i {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #c9773f, var(--accento));
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.conti {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin: 0;
}

.conto {
  display: grid;
  gap: 2px;
}

.conto--prezzo {
  text-align: right;
}

.conto dt {
  color: var(--tenue);
  font-size: 11px;
  font-weight: 560;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.conto dd {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 0;
  font-size: clamp(26px, min(3.2vw, 5.4vh), 38px);
  font-weight: 380;
  font-variation-settings: 'wdth' 92;
  letter-spacing: -0.035em;
  line-height: 1;
}

.conto--prezzo dd {
  justify-content: flex-end;
}

.unita,
.valuta {
  font-family: 'Mona Sans Variable', 'Mona Sans', sans-serif;
  font-size: 13px;
  font-weight: 520;
  letter-spacing: 0;
  color: var(--tenue);
}

.valuta {
  align-self: flex-start;
  margin-top: 0.15em;
  font-size: 15px;
}

/* the digits on their drums */
.cifre {
  display: inline-flex;
  align-items: flex-start;
  font-variant-numeric: lining-nums tabular-nums;
}

.rullo {
  display: block;
  height: 1.05em;
  overflow: hidden;
  line-height: 1.05;
}

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

.rullo__striscia span {
  display: block;
  height: 1.05em;
  text-align: center;
}

/* ------------------------------------------------------------ the button */
.pulsante {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: clamp(42px, 7vh, 50px);
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  color: var(--crema);
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 580;
  font-variation-settings: 'wdth' 100;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pulsante__fondo {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, #2c2722, var(--inchiostro));
  box-shadow: inset 0 1px 0 rgba(255, 240, 220, 0.16), 0 10px 22px -10px rgba(27, 24, 21, 0.6);
}

.pulsante__lampo {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  background: linear-gradient(100deg, rgba(255, 220, 180, 0), rgba(255, 220, 180, 0.22), rgba(255, 220, 180, 0));
  transform: translateX(-120%);
  pointer-events: none;
}

.pulsante__scritta,
.pulsante__fatto,
.pulsante__freccia {
  position: relative;
}

.pulsante__fatto {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  opacity: 0;
}

.pulsante__freccia {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pulsante:focus-visible {
  outline: 2px solid var(--accento);
  outline-offset: 3px;
}

/* ------------------------------------------------------------ narrow screens: the photo on top, the card under it */
@media (max-width: 760px) {
  .scena {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: stretch;
    gap: clamp(10px, 2.4vh, 18px);
    padding: clamp(46px, 11vh, 72px) clamp(12px, 4vw, 24px) clamp(10px, 2.4vh, 20px);
  }

  .finestra {
    height: 100%;
  }

  .scheda {
    gap: clamp(7px, 1.6vh, 12px);
    padding: clamp(10px, 2.2vh, 16px) clamp(12px, 3.6vw, 18px);
    border-radius: 18px;
  }

  .scheda__testa {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
  }

  .scheda__titolo {
    order: -1;
    font-size: clamp(18px, min(5.4vw, 4.6vh), 26px);
  }

  .momenti {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 10px;
  }

  .momento {
    grid-template-columns: minmax(0, 1fr) 13px;
    column-gap: 4px;
    padding: 0 0 7px;
  }

  .momento__nome {
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .momento__frase {
    display: none;
  }

  .momento__min {
    grid-column: 1;
    grid-row: 2;
    font-size: 11.5px;
  }

  .momento__fatto {
    grid-column: 2;
    grid-row: 1;
    width: 13px;
    height: 13px;
  }

  .conto dd {
    font-size: clamp(22px, min(6vw, 5vh), 30px);
  }

  .pulsante {
    height: clamp(36px, 6.4vh, 46px);
    font-size: 13px;
  }

  .vetrino {
    font-size: 11px;
    padding: 5px 9px;
  }
}

@media (max-width: 760px) and (max-height: 520px) {
  .etichetta {
    display: none;
  }

  .barra {
    padding-top: 8px;
    padding-bottom: 8px;
  }
}

@media (min-width: 761px) and (max-height: 620px) {
  .momento__frase {
    display: none;
  }
}
