/* Smart Bundles: page-specific pieces on top of the yap components (css/yap.css)
   and the shared figure kit (css/figures.css). Figures are 16:9 .fig panels sized in cqw. */

/* ── Overview: three stat cards (yap-problem cells) ─────────────── */
/* sized off the card's width or height, whichever is tighter, so the stat fits stacked (landscape) cards too */

/* ── Solution: tagline video, then four phones across the body ── */

/* Touchpoint 01: the card carousel sits under the video, in that column, at that width */
body.case-page {
  & main {
    & .sb-tp1 {
      gap: var(--space-1);
      display: flex;
      flex-direction: column;
      min-inline-size: 0;
      & > .nt-media {
        inline-size: 100%;
        max-inline-size: none;
      }
      @media (width >= 760px) {
        gap: var(--space-1);
      }
    }
    & #core-flows {
      & .dx-media {
        & > video {
          block-size: auto;
          aspect-ratio: 1080 / 1350;
          @media (width >= 760px) {
            &.sb-all-cards {
              aspect-ratio: auto;
              object-fit: contain;
            }
          }
        }
      }
      & > .nt-media {
        & .dx-media {
          & > video {
            aspect-ratio: 16 / 9;
          }
        }
      }
    }
  }
}

/* ── Figure kit additions (all sizes in cqw of the 16:9 panel) ──── */
.fig {
  & .sbf-tag {
    position: absolute;
    inset-inline-start: 4cqw;
    inset-block-start: 3.4cqw;
    font-size: 1.05cqw;
    letter-spacing: var(--label-ls);
    text-transform: uppercase;
    color: var(--muted);
  }
  & .sbf-tag.r {
    inset-inline-start: auto;
    inset-inline-end: 4cqw;
  }
  & .sbf-name {
    font-size: 1.9cqw;
    font-weight: var(--fw-medium);
    letter-spacing: var(--h2-ls);
    line-height: var(--lh-tight);
    color: var(--ink);
  }
  & .sbf-sub {
    font-size: 1.35cqw;
    line-height: var(--lh-snug);
    color: var(--muted);
  }
  & svg.sbf-svg {
    position: absolute;
    inset: 0;
    inline-size: 100%;
    block-size: 100%;
    font-family: inherit;
  }

  /* Personas */
  & .sbp {
    position: absolute;
    inset: 0;
    padding-block: 8cqw 5cqw;
    padding-inline: 4cqw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2.2cqw;
  }
  & .sbp-bar {
    display: flex;
    block-size: 1.4cqw;
    border-radius: var(--r-pill);
    overflow: hidden;
    gap: 0.3cqw;
    & i {
      display: block;
      block-size: 100%;
    }
  }
  & .sbp-cards {
    display: grid;
    grid-template-columns: 1fr 1fr 1.25fr;
    gap: 1.6cqw;
  }
  & .sbp-card {
    display: flex;
    flex-direction: column;
    padding: 2.2cqw;
    background: var(--surface);
    border: 0.0625rem solid var(--line);
    border-radius: var(--fig-r);
    & .c-big {
      margin-block: 1.6cqw 0.6cqw;
      margin-inline: 0;
      font-size: 5cqw;
    }
    & .sbf-sub {
      margin-block-start: 1cqw;
    }
  }
  & .sbp-key {
    display: inline-block;
    inline-size: 1cqw;
    block-size: 1cqw;
    border-radius: 50%;
    margin-inline-end: 0.7cqw;
    vertical-align: -0.05cqw;
  }
  & .sbp-card.hi {
    background: var(--ink);
    border-color: var(--ink);
    & :is(.sbf-name, .c-big) {
      color: var(--surface);
    }
    & :is(.c-lab, .sbf-sub) {
      color: var(--line-strong);
    }
  }
  & .sbp-cmp {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.8cqw 1cqw;
    font-size: 1.15cqw;
    color: var(--line-strong);
    & b {
      display: block;
      block-size: 1cqw;
      border-radius: var(--r-pill);
      background: var(--surface);
    }
    & b.o {
      background: var(--muted);
    }
    & em {
      font-style: normal;
      color: var(--surface);
      font-weight: var(--fw-medium);
    }
  }
  & .sbp-needs {
    margin-block-start: 1.6cqw;
    & em {
      display: block;
      margin-block-end: 0.8cqw;
      font-style: normal;
      font-size: 1.05cqw;
      letter-spacing: var(--label-ls);
      color: var(--line-strong);
    }
    & ul {
      display: flex;
      flex-direction: column;
      gap: 0.5cqw;
      margin: 0;
      padding: 0;
      list-style: none;
    }
    & li {
      position: relative;
      margin: 0;
      padding-inline-start: 1.2cqw;
      font-size: 1.05cqw;
      line-height: var(--lh-snug);
      color: var(--line);
    }
    & li::before {
      content: "";
      position: absolute;
      inset-inline-start: 0;
      inset-block-start: 0.5em;
      inline-size: 0.45cqw;
      block-size: 0.45cqw;
      border-radius: 50%;
      background: var(--line-strong);
    }
  }

  /* Journey */

  /* Inset image (meal kits) */

  /* Market */

  /* Feature comparison */
  & .dot {
    inline-size: 1.7cqw;
    block-size: 1.7cqw;
    border-radius: 50%;
    box-shadow: inset 0 0 0 0.2cqw var(--ink);
  }
  & .dot.y {
    background: var(--ink);
  }
  & .dot.p {
    background: linear-gradient(90deg, var(--ink) 50%, var(--surface) 50%);
  }
  & .dot.n {
    box-shadow: inset 0 0 0 0.2cqw var(--line-strong);
  }
}

