/* ── Driver Console showcase section ─────────────────────
   Background tow-truck photo (darkened with a CSS overlay, never baked
   in), text on the left, a hand holding a phone on the right. The
   phone screen is a stack of layers: a title card (HTML) then real
   Driver Console screenshots. The first layer is the base; each later
   one fades in over the one before it (0.5s), 3s per screen, 12
   screens = 36s loop. CSS only: no script, no inline styles, no
   frames (website CSP).
   The screenshots start at 0s, so the title card (and its caption) shows
   at the end of each loop, not the start. */

.showcase {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg);
}

.showcase-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

.showcase::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(10, 14, 20, 0.92) 0%, rgba(10, 14, 20, 0.80) 42%, rgba(10, 14, 20, 0.55) 100%);
}

.showcase-inner {
  display: grid;
  gap: 8px;
  padding-top: 64px;
}

.showcase-text {
  max-width: 560px;
}

.showcase-text h2 {
  margin-top: 12px;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.showcase-text p {
  margin-top: 16px;
  color: var(--text-soft);
  font-size: 17px;
}

.showcase-list {
  margin-top: 20px;
  display: grid;
  gap: 8px;
  color: var(--text-soft);
  font-size: 15px;
  list-style: none;
  padding: 0;
}

.showcase-list li {
  position: relative;
  padding-left: 22px;
}

.showcase-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal-bright);
}

/* phone column: the composite is clipped by the section's bottom edge */
.showcase-stage {
  position: relative;
  height: 500px;
  margin: 8px auto 0;
  width: 100%;
  max-width: 360px;
}

.sc-hand {
  position: absolute;
  left: 50%;
  top: 0;
  height: 680px;
  aspect-ratio: 1 / 2;
  transform: translateX(-46%);
}

/* hand + phone photograph (one cut-out with a transparent display window),
   used in layers: the whole photo at the back, then the screens, then the
   phone alone enlarged 4.2% from its left edge (closes the gap to the thumb
   and palm), then the original fingers and thumb in front of the phone.
   Geometry in % of the .sc-hand box. */
.sc-hand-photo {
  position: absolute;
  z-index: 1;
  left: 6.899%;
  top: 5.526%;
  width: 113.8%;
  height: auto;
  max-width: none;
  pointer-events: none;
}

.sc-hand-phone {
  z-index: 3;
  transform-origin: 14.521% 43.362%;
  transform: scale(1.042);
  clip-path: polygon(57.12% 1.36%, 57.95% 1.40%, 58.77% 1.53%, 59.56% 1.76%, 60.31% 2.06%, 61.00% 2.44%, 61.63% 2.89%, 62.18% 3.41%, 62.64% 3.98%, 63.01% 4.60%, 63.28% 5.25%, 63.44% 5.92%, 63.49% 6.61%, 63.49% 80.11%, 63.44% 80.80%, 63.28% 81.47%, 63.01% 82.12%, 62.64% 82.74%, 62.18% 83.31%, 61.63% 83.83%, 61.00% 84.28%, 60.31% 84.66%, 59.56% 84.97%, 58.77% 85.19%, 57.95% 85.32%, 57.12% 85.37%, 20.82% 85.37%, 19.99% 85.32%, 19.17% 85.19%, 18.38% 84.97%, 17.64% 84.66%, 16.94% 84.28%, 16.32% 83.83%, 15.77% 83.31%, 15.31% 82.74%, 14.94% 82.12%, 14.67% 81.47%, 14.51% 80.80%, 14.45% 80.11%, 14.45% 6.61%, 14.51% 5.92%, 14.67% 5.25%, 14.94% 4.60%, 15.31% 3.98%, 15.77% 3.41%, 16.32% 2.89%, 16.94% 2.44%, 17.64% 2.06%, 18.38% 1.76%, 19.17% 1.53%, 19.99% 1.40%, 20.82% 1.36%);
}

.sc-hand-fingers,
.sc-hand-thumb {
  z-index: 4;
}

.sc-hand-fingers {
  clip-path: inset(23.164% 83.973% 22.034% 0);
}

.sc-hand-thumb {
  clip-path: inset(26.554% 0 54.237% 63.836%);
}

/* the enlarged phone's display window (screen stack) */
.sc-phone {
  position: absolute;
  z-index: 2;
  left: 27.338%;
  top: 6.625%;
  width: 52.776%;
  height: 57.129%;
}

.sc-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 8.5% / 3.9%;
  background: #0a0e14;
}

/* screenshots shown whole (no cropping); the slim side margins take the
   page background colour of each screen */
.sc-screen > * {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  background-color: #0d1116;
  opacity: 0;
  animation: sc-in 36s linear infinite both;
}

