/* The home page is exactly one screen tall (dvh follows the iPhone address bar), so there is nothing to scroll.
   The document stays the scroller on purpose: that keeps pull to refresh working on phones. */
html.home-page,
html.home-page body {
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  min-height: 0;
  overscroll-behavior-x: none;
}

/* home: four full screen panels. The track is moved sideways by js/panels.js, one panel per gesture. */
.hs {
  position: relative;
}
.hs-stick {
  position: relative;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  overflow: hidden;
  overflow: clip; /* clip also stops the browser from scrolling the strip to a focused link */
  background: var(--bg);
}
.hs-track {
  display: flex;
  width: calc(var(--n, 4) * 100%);
  height: 100%;
  will-change: transform;
}
.pn {
  position: relative;
  flex: 0 0 calc(100% / var(--n, 4));
  overflow: hidden;
}
.pn-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.pn-bg img {
  width: 114%;
  max-width: none;
  margin-inline-start: -7%;
  transform: translate3d(calc(var(--o, 0) * var(--dir) * -5%), 0, 0);
  scale: 1.1;
}
/* the photo of a panel that is arriving slowly pulls back, which gives the background depth */
.pn.zoom .pn-bg img {
  animation: pull-back 3.4s cubic-bezier(0.22, 0.7, 0.3, 1) both;
}
@keyframes pull-back {
  from {
    scale: 1.1;
  }
  to {
    scale: 1;
  }
}
.pn-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(8, 7, 6, 0.2) 0%, rgba(8, 7, 6, 0.62) 100%),
    linear-gradient(rgba(8, 7, 6, 0.5), rgba(8, 7, 6, 0) 28%, rgba(8, 7, 6, 0.4));
}
.pn-ct {
  position: absolute;
  inset-inline: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  padding: 0 clamp(24px, 24vw, 460px);
  text-align: center;
}
.pn h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 3.5vw, 54px);
  line-height: 1.14;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--pt);
}
html[dir='rtl'] .pn h1 {
  font-size: clamp(40px, 4.4vw, 68px);
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
}
body.ready .pn-ct {
  animation: rise 1.4s var(--ease) 0.2s both;
}
body:not(.ready) .pn-ct {
  opacity: 0;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(calc(-50% + 28px));
  }
  to {
    opacity: 1;
    transform: translateY(-50%);
  }
}

@media (max-width: 820px) {
  .pn-bg img {
    width: 100%;
    margin: 0;
    transform: none;
  }
  .pn-ct {
    padding: 0 28px;
    gap: 24px;
  }
  .hs .pv,
  .hs .nx {
    top: auto;
    bottom: 86px;
    transform: none;
    font-size: 11px;
    gap: 12px;
  }
  html[dir='rtl'] .hs .pv,
  html[dir='rtl'] .hs .nx {
    font-size: 14px;
  }
  .hs .pv u,
  .hs .nx u {
    width: 34px;
  }
  .hs .cnt {
    bottom: 36px;
    gap: 6px;
  }
  .hs .cnt u {
    width: 26px;
  }
}
