/* Homepage hero: 3D photo ring (js/hero-ring.js), from trial /test8. */
/* No pull to refresh while the photo hero is on the page. */
html:has(.hero--spiral), html:has(.hero--spiral) body { overscroll-behavior-y: none; }

@property --hs-cut {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 58%;
}
.hero--spiral {
  background:
    radial-gradient(60% 70% at 74% 52%, rgba(201, 162, 39, 0.16) 0%, rgba(201, 162, 39, 0) 70%),
    radial-gradient(40% 30% at 74% 88%, rgba(44, 24, 16, 0.07) 0%, rgba(44, 24, 16, 0) 70%),
    #fbf8f1;
}
.hero--spiral .hero__bg.hs-bg { background: none; }
.hero--spiral .hero__bg.hs-bg::after { display: none; }
.hero--spiral .hero__content { z-index: 3; }
/* The photos are the work, so the hero keeps one button: Book Appointment. */
.hero--spiral .hero__actions .btn--ghost { display: none; }

.hs-stage {
  position: absolute;
  top: calc(var(--nav-height, 72px) * 0.6);
  bottom: 0;
  right: 0;
  width: 58%;
  z-index: 2;
  touch-action: pan-y;
  cursor: grab;
  /* the ring fades in under the text column instead of hitting a hard edge */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 16%);
          mask-image: linear-gradient(to right, transparent 0%, #000 16%);
}
.hs-stage.is-grabbing { cursor: grabbing; }
.hs-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.hs-stage.is-live .hs-canvas { opacity: 1; }

/* Poster: a fan of three prints while Three.js and the photos load, and the
   whole show if WebGL is missing. */