/* Iterations */

/* Next steps: three notes */
body.case-page {
  & main {
    & .sb-next {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: var(--s-6) var(--s-8);
      & p {
        margin: 0;
      }
      & .yap-it__tag {
        margin-inline: 0;
        font-size: var(--fs-xs);
        font-weight: var(--fw-medium);
        line-height: var(--lh-snug);
        letter-spacing: var(--label-ls);
        text-transform: uppercase;
        color: var(--muted);
      }
    }
  }
}
@media (width < 760px) {
  body.case-page {
    & main {
      & .sb-next {
        grid-template-columns: minmax(0, 1fr);
      }
    }
  }
}

/* Reflection link */

/* Impact loop: cards sit on the loop around the center order */
.fig {
  & .card.sbx {
    position: absolute;
    inline-size: 22cqw;
    transform: translate(-50%, -50%);
    padding-block: 1.6cqw;
    padding-inline: 1.8cqw;
    & .c-txt {
      font-size: 1.55cqw;
    }
  }

  /* Pilot targets on a 12-month axis */
  & .sbt {
    position: absolute;
    inset: 0;
  }
  & .sbt-axis {
    position: absolute;
    inset-inline-start: 8%;
    inset-inline-end: 8%;
    inset-block-start: 72%;
    block-size: 0.35cqw;
    border-radius: var(--r-pill);
    background: var(--line-strong);
    transform: translateY(-50%);
  }
  & .sbt-tick {
    position: absolute;
    inset-block-start: 72%;
    inline-size: 0;
  }
  & .sbt-tick::before {
    content: "";
    position: absolute;
    inset-inline-start: -0.5cqw;
    inset-block-start: -0.5cqw;
    inline-size: 1cqw;
    block-size: 1cqw;
    border-radius: 50%;
    background: var(--line-strong);
  }
  & .sbt-tick {
    & span {
      position: absolute;
      inset-block-start: 2cqw;
      inset-inline-start: 0;
      transform: translateX(-50%);
      font-size: 1.05cqw;
      letter-spacing: var(--label-ls);
      color: var(--muted);
      white-space: nowrap;
    }
  }
  & .sbt-mark {
    position: absolute;
    inset-block-start: 72%;
    inline-size: 0;
  }
  & .sbt-mark::before {
    content: "";
    position: absolute;
    inset-inline-start: -0.9cqw;
    inset-block-start: -0.9cqw;
    inline-size: 1.8cqw;
    block-size: 1.8cqw;
    border-radius: 50%;
    background: var(--ink);
    box-shadow: 0 0 0 0.5cqw var(--fig-bg);
    z-index: 1;
  }
  & .sbt-mark::after {
    content: "";
    position: absolute;
    inset-inline-start: -0.0625rem;
    inset-block-end: 0;
    inline-size: 0.125rem;
    block-size: 5cqw;
    background: var(--ink);
  }
  & .sbt-mark {
    & .card {
      position: absolute;
      inset-block-end: 5cqw;
      inset-inline-start: -1.2cqw;
      inline-size: 19.5cqw;
    }
  }
  & .sbt-mark.end {
    & .card {
      inset-inline-start: auto;
      inset-inline-end: -1.2cqw;
    }
  }
  & .sbt-mark {
    & .c-big {
      font-size: 4.2cqw;
    }
  }
}

