.revive-intro {
  padding-block: var(--sp-16) var(--sp-12);
  background: var(--g-hero-bg);
}

.revive-intro h1 {
  font-size: var(--text-hero);
  margin-bottom: var(--sp-4);
}

.revive-intro p {
  font-size: var(--text-lg);
}

.revive-section {
  border-top: 1px solid var(--c-border);
}

.revive-section .section__header {
  margin-bottom: var(--sp-6);
}

.revive-diagram {
  display: grid;
  gap: var(--sp-3);
  padding: clamp(var(--sp-3), 3vw, var(--sp-8));
  background: var(--c-bg-deep);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
}

.revive-diagram h3 {
  font-size: var(--text-2xl);
  margin-bottom: var(--sp-2);
}

.revive-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: clamp(var(--sp-1), 1.2vw, var(--sp-4));
  align-items: stretch;
}

.revive-stack {
  display: grid;
  gap: var(--sp-2);
  align-self: center;
}

.revive-sample,
.revive-stage {
  padding: var(--sp-3);
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
  font-size: var(--text-sm);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.revive-sample {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--c-surface);
}

.revive-sample img {
  flex: none;
  width: clamp(var(--sp-8), 7vw, var(--sp-16));
  border-radius: var(--radius-sm);
}

.revive-stage {
  display: grid;
  align-content: center;
  align-self: center;
  gap: var(--sp-1);
  text-align: center;
  background: var(--c-surface-2);
  border-color: var(--c-border-bright);
  padding-block: var(--sp-4);
}

.revive-stage strong {
  color: var(--c-accent);
}

.revive-sample small,
.revive-stage small {
  display: block;
  color: var(--c-text-muted);
  font-size: var(--text-xs);
}

.revive-arrow {
  align-self: center;
  color: var(--c-accent);
  font: var(--text-lg) var(--font-mono);
}

.revive-diagram__note {
  margin-top: var(--sp-2);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-border);
  font-size: var(--text-sm);
  color: var(--c-text-muted);
}

.revive-diagram__note--feedback {
  border-top-style: dashed;
}

.revive-diagram__note--feedback span {
  margin-right: var(--sp-1);
  color: var(--c-accent);
}

.revive-comparisons {
  margin-block: var(--sp-12) var(--sp-4);
}

.revive-section .comparison__attribution {
  inset-block: var(--sp-3) auto;
}

.revive-section .comparison:has(.comparison__range:focus-visible) {
  border-color: var(--c-accent);
}

.revive-video {
  width: min(100%, var(--revive-video-width, 100%));
  margin-inline: auto;
}

.revive-video__clips:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}

.revive-video__clips button[aria-pressed="true"] {
  border-color: var(--c-accent);
  color: var(--c-accent);
}

.revive-video__viewport {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--c-bg-deep);
  box-shadow: 0 0 0 1px var(--c-border);
}

.revive-video__viewport video {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}

.revive-video--ready .revive-video__viewport {
  height: min(var(--revive-video-height), 75svh);
}

.revive-video--ready .revive-video__viewport video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--revive-video-width);
  height: var(--revive-video-height);
  max-width: none;
  transform: translate(-50%, -50%);
}

.revive-video__controls:not([hidden]) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

.revive-video__play {
  justify-content: center;
  min-width: var(--sp-16);
}

.revive-video__seek {
  width: 100%;
  min-width: 0;
  accent-color: var(--c-accent);
  cursor: pointer;
}

.revive-video__time,
.revive-video__hint,
.revive-video__status {
  color: var(--c-text-muted);
  font-size: var(--text-xs);
}

.revive-video__time {
  font-family: var(--font-mono);
}

.revive-video__hint,
.revive-video__status {
  margin-top: var(--sp-2);
}

.revive-footer {
  padding-block: var(--sp-4);
  border-top: 1px solid var(--c-border);
  background: var(--c-header-bg);
  text-align: center;
}

.revive-footer p {
  margin-inline: auto;
  font-size: var(--text-sm);
}

.revive-footer a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

@media (max-width: 720px) {
  .revive-intro,
  .revive-section {
    padding-block: var(--sp-8);
  }

  .revive-intro h1 {
    font-size: var(--text-5xl);
  }

  .revive-intro p {
    font-size: var(--text-base);
  }

  .revive-diagram--frame .revive-sample img {
    width: var(--sp-12);
  }

  .revive-diagram--frame .revive-flow {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-2);
  }

  .revive-diagram--frame .revive-arrow {
    justify-self: center;
    transform: rotate(90deg);
  }
}

@media (min-width: 381px) and (max-width: 720px) {
  .revive-diagram:not(.revive-diagram--frame) .revive-sample {
    display: grid;
    align-content: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-1);
    font-size: var(--text-xs);
  }

  .revive-diagram:not(.revive-diagram--frame) .revive-stage {
    padding-inline: var(--sp-1);
    font-size: var(--text-xs);
  }
}

@media (max-width: 380px) {
  .revive-flow {
    grid-template-columns: minmax(0, 1fr);
  }

  .revive-flow + .revive-flow {
    margin-top: var(--sp-2);
    padding-top: var(--sp-3);
    border-top: 1px solid var(--c-border);
  }

  .revive-arrow {
    justify-self: center;
    transform: rotate(90deg);
  }
}
