.bottle-story { display: none; }
[data-layout="story"] .hero { display: none; }
[data-layout="story"] .bottle-story {
  display: block;
  isolation: isolate;
  color: var(--paper);
  background: #071c2b;
}
.story-stage { display: none; }

.story-beat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.8rem, 5vw, 5rem);
  padding: clamp(2.5rem, 7vw, 7rem) var(--gutter);
}
.story-still {
  width: min(100%, 24rem);
  height: auto;
  justify-self: center;
}
.story-beat.story-intro {
  position: relative;
  display: flex;
  min-height: 36rem;
  padding: 2rem calc(58% + var(--gutter)) 2rem var(--gutter);
  background: var(--paper);
  color: #302219;
}
.story-intro .story-still {
  position: absolute;
  inset: 0 0 0 auto;
  width: 58%;
  height: 100%;
  object-fit: cover;
  object-position: 31% center;
}
.story-copy { width: min(100%, 32rem); }
.story-copy .eyebrow { margin-bottom: .85rem; color: var(--mint); }
.story-intro :is(.story-copy .eyebrow, .story-next) { color: #664c3c; }
.story-copy :is(h1, h2) {
  font-size: clamp(2.1rem, 4.2vw, 4.65rem);
  line-height: .98;
  letter-spacing: -.025em;
}
.story-copy p:not(.eyebrow) {
  max-width: 30ch;
  margin: 1rem 0 .85rem;
  font-size: clamp(.95rem, 1.4vw, 1.1rem);
  line-height: 1.43;
}
.story-copy .button,
.story-next { margin-top: .25rem; }
.story-next { color: var(--mint); }
.story-origin {
  display: flex;
  width: fit-content;
  max-width: 100%;
  min-height: 2.75rem;
  align-items: center;
  gap: .65rem;
  color: var(--mint);
  font-size: .88rem;
  font-weight: 650;
  text-underline-offset: .2em;
}
.story-origin img {
  width: 3.75rem;
  height: 2.55rem;
  object-fit: cover;
  border: 1px solid rgb(241 231 214 / .55);
}

[data-layout="story"] .bottle-story[data-motion="scrub"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
[data-motion="scrub"] :is(.story-stage, .story-chapters) { grid-area: 1 / 1; }
[data-motion="scrub"] .story-stage {
  position: sticky;
  top: 0;
  display: block;
  align-self: start;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(ellipse at 52% 42%, #102e43 0%, #071c2b 67%);
}
.story-screen {
  position: absolute;
  inset: 0 auto 0 50%;
  width: min(66vw, 56.25vh);
  width: min(66vw, 56.25svh);
  transform: translateX(-50%);
  mask-image: linear-gradient(90deg, transparent, #000 10% 90%, transparent);
}
.story-screen > :is(picture, video, canvas), .story-screen img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.story-screen > :is(video, canvas) { opacity: 0; }
.story-screen > .is-ready { opacity: 1; }
.story-meter {
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: var(--mint);
  transform: scaleX(var(--story-progress, 0));
  transform-origin: left center;
}
[data-motion="scrub"] .story-chapters { z-index: 1; pointer-events: none; }
[data-motion="scrub"] .story-beat:not(.story-intro) .story-still { display: none; }
[data-motion="scrub"] .story-beat {
  display: flex;
  min-height: 106svh;
  align-items: center;
  padding: 2rem var(--gutter);
  scroll-margin-top: 0;
}
[data-motion="scrub"] .story-inside { justify-content: end; }
[data-motion="scrub"] .story-finish { min-height: 212svh; align-items: end; padding-bottom: 31svh; }
[data-motion="scrub"] .story-copy { width: min(29vw, 29rem); }
[data-motion="scrub"] .story-intro { padding-inline-end: calc(58% + var(--gutter)); }
[data-motion="scrub"] .story-copy a { pointer-events: auto; }

@media (max-width: 50rem) {
  [data-layout="story"] .bottle-story[data-motion="scrub"]::before {
    content: "";
    grid-area: 1 / 1;
    height: 530vh;
    height: 530svh;
  }
  [data-motion="scrub"] .story-chapters {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    height: 100svh;
    overflow: clip;
  }
  [data-motion="scrub"] .story-screen {
    inset-block: 0 auto;
    width: min(100%, 34.81vh);
    width: min(100%, 34.81svh);
    height: 62vh;
    height: 62svh;
    mask-image: radial-gradient(ellipse 50% 66% at 50% 40%, #000 80%, transparent 100%);
  }
  .story-screen :is(img, video, canvas) { object-position: center top; }
  [data-motion="scrub"] .story-beat {
    position: absolute;
    inset: 0;
    min-height: 0;
    align-items: end;
    padding-bottom: max(6svh, 2.5rem);
    visibility: hidden;
    opacity: 0;
  }
  [data-motion="scrub"] .story-beat[data-active] {
    visibility: visible;
    opacity: 1;
    transition: opacity .25s ease;
  }
  [data-motion="scrub"] .story-inside { justify-content: start; }
  [data-motion="scrub"] .story-copy {
    width: 100%;
    text-shadow: 0 1px 4px #071c2b, 0 0 1.25rem #071c2b, 0 0 2rem #071c2b;
  }
  .story-copy :is(h1, h2) { font-size: clamp(2rem, 8.9vw, 3.7rem); }
  .story-copy :is(h1, h2) br { display: none; }
  .story-copy .button { text-shadow: none; }

  .story-beat.story-intro {
    --story-intro-image-height: min(54svh, max(15rem, calc(100svh - 21rem)));
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    min-height: 0;
    padding: 0;
  }
  .story-intro .story-still {
    position: static;
    width: 100%;
    height: var(--story-intro-image-height);
    object-position: 24% center;
  }
  .story-intro .story-copy {
    width: 100%;
    padding: 1.1rem var(--gutter) 1.65rem;
    text-shadow: none;
  }
  [data-motion="scrub"] .story-intro {
    position: absolute;
    grid-template-rows: var(--story-intro-image-height) minmax(0, 1fr);
    padding: 0;
    transform: translateY(calc(-100% * var(--story-intro-exit, 0)));
  }
  .story-beat.story-intro[data-active] { transition: none; }
  [data-motion="scrub"] .story-intro .story-copy { align-self: start; }
}

@media (max-width: 37rem) {
  .story-beat { grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }
  .story-still { width: min(100%, 19.5rem); }
}
