/* Motion follows the slide lifecycle, including revisits and manual replay. */
.slide.motion-paused * {
  animation: none !important;
}

.slide.active:not(.motion-paused) .drone-flight {
  animation: drone-approach 2.65s cubic-bezier(.23, .75, .29, 1) both;
}

.slide.active:not(.motion-paused) .rotor-spin {
  animation: rotor-pulse .23s ease-in-out 10 alternate both;
}

.slide.active:not(.motion-paused) .spray-particles > * {
  animation: spray-pass .38s ease-out 1.05s 4 backwards;
}

.slide.active:not(.motion-paused) .spray-particles > :nth-child(3n + 2) {
  animation-delay: 1.13s;
}

.slide.active:not(.motion-paused) .spray-particles > :nth-child(3n) {
  animation-delay: 1.2s;
}

.slide.active:not(.motion-paused) .applied-patch {
  animation: patch-form 1.3s ease-out 1.23s both;
}

.slide.active:not(.motion-paused) .system-triad .focus-first circle {
  animation: node-emphasis 1s ease-out .15s both;
}

.slide.active:not(.motion-paused) .stacked-bar span {
  animation: evidence-reveal .72s cubic-bezier(.23, .75, .29, 1) .12s both;
}

.slide.active:not(.motion-paused) .stacked-bar span + span {
  animation-delay: .55s;
}

#maturidade.active .maturity-row {
  animation: none;
}

#maturidade.active:not(.motion-paused) .chart-flight-ready .band i {
  transform-origin: left center;
  animation: maturity-range-spray var(--spray-time) linear var(--spray-start) both;
}

#maturidade.active:not(.motion-paused) .chart-flight-ready .band i.point-level {
  transform-origin: center;
  animation: maturity-point-spray var(--spray-time) ease-out var(--spray-start) both;
}

#maturidade.active:not(.motion-paused) .chart-flight-ready .maturity-row.recommended {
  animation: maturity-recommend .8s ease-out 7.86s both;
}

#maturidade.active:not(.motion-paused) .chart-flight-ready + .decision-card {
  animation: maturity-decision .8s ease-out 7.86s both;
}

.slide.active:not(.motion-paused) path.curve[pathLength='1'] {
  stroke-dasharray: 1;
  animation: rheology-trace 1.15s ease-out .12s both;
}

.slide.active:not(.motion-paused) .rheology-panel .point,
.slide.active:not(.motion-paused) .rheology-panel .plot-label {
  animation: graph-label .3s ease-out .8s both;
}

@keyframes drone-approach {
  0% { transform: translate(var(--flight-x, -88px), var(--flight-y, 35px)); }
  43% { transform: translate(0, 3px); }
  66% { transform: translate(3px, -4px); }
  85% { transform: translate(-2px, 3px); }
  100% { transform: translate(0, 0); }
}

@keyframes rotor-pulse {
  from { opacity: .54; }
  to { opacity: 1; }
}

@keyframes spray-pass {
  0% { opacity: 0; transform: translateY(5px); }
  32% { opacity: 1; }
  100% { opacity: 0; transform: translateY(var(--spray-travel, -10px)); }
}

@keyframes patch-form {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes node-emphasis {
  0%, 100% { stroke: #3a6975; }
  38% { stroke: var(--teal); stroke-width: 4px; }
}

@keyframes evidence-reveal {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0); }
}

@keyframes maturity-range-spray {
  from { scale: 0 1; }
  to { scale: 1 1; }
}

@keyframes maturity-point-spray {
  0% { opacity: 0; scale: .6; }
  62% { opacity: 1; scale: 1.12; }
  100% { opacity: 1; scale: 1; }
}

