.bf-stack {
  --stack-orange: #ff542f;
  --stack-paper: #f5ead4;
  --stack-ink: #211911;
  --stack-yellow: #f6d746;
  --stack-open: 0;
  --stack-progress: 0;
  --stack-whole: 1;
  --stack-pinned-offset: var(--site-header-height, 0px);
  position: relative;
  color: var(--stack-paper);
  background-color: var(--stack-ink);
}

.bf-stack[data-ready] {
  min-block-size: 210svh;
}

.bf-stack__pin {
  position: relative;
  min-block-size: min(760px, 100svh);
  display: grid;
  align-items: center;
  padding: 5rem clamp(1.5rem, 5vw, 6rem);
  box-sizing: border-box;
  isolation: isolate;
}

.bf-stack[data-ready] .bf-stack__pin {
  position: sticky;
  inset-block-start: var(--stack-pinned-offset);
  min-block-size: calc(100svh - var(--stack-pinned-offset));
}

.bf-stack__shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.42fr) minmax(9.5rem, 0.58fr);
  align-items: center;
  gap: clamp(.75rem, 2.7vw, 3rem);
  inline-size: min(100%, 1450px);
  margin-inline: auto;
}

.bf-stack__intro,
.bf-stack__control {
  position: relative;
  z-index: 2;
}

.bf-stack__name {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 0 0 clamp(1rem, 2.8vw, 2rem);
  color: var(--stack-orange);
  font: 750 .81rem/1 "DM Sans", sans-serif;
  letter-spacing: .14em;
}

.bf-stack__title {
  margin: 0;
  color: var(--stack-paper);
  font: 900 clamp(4rem, 8.6vw, 9.5rem)/.75 "Barlow Condensed", Impact, sans-serif;
  letter-spacing: -.025em;
  text-transform: uppercase;
}

.bf-stack__title em {
  display: inline-block;
  margin-top: .08em;
  color: var(--stack-orange);
  font-style: normal;
}

.bf-stack__lead {
  max-inline-size: 20ch;
  margin: clamp(1.3rem, 3vw, 2.5rem) 0 0;
  color: #d2c5b1;
  font: 500 clamp(.91rem, 1.16vw, 1.08rem)/1.5 "DM Sans", sans-serif;
}

.bf-stack__stage {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  inline-size: 100%;
  block-size: clamp(350px, 57vw, 550px);
  min-inline-size: 0;
  overflow: visible;
  isolation: isolate;
  border-radius: 50%;
}

.bf-stack__target {
  position: absolute;
  z-index: -1;
  inline-size: min(100%, 510px);
  aspect-ratio: 1;
  border: 1px solid rgb(255 84 47 / .28);
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 27%, rgb(255 84 47 / .18) 27.2% 27.45%, transparent 27.6% 46%, rgb(255 84 47 / .19) 46.2% 46.43%, transparent 46.6% 64%, rgb(255 84 47 / .22) 64.2% 64.45%, transparent 64.6%),
    linear-gradient(90deg, transparent calc(50% - .5px), rgb(255 84 47 / .2) 50%, transparent calc(50% + .5px)),
    linear-gradient(0deg, transparent calc(50% - .5px), rgb(255 84 47 / .2) 50%, transparent calc(50% + .5px)),
    radial-gradient(circle, rgb(255 84 47 / .14), transparent 68%);
  transform: scale(calc(.92 + .13 * var(--stack-open)));
}

.bf-stack__cross {
  position: absolute;
  z-index: -1;
  inline-size: .8rem;
  block-size: .8rem;
  color: var(--stack-orange);
  background:
    linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1px 100% no-repeat;
}

.bf-stack__cross--tl {
  inset-block-start: 9%;
  inset-inline-start: 11%;
}

.bf-stack__cross--br {
  inset-block-end: 9%;
  inset-inline-end: 11%;
}

.bf-stack__whole {
  position: absolute;
  z-index: 2;
  inset-inline-start: 50%;
  inset-block-start: 51%;
  inline-size: min(113%, 550px);
  block-size: 88%;
  max-inline-size: none;
  object-fit: contain;
  opacity: var(--stack-whole);
  transform: translate(-50%, -50%) scale(calc(1 + .07 * var(--stack-open)));
  filter: drop-shadow(0 1rem 2rem rgb(0 0 0 / .40));
  pointer-events: none;
}