/* Touchpoint 01: the bundle cards in a row, sliding one at a time (js/card-carousel.js) */
body.case-page {
  & main {
    & .sb-deck {
      overflow: hidden;
    }
    & .sb-deck__track {
      display: flex;
      gap: var(--space-0);
      transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1);
      & img {
        flex: 0 0 72%;
        inline-size: 72%;
        block-size: auto;
        aspect-ratio: 850 / 805;
        border-radius: 0 !important;
      }
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  body.case-page {
    & main {
      & .sb-deck__track {
        transition: none;
      }
    }
  }
}
body.case-page {
  & main {
    & #core-flows {
      & .nt-step:has(.sb-deck) {
        & .sb-deck {
          padding-block-start: 0;
        }
      }
    }

    /* ── Design challenge: copy left, figure right (same layout as forage's FigBuild block) ── */
    & .sb-split {
      display: grid;
      gap: var(--s-8);
      & > .nt-reading {
        max-inline-size: none;
      }
    }
  }
}
@media (width >= 960px) {
  body.case-page {
    & main {
      & .sb-split {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: var(--s-9);
        align-items: start;
      }
    }
  }
}
body.case-page {
  & main {
    & .sb-quote {
      margin-inline: 0;
      padding-block: 0;
      padding-inline: var(--s-5) 0;
      border-inline-start: 0.125rem solid var(--line-strong);
      font-size: var(--fs-base);
      line-height: var(--lh-base);
      color: var(--ink);
    }

    & .sb-challenge-fig {
      overflow: hidden;
      border-radius: var(--r-lg);
      background: var(--fig-bg) var(--fig-dots);
      & img {
        display: block;
        inline-size: 100%;
        block-size: auto;
      }
    }
  }
}