@keyframes maturity-recommend {
  0% { background: transparent; box-shadow: none; }
  40% { background: #183c49; box-shadow: inset 0 0 0 2px var(--teal); }
  100% { background: rgba(101, 221, 213, .07); box-shadow: inset 0 0 0 1px rgba(101, 221, 213, .36); }
}

@keyframes maturity-decision {
  0% { border-color: #3e5d6b; }
  40% { border-color: var(--teal); }
  100% { border-color: #528286; }
}

@keyframes rheology-trace {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes graph-label {
  from { opacity: 0; }
  to { opacity: 1; }
}

.maturity-scale {
  --maturity-columns: minmax(125px, 1.32fr) minmax(65px, 1fr) 62px minmax(77px, .63fr);
  --maturity-gap: 10px;
  --maturity-padding: 12px;
  --maturity-band-column: 2;
}

.maturity-scale .maturity-row,
.maturity-scale .scale-labels {
  grid-template-columns: var(--maturity-columns);
  column-gap: var(--maturity-gap);
}

.maturity-scale .maturity-row {
  padding-inline: var(--maturity-padding);
  border: 1px solid transparent;
  border-bottom-color: #1d3a47;
}

.maturity-scale .maturity-row.recommended {
  border-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(101, 221, 213, .36);
}

.maturity-scale .scale-labels {
  display: grid;
  padding-inline: calc(var(--maturity-padding) + 1px);
  color: #a5bdc6;
}

.maturity-scale .ticks {
  position: relative;
  grid-column: var(--maturity-band-column);
  min-height: 1.3em;
  font-variant-numeric: tabular-nums;
}

.maturity-scale .ticks span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
}

.maturity-scale .ticks span:nth-child(1) { left: 0; }
.maturity-scale .ticks span:nth-child(2) { left: 25%; }
.maturity-scale .ticks span:nth-child(3) { left: 50%; }
.maturity-scale .ticks span:nth-child(4) { left: 75%; }
.maturity-scale .ticks span:nth-child(5) { left: 100%; }

.maturity-row .band {
  background: repeating-linear-gradient(90deg, #193744 0, #193744 calc(25% - 1px), #36515c 25%);
}

.maturity-row .band i.point-level {
  width: 12px;
  translate: -50% 0;
}

.cover-title-end {
  display: block;
  margin-top: .55em;
  font-size: clamp(1.15rem, 2.1vw, 1.85rem);
  font-weight: 800;
  line-height: 1.13;
  letter-spacing: -.018em;
}

.cover h1 {
  max-width: 67%;
  font-size: clamp(2.1rem, 4.7vw, 5.2rem);
}

.cover-visual {
  left: 28%;
}

.cover-shade {
  background: linear-gradient(90deg, #05131c 18%, rgba(5, 19, 28, .92) 40%, rgba(5, 19, 28, .35) 64%, transparent 91%);
}

/* Fill the stage even when slide height is set by the viewport. */
.slide {
  width: 100%;
  aspect-ratio: auto;
}

@media (min-width: 901px) {
  .stage,
  .topbar {
    width: calc(100% - 2 * clamp(20px, 2.6vw, 52px));
    max-width: none;
  }

  .topbar {
    padding-inline: 0;
  }
}

/* The deck and controls fit inside the available projection viewport. */
@media (min-width: 901px) {
  .slide {
    height: min(850px, calc(100dvh - 132px));
    min-height: 0;
  }

  .slide-inner,
  .conclusion-content {
    padding-block: clamp(24px, 5vh, 68px);
  }

  .maturity-layout {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, .75fr);
    gap: clamp(14px, 2vw, 28px);
  }

}

/* Let the cover retain its intrinsic content height at high zoom. */
#capa.repair-cover {
  overflow-x: hidden;
  overflow-y: auto;
}

#capa.repair-cover .cover-content {
  height: auto;
  min-height: 100%;
  padding-block: clamp(16px, 3.2dvh, 34px);
}

#capa.repair-cover .authors {
  margin-top: 0;
}

#capa.repair-cover .repair-stages {
  margin-bottom: 0;
}

@media (min-width: 901px) and (max-height: 680px) {
  .slide {
    overflow-y: auto;
  }

  .cover h1,
  .conclusion h2 {
    font-size: clamp(2rem, 4.4vw, 3.9rem);
  }

  .architecture {
    margin-block: 22px 18px;
  }

  .arch-node {
    min-height: 156px;
  }

  .acceptance-layout {
    gap: 18px;
  }
}