.bf-stack__layers {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: calc(1 - var(--stack-whole));
}

.bf-stack[data-ready] .bf-stack__layers {
  display: block;
}

.bf-stack__layer {
  position: absolute;
  inset-inline-start: 50%;
  inset-block-start: calc(var(--layer-home) + var(--stack-open) * var(--layer-travel));
  inline-size: var(--layer-width);
  block-size: auto;
  max-inline-size: 430px;
  object-fit: contain;
  transform: translate(-50%, -50%) translateX(calc(var(--stack-open) * var(--layer-slide)));
  filter: drop-shadow(0 .8rem 1rem rgb(0 0 0 / .38));
  transition: filter .26s ease, opacity .26s ease;
}

.bf-stack__layer--bun {
  --layer-home: 36%;
  --layer-travel: -19%;
  --layer-slide: -2%;
  --layer-width: 75%;
  z-index: 4;
}

.bf-stack__layer--pickle {
  --layer-home: 47%;
  --layer-travel: -8%;
  --layer-slide: 5%;
  --layer-width: 68%;
  z-index: 3;
}

.bf-stack__layer--patty {
  --layer-home: 57%;
  --layer-travel: 5%;
  --layer-slide: -3%;
  --layer-width: 83%;
  z-index: 2;
}

.bf-stack__layer--base {
  --layer-home: 68%;
  --layer-travel: 17%;
  --layer-slide: 3%;
  --layer-width: 73%;
  z-index: 1;
}

.bf-stack[data-current="bun"] .bf-stack__layer:not([data-stack-layer="bun"]),
.bf-stack[data-current="pickle"] .bf-stack__layer:not([data-stack-layer="pickle"]),
.bf-stack[data-current="patty"] .bf-stack__layer:not([data-stack-layer="patty"]),
.bf-stack[data-current="base"] .bf-stack__layer:not([data-stack-layer="base"]) {
  opacity: .60;
}

.bf-stack__layer[data-spotlight] {
  filter: drop-shadow(0 0 1rem rgb(255 84 47 / .32)) drop-shadow(0 .8rem 1rem rgb(0 0 0 / .38));
}

.bf-stack__ingredients {
  border-block-start: 1px solid #705643;
}

.bf-stack__button {
  position: relative;
  display: block;
  inline-size: 100%;
  min-block-size: 3.7rem;
  margin: 0;
  border: 0;
  border-block-end: 1px solid #705643;
  padding: .78rem 0 .78rem .95rem;
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: start;
  transition: color .18s ease, background-color .18s ease;
}

.bf-stack__button::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  inline-size: 2px;
  background: var(--stack-orange);
  transform: scaleY(0);
  transition: transform .18s ease;
}

.bf-stack__button:hover,
.bf-stack__button[aria-pressed="true"] {
  color: var(--stack-yellow);
  background-color: rgb(255 84 47 / .065);
}

.bf-stack__button[aria-pressed="true"]::before {
  transform: scaleY(1);
}

.bf-stack__button-name {
  display: block;
  font: 780 clamp(.9rem, 1.28vw, 1.14rem)/1.15 "DM Sans", sans-serif;
}

.bf-stack__button-note {
  display: block;
  max-inline-size: 28ch;
  margin-block-start: .28rem;
  color: #d2c5b1;
  font: 500 .77rem/1.35 "DM Sans", sans-serif;
}

.bf-stack__reset {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-block-size: 2.75rem;
  margin: .6rem 0 0;
  padding: 0 .25rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--stack-orange);
  font: 750 .79rem/1.2 "DM Sans", sans-serif;
  cursor: pointer;
}

.bf-stack__reset:hover {
  color: var(--stack-yellow);
}

.bf-stack__button:focus-visible,
.bf-stack__reset:focus-visible {
  outline: 2px solid var(--stack-yellow);
  outline-offset: 3px;
}

