/* Home page (/). Values come from getComputedStyle() on the old SP Page Builder page, not from its stylesheets.
   Breakpoints follow the old site: 576 / 768 / 992 / 1200 px. */

/* ===== 1. Hero ==========================================================================
   Layers inside .home-hero (its own stacking context): linen -2, headline -1, photo 1, scroll cue 2.
   The photo and linen are position:fixed, so they stay put while the headline scrolls behind the photo.
   home.js scales the photo and linen, moves the headline at 46% of the scroll speed and fades each line in
   as it rises past the parchment and out towards the top (opacity only; see home.js part 1).
   z-index 1 also keeps the fixed layers below the later sections (film 5, features 20, footer 21). */
.home-hero {
  position: relative;
  z-index: 1;
  isolation: isolate;
  overflow: hidden;
  padding: 2px 0 1px; /* the old page's three empty builder columns took 1px each; keeps the headline where it was */
}

/* The <picture> around the photo only picks the file (AVIF/WebP, 1280-2560 wide); it adds no box of its own. */
.home-hero__picture { display: contents; }
/* home.js sets .is-away once the hero is half a screen out of view (see the observer there). */
.home-hero.is-away .home-hero__photo,
.home-hero.is-away .home-hero__linen { visibility: hidden; }
/* Same for the linen and the feature photos: <picture> offers AVIF, the <img> keeps WebP/JPG for older browsers. */
.home-picture { display: contents; }

.home-hero__photo {
  position: fixed;
  z-index: 1;
  left: 50vw;
  bottom: -20px;
  width: 930px;
  max-width: none;
  height: auto;
  min-height: 80vh;
  max-height: 85vh;
  object-fit: cover;
  transform: translate3d(-50%, 0, 0);
  will-change: transform;
}
@media (min-width: 576px)  { .home-hero__photo { width: 1200px; } }
@media (min-width: 768px)  { .home-hero__photo { width: 1400px; } }
@media (min-width: 992px)  { .home-hero__photo { width: 1600px; } }
@media (min-width: 1200px) { .home-hero__photo { width: 1750px; } }
@media (min-aspect-ratio: 16/9) {
  .home-hero__photo { bottom: -90px; min-height: 0; max-height: none; }
}

.home-hero__linen {
  position: fixed;
  z-index: -2;
  left: 50vw;
  top: 50vh;
  width: 100vw;
  max-width: none;
  height: 100vh;
  object-fit: cover;
  transform: translate3d(-50%, -50%, 0);
  will-change: transform;
  pointer-events: none;
}
@media (max-width: 575.98px) { .home-hero__linen { width: 1200px; } }

.home-hero__text {
  position: relative;
  z-index: -1;
  overflow: hidden;
  padding: 230px 0 200px;
  color: #48210e;
  will-change: transform;
}
@media (min-width: 576px) { .home-hero__text { padding-bottom: 300px; } }
@media (min-width: 768px) and (max-width: 991.98px) { .home-hero__text { padding-top: 330px; } }

.home-hero__headline {
  margin: 0;
  font-family: 'Druk Medium', sans-serif;
  font-size: 80px;
  font-weight: 500;
  line-height: 65px;
  text-align: center;
}
@media (min-width: 768px)  { .home-hero__headline { font-size: 100px; line-height: 90px; } }
@media (min-width: 992px)  { .home-hero__headline { font-size: 120px; line-height: 110px; } }
@media (min-width: 1200px) { .home-hero__headline { line-height: 100px; } }

/* Each line is its own layer (will-change: opacity), so home.js fading it costs no redraw. Lines start
   invisible; home.js places the headline and fades each line in. The box hugs the text (centred). */
.home-hero__line {
  display: block;
  width: fit-content;
  margin: 0 auto 8px;
  opacity: 0;
  will-change: opacity;
}

/* Landscape windows 992px and wider (desktops, including zoomed or short ones), PB-PERF v4.2 + v4.3:
   - the headline and its top padding scale with the window height, so the photo never rises over it;
   - the photo is never narrower than the window (no table edge at the sides). Its extra height goes below
     the bottom edge so the food stays in place: 0.3137 = (1 - 0.42) / 1.849 keeps the food top (~42% down
     the photo) fixed; the 0.0649 * width cap keeps the food bottom (~88%) inside the window.
   Identical to the base sizes on windows 1000px or more tall. */
@media (min-width: 992px) and (orientation: landscape) {
  .home-hero {
    --photo-w0: min(1750px, 175vh);
    --photo-w: max(var(--photo-w0), 100vw);
  }
  .home-hero__photo {
    width: var(--photo-w);
    bottom: calc(-1 * min(min(90px, 9vh) + 0.3137 * (var(--photo-w) - var(--photo-w0)), 0.0649 * var(--photo-w)));
  }
  .home-hero__text { padding-top: min(230px, 23vh); }
  .home-hero__headline { font-size: min(120px, 12vh); line-height: min(100px, 10vh); }
  .home-hero__line { margin-bottom: min(8px, 0.8vh); }
}