@media (max-width: 900px) {
  .cover.active,
  .conclusion.active {
    display: flex;
    flex-direction: column;
  }

  .cover-shade,
  .conclusion-shade {
    display: none;
  }

  .cover-visual,
  .conclusion-art {
    position: relative;
    inset: auto;
    order: 1;
    flex: none;
    width: 100%;
    aspect-ratio: 1.55;
    max-height: 500px;
    overflow: hidden;
    border-top: 1px solid var(--line);
  }

  .cover-visual {
    order: -1;
    border-top: 0;
    border-bottom: 1px solid var(--line);
  }

  .cover-content,
  .conclusion-content {
    height: auto;
    padding: clamp(22px, 4.5vw, 40px);
  }

  .institution-row {
    margin-bottom: clamp(22px, 5vw, 42px);
  }

  .cover h1 {
    font-size: clamp(2rem, 8.4vw, 3.8rem);
    max-width: none;
  }

  .controls {
    gap: clamp(5px, 1.5vw, 12px);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .controls .nav-button {
    width: clamp(34px, 9.5vw, 44px);
    height: 42px;
    flex: 0 0 auto;
  }

  .markers {
    gap: clamp(4px, 1.2vw, 9px);
  }

  .maturity-scale {
    --maturity-columns: minmax(0, 1fr) 68px;
    --maturity-gap: 12px;
    --maturity-band-column: 1;
  }

  .maturity-row {
    row-gap: 8px;
  }

  .maturity-row .band {
    display: block;
    grid-row: 2;
    grid-column: 1;
    height: 9px;
  }

  .maturity-row b {
    grid-row: 1;
    grid-column: 2;
  }

  .maturity-row small {
    display: block;
    grid-row: 3;
    grid-column: 1 / -1;
  }

  .cover .cover-tag,
  .conclusion .cover-tag {
    position: static;
    display: inline-flex;
    margin-top: 12px;
  }
}

@media (min-width: 701px) and (max-width: 900px) {
  .topbar { height: 54px; }
  .pdf-top { display: inline-flex; }
  .stage { width: calc(100% - 32px); }
  .slide { height: calc(100dvh - 118px); min-height: 0; }
  .slide-inner { padding: 27px 30px; }
  .slide h2 { font-size: clamp(1.85rem, 4.4vw, 2.6rem); }
  .split { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 22px; }
  .cover.active, .conclusion.active { display: block; }
  .cover-visual, .conclusion-art { position: absolute; inset: 0; width: auto; max-height: none; aspect-ratio: auto; border: 0; }
  .cover-visual { left: 27%; }
  .cover-shade, .conclusion-shade { display: block; }
  .cover-content, .conclusion-content { height: 100%; padding: 30px 34px; }
  .cover h1 { max-width: 66%; font-size: clamp(2.1rem, 5.2vw, 3rem); }
  .cover .cover-tag, .conclusion .cover-tag { position: absolute; margin-top: 0; }
  .institution-row { margin-bottom: auto; }
  .institution-row img { width: 43px; }
  .deckline { max-width: 61%; }
  .question-layout .system-triad { min-height: 0; height: 90%; }
  .evidence-grid { display: grid; gap: 10px; margin-top: 18px; grid-template-columns: 1.15fr .9fr 1.15fr; }
  .metric-panel { min-height: 0; padding: 16px; }
  .period-panel, .dimension-list, .scope-note { padding: 12px; }
  .dimension-list li { padding: 4px; }
  .maturity-layout { display: grid; gap: 13px; grid-template-columns: 1.55fr .85fr; margin-top: 16px; }
  .maturity-scale {
    --maturity-columns: minmax(0, 1.5fr) minmax(35px, .7fr) 59px;
    --maturity-gap: 9px;
    --maturity-padding: 8px;
    --maturity-band-column: 2;
  }
  .maturity-row { padding-block: 9px; }
  .maturity-scale .ticks { font-size: .64rem; }
  .maturity-row .band { grid-row: 1; grid-column: 2; }
  .maturity-row b { grid-column: 3; font-size: .83rem; }
  .maturity-row small { grid-row: 2; }
  .decision-card { padding: 16px; }
  .decision-card p { font-size: .87rem; }
  .rheology-panel { height: 90%; padding: 14px; }
  .state-cards article { padding: 12px; }
  .architecture { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 24px 0 18px; }
  .arch-node { min-height: 165px; padding: 10px; }
  .arch-node svg { width: 68px; height: 60px; }
  .gate { min-width: 0; width: 63px; }
  .gate b { width: 42px; height: 42px; }
  .gate-line > i { min-width: 0; margin-top: 21px; }
  .gate span { font-size: .63rem; }
  .acceptance-cards { grid-template-columns: 1fr auto 1fr; gap: 12px; }
  .acceptance-cards article { padding: 14px; }
  .conclusion-content { width: 64%; }
  .controls { height: 64px; }
}

@media (max-width: 700px) {
  .cover-visual { max-height: 245px; }
  .conclusion-art { max-height: 320px; }
  .cover-visual, .conclusion-art { left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .slide.active:not(.motion-paused) *,
  .slide.active:not(.motion-paused) *::before,
  .slide.active:not(.motion-paused) *::after {
    animation: none !important;
  }
}
