/* Full-screen home intro: reuse the existing hero layout, colors, fonts, and assets. */
html.intro-locked,
body.intro-locked {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden !important;
  overscroll-behavior: none;
}

body.intro-locked {
  margin: 0;
  background: var(--wine, #2b0c09);
  touch-action: none;
}

body.intro-locked > :not(main) {
  display: none !important;
}

body.intro-locked main {
  position: fixed !important;
  inset: 0 !important;
  width: 100%;
  height: 100vh;
  height: 100svh;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: var(--wine, #2b0c09);
}

body.intro-locked main > :not(#home) {
  display: none !important;
}

body.intro-locked #home {
  position: fixed !important;
  z-index: 1000;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100svh !important;
  min-height: 100svh !important;
  margin: 0 !important;
  overflow: hidden !important;
  scroll-snap-align: none !important;
  background: var(--wine, #2b0c09);
}

body.intro-locked #home .hero-pin {
  position: absolute !important;
  inset: 0 !important;
  top: 0 !important;
  width: 100%;
  height: 100% !important;
  min-height: 100% !important;
  overflow: hidden !important;
  isolation: isolate;
  display: block !important;
  --nav-h: 0px;
  --hero-top: 0px;
  --hero-bottom: 0px;
}

body.intro-locked #home .hero-frame,
body.intro-locked #home .hero-canvas,
body.intro-locked #home .hero-rest {
  display: none !important;
}

body.intro-locked #home .hero-opening {
  position: absolute !important;
  z-index: 2;
  inset: 0 !important;
  display: block !important;
  width: 100%;
  height: 100%;
  padding: 0 !important;
  pointer-events: none;
}

body.intro-locked #home .hero-open-img {
  visibility: visible !important;
  opacity: 0;
  animation: intro-image-in 550ms cubic-bezier(.2, .65, .25, 1) 100ms both;
}

body.intro-locked #home .hero-design {
  visibility: visible !important;
  opacity: 0;
  clip-path: inset(0 100% 0 0);
  animation: intro-design-write 720ms cubic-bezier(.42, 0, .22, 1) 680ms both;
}

body.intro-locked #home .hero-open-half {
  opacity: 0;
  will-change: transform, translate, opacity;
}

body.intro-locked #home .hero-open-left {
  animation: intro-left-slide 620ms cubic-bezier(.22, .72, .25, 1) 1400ms both;
}

body.intro-locked #home .hero-open-right {
  animation: intro-right-slide 620ms cubic-bezier(.22, .72, .25, 1) 1400ms both;
}

body.intro-locked #home .hero-enter {
  z-index: 3;
  opacity: 0;
  pointer-events: none !important;
  animation: intro-cta-in 520ms ease 2240ms both;
}

body.intro-playing #home .hero-open-img,
body.intro-playing #home .hero-design,
body.intro-playing #home .hero-open-half,
body.intro-playing #home .hero-enter {
  animation-play-state: running;
}

body.intro-locked:not(.intro-playing) #home .hero-open-img,
body.intro-locked:not(.intro-playing) #home .hero-design,
body.intro-locked:not(.intro-playing) #home .hero-open-half,
body.intro-locked:not(.intro-playing) #home .hero-enter {
  animation-play-state: paused;
}

body.intro-ready #home .hero-enter {
  pointer-events: auto !important;
}

body.intro-exiting #home .hero-open-half,
body.intro-exiting #home .hero-design,
body.intro-exiting #home .hero-enter {
  animation: none !important;
  opacity: 0 !important;
  transition: opacity 420ms ease;
}

body.intro-exiting #home .hero-design {
  visibility: visible !important;
}

/* Reveal the original hero canvas only when the user activates the CTA. */
body.intro-canvas-on #home .hero-canvas {
  display: block !important;
  z-index: 3 !important;
}

body.intro-canvas-on #home .hero-opening {
  z-index: 4 !important;
}

body.intro-canvas-ready #home .hero-open-img {
  visibility: hidden !important;
}

/* Keep the site chrome absent through the hero sequence, but let the original page follow it. */
html.parallax-only {
  overflow-x: clip;
}

body.parallax-only {
  min-height: 100%;
  overflow: visible !important;
  overscroll-behavior-y: none;
  touch-action: pan-y;
}

body.parallax-only > :not(main, dialog) {
  display: none !important;
}

body.parallax-only.parallax-menu-visible > .site-header {
  display: block !important;
  animation: parallax-menu-reveal 720ms cubic-bezier(.2, .65, .25, 1) both;
}

body.parallax-only main {
  position: relative !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

body.parallax-only #home .hero-canvas {
  display: block !important;
  z-index: 1 !important;
}

body.parallax-only #home .hero-opening {
  z-index: 2 !important;
}

body.parallax-only #home .hero-open-img {
  visibility: hidden !important;
}

body.parallax-only #home .hero-rest {
  position: absolute !important;
  z-index: 3 !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  background: none !important;
  pointer-events: none;
}

body.parallax-only #home .hero-rest-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(68vw, 360px);
  margin: 0;
  line-height: 0;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.85);
  transition: opacity 800ms cubic-bezier(.2, .65, .25, 1), transform 800ms cubic-bezier(.2, .65, .25, 1);
}

