/* Funnyeye — products · full-colour pinned bottle reel
   .fe-ps is N viewports tall; .fe-ps-stage sticks and floods with the
   active beer's colour (--bg, set by works.js).  Bottles swing in /
   out with rotation; while active they sway with scroll (--sway,
   -1…1).  A faint azulejo lattice sits over the colour.
   */

.fe-ps {
  position: relative;
  height: calc(var(--n, 5) * 85svh + 15svh);
}

.fe-ps-stage {
  --sway: 0;
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  padding: calc(var(--fe-nav-h, 4.25rem) + 1.5rem) clamp(1rem, 5vw, 5rem) 1.75rem;
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background-color: var(--bg);
  color: var(--paper);
  transition: background-color 0.9s cubic-bezier(.4,0,.2,1);
}

/* Azulejo lattice glaze over the colour */
.fe-ps-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--tile-lattice) 0 0 / 110px;
  mix-blend-mode: soft-light;
  opacity: 0.16;
  pointer-events: none;
}

.fe-ps-head {
  position: relative;
  z-index: 4;
}

.fe-ps .fe-label {
  color: var(--paper);
  opacity: 0.85;
}

.fe-ps-title {
  margin: 0.5rem 0 0;
  color: var(--paper);
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  line-height: 1.1;
  font-weight: 400;
}

.fe-ps-title .mx-zh-serif,
.fe-ps-title .mx-zh-sans { font-size: 0.92em; }

/* ---- Slides ---- */
.fe-ps-slides {
  position: relative;
  min-height: 0;
}

.fe-ps-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 0.8fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  gap: clamp(1rem, 3vw, 3rem);
  pointer-events: none;
}

.fe-ps-slide.is-active {
  pointer-events: auto;
}

/* Giant ghost word, a deeper tone of the stage colour */
.fe-ps-ghost {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 0;
  margin: 0;
  font-family: var(--f-sans);
  font-stretch: 62%;
  font-weight: 900;
  font-size: clamp(12rem, 40vw, 44rem);
  line-height: 0.78;
  letter-spacing: -0.03em;
  color: var(--tone);
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -50%) translateY(12%);
  transition: opacity 0.6s, transform 1.1s cubic-bezier(.2,.7,.2,1);
  pointer-events: none;
  user-select: none;
}

.fe-ps-slide.is-before .fe-ps-ghost {
  transform: translate(-50%, -50%) translateY(-12%);
}

.fe-ps-slide.is-active .fe-ps-ghost {
  opacity: 1;
  transform: translate(-50%, -50%) translateX(calc(var(--sway) * -3%));
}

/* Bottle */
.fe-ps-figure {
  grid-column: 2;
  position: relative;
  z-index: 2;
  margin: 0;
  height: 100%;
  max-height: 58rem;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transform: translateY(70svh) rotate(38deg);
  transition: opacity 0.5s, transform 1s cubic-bezier(.2,.8,.2,1);
}

.fe-ps-slide.is-before .fe-ps-figure {
  transform: translateY(-70svh) rotate(-48deg);
}

.fe-ps-slide.is-active .fe-ps-figure {
  opacity: 1;
  transform: translateY(calc(var(--sway) * -3svh)) rotate(calc(-14deg + var(--sway) * 9deg));
}

/* While active, follow scroll without easing lag */
.fe-ps-slide.is-active.is-settled .fe-ps-figure {
  transition: opacity 0.5s, transform 0.12s linear;
}

.fe-ps-bottle {
  height: 100%;
  width: auto;
  display: block;
  filter: drop-shadow(18px 28px 22px rgba(0, 0, 0, 0.28));
}

/* Copy (left) */
.fe-ps-copy {
  grid-column: 1;
  position: relative;
  z-index: 3;
  max-width: 30rem;
}

.fe-ps-copy > *,
.fe-ps-specs > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.45s, transform 0.6s cubic-bezier(.2,.7,.2,1);
}

.fe-ps-slide.is-active .fe-ps-copy > *,
.fe-ps-slide.is-active .fe-ps-specs > * {
  opacity: 1;
  transform: none;
}

.fe-ps-slide.is-active .fe-ps-copy > :nth-child(2) { transition-delay: 0.1s; }
.fe-ps-slide.is-active .fe-ps-copy > :nth-child(3) { transition-delay: 0.18s; }
.fe-ps-slide.is-active .fe-ps-copy > :nth-child(4) { transition-delay: 0.26s; }
.fe-ps-slide.is-active .fe-ps-specs > :nth-child(1) { transition-delay: 0.2s; }
.fe-ps-slide.is-active .fe-ps-specs > :nth-child(2) { transition-delay: 0.3s; }

.fe-ps-kicker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1rem;
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.fe-ps-kicker span {
  padding-right: 0.75rem;
  border-right: 1px solid rgba(242, 239, 230, 0.5);
}

