/* The homes grid to home transition: the stays app of an invented rental brand, Lowtide, on a warm sand page with
   soft light and grain. Two views share one window: the grid of homes and the home's page. The photo that flies
   between them (.volo) and the price that flies into the bar (.prezzo-volo) are pieces of their own, above both. */
:root {
  --page: #e9e3d9;          /* the page */
  --page-light: #f7f2ea;    /* the soft light on the page */
  --app: #fbfaf7;           /* the window of the app */
  --ink: #1d1b18;           /* the words */
  --muted: #7d766c;         /* the small words */
  --line: rgba(29, 27, 24, 0.08); /* thin lines */
  --accent: #c4552d;        /* terracotta: the heart, the star, the button */
  --accent-deep: #a8441f;   /* the button pressed */
  --sea: #2f5d6b;           /* the sea in the photos */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

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

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

.num {
  font-variant-numeric: tabular-nums;
}

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

.palco {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 12px;
  overflow: hidden;
  background:
    radial-gradient(60% 50% at 30% 18%, var(--page-light), transparent 70%),
    radial-gradient(50% 45% at 80% 90%, rgba(196, 85, 45, 0.08), transparent 70%),
    var(--page);
}

/* the grain over the page */
.palco::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  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='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.app {
  position: relative;
  z-index: 1;
  width: min(94vw, 400px);
  height: min(94vh, 600px);
  border-radius: clamp(20px, 3.6vh, 30px);
  background: var(--app);
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 0 0 1px rgba(29, 27, 24, 0.06),
    0 1px 2px rgba(60, 45, 30, 0.08),
    0 8px 18px -6px rgba(60, 45, 30, 0.12),
    0 36px 70px -24px rgba(60, 45, 30, 0.32);
}

.vista {
  position: absolute;
  inset: 0;
}

/* ---------- the grid ---------- */
.vista--griglia {
  display: flex;
  flex-direction: column;
  padding: clamp(14px, 3.4vh, 22px) clamp(12px, 4vw, 18px) clamp(12px, 2.6vh, 18px);
  gap: clamp(8px, 1.8vh, 12px);
}