body.parallax-only #home .hero-rest-mark img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 2px 14px rgba(31, 8, 6, .46));
}

body.parallax-only #home .hero-rest.parallax-brand-visible .hero-rest-mark {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

body.parallax-only #home .hero-rest-tag {
  position: absolute;
  left: 50%;
  top: calc(50% + clamp(65px, 7vw, 92px));
  margin: 0;
  white-space: nowrap;
  font: 500 11px/1 var(--sans);
  letter-spacing: .24em;
  color: var(--gold, #c9aa7d);
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity 600ms ease;
}

body.parallax-only #home .hero-rest.parallax-cue-visible .hero-rest-tag {
  opacity: 1;
}

body.parallax-only #home .hero-rest.parallax-scrolling .hero-rest-mark,
body.parallax-only #home .hero-rest.parallax-scrolling .hero-rest-tag {
  opacity: 0;
}

@keyframes intro-image-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes intro-design-write {
  0% { opacity: 0; clip-path: inset(0 100% 0 0); }
  10% { opacity: 1; }
  100% { opacity: 1; clip-path: inset(0 0 0 0); }
}

@keyframes intro-left-slide {
  from { opacity: 0; translate: 12vw 0; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes intro-right-slide {
  from { opacity: 0; translate: -12vw 0; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes intro-cta-in {
  from { opacity: 0; translate: 0 8px; }
  to { opacity: 1; translate: 0 0; }
}

@media (max-width: 760px) {
  body.intro-locked #home .hero-opening {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
}

body.intro-reduced-motion #home .hero-open-img,
body.intro-reduced-motion #home .hero-design,
body.intro-reduced-motion #home .hero-open-half,
body.intro-reduced-motion #home .hero-enter {
  animation: none !important;
  opacity: 1 !important;
  translate: 0 0 !important;
  clip-path: none !important;
}

body.intro-reduced-motion #home .hero-design {
  visibility: visible !important;
}

body.intro-reduced-motion #home .hero-enter {
  pointer-events: auto !important;
}

@keyframes parallax-menu-reveal {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  body.parallax-only.parallax-menu-visible > .site-header {
    animation: none;
  }
}


/* Fine-tune the opening copy around the existing frame without changing its size or artwork. */
@media (min-width: 761px) {
  body.intro-locked #home .hero-open-left {
    right: calc(50% + var(--open-w) / 2 + clamp(8px, .8vw, 14px));
  }
  body.intro-locked #home .hero-open-right {
    left: calc(50% + var(--open-w) / 2 + clamp(8px, .8vw, 14px));
  }
}

body.intro-locked #home .hero-design {
  left: 50% !important;
  top: 50% !important;
  color: #fff !important;
}

@media (max-width: 760px) {
  body.intro-locked #home .hero-open-frame {
    margin-top: 12px !important;
  }
}


/* Landing state: keep the menu clear over the pinned hero and emphasize the centered brand. */
body.parallax-only.parallax-hero-pinned > .site-header {
  background-color: transparent !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
}

/* Hero unpinned but still under the menu: solid wine instead of a blur over the moving canvas. */
body.parallax-only.parallax-hero-leaving > .site-header.is-scrolled {
  background-color: rgb(43 12 9 / .92) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

body.parallax-only #home .hero-rest-mark {
  width: min(82vw, 560px);
}

body.parallax-only #home .hero-rest-tag {
  top: calc(50% + min(14.5vw, 100px) + 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  color: #fff;
  letter-spacing: .2em;
}

body.parallax-only #home .hero-rest-tag::before {
  content: "";
  display: block;
  width: 10px;
  height: 18px;
  border: 1px solid currentColor;
  border-radius: 999px;
  opacity: .86;
}

body.parallax-only #home .hero-rest-tag::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 50%;
  width: 2px;
  height: 4px;
  border-radius: 2px;
  background: currentColor;
  animation: minimal-scroll-cue 1.5s ease-in-out infinite;
}

@keyframes minimal-scroll-cue {
  0%, 100% { opacity: .45; transform: translate(-50%, 0); }
  50% { opacity: 1; transform: translate(-50%, 4px); }
}

@media (prefers-reduced-motion: reduce) {
  body.parallax-only #home .hero-rest-tag::after {
    animation: none;
  }
}


/* A final, quiet bridge into the existing story section. */
body.parallax-only #home .hero-rest-ending {
  position: absolute;
  left: 50%;
  bottom: clamp(42px, 8vh, 88px);
  width: min(88vw, 620px);
  margin: 0;
  color: rgba(255, 255, 255, .76);
  font: 400 clamp(15px, 1.45vw, 20px)/1.3 var(--serif);
  letter-spacing: .025em;
  text-align: center;
  text-shadow: 0 1px 12px rgba(31, 8, 6, .3);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%);
  pointer-events: none;
}


/* Match the About signature and Services script to the site's wine-maroon. */
html body main #story .story-signature {
  color: var(--ink) !important;
}

html body main #services #servicesTitle em {
  color: var(--wine) !important;
}


/* Add a little visual breathing room without moving the following section. */
#story .story-signature {
  position: relative;
  top: 8px;
}