.sc-screen > :nth-child(6) { background-color: #11141a; }
.sc-screen > :nth-child(11) { background-color: #202733; }

/* title card (first, base layer) */
.sc-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 10%;
  text-align: center;
  background:
    radial-gradient(90% 60% at 50% 40%, rgba(8, 215, 190, 0.16), transparent 70%),
    #0a0e14;
}

.sc-title-mark {
  width: 34%;
  height: auto;
}

.sc-title .wordmark {
  font-size: clamp(22px, 2.4vw, 30px);
}

.sc-title-tagline {
  color: var(--text-soft);
  font-size: clamp(11px, 1.05vw, 14px);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sc-screen > :first-child {
  opacity: 1;
  animation: none;
}

.sc-screen > :nth-child(2), .sc-steps span:nth-child(2) { animation-delay: 0s; }
.sc-screen > :nth-child(3), .sc-steps span:nth-child(3) { animation-delay: 3s; }
.sc-screen > :nth-child(4), .sc-steps span:nth-child(4) { animation-delay: 6s; }
.sc-screen > :nth-child(5), .sc-steps span:nth-child(5) { animation-delay: 9s; }
.sc-screen > :nth-child(6), .sc-steps span:nth-child(6) { animation-delay: 12s; }
.sc-screen > :nth-child(7), .sc-steps span:nth-child(7) { animation-delay: 15s; }
.sc-screen > :nth-child(8), .sc-steps span:nth-child(8) { animation-delay: 18s; }
.sc-screen > :nth-child(9), .sc-steps span:nth-child(9) { animation-delay: 21s; }
.sc-screen > :nth-child(10), .sc-steps span:nth-child(10) { animation-delay: 24s; }
.sc-screen > :nth-child(11), .sc-steps span:nth-child(11) { animation-delay: 27s; }
.sc-screen > :nth-child(12), .sc-steps span:nth-child(12) { animation-delay: 30s; }

.sc-steps span:nth-child(1) { animation-delay: 33s; }

.sc-screen > :nth-child(12) {
  animation-name: sc-last;
}

/* later screens: fade in over 0.5s, hold, drop once the next one is fully in */
@keyframes sc-in {
  0% { opacity: 0; }
  1.39% { opacity: 1; }
  9.72% { opacity: 1; }
  10% { opacity: 0; }
  100% { opacity: 0; }
}

/* last screen fades out to reveal the title card again */
@keyframes sc-last {
  0% { opacity: 0; }
  1.39% { opacity: 1; }
  8.33% { opacity: 1; }
  9.72% { opacity: 0; }
  100% { opacity: 0; }
}

/* captions: one per 3s slot (the first included), fade out then in --
   text never cross-fades over other text */
@keyframes sc-cap {
  0% { opacity: 0; }
  0.69% { opacity: 1; }
  7.64% { opacity: 1; }
  8.33% { opacity: 0; }
  100% { opacity: 0; }
}

/* step label + pause control (in the text column, never over the phone) */
.sc-pause-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.sc-caption {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding: 7px 8px 7px 14px;
  border-radius: 999px;
  background: rgba(10, 14, 20, 0.85);
  border: 1px solid rgba(94, 234, 212, 0.35);
  white-space: nowrap;
}

.sc-caption-label {
  color: var(--teal-bright);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sc-steps {
  display: grid;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
}

.sc-steps span {
  grid-area: 1 / 1;
  opacity: 0;
  animation: sc-cap 36s linear infinite both;
}

.sc-pause {
  position: relative;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.sc-pause::before,
.sc-pause::after {
  content: "";
  position: absolute;
  top: 9px;
  width: 3px;
  height: 10px;
  border-radius: 1px;
  background: #ffffff;
}

.sc-pause::before { left: 10px; }
.sc-pause::after { left: 15px; }

.sc-pause-input:checked ~ .showcase-text .sc-pause::before {
  left: 11px;
  width: 0;
  height: 0;
  border-radius: 0;
  background: none;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent #ffffff;
}

.sc-pause-input:checked ~ .showcase-text .sc-pause::after {
  display: none;
}

.sc-pause-input:focus-visible ~ .showcase-text .sc-pause {
  outline: 2px solid var(--teal-bright);
  outline-offset: 2px;
}

.sc-pause-input:checked ~ .showcase-text .sc-steps span,
.sc-pause-input:checked ~ .showcase-stage .sc-screen > * {
  animation-play-state: paused;
}

/* Reduced motion: no cycling -- one static screen (the new job), no pause control */
@media (prefers-reduced-motion: reduce) {
  .sc-screen > :nth-child(n),
  .sc-steps span:nth-child(n) {
    animation: none;
  }

  .sc-screen > :nth-child(3),
  .sc-steps span:nth-child(3) {
    opacity: 1;
  }

  .sc-pause {
    display: none;
  }
}

/* ── Desktop (≥ 1024px): text left, phone right ── */
@media (min-width: 1024px) {
  .showcase::before {
    background:
      linear-gradient(90deg, rgba(10, 14, 20, 0.94) 0%, rgba(10, 14, 20, 0.82) 42%, rgba(10, 14, 20, 0.45) 100%);
  }

  .showcase-inner {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 48px;
    padding-top: 0;
    min-height: 680px;
  }

  .showcase-text h2 {
    font-size: 46px;
  }

  .showcase-stage {
    height: 680px;
    max-width: none;
    margin: 0;
  }

  .sc-hand {
    top: 56px;
    height: 900px;
  }
}

/* Phones: drop the "On screen" label so the pill fits */
@media (max-width: 699px) {
  .sc-caption-label {
    display: none;
  }
}

/* Small phones: slightly smaller captions so the longest stays clear of the edge */
@media (max-width: 374px) {
  .sc-steps {
    font-size: 13px;
  }
}
