/* ==========================================================================
   "Así trabajamos": línea de tiempo de edición, claqueta y detalle de cada etapa.
   ========================================================================== */

/* Claqueta animada junto al texto de "Así trabajamos" */
.clap {
  width: clamp(72px,8.4vw,118px);
  height: auto;
  flex: none;
  overflow: visible;
}

.clap * {
  transform-box: view-box;
}

.clap .cl-arm {
  transform-origin: 12px 29px;
  animation: clIdle 3.2s ease-in-out infinite;
}

.clap .cl-board {
  transform-origin: 60px 102px;
  animation: clJolt 3.2s ease-in-out infinite;
}

.clap .cl-rec {
  animation: evTw .8s ease-in-out infinite alternate;
}

@keyframes clIdle {
  0%, 55% {
    transform: rotate(-24deg);
  }
  66% {
    transform: rotate(0);
  }
  70% {
    transform: rotate(-5deg);
  }
  74%, 84% {
    transform: rotate(0);
  }
  100% {
    transform: rotate(-24deg);
  }
}

@keyframes clJolt {
  0%, 65%, 74%, 100% {
    transform: translateY(0);
  }
  67% {
    transform: translateY(1.5px);
  }
}

.clap.snap .cl-arm {
  animation: clSnap .7s ease-in-out;
}

.clap.snap .cl-board {
  animation: clSnapJolt .7s ease-in-out;
}

@keyframes clSnap {
  0% {
    transform: rotate(-24deg);
  }
  35% {
    transform: rotate(0);
  }
  45% {
    transform: rotate(-5deg);
  }
  55% {
    transform: rotate(0);
  }
  100% {
    transform: rotate(-24deg);
  }
}

@keyframes clSnapJolt {
  0%, 30%, 45%, 100% {
    transform: translateY(0);
  }
  36% {
    transform: translateY(1.5px);
  }
}

@media (prefers-reduced-motion:reduce) {
  .clap .cl-arm, .clap .cl-board, .clap .cl-rec {
    animation: none;
  }
}

.process {
  background: #FFFFFF;
  color: #000000;
  --bg: #FFFFFF;
  --surface: #EEF5F6;
  --ink: #000000;
  --muted: #44585C;
  --teal: #019EB5;
  --teal-ink: #006A7A;
  --line: rgba(0,0,0,.14);
}

.process .clip {
  background: var(--surface);
}

.process .clip:hover {
  background: #CFE9EE;
}

.process .clip[aria-pressed="true"] {
  background: #019EB5;
  color: #000000;
}

.process .tl-audio {
  background: var(--surface);
}

.process .phase-nav button:hover:not(:disabled) {
  background: #000000;
  color: #FFFFFF;
  border-color: #000000;
}

.process ::selection {
  background: #019EB5;
  color: #000000;
}

.tl-scroll {
  overflow-x: auto;
  padding-bottom: 8px;
  margin-inline: calc(var(--pad) * -1);
  padding-inline: var(--pad);
}

.timeline {
  --label: 84px;
  --p: 0;
  position: relative;
  min-width: 760px;
  padding-left: var(--label);
  user-select: none;
}

.tl-ruler {
  height: 34px;
  position: relative;
  background: repeating-linear-gradient(90deg,var(--muted) 0 1px,transparent 1px 10%) 0 100%/100% 14px no-repeat,
  repeating-linear-gradient(90deg,var(--line) 0 1px,transparent 1px 2%) 0 100%/100% 7px no-repeat;
  border-bottom: 1px solid var(--line);
}

.tl-row {
  position: relative;
  margin-top: 10px;
}

.tl-label {
  position: absolute;
  left: calc(var(--label) * -1);
  top: 50%;
  transform: translateY(-50%);
  font-size: .85rem;
  color: var(--muted);
  font-weight: 600;
}

.tl-video {
  display: flex;
  gap: 4px;
  height: 84px;
}

.clip {
  --c: 12px;
  height: 100%;
  border: 0;
  font: inherit;
  font-weight: 700;
  font-stretch: 80%;
  font-size: 1.05rem;
  text-align: left;
  padding: 10px 12px;
  display: flex;
  align-items: flex-end;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  clip-path: polygon(0 0,calc(100% - var(--c)) 0,100% var(--c),100% 100%,0 100%);
  transition: background .25s,color .25s;
  min-width: 0;
}

.clip:hover {
  background: color-mix(in srgb,var(--teal) 25%,var(--bg));
}

.clip[aria-pressed="true"] {
  background: var(--teal);
  color: #000;
}

.clip:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: -6px;
}

.tl-audio {
  height: 58px;
  background: var(--bg);
}

.tl-audio svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tl-audio rect {
  fill: var(--teal-ink);
  opacity: .55;
}

.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--label) + (100% - var(--label)) * var(--p));
  width: 2px;
  background: var(--ink);
  transition: left .55s cubic-bezier(.7,0,.2,1);
  pointer-events: none;
}

.playhead::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 16px;
  height: 18px;
  background: var(--ink);
  transform: translateX(-50%);
  clip-path: polygon(0 0,100% 0,100% 55%,50% 100%,0 55%);
}

.phase {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1.4fr) auto;
  gap: 1.5rem 3rem;
  align-items: start;
  margin-top: 48px;
}

.phase-step {
  color: var(--muted);
  font-weight: 600;
  font-size: .95rem;
  margin-bottom: .4rem;
}

.phase h3 {
  font-size: clamp(1.9rem,3.4vw,2.8rem);
  font-weight: 800;
  font-stretch: 112%;
  line-height: 1;
  letter-spacing: -.02em;
}

.phase p {
  font-size: 1.15rem;
  max-width: 48ch;
}

.phase-nav {
  display: flex;
  gap: 8px;
}

.phase-nav button {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  padding: .6rem 1rem;
  cursor: pointer;
}

.phase-nav button:hover:not(:disabled) {
  border-color: var(--ink);
}

.phase-nav button:disabled {
  opacity: .35;
  cursor: default;
}

/* Línea de tiempo en celular: el cabezal queda fijo a la izquierda y la pista se desliza, como en un editor móvil */
.swipe-hint {
  display: none;
  margin-top: 12px;
  font-size: .9rem;
  color: var(--muted);
}

@media (max-width:980px) {
  .phase {
    grid-template-columns: 1fr;
  }
}

@media (max-width:860px) {
  .tl-scroll {
    overflow: hidden;
    touch-action: pan-y;
  }
  .tl-scroll:not(.at-end) {
    -webkit-mask-image: linear-gradient(90deg,#000 84%,transparent);
    mask-image: linear-gradient(90deg,#000 84%,transparent);
  }
  .timeline {
    --label: 0px;
    min-width: 0;
    width: max(100%,920px);
    transition: transform .55s cubic-bezier(.7,0,.2,1);
  }
  .tl-label {
    display: none;
  }
  .tl-video {
    height: 76px;
  }
  .phase {
    margin-top: 28px;
    gap: 1rem;
  }
  .phase-nav {
    width: 100%;
  }
  .phase-nav button {
    flex: 1;
    padding: .85rem 1rem;
  }
  .process .swipe-hint {
    display: block;
  }
}