/* "SCROLL" cue: bottom centre on phones, bottom left from 768px. */
.home-scroll-cue {
  position: fixed;
  z-index: 2;
  left: 50%;
  bottom: 5vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transform: translateX(-50%);
}
.home-scroll-cue__label {
  display: none;
  color: #000;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.18em;
  white-space: nowrap;
}
@media (min-width: 768px) {
  .home-scroll-cue { left: 28px; bottom: 20px; flex-direction: row-reverse; justify-content: normal; transform: none; }
  .home-scroll-cue__label { display: block; }
}
.home-scroll-cue__btn {
  position: relative;
  display: block;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 1px solid #000;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.home-scroll-cue__arrow {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  pointer-events: none;
  animation: home-scroll-arrow 1.4s ease-in-out infinite;
}
.home-scroll-cue__arrow svg { display: block; width: 20px; height: 12px; fill: currentColor; }
@keyframes home-scroll-arrow {
  0%   { transform: translateY(-14px); opacity: 0; }
  20%  { transform: translateY(-6px);  opacity: 1; }
  60%  { transform: translateY(8px);   opacity: 1; }
  100% { transform: translateY(16px);  opacity: 0; }
}

/* ===== 2. Film: parchment cut-out over the video (PB-PERF v8) ===========================
   The stage is 180vh tall. The video mask is 100vh: it scrolls in with the stage, home.js pins it
   (.is-pinned) for the next 80vh, then releases it at the bottom (.is-released). */
.home-film__anchor { height: 1px; width: 1px; scroll-margin-top: 80px; }

.home-film__stage {
  position: relative;
  z-index: 5;
  height: 180vh;
  overflow: hidden;
  isolation: isolate;
}
.home-film__mask {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  pointer-events: none;
}
.home-film__mask.is-pinned   { position: fixed; }
.home-film__mask.is-released { top: 80vh; }

.home-film__fallback,
.home-film__video {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  transform: translate3d(-50%, -50%, 0);
}
.home-film__fallback { z-index: 1; max-width: 100%; transition: opacity 0.4s ease; }
.home-film__video    { z-index: 2; opacity: 0; transition: opacity 0.4s ease; aspect-ratio: 16 / 10; } /* the video's shape before it loads (portrait width:auto) */
.home-film__mask.video-ready .home-film__video    { opacity: 1; }
.home-film__mask.video-ready .home-film__fallback { opacity: 0; }

.home-film__parchment-panel,
.home-film__text-panel { position: relative; width: 100%; }
.home-film__parchment-panel { z-index: 6; height: 100vh; overflow: hidden; }
.home-film__parchment {
  position: absolute;
  left: 50%;
  top: 0;
  width: 100%;
  height: 100vh;    /* iOS < 15.4 has no svh */
  height: 100svh;
  object-fit: cover;
  transform: translate3d(-50%, 0, 0); /* home.js adds a slow upward drift */
  pointer-events: none;
  will-change: transform;
}