.testa {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.marchio {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  font-variation-settings: 'wdth' 112;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.marchio svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.7;
  stroke-linecap: round;
}

.titolo-griglia {
  margin: 3px 0 0;
  font-size: clamp(18px, min(5.6vw, 4.6vh), 23px);
  line-height: 1.05;
  font-weight: 650;
  font-variation-settings: 'wdth' 92;
  letter-spacing: -0.025em;
}

.date {
  flex: none;
  font-size: 11px;
  font-weight: 520;
  color: var(--ink);
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(60, 45, 30, 0.06);
}

.filtri {
  display: flex;
  gap: 6px;
  overflow: hidden;
}

.filtro {
  flex: none;
  font-size: 11px;
  font-weight: 520;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
}

.filtro.is-on {
  color: #fff;
  background: var(--ink);
  box-shadow: none;
}

.case {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: clamp(8px, 1.8vh, 12px) clamp(8px, 2.4vw, 12px);
}

.casa {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

/* the face of the card: GSAP moves .casa, the CSS presses the face */
.casa__faccia {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.casa.e-premuta .casa__faccia,
.casa:active .casa__faccia {
  transform: scale(0.97);
  transition-duration: 0.12s;
}

.casa:focus-visible .foto {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.foto {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #d9cfc0;
  box-shadow: 0 1px 2px rgba(60, 45, 30, 0.1), 0 6px 14px -8px rgba(60, 45, 30, 0.35);
}

.foto__img,
.volo__foto,
.cover__img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.foto__img {
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* the thin edge that catches the light, over every photo */
.foto::after,
.volo::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.casa.e-sopra .foto__img {
  transform: scale(1.045);
}

@media (hover: hover) {
  .casa:hover .foto__img {
    transform: scale(1.045);
  }
}

.cuore {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.cuore svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.cuore.is-on svg {
  fill: var(--accent);
  stroke: var(--accent);
}

.casa__righe {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.casa__nome {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  font-variation-settings: 'wdth' 96;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform-origin: 0 50%;
}

.casa__voto {
  flex: none;
  font-size: 11px;
  color: var(--muted);
}

.casa__sotto {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  margin-top: -3px;
  white-space: nowrap;
}

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

/* ---------- the home ---------- */
.vista--casa {
  visibility: hidden;
}

.cover {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 46%;
  overflow: hidden;
}

.cover__luce {
  position: absolute;
  inset: -20% -60%;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 246, 228, 0.42) 48%, rgba(255, 255, 255, 0.6) 50%, rgba(255, 246, 228, 0.42) 52%, transparent 62%);
  mix-blend-mode: soft-light;
  transform: translateX(-70%);
  opacity: 0;
}

.cover__pagine {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 26px;
  display: flex;
  gap: 4px;
  transform: translateX(-50%);
}

.cover__pagine i {
  width: 10px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.45);
}

.cover__pagine i.is-on {
  width: 18px;
  background: #fff;
}

.tondo {
  position: absolute;
  z-index: 4;
  top: 12px;
  left: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tondo svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tondo:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.foglio {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  top: calc(46% - 16px);
  bottom: 0;
  padding: clamp(14px, 2.8vh, 20px) clamp(14px, 4.6vw, 20px) 0;
  border-radius: 18px 18px 0 0;
  background: var(--app);
  box-shadow: 0 -10px 24px -14px rgba(40, 30, 20, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.foglio__testa {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.titolo-casa {
  margin: 0;
  font-size: clamp(18px, min(5.6vw, 4.4vh), 22px);
  line-height: 1.1;
  font-weight: 650;
  font-variation-settings: 'wdth' 92;
  letter-spacing: -0.025em;
  transform-origin: 0 50%;
  white-space: nowrap;
}

.voto {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}

.voto svg {
  width: 13px;
  height: 13px;
  fill: var(--accent);
}

.luogo {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: clamp(10px, 2.2vh, 14px) 0 0;
  padding: 0;
  list-style: none;
}

.specs li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: clamp(7px, 1.4vh, 10px) 9px;
  border-radius: 11px;
  font-size: 10.5px;
  color: var(--muted);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(60, 45, 30, 0.05);
}

.specs b {
  color: var(--ink);
  font-weight: 620;
}

.specs svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.frase {
  margin: clamp(8px, 1.8vh, 12px) 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.host {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: clamp(8px, 1.8vh, 12px);
  padding-top: clamp(8px, 1.8vh, 12px);
  border-top: 1px solid var(--line);
}

.host__volto {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 650;
  color: #fff;
  background: linear-gradient(140deg, #d9825c, var(--accent-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.host__testo {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  color: var(--muted);
}

.host__testo b {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.barra {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: clamp(9px, 1.8vh, 12px) clamp(12px, 4vw, 16px) clamp(10px, 2.2vh, 14px);
  background: rgba(251, 250, 247, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}

.barra__prezzo {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 3px;
  font-size: 12px;
  color: var(--muted);
}

.barra__prezzo b {
  display: inline-block;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.barra__date {
  flex-basis: 100%;
  font-size: 10.5px;
}

.prenota {
  flex: none;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  font: inherit;
  color: #fff;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.prenota:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 999px;
}

/* the face of the button: the colour, the light on its top edge, the press */
.prenota__faccia {
  position: relative;
  height: 100%;
  min-width: 104px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(180deg, #d0643b, var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), inset 0 -1px 0 rgba(0, 0, 0, 0.12), 0 6px 14px -6px rgba(196, 85, 45, 0.7);
}

.prenota__parole {
  font-size: 13px;
  font-weight: 600;
  font-variation-settings: 'wdth' 100;
  white-space: nowrap;
}

.prenota__spunta {
  width: 15px;
  height: 15px;
  display: none;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.prenota.is-fatto .prenota__spunta {
  display: block;
}

/* the light that runs across the button while it waits */
.prenota__faccia::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  pointer-events: none;
}

.prenota.is-attesa .prenota__faccia::after {
  animation: passa 1s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes passa {
  to {
    transform: translateX(120%);
  }
}

/* ---------- the pieces that fly ---------- */
.volo {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  will-change: transform, width, height;
}

.cuore--volo {
  z-index: 2;
}

.prezzo-volo {
  position: absolute;
  z-index: 7;
  left: 0;
  top: 0;
  visibility: hidden;
  pointer-events: none;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
  transform-origin: 0 0;
}

.puntatore {
  position: absolute;
  z-index: 9;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  margin: -3px 0 0 -5px;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}

.puntatore svg {
  width: 100%;
  height: 100%;
  fill: #1d1b18;
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linejoin: round;
}

/* a short window: the sentence under the specs stays out */
@media (max-height: 520px) {
  .frase {
    display: none;
  }
}

@media (max-height: 360px) {
  .host {
    display: none;
  }
}