.bf-stack:not([data-ready]) .bf-stack__lead,
.bf-stack:not([data-ready]) .bf-stack__reset,
.bf-stack:not([data-ready]) .bf-stack__progress {
  display: none;
}

.bf-stack:not([data-ready]) .bf-stack__button {
  cursor: default;
  color: inherit;
  background: transparent;
}

.bf-stack__status {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.bf-stack__progress {
  position: absolute;
  inset: auto 0 0;
  block-size: 3px;
  background: rgb(255 84 47 / .14);
  overflow: hidden;
}

.bf-stack__progress::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--stack-orange);
  transform: scaleX(var(--stack-progress));
  transform-origin: left center;
}

@media (max-width: 1040px) {
  .bf-stack__pin {
    padding-inline: 1.75rem;
  }

  .bf-stack__shell {
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.45fr) minmax(8.3rem, .64fr);
    gap: .85rem;
  }

  .bf-stack__title {
    font-size: clamp(3.45rem, 8.6vw, 7rem);
  }

  .bf-stack__stage {
    block-size: clamp(320px, 51vw, 440px);
  }

  .bf-stack__button {
    padding-inline-start: .6rem;
  }
}

@media (max-width: 720px) {
  .bf-stack[data-ready] {
    min-block-size: 175svh;
  }

  .bf-stack__pin,
  .bf-stack[data-ready] .bf-stack__pin {
    padding: clamp(1rem, 3svh, 2.2rem) 1.2rem clamp(1.1rem, 2svh, 1.6rem);
  }

  .bf-stack__shell {
    grid-template-columns: minmax(0, 1fr);
    gap: .45rem;
  }

  .bf-stack__intro {
    display: grid;
    justify-items: start;
    max-inline-size: 31rem;
  }

  .bf-stack__name {
    margin-block-end: .55rem;
    font-size: .67rem;
  }

  .bf-stack__name svg {
    inline-size: .8rem;
    block-size: .8rem;
  }

  .bf-stack__title {
    font-size: clamp(3.25rem, 11vw, 5.8rem);
    line-height: .77;
  }

  .bf-stack__title br {
    display: none;
  }

  .bf-stack__title em {
    margin-inline-start: .09em;
    margin-block-start: 0;
  }

  .bf-stack__lead {
    max-inline-size: none;
    margin-block-start: .7rem;
    font-size: .81rem;
  }

  .bf-stack__stage {
    justify-self: center;
    inline-size: min(100%, 405px);
    block-size: clamp(225px, 41svh, 405px);
  }

  .bf-stack__target {
    inline-size: min(83%, 34svh);
  }

  .bf-stack__whole {
    inline-size: min(100%, 410px);
    block-size: 91%;
  }

  .bf-stack__layer {
    max-inline-size: 270px;
    max-block-size: 24%;
  }

  .bf-stack__ingredients {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: .8rem;
  }

  .bf-stack__button {
    min-block-size: 3.2rem;
    padding-block: .36rem;
  }

  .bf-stack__button-name {
    font-size: .83rem;
  }

  .bf-stack__button-note {
    margin-block-start: .18rem;
    font-size: .66rem;
  }

  .bf-stack__reset {
    min-block-size: 2.75rem;
    margin-block-start: .15rem;
    font-size: .74rem;
  }
}

@media (max-width: 410px) {
  .bf-stack__title {
    font-size: clamp(2.45rem, 11.1vw, 3.35rem);
  }
}

@media (max-height: 600px) {
  .bf-stack[data-ready] {
    min-block-size: 0;
  }

  .bf-stack[data-ready] .bf-stack__pin {
    position: relative;
    min-block-size: 0;
  }

  .bf-stack__progress {
    display: none;
  }
}

@media (max-height: 690px) and (min-width: 721px) {
  .bf-stack__pin {
    padding-block: 2rem;
  }

  .bf-stack__stage {
    block-size: min(65svh, 440px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bf-stack[data-ready] {
    min-block-size: 0;
  }

  .bf-stack[data-ready] .bf-stack__pin {
    position: relative;
    min-block-size: 0;
  }

  .bf-stack__progress {
    display: none;
  }

  .bf-stack__button,
  .bf-stack__button::before,
  .bf-stack__layer {
    transition: none;
  }
}