.home-film__text-panel {
  z-index: 7;
  height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-film__title {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  padding: 24px 32px;
  border: 2px solid #fff;
  color: #fff;
  font-family: 'Druk Medium', sans-serif;
  font-size: 80px;
  line-height: 0.9;
  text-align: center;
}

.home-film__control {
  position: absolute;
  z-index: 8;
  left: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 10px;
}
.home-film__control-label {
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0.12em;
  white-space: nowrap;
}
.home-film__toggle {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #fff;
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.home-film__toggle-icon { position: relative; display: block; width: 16px; height: 16px; }
.home-film__toggle.is-play .home-film__toggle-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 1px;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid #000;
}
.home-film__toggle.is-pause .home-film__toggle-icon::before,
.home-film__toggle.is-pause .home-film__toggle-icon::after {
  content: "";
  position: absolute;
  top: 1px;
  width: 4px;
  height: 14px;
  background: #000;
  border-radius: 1px;
}
.home-film__toggle.is-pause .home-film__toggle-icon::before { left: 2px; }
.home-film__toggle.is-pause .home-film__toggle-icon::after  { right: 2px; }

@media (orientation: portrait) {
  .home-film__fallback,
  .home-film__video { width: auto; height: 102vh; }
  .home-film__parchment { height: 100vh; }
  .home-film__title { font-size: 60px; padding: 20px 24px; }
  .home-film__control { left: 16px; bottom: 16px; gap: 8px; }
  .home-film__toggle { width: 48px; height: 48px; }
  .home-film__control-label { font-size: 14px; }
}

/* ===== 3. Features =====================================================================
   Each .home-feature is a text tile and a photo tile: stacked on phones and tablets, side by side
   from 992px (the photo on the left for --reverse). Opaque, and above the fixed hero layers. */
.home-features {
  position: relative;
  z-index: 20;
  background: #fbf5ee;
}
/* Stacked cards on desktop: .home-features is a .pb-stack and each .home-feature a .pb-stack-card (shared component,
   assets/js/stack-cards.js + base.css). Cards are opaque so they cover the one below. */
.home-feature { display: flex; flex-wrap: wrap; background: #fbf5ee; }
.home-tile { position: relative; flex: 0 0 100%; max-width: 100%; }
@media (min-width: 992px) {
  .home-tile { flex-basis: 50%; max-width: 50%; }
  .home-feature--reverse { flex-direction: row-reverse; }
}

/* Text tile: content centred vertically in the row. */
.home-tile--text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 0 50px;
  background: #fff;
  text-align: center;
}
.home-feature:first-child .home-tile--text { padding: 0 0 30px; }
@media (min-width: 576px) { .home-tile--text, .home-feature:first-child .home-tile--text { padding: 30px 0; } }
@media (min-width: 768px) { .home-tile--text, .home-feature:first-child .home-tile--text { padding: 30px 0 60px; } }
@media (min-width: 992px) {
  .home-tile--text, .home-feature:first-child .home-tile--text { padding: 50px 0 60px; }
}
@media (min-width: 1200px) { .home-tile--text, .home-feature:first-child .home-tile--text { padding: 0; } }

/* Script title: shifted 20px down so it overlaps (and, being positioned, paints over) the kicker. */
.home-tile__title {
  position: relative;
  top: 20px;
  margin: 0 0 8px;
  color: #cb333b;
  font-family: 'Belguri', sans-serif;
  font-size: 40px;
  font-weight: 500;
  line-height: 40px;
}
.home-tile__kicker {
  margin: 0;
  color: #48210e;
  font-family: 'Druk Medium', sans-serif;
  font-size: 50px;
  line-height: 1.5;
}
.home-tile__body {
  margin: 0;
  padding: 0 20px 20px;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 14px;
  line-height: 23px;
}
@media (min-width: 576px) {
  .home-tile__title  { font-size: 60px; }
  .home-tile__kicker { font-size: 70px; }
  .home-tile__body   { padding: 0 80px 20px; font-size: 15px; }
}
@media (min-width: 992px) { .home-tile__body { padding: 0 50px 15px; } }
@media (min-width: 1200px) {
  .home-tile__title  { font-size: 80px; }
  .home-tile__kicker { font-size: 100px; }
  .home-tile__body   { padding: 0 100px 30px; font-size: 20px; line-height: 30px; }
}

.home-btn {
  display: inline-block;
  align-self: center;
  padding: 8px 16px;
  border: 1px solid #cb333b;
  border-radius: 7px;
  background: #cb333b;
  color: #fff;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  text-decoration: none;
  transition: all 0.15s ease-in-out;
}
.home-btn:hover { background: #fff; color: #cb333b; }
@media (min-width: 1200px) { .home-btn { font-size: 20px; } }

/* Photo tile: the photo covers the tile (lazy <img> in place of the old CSS background). */
.home-tile--photo { min-height: 350px; }
@media (min-width: 576px)  { .home-tile--photo { min-height: 400px; } }
@media (min-width: 992px)  { .home-tile--bento { min-height: 600px; } }
@media (min-width: 1200px) { .home-tile--photo { min-height: 600px; } }
.home-tile__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 767.98px) { .home-tile--wrap .home-tile__img { object-position: 100% 50%; } }
@media (min-width: 992px) and (max-width: 1199.98px) { .home-tile--wrap .home-tile__img { object-position: 50% 100%; } }

/* White outline words in the photo's top-right corner, desktop only. */
.home-tile__outline { display: none; }
@media (min-width: 992px) {
  .home-tile__outline {
    display: block;
    position: relative;
    padding: 20px;
    color: #fff;
    font-family: 'Druk Medium', sans-serif;
    font-size: 60px;
    line-height: 35px;
    text-align: right;
  }
  .home-tile__outline p { margin: 0 0 16px; }
}
@media (min-width: 1200px) { .home-tile__outline { font-size: 120px; line-height: 80px; } }

/* Tiles fade in as they scroll into view (home.js adds .home-reveal, then .is-shown). */
.home-reveal { visibility: hidden; }
.home-reveal.is-shown { visibility: visible; animation: home-fade-in 0.5s both; }
@keyframes home-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Live compositor hints, kept for iOS Safari (avoids flicker on the fixed and moving layers). */
.home-hero__photo,
.home-hero__linen,
.home-film__fallback,
.home-film__video,
.home-film__parchment { backface-visibility: hidden; }
.home-film__video { will-change: opacity; }
