.shift {
  --shift-black: #101112;
  --shift-charcoal: #17181a;
  --shift-silver: #e4e5e4;
  --shift-muted: #afb2b6;
  --shift-gold: #d8b878;
  --shift-rule: #48494a;
  color: var(--shift-silver);
  background: var(--shift-black);
  padding-block: clamp(2.4rem, 5vw, 5.5rem);
}
.shift-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  margin-bottom: clamp(1.15rem, 2.1vw, 2.6rem);
}
.shift-heading h2 {
  margin: 0;
  font: 480 clamp(2.75rem, 5.6vw, 6.25rem)/.99 var(--display, var(--sans));
  letter-spacing: -.04em;
}
.shift-heading h2 em {
  font: inherit;
  font-weight: 300;
  color: var(--shift-gold);
}
.shift-skip {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  flex: none;
  min-height: 44px;
  color: var(--shift-silver);
  text-decoration: underline;
  text-decoration-color: #747577;
  text-underline-offset: .35em;
  font: 500 .82rem/1.25 var(--sans);
}
.shift-skip:hover { color: var(--shift-gold); }
.shift-skip svg { color: var(--shift-gold); }
.shift-step { margin: 0; }
.shift-step + .shift-step { margin-top: 2.8rem; }
.shift-photo { overflow: hidden; background: var(--shift-charcoal); }
.shift-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
.shift-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .75rem;
  margin-block: .9rem .65rem;
}
.shift-count {
  font: 500 .78rem/1.4 var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--shift-muted);
  white-space: nowrap;
}
.shift-count b { color: var(--shift-gold); margin-right: .18em; }
.shift-credit { color: var(--shift-muted); font: 400 .75rem/1.35 var(--sans); }
.shift-caption h3 {
  margin: 0;
  font: 380 clamp(2.15rem, 4.6vw, 5.1rem)/1.03 var(--display, var(--sans));
  letter-spacing: -.04em;
  text-wrap: balance;
}
.shift-caption p {
  margin: .75rem 0 0;
  max-width: 46ch;
  color: var(--shift-silver);
  font: 400 clamp(1rem, 1.24vw, 1.2rem)/1.52 var(--sans);
}
.shift-sweep, .shift-strip { display: none; }
.shift :focus-visible { outline: 2px solid var(--shift-gold); outline-offset: 3px; }

