/* Native three-screen sequence for the final single-phone showcase. */
.phone-sequence .layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transition: transform var(--phone-transition, .78s) cubic-bezier(.65, 0, .2, 1);
  will-change: transform;
}

.phone-sequence .lock-layer { z-index: 4; transform: translate(0, 0); }
.phone-sequence .dash-layer { z-index: 3; transform: translate(0, 100%); }
.phone-sequence .ig-layer { z-index: 2; transform: translate(100%, 0); }

.phone-sequence[data-state="dashboard"] .lock-layer,
.phone-sequence[data-state="instagram"] .lock-layer { transform: translate(0, -100%); }
.phone-sequence[data-state="lock"] .lock-layer,
.phone-sequence[data-state="dashboard"] .dash-layer,
.phone-sequence[data-state="instagram"] .ig-layer { transform: translate(0, 0); }
.phone-sequence[data-state="instagram"] .dash-layer { transform: translate(-100%, 0); }
.phone-sequence[data-state="lock"] .dash-layer { transform: translate(0, 100%); }
.phone-sequence[data-state="dashboard"] .ig-layer { transform: translate(100%, 0); }
.phone-sequence[data-state="lock"] .ig-layer { transform: translate(0, 100%); }

.phone-sequence .screen::after {
  content: "";
  position: absolute;
  z-index: 49;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
}
.phone-sequence.is-lock-returning .screen::after {
  animation: lock-return-fade .9s ease-in-out both;
}
.phone-sequence.is-lock-returning .layer {
  transition: transform var(--phone-transition, .78s) cubic-bezier(.65, 0, .2, 1);
  pointer-events: none;
}
.phone-sequence.is-lock-returning .dash-layer {
  transform: translate(-100%, 0);
}
.phone-sequence.is-jump-lock-instagram .dash-layer,
.phone-sequence.is-jump-dashboard-lock .ig-layer,
.phone-sequence.is-jump-lock-dashboard .ig-layer {
  transition: none;
}
@keyframes lock-return-fade {
  0% { opacity: 0; }
  44%, 56% { opacity: 1; }
  100% { opacity: 0; }
}

/* Visual cue: Instagram is the next destination from the dashboard. */
.phone-sequence[data-state="dashboard"] .app-grid .app:nth-child(5) {
  animation: instagram-launch-cue 2.2s .35s ease-in-out both;
}
@keyframes instagram-launch-cue {
  0%, 100% { transform: translateY(0) scale(1); filter: brightness(1); }
  45%, 70% {
    transform: translateY(-3px) scale(1.1);
    filter: brightness(1.2) drop-shadow(0 8px 14px rgb(216 158 40 / 45%));
  }
}

.phone-sequence .status {
  top: 22px;
  left: 24px;
  right: 24px;
}
.status-battery {
  position: relative;
  align-self: center;
  box-sizing: border-box;
  width: 18px;
  height: 10px;
  margin-right: 3px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  color: inherit;
  opacity: .94;
}
.status-battery::after {
  content: "";
  position: absolute;
  top: 2px;
  right: -3px;
  width: 2px;
  height: 4px;
  border-radius: 0 1px 1px 0;
  background: currentColor;
}
.status-battery-bolt {
  position: absolute;
  top: -5px;
  left: 5px;
  width: 7px;
  height: 19px;
  background: currentColor;
  clip-path: polygon(58% 0, 18% 52%, 47% 52%, 35% 100%, 82% 42%, 53% 42%);
}
.ig-more {
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  line-height: 10px;
}
.phone-sequence { touch-action: none; cursor: grab; }
.phone-sequence:active { cursor: grabbing; }
.phone-sequence.is-dragging .layer { transition: none; }
.phone-sequence img {
  user-select: none;
  -webkit-user-drag: none;
}

.lock-hint {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 74px;
  left: 0;
  color: rgb(255 255 255 / 82%);
  font-size: 12px;
  letter-spacing: .04em;
  text-align: center;
  text-shadow: 0 2px 8px rgb(0 0 0 / 45%);
  pointer-events: none;
  animation: lock-swipe-cue 1.8s ease-in-out infinite;
}
.lock-hint span {
  display: inline-block;
  margin-right: 5px;
  font-size: 18px;
  line-height: .7;
  vertical-align: -2px;
}
@keyframes lock-swipe-cue {
  0%, 100% { opacity: .55; transform: translateY(4px); }
  50% { opacity: 1; transform: translateY(-5px); }
}
.phone-sequence.is-unlocking .lock-hint {
  animation: lock-unlock-cue .48s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes lock-unlock-cue {
  0% { opacity: .55; transform: translateY(6px); }
  55% { opacity: 1; transform: translateY(-6px); }
  100% { opacity: 0; transform: translateY(-18px); }
}

.sequence-control {
  appearance: none;
  padding: 0;
  border: 0;
  color: #ff5b65;
  cursor: pointer;
}

.sequence-light {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 5px currentColor;
  transform: translateY(-50%);
  transition: transform .2s ease, filter .2s ease;
}

.phone-sequence[data-state="lock"] .sequence-control { color: #ff5b65; }
.phone-sequence[data-state="dashboard"] .sequence-control { color: #f3bd3f; }
.phone-sequence[data-state="instagram"] .sequence-control { color: #55d98b; }

.sequence-control:hover .sequence-light,
.sequence-control:focus-visible .sequence-light {
  filter: brightness(1.2);
  transform: translateY(-50%) scale(1.2);
}

@media (prefers-reduced-motion: reduce) {
  .phone-sequence .layer {
    transition-duration: .35s;
  }
  .phone-sequence.is-lock-returning .screen::after { animation: none; }
  .sequence-light { transition: none; }
  .lock-hint { animation-duration: 3s; }
  .sequence-control:hover .sequence-light,
  .sequence-control:focus-visible .sequence-light { transform: translateY(-50%); }
}