/* ── Problem: where waste accumulates (visible → invisible at the door) ── */
.fig {
  & .sbw {
    position: absolute;
    inset: 0;
  }
  & .sbw-zone {
    position: absolute;
    inset-block-start: 4cqw;
    inset-block-end: 13cqw;
    padding-block: 2.2cqw;
    padding-inline: 2.4cqw;
    border-radius: var(--fig-r);
  }
  & .sbw-zone.in {
    inset-inline-start: 4cqw;
    inset-inline-end: calc(50% + 0.6cqw);
    background: var(--surface);
    border: 0.0625rem solid var(--line);
    box-shadow: var(--shadow-raise);
  }
  & .sbw-zone.out {
    inset-inline-start: calc(50% + 0.6cqw);
    inset-inline-end: 4cqw;
    background: repeating-linear-gradient(135deg, var(--line) 0 0.5cqw, var(--fig-bg) 0.5cqw 1cqw);
    border: 0.0625rem dashed var(--line-strong);
  }
  & .sbw-head {
    display: flex;
    align-items: center;
    gap: 0.8cqw;
    font-size: 1.15cqw;
    letter-spacing: var(--label-ls);
    text-transform: uppercase;
    color: var(--ink);
  }
  & .sbw-zone.out {
    & .sbw-head {
      color: var(--muted);
    }
  }
  & .sbw-head {
    & svg {
      inline-size: 2cqw;
      block-size: auto;
    }
  }
  & .sbw-zone {
    & p {
      margin-block: 0.5cqw 0;
      margin-inline: 0;
      font-size: 2.4cqw;
      font-weight: var(--fw-medium);
      letter-spacing: var(--h2-ls);
      color: var(--ink);
    }
  }
  & .sbw-zone.out {
    & p {
      color: var(--muted);
    }
  }
  & .sbw-door {
    position: absolute;
    inset-inline-start: 50%;
    inset-block-start: 4cqw;
    inset-block-end: 13cqw;
    inline-size: 0;
  }
  & .sbw-door::before {
    content: "";
    position: absolute;
    inset-inline-start: -0.0625rem;
    inset-block-start: 0;
    inset-block-end: 0;
    inline-size: 0.125rem;
    background: var(--ink);
  }
  & .sbw-door {
    & span {
      position: absolute;
      inset-inline-start: 0;
      inset-block-start: 11cqw;
      transform: translateX(-50%);
      padding-block: 0.5cqw;
      padding-inline: 1.2cqw;
      border-radius: var(--r-pill);
      background: var(--ink);
      color: var(--surface);
      font-size: 1.15cqw;
      white-space: nowrap;
      z-index: 2;
    }
  }
  & .sbw-line {
    position: absolute;
    inset-inline-start: 10%;
    inset-inline-end: 10%;
    inset-block-start: 24cqw;
    block-size: 0.35cqw;
    display: flex;
    & i {
      flex: 1;
    }
    & .on {
      background: var(--ink);
      border-radius: var(--r-pill) 0 0 var(--r-pill);
    }
    & .off {
      background: repeating-linear-gradient(
        90deg,
        var(--line-strong) 0 1cqw,
        transparent 1cqw 1.8cqw
      );
    }
  }
  & .sbw-stop {
    position: absolute;
    inset-block-start: 24cqw;
    inline-size: 17cqw;
    transform: translate(-50%, -3cqw);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  & .sbw-ico {
    box-sizing: border-box;
    inline-size: 6.4cqw;
    block-size: 6.4cqw;
    padding: 1.4cqw;
    border-radius: 50%;
    background: var(--ink);
    color: var(--surface);
  }
  & .sbw-stop.out {
    & .sbw-ico {
      background: var(--fig-bg);
      color: var(--muted);
      box-shadow: inset 0 0 0 0.2cqw var(--line-strong);
    }
  }
  & .sbw-stop {
    & .c-lab {
      margin-block: 1.6cqw 0.5cqw;
      margin-inline: 0;
      color: var(--muted);
    }
    & .sbf-name {
      font-size: 2cqw;
    }
  }
  & .sbw-stop.out {
    & .sbf-name {
      color: var(--muted);
    }
  }
  & .sbw-loop {
    position: absolute;
    inset-inline-start: 4cqw;
    inset-inline-end: 4cqw;
    inset-block-end: 4.2cqw;
    block-size: 7cqw;
    & svg {
      inline-size: 100%;
      block-size: 100%;
      overflow: visible;
    }
    & span {
      position: absolute;
      inset-inline-start: 50%;
      inset-block-start: 100%;
      transform: translate(-50%, -50%);
      padding-block: 0.5cqw;
      padding-inline: 1.4cqw;
      border-radius: var(--r-pill);
      background: var(--fig-bg);
      border: 0.0625rem solid var(--line);
      font-size: 1.2cqw;
      color: var(--muted);
      white-space: nowrap;
    }
  }
}

/* ── Solution: prototype captures already include the status bar and notch ── */

/* ── Research: meal-kit collage on the standard figure background ── */
body.case-page {
  & main {
    & .fig.sbf-collage {
      & img {
        display: block;
        inline-size: 100%;
        block-size: 100%;
        object-fit: cover;
        border-radius: 0 !important;
      }
    }
  }
}

/* ── Research: supporting statistics (cost of waste + why now) ── */
.fig {
  & .sbs {
    position: absolute;
    inset: 3.4cqw 4cqw;
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 1.6cqw;
  }
  & .sbs-row {
    display: grid;
    grid-template-columns: 11cqw repeat(3, 1fr);
    gap: 1.4cqw;
  }
  & .sbs-lab {
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 2.1cqw;
    font-weight: var(--fw-medium);
    letter-spacing: var(--h2-ls);
    line-height: var(--lh-tight);
    color: var(--ink);
  }
  & .sbs-k {
    font-size: 1.05cqw;
    font-weight: var(--fw-regular);
    letter-spacing: var(--label-ls);
    color: var(--muted);
    margin-block-end: 0.8cqw;
  }
  & .sbs-cell {
    display: grid;
    grid-template-columns: 7cqw 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 1.8cqw;
    align-content: center;
    align-items: start;
    padding-block: 1.8cqw;
    padding-inline: 2cqw;
    background: var(--surface);
    border: 0.0625rem solid var(--line);
    border-radius: var(--fig-r);
  }
  & .sbs-row.now {
    & .sbs-cell {
      background: var(--ink);
      border-color: var(--ink);
    }
  }
  & .sbs-vis {
    grid-row: 1 / 4;
    display: flex;
    align-items: center;
    justify-content: center;
    block-size: 7cqw;
    align-self: center;
    & > * {
      inline-size: 100%;
    }
    & svg {
      block-size: 100%;
    }
  }
  & .sbs-num {
    font-size: 3.4cqw;
    font-weight: var(--fw-medium);
    letter-spacing: var(--h1-ls);
    line-height: var(--lh-none);
    color: var(--ink);
  }
  & .sbs-name {
    margin-block-start: 0.6cqw;
    font-size: 1.15cqw;
    letter-spacing: var(--label-ls);
    text-transform: uppercase;
    color: var(--muted);
  }
  & .sbs-sub {
    margin-block-start: 0.6cqw;
    font-size: 1.2cqw;
    line-height: var(--lh-snug);
    color: var(--muted);
  }
  & .sbs-row.now {
    & :is(.sbs-num) {
      color: var(--surface);
    }
    & :is(.sbs-name, .sbs-sub) {
      color: var(--line-strong);
    }
  }
  & .sbs-seg {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.35cqw;
    & i {
      aspect-ratio: 1;
      border-radius: var(--fig-r-sm);
      background: var(--line);
    }
    & i.on {
      background: var(--ink);
    }
    & i.mid {
      background: repeating-linear-gradient(
        135deg,
        var(--ink) 0 0.25cqw,
        var(--line-strong) 0.25cqw 0.5cqw
      );
    }
  }
  & .sbs-coins {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 0;
    block-size: 100%;
    justify-content: flex-start;
    justify-content: center;
    & i {
      inline-size: 80%;
      block-size: 0.42cqw;
      margin-block-start: 0.12cqw;
      border-radius: var(--r-pill);
      background: var(--ink);
    }
    & i:nth-child(odd) {
      inline-size: 70%;
      background: var(--muted);
    }
  }
  & .sbs-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.3cqw;
    block-size: 100%;
    & i {
      flex: 1;
      border-radius: var(--fig-r-sm) var(--fig-r-sm) 0 0;
      background: var(--muted);
    }
    & i:last-child {
      background: var(--surface);
    }
  }
  & .sbs-row.now {
    & .sbs-vis {
      & svg {
        & path:first-child {
          fill: var(--ink);
        }
        & path:last-child {
          stroke: var(--surface);
        }
      }
    }
  }
  & .sbs-dots {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.3cqw;
    & i {
      aspect-ratio: 1;
      border-radius: 50%;
      background: var(--surface);
    }
  }
}

