/* App reel: stacked phone screens that crossfade, with the matching caption lit in step (js/reel.js). */

.app-reel-group {
  --reel-w: 260px;
  display: grid;
  gap: 28px;
  justify-items: center;
}

.app-reel {
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* The tinted stage echoes the step scenes; the phone images already include the phone frame, so they are shown whole. */
.reel-stage {
  position: relative;
  width: 100%;
  display: grid;
  justify-items: center;
  padding: 24px 16px;
  border-radius: var(--r-lg);
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(11, 31, 26, .07);
  box-shadow: var(--gloss);
  background: radial-gradient(110% 100% at 50% 35%, #f3fbf7 0%, #caeedd 52%, #8ad6b2 100%);
}

.reel-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--grain);
  opacity: .16;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.reel-stage.is-sky {
  background: radial-gradient(120% 90% at 50% 0%, #f4f9ff 0%, #d9e8fa 58%, #bfd6f3 100%);
}

.reel-frames {
  position: relative;
  z-index: 1;
  width: min(100%, var(--reel-w));
  aspect-ratio: 640 / 1342;
}

.reel-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  filter: drop-shadow(0 14px 26px rgba(11, 31, 26, .18));
}

/* No script, or reduced motion: the first screen stays as a still and every caption is plain text beside it. */
.reel-frame:first-child {
  opacity: 1;
}

.app-reel-group.is-ready .reel-frame {
  opacity: 0;
  transition: opacity 400ms ease;
}

.app-reel-group.is-ready .reel-frame.is-on {
  opacity: 1;
}

.reel-cap {
  max-width: 34ch;
  text-align: center;
  font-size: 14px;
  line-height: 1.55;
  color: var(--body);
}

/* Pause / Play (WCAG 2.2.2): shown by the script only when the reel is moving */
.reel-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 500 14px var(--font-sans);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}

.reel-toggle[hidden] {
  display: none;
}

.reel-toggle .ico-play,
.app-reel-group.is-paused .reel-toggle .ico-pause {
  display: none;
}

.app-reel-group.is-paused .reel-toggle .ico-play {
  display: block;
}

.reel-toggle .ico {
  fill: currentColor;
  stroke: none;
}

/* Caption list: all five stay visible, the current one is lit */
.app-reel-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  width: 100%;
  counter-reset: reel;
}

.app-reel-steps li {
  counter-increment: reel;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 10px 14px 10px 10px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  color: var(--body);
  font-size: 16px;
  line-height: 1.45;
}

.app-reel-steps li::before {
  content: counter(reel);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1.5px solid var(--line-strong);
  color: var(--body);
  font: 600 13px var(--font-mono);
}

.app-reel-group.is-ready .app-reel-steps li {
  transition: background-color 300ms ease, border-color 300ms ease, color 300ms ease;
}

.app-reel-steps li[aria-current="step"] {
  background: #fff;
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-weight: 500;
}

.app-reel-steps li[aria-current="step"]::before {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.app-reel-side {
  width: 100%;
  display: grid;
  gap: 16px;
}

.app-reel-side h3 {
  margin: 0;
}

.app-reel-side .band-link {
  width: fit-content;
}

/* From 640px the phone sits beside its captions */
@media (min-width: 640px) {
  .app-reel-group {
    grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
    gap: clamp(28px, 5vw, 56px);
    align-items: center;
    justify-items: stretch;
  }
}

/* Home: the small reel under the three steps, phone about 220px wide */
.app-reel-mini {
  --reel-w: 220px;
  margin-top: clamp(28px, 4vw, 48px);
}

@media (min-width: 640px) {
  .app-reel-mini {
    grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  }
}

/* How it works, #app and #carriers: heading and captions on the left, phone on the right from 1200px (the band-side pattern) */
:is(#app, #carriers.band-side) .app-reel-group {
  --reel-w: 280px;
}

@media (min-width: 1024px) and (max-width: 1199.98px) {
  :is(#app, #carriers).band-side > .container {
    display: block;
  }
  :is(#app, #carriers).band-side > .container > .band-head {
    margin-bottom: clamp(28px, 3.5vw, 48px);
  }
}

@media (min-width: 1200px) {
  :is(#app, #carriers).band-side {
    --side-cols: minmax(0, 1fr) minmax(0, 1fr);
  }
  :is(#app, #carriers).band-side > .container > .app-reel-group {
    display: contents;
  }
  :is(#app, #carriers).band-side > .container > .app-reel-group > .app-reel {
    grid-column: 2;
    grid-row: 1 / -1;
  }
  :is(#app, #carriers).band-side > .container > .app-reel-group > .app-reel-steps {
    grid-column: 1;
    grid-row: auto;
  }
  :is(#app, #carriers.band-side) .app-reel-group {
    --reel-w: 300px;
  }
  :is(#app, #carriers.band-side) .reel-stage {
    max-width: 440px;
  }
}

/* The carrier link under the captions */
.reel-link-row {
  display: flex;
  margin-top: clamp(20px, 3vw, 28px);
}

@media (prefers-reduced-motion: reduce) {
  .app-reel-group.is-ready .reel-frame,
  .app-reel-group.is-ready .app-reel-steps li {
    transition: none;
  }
}

/* Print: the captions stay, the moving screens and the button do not */
@media print {
  .reel-stage,
  .reel-toggle {
    display: none !important;
  }
}

/* Full width (2026-11-20): the small home reel keeps its phone and captions together in the middle */
@media (min-width: 1400px) {
  .app-reel-mini { max-width: 1180px; margin-inline: auto; }
}
@media (min-width: 1400px) {
  /* Full width: the phone column hugs the right edge instead of floating in the middle of a half-width column */
  :is(#app, #carriers).band-side { --side-cols: minmax(0, 1fr) minmax(0, 440px); }
}
