:root {
  --carta: #f4f1ea;        /* the paper of the page */
  --inchiostro: #1c1b18;   /* the ink of titles and values */
  --spento: #8b867c;       /* labels and second lines */
  --filo: rgba(28, 27, 24, 0.1);
  --barra: #fffdf8;        /* the booking bar */
  --accento: #b4532a;      /* the clay of Book now and of the italic */
  --accento-scuro: #96421f;
  --s: 0;                  /* how far the bar has become the pill, set by the script */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--carta); }
body {
  background: var(--carta);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
ul { list-style: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

/* the header */
.testata {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(14px, 3.2vh, 26px) clamp(18px, 5vw, 56px);
}
.marchio {
  font-family: "Newsreader Variable", Georgia, serif;
  font-size: clamp(17px, min(4.6vw, 3.4vh), 22px);
  font-variation-settings: "opsz" 36; letter-spacing: -0.01em;
}
.testata__voci { display: flex; gap: clamp(14px, 2.6vw, 30px); font-size: 13px; color: var(--spento); }
@media (max-width: 560px) { .testata__voci { display: none; } }

/* the opening */
.apertura {
  height: 100vh; min-height: 0;
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  padding: clamp(56px, 12vh, 110px) clamp(18px, 5vw, 56px) clamp(16px, 5vh, 50px);
  gap: clamp(8px, 2vh, 16px);
}
.occhiello { font-size: clamp(11px, min(3.2vw, 2vh), 13px); letter-spacing: 0.04em; color: var(--spento); }
.titolo {
  font-family: "Newsreader Variable", Georgia, serif; font-weight: 380;
  font-size: clamp(30px, min(9vw, 9vh), 84px); line-height: 1.02; letter-spacing: -0.025em;
  font-variation-settings: "opsz" 72; max-width: 14ch;
}
.titolo em, .sezione__titolo em { font-style: italic; color: var(--accento); }
.riga { font-size: clamp(12.5px, min(3.6vw, 2.3vh), 16px); line-height: 1.45; color: var(--spento); max-width: 42ch; }
/* the empty place the bar sits on at the top of the page */
.posto {
  width: min(880px, 92vw); height: 84px; flex: none;
  margin-top: clamp(10px, 3.4vh, 34px);
}

/* the sections */
.sezione {
  height: 100vh; min-height: 0;
  display: flex; flex-direction: column; justify-content: center;
  width: min(880px, 92vw); margin: 0 auto;
  padding: clamp(24px, 6vh, 60px) 0 clamp(84px, 16vh, 130px);
  gap: clamp(8px, 2vh, 16px);
}
.sezione__sopra { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accento); font-variation-settings: "wdth" 110; }
.sezione__titolo {
  font-family: "Newsreader Variable", Georgia, serif; font-weight: 380;
  font-size: clamp(22px, min(6.4vw, 5.6vh), 48px); line-height: 1.1; letter-spacing: -0.02em; max-width: 20ch;
  font-variation-settings: "opsz" 60;
}
.sezione__titolo--grande { font-size: clamp(30px, min(9vw, 9vh), 80px); max-width: 12ch; }
.sezione--fine { align-items: center; text-align: center; }
.sezione__nota { font-size: clamp(12.5px, min(3.6vw, 2.3vh), 15px); color: var(--spento); }
.stanze { margin-top: clamp(4px, 1.6vh, 14px); border-top: 1px solid var(--filo); }
.stanze li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 18px; align-items: baseline;
  padding: clamp(10px, 2.2vh, 18px) 0; border-bottom: 1px solid var(--filo);
  font-size: clamp(13px, min(3.8vw, 2.5vh), 17px);
}
.stanze--orari li { grid-template-columns: minmax(0, 1fr) auto; }
.stanze__dato { color: var(--spento); font-variant-numeric: tabular-nums; }
.stanze__prezzo { font-variant-numeric: tabular-nums; }