/* ── System design: three decisions as text columns (same styling as Next steps) ── */

/* ── Solution: iPhone 16 Pro frame (Figma: iPhone 16 Mockup, Model=Pro, Color=Desert; 434 × 904) ── */
.sb-iphone {
  position: relative;
  flex: none;
  block-size: 100%;
  aspect-ratio: 434 / 904;
}
.sb-iphone::before {
  content: "";
  position: absolute;
  inset: 0 0.46%;
  border-radius: 18.4% / 8.85%;
  background: linear-gradient(
    150deg,
    #f2dccb 0%,
    #c2a697 8%,
    #9c7f6c 30%,
    #8d715f 52%,
    #a88b78 74%,
    #d9c0ae 92%,
    #f4e1d2 100%
  );
  box-shadow: var(--shadow-raise);
}
.sb-iphone::after {
  content: "";
  position: absolute;
  inset: 0.66% 2.07%;
  border-radius: 17.2% / 8.2%;
  background: #000;
}
.sb-iphone__screen {
  position: absolute;
  z-index: 1;
  inset-inline-start: 3.69%;
  inset-inline-end: 3.69%;
  inset-block-start: 1.55%;
  inset-block-end: 1.77%;
  border-radius: 15.92% / 7.32%;
  overflow: hidden;
  background: var(--surface);
}
body.case-page {
  & main {
    & .sb-iphone__screen {
      & img {
        display: block;
        inline-size: 100%;
        block-size: 100%;
        max-inline-size: none;
        object-fit: cover;
        object-position: top;
        border-radius: 0 !important;
        filter: none;
      }
    }
  }
}
.sb-iphone__island {
  position: absolute;
  z-index: 2;
  inset-inline-start: calc(50% + 0.115%);
  inset-block-start: 3.21%;
  inline-size: 28.8%;
  block-size: 3.98%;
  transform: translateX(-50%);
  border-radius: var(--r-pill);
  background: #000;
  & i {
    position: absolute;
    inset-inline-end: 8%;
    inset-block-start: 50%;
    inline-size: 9.6%;
    aspect-ratio: 1;
    transform: translateY(-50%);
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, #2a3350, #0b0d18 60%);
  }
}
.sb-iphone__btn {
  position: absolute;
  inline-size: 0.46%;
  background: linear-gradient(180deg, #e8d6c9, #c0a899 20%, #a48c7d 80%, #d9c6b8);
}
.sb-iphone__btn--action {
  inset-inline-start: 0;
  inset-block-start: 18.7%;
  block-size: 4.2%;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}
.sb-iphone__btn--up {
  inset-inline-start: 0;
  inset-block-start: 25.6%;
  block-size: 6.75%;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}
.sb-iphone__btn--down {
  inset-inline-start: 0;
  inset-block-start: 35.07%;
  block-size: 6.75%;
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}
.sb-iphone__btn--side {
  inset-inline-end: 0;
  inset-block-start: 27.99%;
  block-size: 10.84%;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

/* ── Core flows: Touchpoint 01 cards on the Smart Bundles green ── */
body.case-page {
  & main {
    & .sb-deck-wrap {
      padding-block: var(--s-8);
      padding-inline: 0;
      border-radius: var(--r-lg);
      background: #06886c;
      overflow: hidden;
    }
    /* Keep the end cards inset from the frame; read by js/card-carousel.js. */
    & .sb-deck-wrap {
      & .sb-deck {
        scroll-padding-inline: var(--s-6);
      }
    }
  }
}

/* ── Overview meta: four equal columns, each with the same text width ── */
body[data-case="smart-bundles"] {
  & .nt-meta {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: var(--s-8);
  }
}
@media (width < 760px) {
  body[data-case="smart-bundles"] {
    & .nt-meta {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      column-gap: var(--s-6);
    }
  }
}
/* Solution phone headings sit a block below the frame, in the shared call style */

/* Introductory context: equal columns fit the embedded post or artwork. */
@media (width >= 960px) {
  body.case-page[data-case] {
    & main {
      & #overview-challenge {
        & > .sb-split {
          grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        }
      }
    }
  }
}

/* Solution captures are clipped to the product screen inside the shared phone. */
body.case-page {
  & main {
    & .sb-screen--discover {
      & > img {
        position: absolute;
        inline-size: 211.765%;
        max-inline-size: none;
        block-size: 122.505%;
        inset-inline-start: -56.078%;
        inset-block-start: -11.252%;
      }
    }
    & .sb-screen--check-in {
      & > img {
        position: absolute;
        inline-size: 117.413%;
        max-inline-size: none;
        block-size: 102.155%;
        inset-inline-start: -10.323%;
        inset-block-start: -1.631%;
      }
    }
    & .sb-decision {
      display: grid;
      grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
      gap: var(--space-1);
      align-items: start;
    }
  }
}
@media (width < 760px) {
  body.case-page {
    & main {
      & .sb-decision {
        grid-template-columns: minmax(0, 1fr);
      }
    }
  }
}
/* Retain the clean status and navigation bars around the reference captures. */
body.case-page {
  & main {
    & :is(.sb-screen--discover, .sb-screen--check-in)::before,
    & .sb-screen--check-in::after {
      content: "";
      position: absolute;
      inset-inline-start: 0;
      inline-size: 100%;
      z-index: 1;
      pointer-events: none;
      background-size: 100% auto;
      background-repeat: no-repeat;
    }
    & .sb-screen--discover::before {
      inset-block-start: 0;
      block-size: 10.8%;
      background-image: url("../assets/smart-bundles/solution/screens/frame-home.webp");
    }
    & .sb-screen--check-in::before {
      inset-block-start: 0;
      block-size: 10.8%;
      background-image: url("../assets/smart-bundles/solution/screens/frame-feedback.webp");
    }
    & .sb-screen--check-in::after {
      inset-block-end: 0;
      block-size: 8.9%;
      background-image: url("../assets/smart-bundles/solution/screens/frame-feedback.webp");
      background-position: bottom;
    }
  }
}
body[data-case="smart-bundles"] {
  & main {
    & .pmap__pt:not(.hi) {
      padding-block: 0.6cqw;
      padding-inline: 0.7cqw 1.2cqw;
      border-radius: var(--r-pill);
      background: var(--fig-bg);
    }
  }
}

/* Image above each comparison-column title. */
body[data-case="smart-bundles"] {
  & main {
    & .cmp {
      grid-template-rows: minmax(10cqw, auto);
    }
    & .cmp__h {
      & > img.cmp-photo {
        display: block;
        flex: none;
        inline-size: 4cqw;
        block-size: 4cqw;
        object-fit: cover;
        border-radius: var(--fig-r) !important;
      }
    }
    & .cmp-photo--meal-kits {
      object-view-box: inset(28% 14% 34% 55%);
    }
    & .cmp-photo--grocery {
      object-view-box: inset(10% 50% 12% 5%);
    }
    & .cmp-photo--bundles {
      object-view-box: inset(4% 4% 65% 4%);
    }
  }
}

body.case-page {
  & main {
    & .sb-decision {
      & > .nt-media {
        & > img {
          display: block;
          inline-size: 100%;
          block-size: auto;
        }
      }
    }
    & .phones-fig--bundles {
      background: var(--fig-bg)
        url("../assets/smart-bundles/solution/smart-bundles-solution-bg.jpg") center / cover;
    }
    & .sb-solution-phones {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 2cqw;
      block-size: 44cqw;
      & .sb-iphone {
        block-size: 100%;
        inline-size: auto;
      }
    }
    & .sb-solution-captions {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: var(--space-1);
    }
  }
}
@media (width < 760px) {
  body.case-page {
    & main {
      & .sb-solution-captions {
        grid-template-columns: 1fr;
        row-gap: var(--space-1);
      }
    }
  }
}

@media (width >= 760px) {
  body.case-page main .sb-directions-media {
    gap: var(--space-1);
  }
}

body.case-page main .sb-solution-media {
  gap: var(--space-1);
}

/* One exploration at a time, with full-size body notes below the screens. */

[data-sb-tabs] {
  & .yap-it__panel.is-active {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
  }
}

/* Three closely grouped, proportional phones with callouts tied to their controls. */
.sb-ex-figure {
  & .sb-ex-item {
    display: contents;
  }
  & .sb-ex-phone {
    position: absolute;
    inset-block-start: 21%;
    inset-inline-start: var(--phone-left);
    display: block;
    inline-size: auto;
    block-size: 58%;
    aspect-ratio: 402 / 875;
    overflow: visible;
    filter: drop-shadow(0 1.2cqw 2cqw rgba(28, 31, 36, 0.14));
  }
  & .sb-ex-note {
    padding-block: 1cqw;
    padding-inline: 1.2cqw;
    position: absolute;
    inset-inline-start: var(--card-left);
    inset-block-start: var(--card-top);
    transform: translateY(-50%);
    inline-size: 19%;
    z-index: 2;
  }
  & .conn {
    z-index: 1;
  }
  & .sb-ex-endpoint {
    position: absolute;
    inset-inline-start: var(--point-x);
    inset-block-start: var(--point-y);
    inline-size: 1.1cqw;
    block-size: 1.1cqw;
    border-radius: var(--r-pill);
    background: var(--line-strong);
    translate: -50% -50%;
    z-index: 3;
  }
  /* stacked on phones like Instagram's explorations: the three screens in a row, then the notes, no connectors */
  @media (width < 760px) {
    aspect-ratio: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: start;
    gap: 3cqw 1.5cqw;
    padding: 5cqw;
    & .sb-ex-item {
      display: contents;
    }
    & .sb-ex-phone {
      grid-row: 1;
      position: static;
      inline-size: 100%;
      block-size: auto;
    }
    & .sb-ex-note {
      grid-column: 1 / -1;
      position: static;
      transform: none;
      inline-size: 100%;
      padding-block: 3.4cqw;
      padding-inline: 4cqw;
      border-radius: calc(var(--fig-r) * 2.4);
    }
    & .c-lab {
      font-size: 2.6cqw;
      margin-block-end: 1.2cqw;
    }
    & .c-txt {
      font-size: 3.6cqw;
    }
    & .conn,
    & .sb-ex-endpoint {
      display: none;
    }
  }
}

/* Each concept keeps its key screens first, with the remaining work one arrow away. */
.sb-ex-gallery {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-0);
  & .sb-ex-overview {
    display: grid;
    grid-template-columns: repeat(var(--screen-columns), minmax(0, 1fr));
    grid-template-rows: repeat(var(--screen-rows), minmax(0, 1fr));
    place-items: center;
    gap: 1.5cqw;
    padding: 3cqw;
    & .sb-ex-phone {
      display: block;
      inline-size: auto;
      block-size: 100%;
      max-inline-size: 100%;
      overflow: visible;
      filter: drop-shadow(0 1.2cqw 2cqw rgba(28, 31, 36, 0.14));
    }
    /* phones: fewer, larger columns so the screens fill the slide, which matches the first figure's height */
    @media (width < 760px) {
      aspect-ratio: auto;
      contain: size;
      grid-template-columns: repeat(var(--screen-columns-sm), minmax(0, 1fr));
      grid-template-rows: repeat(var(--screen-rows-sm), minmax(0, 1fr));
      gap: 3cqw 1.5cqw;
      padding: 5cqw;
    }
  }
}