@media (min-width: 761px) {
  .shift:not(.shift-enhanced) .shift-step {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    align-items: center;
    gap: clamp(2rem, 5.5vw, 6rem);
    border-top: 1px solid var(--shift-rule);
    padding-block: 2rem;
  }
  .shift:not(.shift-enhanced) .shift-step + .shift-step { margin: 0; }
  .shift:not(.shift-enhanced) .shift-meta { margin-bottom: 1.3rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .shift-enhanced { padding-block: 0; }
  .shift-enhanced .shift-track::after { content: ""; display: block; height: 200vh; }
  .shift-enhanced .shift-stage {
    position: sticky;
    top: var(--header-height, 64px);
    padding-block: clamp(1rem, 3.2vh, 2.4rem);
  }
  .shift-enhanced .shift-heading { margin-bottom: clamp(1rem, 2vh, 1.5rem); }
  .shift-enhanced .shift-heading h2 { font-size: clamp(2.6rem, 6.9vh, 5.4rem); }
  .shift-enhanced .shift-steps {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    height: clamp(18rem, 59vh, 46rem);
    background: var(--shift-charcoal);
  }
  .shift-enhanced .shift-step, .shift-enhanced .shift-photo,
  .shift-enhanced .shift-description, .shift-enhanced .shift-sweep {
    position: absolute;
    inset: 0;
    margin: 0;
  }
  .shift-enhanced .shift-step { pointer-events: none; }
  .shift-enhanced .shift-photo { clip-path: inset(0 0 0 var(--wipe, 100%)); }
  .shift-enhanced .shift-step:first-child .shift-photo { clip-path: none; }
  .shift-enhanced .shift-photo img { height: 100%; }
  .shift-enhanced .shift-steps::after {
    content: "";
    position: absolute;
    pointer-events: none;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgb(5 6 7 / .76), transparent 27%, transparent 38%, rgb(5 6 7 / .73) 75%, rgb(5 6 7 / .96));
  }
  .shift-enhanced .shift-description {
    z-index: 3;
    padding: clamp(1.4rem, 2.8vw, 3rem);
    display: flex;
    flex-flow: column;
    justify-content: space-between;
    visibility: hidden;
  }
  .shift-enhanced .shift-step.is-current .shift-description { visibility: visible; }
  .shift-enhanced .shift-meta { margin: 0; align-items: center; }
  .shift-enhanced .shift-count { font-size: .82rem; color: #e4e5e4; }
  .shift-enhanced .shift-count b {
    font: 500 clamp(1.4rem, 1.8vw, 2rem)/1 var(--display, var(--sans));
    vertical-align: -.08em;
  }
  .shift-enhanced .shift-credit { color: #f5f5f3; }
  .shift-enhanced .shift-caption {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .78fr);
    align-items: end;
    gap: clamp(2rem, 4vw, 4.5rem);
  }
  .shift-enhanced .shift-caption h3 { font-size: clamp(2.5rem, 4.55vw, 5.1rem); color: #f6f6f4; }
  .shift-enhanced .shift-caption p { margin: 0; max-width: 40ch; color: #f5f5f3; }
  .shift-enhanced .shift-sweep {
    display: block;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    border-inline-end: 1px solid var(--shift-gold);
  }
  .shift-enhanced .shift-strip { display: block; overflow: clip; padding: .8rem 0 4px; }
  .shift-progress { height: 1px; background: var(--shift-rule); }
  .shift-progress i {
    display: block;
    height: 2px;
    transform: scaleX(var(--progress, 0));
    transform-origin: left;
    background: var(--shift-gold);
  }
  .shift-choices {
    display: grid;
    width: 108%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    transform: translateX(var(--rail-x, 0%));
  }
  .shift-choice {
    border: 0;
    background: transparent;
    border-radius: 0;
    color: var(--shift-muted);
    padding: .75rem .3rem;
    min-height: 44px;
    font: 500 clamp(.82rem, 1.09vw, 1.02rem)/1.25 var(--sans);
    cursor: pointer;
  }
  .shift-choice span {
    color: var(--shift-muted);
    margin-right: .55em;
    font-size: .78em;
    font-variant-numeric: tabular-nums;
  }
  .shift-choice:hover { color: var(--shift-silver); }
  .shift-choice[aria-current="step"] {
    color: var(--shift-silver);
    text-decoration: underline;
    text-underline-offset: .42em;
    text-decoration-color: var(--shift-gold);
  }
  .shift-choice[aria-current="step"] span { color: var(--shift-gold); }
  .shift-choice:focus-visible { outline-offset: -3px; }
}

/* The handset stage keeps the photographs aligned. Its caption has its own
   space so the wipe stays visible under a thumb and all four titles fit. */
@media (max-width: 760px) {
  .shift-enhanced {
    --phone-frame: min(95vw, 48svh, max(9rem, calc(100svh - var(--header-height) - 20.25rem)));
  }
  .shift-enhanced .shift-track::after { height: 165svh; }
  .shift-enhanced .shift-stage {
    padding-block: clamp(.7rem, 2svh, 1.15rem);
  }
  .shift-enhanced .shift-heading { margin-bottom: .8rem; gap: .6rem; }
  .shift-enhanced .shift-heading h2 {
    font-size: clamp(2.2rem, 9.1vw, 3.25rem);
  }
  .shift-enhanced .shift-skip { font-size: .75rem; }
  .shift-enhanced .shift-steps {
    display: grid;
    height: auto;
    background: transparent;
  }
  .shift-enhanced .shift-step {
    position: relative;
    inset: auto;
    grid-area: 1 / 1;
    display: grid;
    grid-template-rows: var(--phone-frame) auto;
  }
  .shift-enhanced .shift-photo {
    position: relative;
    grid-row: 1;
    height: var(--phone-frame);
  }
  .shift-enhanced .shift-steps::after { display: none; }
  .shift-enhanced .shift-sweep { bottom: auto; height: var(--phone-frame); }
  .shift-enhanced .shift-description {
    position: relative;
    grid-row: 2;
    display: block;
    padding: .75rem 0 0;
  }
  .shift-enhanced .shift-meta { margin-bottom: .55rem; }
  .shift-enhanced .shift-count b { font-size: .98rem; }
  .shift-enhanced .shift-credit { color: var(--shift-muted); }
  .shift-enhanced .shift-caption { display: block; }
  .shift-enhanced .shift-caption h3 {
    font-size: clamp(1.75rem, 6.7vw, 2.55rem);
    line-height: 1.08;
  }
  .shift-enhanced .shift-caption p {
    margin-top: .45rem;
    font-size: 1rem;
    line-height: 1.4;
  }
  .shift-enhanced .shift-strip { padding: .85rem 0 0; }
  .shift-enhanced .shift-choices { width: 100%; transform: none; }
  .shift-enhanced .shift-choice {
    min-width: 0;
    min-height: 48px;
    padding: .5rem .2rem;
    font-size: .75rem;
    text-wrap: balance;
  }
  .shift-enhanced .shift-choice span { display: none; }
}

@media (max-width: 760px) and (max-height: 639px) and (orientation: portrait) {
  .shift-enhanced {
    --phone-frame: min(75vw, 43svh, calc(100svh - var(--header-height) - 18.75rem));
  }
  .shift-enhanced .shift-stage { padding-block: .4rem; }
  .shift-enhanced .shift-heading { margin-bottom: .4rem; }
  .shift-enhanced .shift-description { padding-top: .5rem; }
  .shift-enhanced .shift-meta { margin-bottom: .35rem; }
  .shift-enhanced .shift-strip { padding-top: .5rem; }
}

@media (max-width: 360px) {
  .shift-enhanced .shift-heading h2 { font-size: 1.85rem; }
}