/* the booking bar: fixed, placed and sized by the script every frame */
.barra {
  position: fixed; left: 0; top: 0; z-index: 10;
  width: 0; height: 0;
  border-radius: 18px;
  background: var(--barra);
  border: 1px solid rgba(28, 27, 24, calc(0.08 + var(--s) * 0.04));
  box-shadow:
    0 1px 1px rgba(28, 27, 24, 0.04),
    0 calc(4px + var(--s) * 8px) calc(10px + var(--s) * 18px) rgba(28, 27, 24, calc(0.05 + var(--s) * 0.06)),
    0 calc(10px + var(--s) * 24px) calc(30px + var(--s) * 40px) rgba(28, 27, 24, calc(0.04 + var(--s) * 0.08));
  overflow: hidden;
  will-change: transform, width, height;
  visibility: hidden;
}
.barra.is-pronta { visibility: visible; }
/* the thread of light on the top edge */
.barra__luce {
  position: absolute; left: 10%; right: 10%; top: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95) 30%, rgba(255, 255, 255, 0.95) 70%, transparent);
  opacity: calc(0.4 + var(--s) * 0.6);
}

/* the wide layer: keeps the widget width, clipped by the bar as it shrinks */
.largo {
  position: absolute; left: 0; top: 0; height: 100%;
  display: grid; grid-template-columns: 1.35fr 1fr 1fr auto; align-items: center;
  padding: 0 12px 0 0;
}
.campo {
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  height: 100%; padding: 0 22px; border-right: 1px solid var(--filo);
  transform-origin: 100% 50%; min-width: 0;
}
.campo--prezzo { border-right: 0; }
.campo__etichetta { font-size: 11px; letter-spacing: 0.02em; color: var(--spento); white-space: nowrap; }
.campo__valore { font-size: 15px; font-weight: 560; white-space: nowrap; font-variant-numeric: tabular-nums; }
.campo__valore small { font-size: 12px; font-weight: 440; color: var(--spento); }

.tasto {
  position: relative; display: grid; place-items: center;
  height: 56px; padding: 0 24px; border-radius: 12px;
  background: var(--inchiostro); color: #fff;
  font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 2px 6px rgba(28, 27, 24, 0.18);
}
.tasto--largo span { font-variation-settings: "wdth" 100; transition: font-variation-settings 0.3s ease; }
.tasto--prenota { background: var(--accento); padding: 0; border-radius: 999px; }
@media (hover: hover) {
  .tasto--largo:hover span { font-variation-settings: "wdth" 112; }
  .tasto--prenota:hover { background: var(--accento-scuro); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 4px 12px rgba(180, 83, 42, 0.32); }
}
.tasto:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }

/* the narrow layer: the pill */
.stretto {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px;
  padding: 0 7px 0 22px;
  opacity: 0; pointer-events: none;
}
.stretto.is-attivo { pointer-events: auto; }
.stretto__date, .stretto__totale { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; }
.stretto__date b, .totale { font-size: 14px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stretto__date span, .stretto__totale > span { font-size: 11.5px; color: var(--spento); white-space: nowrap; }
.stretto__totale { align-items: flex-end; text-align: right; }
.totale { display: inline-flex; align-items: baseline; line-height: 1.15; }
.totale__cifre { display: inline-flex; }
/* a rolling digit: a window one digit tall over a strip of ten digits and a blank */
.colonna { display: inline-block; height: 1.15em; overflow: hidden; }
.colonna__striscia { display: flex; flex-direction: column; }
.colonna__striscia span { height: 1.15em; line-height: 1.15em; text-align: center; }

.tasto--prenota { height: calc(100% - 14px); width: 118px; }
.tasto__faccia { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; }
.tasto__faccia--fatto { opacity: 0; }
.tasto__faccia svg { width: 15px; height: 15px; flex: none; }
.tasto__faccia path { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }

/* on a phone the widget has two rows */
@media (max-width: 560px) {
  .posto { height: 124px; }
  .largo { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; padding: 0; }
  .campo { padding: 0 16px; }
  .campo--date { border-bottom: 1px solid var(--filo); }
  .campo--ospiti { border-right: 0; border-bottom: 1px solid var(--filo); }
  .campo--prezzo { border-right: 1px solid var(--filo); }
  .tasto--largo { height: auto; margin: 9px; align-self: stretch; padding: 0 12px; font-size: 13px; }
  .campo__valore { font-size: 14px; }
  .stretto { gap: 10px; padding: 0 6px 0 16px; }
  .tasto--prenota { width: 100px; font-size: 13px; height: calc(100% - 12px); }
  .stretto__date b, .totale { font-size: 13px; }
  .stretto__date span, .stretto__totale > span { font-size: 11px; }
}
@media (max-height: 460px) {
  .posto { margin-top: 6px; }
}