.sb-ex-gallery {
  & .igx__track > .fig {
    flex: 0 0 100%;
    scroll-snap-align: start;
    margin: 0;
  }
}

/* Wordless grocery-to-meal/waste loop. Coordinates follow the 1200 × 675 canvas. */
.sb-food-loop {
  & .sb-food-loop__scene {
    display: block;
    inline-size: 100%;
    block-size: 100%;
  }
  & .sb-food-loop__surfaces {
    fill: var(--surface);
  }
  & .sb-food-loop__route {
    fill: none;
    stroke: var(--line-strong);
    stroke-width: 2;
    stroke-dasharray: var(--dash);
  }
  &
    :is(
      .sb-food-loop__chicken,
      .sb-food-loop__carrot,
      .sb-food-loop__broccoli,
      .sb-food-loop__lid
    ) {
    animation-duration: 10s;
    animation-timing-function: var(--ease-inout);
    animation-iteration-count: infinite;
  }
  & .sb-food-loop__chicken {
    animation-name: sb-chicken-to-plate;
    transform-origin: 3.75% 6.66667%;
  }
  & .sb-food-loop__carrot {
    animation-name: sb-carrot-to-bin;
    transform-origin: 3.25% 5.77778%;
  }
  & .sb-food-loop__broccoli {
    animation-name: sb-produce-wilts;
    transform-origin: 4% 12.59259%;
  }
  & .sb-food-loop__mold {
    opacity: 0;
    animation: sb-mold-grows 10s var(--ease-inout) infinite;
  }
  & .sb-food-loop__lid {
    animation-name: sb-bin-opens;
    transform-origin: 78.91667% 66.37037%;
  }
}
@keyframes sb-chicken-to-plate {
  0%,
  14% {
    transform: translate(0, 0);
    opacity: 1;
  }
  34%,
  89% {
    transform: translate(52.75%, -10.81481%);
    opacity: 1;
  }
  90% {
    transform: translate(0, 0);
    opacity: 0;
  }
  98%,
  100% {
    transform: translate(0, 0);
    opacity: 1;
  }
}
@keyframes sb-carrot-to-bin {
  0%,
  26% {
    transform: translate(0, 0);
    opacity: 1;
  }
  46%,
  51% {
    transform: translate(42.66667%, 23.7037%);
    opacity: 1;
  }
  60%,
  89% {
    transform: translate(42.66667%, 37.03704%) scale(0.5);
    opacity: 0;
  }
  90% {
    transform: translate(0, 0);
    opacity: 0;
  }
  98%,
  100% {
    transform: translate(0, 0);
    opacity: 1;
  }
}
@keyframes sb-produce-wilts {
  0%,
  40% {
    transform: rotate(0);
    filter: none;
    opacity: 1;
  }
  56%,
  62% {
    transform: translate(20%, 5%) rotate(38deg) scaleY(0.72);
    filter: grayscale(1) brightness(0.65);
    opacity: 1;
  }
  76% {
    transform: translate(47.41667%, 24.88889%) rotate(38deg) scaleY(0.72);
    filter: grayscale(1) brightness(0.65);
    opacity: 1;
  }
  84%,
  89% {
    transform: translate(47.41667%, 39.25926%) scale(0.5);
    filter: grayscale(1);
    opacity: 0;
  }
  90% {
    transform: translate(0, 0);
    opacity: 0;
  }
  98%,
  100% {
    transform: translate(0, 0);
    filter: none;
    opacity: 1;
  }
}
@keyframes sb-bin-opens {
  0%,
  34%,
  62%,
  89%,
  100% {
    transform: rotate(0);
  }
  44%,
  55%,
  72%,
  82% {
    transform: rotate(48deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .sb-food-loop {
    &
      :is(
        .sb-food-loop__chicken,
        .sb-food-loop__carrot,
        .sb-food-loop__broccoli,
        .sb-food-loop__lid
      ) {
      animation: none;
    }
    & .sb-food-loop__chicken {
      transform: translate(52.75%, -10.81481%);
    }
    & .sb-food-loop__carrot {
      transform: translate(42.66667%, 30.07407%) scale(0.7);
    }
    & .sb-food-loop__broccoli {
      transform: rotate(25deg);
      filter: grayscale(1);
    }
    & .sb-food-loop__lid {
      transform: rotate(48deg);
    }
  }
}

@keyframes sb-mold-grows {
  0%,
  42%,
  92%,
  100% {
    opacity: 0;
  }
  56%,
  86% {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sb-food-loop .sb-food-loop__mold {
    animation: none;
    opacity: 1;
  }
}

/* Three circular bites remove the meat in place; the bone stays on the plate. */
.sb-food-loop {
  & .sb-food-loop__bite {
    opacity: 0;
    animation-duration: 10s;
    animation-timing-function: steps(1, end);
    animation-iteration-count: infinite;
  }
  & .sb-food-loop__bite--1 {
    animation-name: sb-chicken-bite-one;
  }
  & .sb-food-loop__bite--2 {
    animation-name: sb-chicken-bite-two;
  }
  & .sb-food-loop__bite--3 {
    animation-name: sb-chicken-bite-three;
  }
}
@keyframes sb-chicken-bite-one {
  0%,
  43% {
    opacity: 0;
  }
  44%,
  89% {
    opacity: 1;
  }
  90%,
  100% {
    opacity: 0;
  }
}
@keyframes sb-chicken-bite-two {
  0%,
  53% {
    opacity: 0;
  }
  54%,
  89% {
    opacity: 1;
  }
  90%,
  100% {
    opacity: 0;
  }
}
@keyframes sb-chicken-bite-three {
  0%,
  63% {
    opacity: 0;
  }
  64%,
  89% {
    opacity: 1;
  }
  90%,
  100% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sb-food-loop .sb-food-loop__bite {
    animation: none;
    opacity: 0;
  }
}
