/* Homepage hero and motion: clearer film, quieter type and a restrained FAQ. */
#home.hero {
  --hero-tail: clamp(32px, 5vh, 56px);
  min-height: calc(100vh - var(--hero-header-height, 88px) + var(--hero-tail));
  background: #090909;
}

@supports (height: 100svh) {
  #home.hero {
    --hero-tail: clamp(32px, 5svh, 56px);
    min-height: calc(100svh - var(--hero-header-height, 88px) + var(--hero-tail));
  }
}

#home .hero-video-showcase {
  background: #090909;
}

/* Keep contrast behind the lettering without darkening the entire scene. */
#home .hero-video-showcase::before {
  background: linear-gradient(90deg, rgba(9, 9, 9, 0.32), rgba(9, 9, 9, 0.06) 60%, rgba(9, 9, 9, 0.12));
}

#home .hero-overlay {
  background: linear-gradient(180deg, rgba(9, 9, 9, 0.12), transparent 30%);
}

#home.hero::after {
  top: auto;
  bottom: -1px;
  height: clamp(80px, 13vh, 140px);
  z-index: 2;
  background: linear-gradient(180deg, transparent, #0b0b0b);
}

#home .hero-video {
  filter: brightness(0.98) contrast(1.04) saturate(0.92);
  transform:
    translateX(var(--hero-video-pan-x, 0))
    translateY(var(--hero-video-pan-y, 0))
    scale(var(--hero-video-active-scale, 1))
    scale(var(--hero-video-framing, 1));
  transition: opacity 1.1s ease-in-out;
}

#home .hero-video:nth-of-type(1) {
  --hero-video-active-scale: 1;
}

/* The first scene and its poster sit a little farther back than the beard scene. */
#home .hero-video:nth-of-type(-n+2) {
  --hero-video-framing: 0.965;
}

#home .hero-video:nth-of-type(1) {
  --hero-video-framing: 0.945;
}

/* Fill the desktop hero and keep the first scene on the head and clipper. */
@media (min-width: 981px) {
  #home .hero-video:nth-of-type(1) {
    --hero-video-framing: 1;
    --hero-video-y: 25%;
  }

  #home .hero-video:nth-of-type(2) {
    --hero-video-x: 50%;
    --hero-video-y: 0%;
    --hero-video-pan-x: -8.5vw;
    --hero-video-pan-y: 1.5vh;
    --hero-video-active-scale: 1.18;
    --hero-video-framing: 1;
  }
}

/* Remove the old off-centre crop from the beard scene on compact screens. */
@media (max-width: 980px) {
  #home .hero-video:nth-of-type(2) {
    --hero-video-x: 50%;
    --hero-video-y: 50%;
    --hero-video-pan-x: 0px;
    --hero-video-pan-y: 0px;
    --hero-video-active-scale: 1;
  }

}

/* Keep the barber cleaning his brush in frame on narrow screens. */
@media (max-width: 980px) and (orientation: portrait) {
  #home .hero-video:nth-of-type(3) {
    --hero-video-x: 88%;
  }
}

#home .hero-video.active {
  opacity: 0.65;
}

#home .hero-video.leaving {
  opacity: 0;
}

#home .hero-content {
  z-index: 3;
  width: min(100% - 40px, 1120px);
  padding: 72px 0 calc(72px + var(--hero-tail));
}

.home-page .header-location {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  flex-shrink: 0;
  color: #c7bdac;
  font-size: 0.76rem;
  white-space: nowrap;
}
.home-page .header-location svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}
.home-page .header-location:hover { color: #f5f1e8; }
.home-page .header-location:focus-visible {
  outline: 2px solid #c7bdac;
  outline-offset: 4px;
}
#home .hero-booking {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}
#home .hero-booking .booking-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 196px;
  min-height: 52px;
  border-radius: 10px;
  background: #174633;
  border-color: rgba(174, 202, 180, 0.5);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  transition: background-color 0.18s ease, border-color 0.18s ease;
  transform: none;
}
#home .hero-booking .booking-cta:hover {
  background: #20563e;
  border-color: #afc8b5;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  transform: none;
}
#home .hero-booking .booking-cta:focus-visible {
  outline: 2px solid #f5f1e8;
  outline-offset: 4px;
}
#home .hero-booking svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@media (max-width: 1080px) {
  .home-page .header-location { order: 1; font-size: 0.72rem; }
}
@media (max-width: 600px) {
  .home-page .header-location { font-size: 0.68rem; gap: 4px; }
}

#home h1.hero-signature {
  font-size: clamp(4rem, 6vw, 6rem);
  transform: none;
  color: #f5f1e8;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.55);
}

/* Simple opacity replaces the painted handwriting mask and permanent layers. */
#home .signature-line {
  clip-path: none;
  transform: none;
  will-change: auto;
  animation: hero-signature-reveal 0.85s ease-out both;
}

#home .signature-line-1 { animation-delay: 0.15s; }
#home .signature-line-2 { animation-delay: 0.65s; }
#home .signature-line-3 { animation-delay: 1.15s; }

@keyframes hero-signature-reveal {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 900px) {
  #home h1.hero-signature {
    font-size: clamp(3.5rem, 8.5vw, 5.6rem);
  }
}

@media (max-width: 620px) {
  #home .hero-content {
    align-self: flex-end;
    padding-bottom: calc(80px + var(--hero-tail));
  }

  #home h1.hero-signature {
    font-size: clamp(2.8rem, 12.5vw, 4.2rem);
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  #home .hero-content {
    padding-top: 32px;
    padding-bottom: calc(32px + var(--hero-tail));
  }
  #home h1.hero-signature {
    font-size: clamp(2.2rem, 9vh, 3rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  #home .hero-video { transition: none; }
  #home .signature-line { animation: none; opacity: 1; }
}

/* The embedded map fills a rounded container without a coloured rim. */
#contact .contact-map {
  width: 100%;
  margin-inline: 0;
  padding: 0;
  border: 0;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
}

#contact .contact-map iframe {
  border-radius: inherit;
}

/* Keep the desktop map aligned with the visible phone block, not its empty column. */
@media (min-width: 821px) {
  #contact > .container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, calc((100% - 52px) / 3))) max-content;
    justify-content: center;
    column-gap: 26px;
    row-gap: 25px;
    padding-top: 46px;
  }
  #contact .contact-top-row { display: contents; }
  #contact .contact-map { grid-column: 1 / -1; min-width: 0; contain: inline-size; }
}


@media (max-width: 820px) {
  #contact .contact-map { border-radius: 22px; }
}

@media (max-width: 1080px) {
  #contact [data-i18n="contact.address.street"] { white-space: pre-line; }
}

/* Product magnification shares the existing spotlight and keeps layout fixed. */
#products .product-image img {
  touch-action: manipulation;
}
#products .product-image img:focus-visible {
  outline: 2px solid #f5f1e8;
  outline-offset: 6px;
}
@media (hover: hover) and (pointer: fine) {
  #products .product-card .product-image img:hover { transform: scale(1.24); }
}
#products .product-card .product-image.is-touched img { transform: scale(1.24); }

@media (prefers-reduced-motion: reduce) {
  #products .product-image img { transition: none; }
}

/* Animate only the accordion row; avoid blurred surfaces during page reflow. */
#faq .faq-item {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

#faq .faq-answer {
  transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#faq .faq-answer-inner {
  opacity: 1;
  transition: none;
}

@media (max-width: 980px), (hover: none) and (pointer: coarse) {
  #faq .faq-answer { transition-duration: 0.4s; }
}

@media (prefers-reduced-motion: reduce) {
  #faq .faq-answer { transition: none; }
}