.fe-ps-name {
  margin: 0;
  color: var(--paper);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.fe-ps-name-en {
  font-family: var(--f-sans);
  font-stretch: 68%;
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(3rem, 6.4vw, 6.5rem);
  line-height: 0.86;
  letter-spacing: -0.01em;
}

.fe-ps-name-zh {
  font-family: var(--f-zh-serif);
  font-weight: 700;
  font-size: clamp(1.3rem, 2vw, 1.9rem);
  letter-spacing: 0.06em;
}

.fe-ps-tagline {
  margin: 1.1rem 0 0;
  max-width: 24rem;
  font-family: var(--f-serif);
  font-style: italic;
  font-size: clamp(1.15rem, 1.5vw, 1.4rem);
  line-height: 1.4;
}

:lang(zh) .fe-ps-tagline {
  font-family: var(--f-zh-serif);
  font-style: normal;
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.8;
}

.fe-ps-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.75rem;
}

.fe-ps .fe-btn-line {
  color: var(--paper);
}

.fe-ps .fe-btn-line--solid {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--bg);
}

.fe-ps .fe-btn-line:hover,
.fe-ps .fe-btn-line:focus-visible {
  background: var(--paper);
  color: var(--ink-deep);
}

.fe-ps .fe-btn-line--solid:hover,
.fe-ps .fe-btn-line--solid:focus-visible {
  background: transparent;
  color: var(--paper);
}

.fe-ps .fe-btn-line:focus-visible {
  outline-color: var(--paper);
}

/* Specs (right) */
.fe-ps-specs {
  grid-column: 3;
  position: relative;
  z-index: 3;
  justify-self: end;
  max-width: 15rem;
}

.fe-ps-meta {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 0;
}

.fe-ps-meta div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(242, 239, 230, 0.4);
}

.fe-ps-meta dt {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
}

.fe-ps-meta dd {
  margin: 0;
  font-family: var(--f-serif);
  font-size: clamp(2.4rem, 3.6vw, 3.6rem);
  line-height: 1;
}

.fe-ps-flavors {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.fe-ps-flavors li {
  font-family: var(--f-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fe-ps-flavors li::before {
  content: "✦ ";
}

/* ---- Index + progress ---- */
.fe-ps-index {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.fe-ps-index ol {
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fe-ps-dot {
  min-width: 2.4rem;
  height: 2.4rem;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(242, 239, 230, 0.7);
  font-family: var(--f-mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.fe-ps-dot:hover,
.fe-ps-dot.is-active {
  color: var(--paper);
}

.fe-ps-dot.is-active {
  border-color: var(--paper);
}

.fe-ps-dot:focus-visible {
  outline: 1px solid var(--paper);
  outline-offset: 2px;
}

.fe-ps-bar {
  width: clamp(6rem, 14vw, 12rem);
  height: 1px;
  background: rgba(242, 239, 230, 0.35);
}

.fe-ps-bar i {
  display: block;
  height: 100%;
  background: var(--paper);
  transform-origin: left;
  transform: scaleX(0);
}

/* ---- Tablet / phone ---- */
@media (max-width: 900px) {
  .fe-ps-stage {
    padding-top: calc(var(--fe-nav-h, 4rem) + 1rem);
    padding-bottom: 1rem;
  }

  .fe-ps-title {
    font-size: 1.2rem;
  }

  .fe-ps-slide {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(0, 1fr);
    align-items: end;
    gap: 0.5rem 0.75rem;
  }

  .fe-ps-copy {
    grid-column: 1 / -1;
    grid-row: 1;
    align-self: start;
    max-width: none;
  }

  .fe-ps-name-en {
    font-size: clamp(2.6rem, 13vw, 4rem);
  }

  .fe-ps-tagline {
    margin-top: 0.6rem;
    font-size: 1rem;
  }

  :lang(zh) .fe-ps-tagline {
    font-size: 0.9rem;
    line-height: 1.65;
  }

  .fe-ps-actions {
    margin-top: 1rem;
  }

  .fe-ps-figure {
    grid-column: 1;
    grid-row: 2;
    height: 100%;
    max-height: 30rem;
    align-self: center;
  }

  .fe-ps-specs {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    max-width: 8.5rem;
  }

  .fe-ps-meta dd {
    font-size: 2rem;
  }

  .fe-ps-flavors {
    display: none;
  }

  .fe-ps-ghost {
    top: 62%;
    font-size: 46vw;
  }

  .fe-ps-index {
    justify-content: center;
  }

  .fe-ps-bar {
    display: none;
  }

}


@media (max-height: 680px) and (max-width: 900px) {
  .fe-ps-tagline {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fe-ps-figure,
  .fe-ps-copy > *,
  .fe-ps-specs > * {
    transition-property: opacity;
    transform: none !important;
  }
  .fe-ps-ghost {
    transform: translate(-50%, -50%) !important;
  }
  .fe-ps-stage {
    transition: none;
  }
}
