.zoom-deck {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #fff;
  outline: none;
}

.zd-view, .zd-backdrop, .zd-scroll, .zd-rim, .zd-window-face {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.zd-view {
  color: var(--ls-ink, #141414);
  background: #fff;
  transform-origin: top left;
}

.zd-view[data-theme="dark"] { color: #f6f5f1; background: #141414; }
.zoom-deck > .zd-view { z-index: 0; }

.zd-backdrop { overflow: hidden; pointer-events: none; }

.zd-backdrop img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.zd-scroll {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  transform-origin: top left;
  outline: none;
}

[data-zoom-crop] {
  position: absolute;
  overflow: hidden;
  contain: layout paint;
  pointer-events: none;
}

[data-zoom-lifted] > [data-zoom-crop] {
  overflow: visible;
  contain: layout;
}

[data-zoom-lifted] > [data-zoom-crop]::before {
  content: "";
  position: absolute;
  inset: -8px;
  background-color: inherit;
}

.zd-window {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.zd-window .zd-view { right: auto; bottom: auto; }
.zd-window .zd-scroll { scrollbar-width: none; }
.zd-window .zd-scroll::-webkit-scrollbar { display: none; }
.zoom-deck[data-zooming] > .zd-view { pointer-events: none; }

.zd-jump-pane {
  position: absolute;
  inset: 0;
  background: #fafaf8;
  color: #0b0b0b;
  overflow: hidden;
  pointer-events: none;
}
.zd-jump-pane[data-theme="dark"] { background: #0b0b0b; color: #fff; }

.zd-jump-content {
  position: absolute;
  inset: 0;
  transform-origin: top left;
}

/* A layer passed on a long jump: its header (the host's stand-in, or a skeleton) and its cards as
   plain shapes where they sit on the page. The page part can be shifted (as if scrolled) and blurred. */
.zd-jump-page {
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  min-block-size: 100%;
}
.zd-jump-card {
  position: absolute;
  overflow: hidden;
  border-radius: var(--zd-radius, 24px);
  background: color-mix(in srgb, currentColor 6%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 8%, transparent);
}
.zd-jump-card[data-theme="light"] { color: #0b0b0b; }
.zd-jump-card[data-theme="dark"] { color: #fff; }
.zd-jump-card > span {
  position: absolute;
  inset-block-start: 20px;
  inset-inline-start: 20px;
  inline-size: min(46%, 220px);
  block-size: 14px;
  border-radius: 7px;
  background: color-mix(in srgb, currentColor 14%, transparent);
}

/* The skeleton header, for hosts without stand-ins. Hosts can line it up with their pages
   through --zd-jump-top and --zd-jump-frame. */
.zd-jump-skeleton {
  position: absolute;
  inset-block-start: var(--zd-jump-top, 112px);
  inset-inline-start: max(24px, calc((100% - var(--zd-jump-frame, 880px)) / 2));
  display: grid;
  gap: 14px;
  inline-size: min(var(--zd-jump-frame, 880px), calc(100% - 48px));
}
.zd-jump-skeleton > span { display: block; border-radius: 8px; background: color-mix(in srgb, currentColor 9%, transparent); }
.zd-jump-eyebrow { inline-size: 132px; block-size: 12px; }
.zd-jump-title { inline-size: min(460px, 70%); block-size: 46px; }
.zd-jump-line { inline-size: min(560px, 90%); block-size: 14px; }
.zd-jump-line + .zd-jump-line { inline-size: min(380px, 62%); }

.zd-rim {
  --zd-edge: 0px;
  z-index: 1;
  pointer-events: none;
  /* Cut glass: a fine cut line, a lit upper bevel, a faint cool body and a shaded lower bevel,
     resting on a soft contact shadow. Every term scales with the edge, so it vanishes at full size. */
  box-shadow:
    inset 0 0 0 calc(var(--zd-edge) / 6) rgba(62, 83, 111, .33),
    inset 0 calc(var(--zd-edge) * .28) calc(var(--zd-edge) * .4) rgba(255, 255, 255, .8),
    inset 0 0 0 var(--zd-edge) rgba(177, 199, 230, .21),
    inset 0 calc(var(--zd-edge) * -.28) calc(var(--zd-edge) * .4) rgba(116, 138, 168, .26),
    0 calc(var(--zd-edge) * .7) calc(var(--zd-edge) * 2) rgba(23, 35, 56, .12);
}

.zd-jump-rim { z-index: 4; }

[data-zoom-card] {
  position: relative;
  border-radius: var(--zd-radius, 24px);
}

[data-zoom-card][data-zoom-lifted] { z-index: 1; }

.zd-resume {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.zd-hit {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.zd-hit:focus, .zd-resume:focus { outline: 2px solid var(--ls-accent, #1f33f0); outline-offset: 3px; }
.zd-hit:focus:not(:focus-visible), .zd-resume:focus:not(:focus-visible) { outline-color: transparent; }
@media (prefers-reduced-motion: no-preference) {
  .zoom-deck:not([data-zoom-scrub-disabled]) :is([data-zoom-scrub], .zd-resume) {
    touch-action: pan-x;
    touch-action: pan-x pinch-zoom;
  }
}

[data-zoom-crop] {
  inset: 0;
  border-radius: inherit;
}

[data-zoom-crop][data-ready] { background: #fff; }
[data-zoom-crop][data-ready][data-theme="dark"] { background: #141414; }
[data-zoom-crop][data-ready] > [data-zoom-fallback] { display: none; }
[data-zoom-crop] > .zd-view { right: auto; bottom: auto; z-index: 0; }
[data-zoom-crop] .zd-scroll { scrollbar-width: none; }
[data-zoom-crop] .zd-scroll::-webkit-scrollbar { display: none; }