.hs-poster {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.hs-stage.is-live .hs-poster { opacity: 0; }
.hs-poster img {
  grid-area: 1 / 1;
  width: clamp(150px, 17vw, 250px);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 6px solid #fbf8f1;
  border-radius: 10px;
  box-shadow: 0 24px 50px -18px rgba(44, 24, 16, 0.45);
  transform: translateX(calc(var(--i) * 62%)) rotate(calc(var(--i) * 9deg)) scale(calc(1 - (var(--i) * var(--i)) * 0.1));
  z-index: calc(2 - var(--i) * var(--i));
  animation: hsPoster 0.9s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes hsPoster {
  from { opacity: 0; transform: translateY(24px) rotate(0deg) scale(0.9); }
}

.hs-caption {
  position: absolute;
  left: 50%;
  bottom: clamp(4.5rem, 10vh, 6rem);
  transform: translateX(-50%);
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  white-space: nowrap;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  color: var(--black, #1a1a1a);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: rgba(251, 248, 241, 0.82);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
          backdrop-filter: blur(10px) saturate(140%);
  box-shadow: 0 8px 24px -12px rgba(44, 24, 16, 0.35), 0 0 0 1px rgba(44, 24, 16, 0.06);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.hs-caption.is-on { opacity: 1; }
.hs-caption__num {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--slate, #6b6b6b);
  font-variant-numeric: tabular-nums;
}
.hs-caption__name {
  font-family: var(--font-display, 'Playfair Display', serif);
  font-style: italic;
  font-size: 1.15rem;
}
.hs-caption.is-swap .hs-caption__name { animation: hsSwap 0.45s cubic-bezier(.2, .8, .2, 1); }
@keyframes hsSwap {
  from { opacity: 0; transform: translateY(8px); filter: blur(3px); }
}
.hs-caption__hint {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate, #6b6b6b);
  padding-left: 0.75rem;
  border-left: 1px solid rgba(44, 24, 16, 0.18);
  transition: opacity 0.4s ease;
}
.hs-caption.is-used .hs-caption__hint { opacity: 0; }

@media (max-width: 900px) {
  .hero--spiral {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-height: auto;
    padding-bottom: 2rem;
    background:
      radial-gradient(90% 32% at 50% 26%, rgba(201, 162, 39, 0.18) 0%, rgba(201, 162, 39, 0) 70%),
      #fbf8f1;
  }
  /* Photos first on a phone: the ring is the hook, the glass card rides up
     over its reflection. */
  .hs-stage {
    order: -1;
    position: relative;
    top: auto;
    width: 100vw;
    align-self: center;
    height: clamp(340px, 98vw, 460px);
    margin-top: var(--nav-height, 72px);
    -webkit-mask-image: none;
            mask-image: none;
  }
  .hero--spiral .hero__content {
    margin-top: -1.5rem;
    position: relative;
    z-index: 3;
  }
  .hs-poster img { width: clamp(130px, 36vw, 200px); }
  .hs-caption { bottom: 2.2rem; }
  .hs-caption__hint { display: none; }
}

/* Phones: one full screen, layered top to bottom. The photo drum turns
   behind everything; the headline sits over its top fade and the booking
   block over its bottom fade, with Book Appointment as the last, biggest
   thing under the thumb. */
@media (max-width: 640px) {
  .hero--spiral {
    display: block;
    min-height: 100svh;
    padding: 0;
    background:
      radial-gradient(120% 45% at 60% 48%, rgba(201, 162, 39, 0.2) 0%, rgba(201, 162, 39, 0) 70%),
      #fbf8f1;
  }
  .hs-stage {
    position: absolute;
    top: 0;
    left: 0;
    right: auto;
    bottom: auto;
    order: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    -webkit-mask-image: linear-gradient(to bottom, transparent 7%, #000 15%, #000 calc(var(--hs-cut) - 7%), transparent var(--hs-cut));
            mask-image: linear-gradient(to bottom, transparent 7%, #000 15%, #000 calc(var(--hs-cut) - 7%), transparent var(--hs-cut));
  }
  .hs-caption { display: none; }
  /* The drum takes vertical swipes itself, so a pull down spins it instead
     of scrolling or refreshing the page. The booking block below still
     scrolls the page as normal. */
  .hs-stage.is-vertical { touch-action: none; }
  .hs-poster img { width: 46vw; }
  /* The drum owns the screen while the text is away, then pulls its bottom
     fade up above the booking block. */
  .hs-stage { --hs-cut: var(--hs-win, 62%); transition: --hs-cut 0.9s cubic-bezier(.2, .8, .2, 1); }
  .hs-intro .hs-stage { --hs-cut: 88%; }
  /* No headline or blurb on phones: the photos say it. Both stay in the page
     for search engines and screen readers. */
  .hero--spiral .hero__title,
  .hero--spiral .hero__sub-strong {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  .hero--spiral .hero__content > * {
    transition: opacity 0.6s ease, transform 0.7s cubic-bezier(.2, .8, .2, 1);
  }
  .hero--spiral .hero__content > :nth-child(n) { transition-delay: 0.05s; }
  .hero--spiral .hero__actions { transition-delay: 0.18s; }
  .hs-intro .hero__content > * {
    opacity: 0 !important;
    transform: translateY(18px) !important;
    pointer-events: none !important;
  }
  .hero--spiral .hero__content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    min-height: 100svh;
    margin: 0;
    padding: calc(var(--nav-height, 72px) + 0.75rem) 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
            backdrop-filter: none;
    pointer-events: none;   /* the drum between the two blocks takes the touches */
  }
  .hero--spiral .hero__content > * { pointer-events: auto; }
  /* flexible gap that holds the drum's window open */
  .hero--spiral .hero__content::before {
    content: "";
    order: 1;
    flex: 1 1 auto;
    min-height: 42svh;
  }
  .hero--spiral .hero__title {
    font-size: clamp(2.4rem, 11.5vw, 3rem);
    margin-bottom: 0.6rem;
  }
  .hero--spiral .hero__sub-strong {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
    color: var(--charcoal);
  }
  .hero--spiral .promo-card { order: 2; margin: 0 0 0.75rem; }
  .hero--spiral .hero__proof { order: 3; margin: 0; text-align: center; }
  .hero--spiral .hero__availability { order: 4; justify-content: center; margin: 0.25rem 0 0.9rem; }
  .hero--spiral .hero__actions {
    order: 5;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
    margin: 0;
  }
  .hero--spiral .hero__actions .btn { width: 100%; }
  .hero--spiral .hero__actions .btn--primary {
    min-height: 58px;
    font-size: 1rem;
    box-shadow: 0 14px 30px -14px rgba(160, 120, 20, 0.75);
  }
  .hero--spiral .hero__actions .btn--ghost {
    min-height: 46px;
    border-color: transparent;
    background: rgba(251, 248, 241, 0.7);
    font-size: 0.85rem;
  }
  .hero--spiral .hero__scarcity { order: 6; text-align: center; }
  /* the review bar on the trial pages sits over the bottom edge */
  body:has(.trial-bar:not([hidden])) .hero--spiral .hero__content { padding-bottom: 4.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hs-poster img, .hs-caption.is-swap .hs-caption__name { animation: none; }
}

/* Phones: the name sits next to the logo again (main.css hides it under
   560px). Sized to share the bar with the Menu button. */
@media (max-width: 560px) {
  .nav__logo { gap: 0.6rem; min-width: 0; }
  .nav__logo-text-wrap { display: flex; min-width: 0; }
  .nav__logo-text { font-size: 1.12rem; white-space: nowrap; }
  .nav__logo-sub { font-size: 0.52rem; letter-spacing: 0.14em; margin-top: 2px; white-space: nowrap; }
}
@media (max-width: 359px) {
  .nav__logo-sub { display: none; }
  .nav__logo-text { font-size: 1rem; }
}
