/* ============================================================
   Residential drone page: title, drone view in the standard
   laptop with a live flight overlay, the standard stat cards below.
   ============================================================ */

.drone-story {
  --ds-gold: #f3c66d;
  --ds-gold-deep: #c48d26;
  --ds-ink: #10210d;
  padding: clamp(46px, 6vw, 80px) 0 clamp(36px, 4.6vw, 64px);
  scroll-margin-top: 112px;
}

.drone-story__inner {
  display: grid;
  justify-items: center;
  gap: clamp(8px, 1.4vw, 18px);
}

.drone-story__head {
  text-align: center;
}

/* ---------- Laptop ---------- */

.drone-story__device {
  position: relative;
  width: min(100%, 1060px);
  aspect-ratio: 3 / 2;
}

.drone-story__device::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: clamp(3px, 1.2vw, 15px);
  z-index: 0;
  width: 84%;
  height: 8%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(7, 14, 9, 0.22) 0%, rgba(7, 14, 9, 0.12) 44%, transparent 74%);
  filter: blur(8px);
  transform: translateX(-50%);
  pointer-events: none;
}

.drone-story__screen {
  position: absolute;
  top: 8%;
  left: 17.35%;
  z-index: 1;
  width: 64.9%;
  height: 61.3%;
  margin: 0;
  overflow: hidden;
  background: #10210d;
}

.drone-story__shell {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 28px 34px rgba(6, 14, 8, 0.16));
}

.drone-story__view {
  position: absolute;
  inset: 0;
  transform-origin: 46% 58%;
}

.drone-story.is-live .drone-story__view {
  animation: dsDrift 18s ease-in-out infinite alternate;
}

@keyframes dsDrift {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.07) translate(-1.2%, -0.8%);
  }
}

.drone-story__photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drone-story__hud {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ds-outline {
  fill: rgba(243, 198, 109, 0);
  stroke: var(--ds-gold);
  stroke-width: 4;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.9s cubic-bezier(0.45, 0, 0.2, 1), fill 900ms ease, opacity 600ms ease;
}

.ds-outline--glow {
  stroke: rgba(243, 198, 109, 0.32);
  stroke-width: 14;
}

.drone-story.is-lot .ds-outline {
  stroke-dashoffset: 0;
}

.drone-story.is-lot .ds-outline:not(.ds-outline--glow) {
  fill: rgba(243, 198, 109, 0.08);
  transition-delay: 0s, 1.6s, 0s;
}

.drone-story.is-clearing .ds-outline {
  opacity: 0;
}

.ds-pin {
  opacity: 0;
  transition: opacity 320ms ease;
}

.ds-pin.is-on {
  opacity: 1;
}

.ds-pin__dot {
  fill: var(--ds-gold);
  stroke: #fffaf0;
  stroke-width: 3;
}

.ds-pin__ring {
  fill: none;
  stroke: rgba(243, 198, 109, 0.9);
  stroke-width: 2.5;
  transform-box: fill-box;
  transform-origin: center;
}

.drone-story.is-live .ds-pin.is-on .ds-pin__ring {
  animation: dsPing 1.8s ease-out infinite;
}

@keyframes dsPing {
  from {
    opacity: 0.9;
    transform: scale(0.45);
  }

  to {
    opacity: 0;
    transform: scale(1.5);
  }
}

.ds-reticle {
  fill: none;
  stroke: rgba(255, 250, 240, 0.7);
  stroke-width: 2;
  stroke-linecap: round;
}

.ds-label {
  position: absolute;
  z-index: 2;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(16, 33, 13, 0.9);
  border: 1px solid rgba(243, 198, 109, 0.55);
  color: #fffaf0;
  font-family: var(--font-heading);
  font-size: clamp(0.56rem, 0.95vw, 0.76rem);
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 12px)) scale(0.9);
  transform-origin: 50% 100%;
  transition: opacity 280ms ease, transform 420ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ds-label.is-on {
  opacity: 1;
  transform: translate(-50%, calc(-100% - 12px)) scale(1);
}

.ds-label--lot {
  background: var(--ds-gold);
  border-color: rgba(255, 250, 240, 0.6);
  color: var(--ds-ink);
  transform: translate(-100%, -50%) scale(0.9);
  transform-origin: 100% 50%;
}

.ds-label--lot.is-on {
  transform: translate(-100%, -50%) scale(1);
}

.ds-hud {
  position: absolute;
  top: 7%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(7, 14, 9, 0.62);
  color: #fffaf0;
  font-family: var(--font-heading);
  font-size: clamp(0.5rem, 0.8vw, 0.66rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.ds-hud--rec {
  left: 6.5%;
}

.ds-hud--rec i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff4a3d;
  box-shadow: 0 0 8px rgba(255, 74, 61, 0.8);
}

.drone-story.is-live .ds-hud--rec i {
  animation: dsBlink 1.2s steps(2, jump-none) infinite;
}

@keyframes dsBlink {
  50% {
    opacity: 0.15;
  }
}

.ds-hud--faa {
  right: 6.5%;
}

.ds-corners,
.ds-corners::before,
.ds-corners::after {
  position: absolute;
  pointer-events: none;
}

.ds-corners {
  inset: 4%;
  z-index: 2;
  background:
    linear-gradient(#fffaf0, #fffaf0) left top / 22px 2px no-repeat,
    linear-gradient(#fffaf0, #fffaf0) left top / 2px 22px no-repeat,
    linear-gradient(#fffaf0, #fffaf0) right top / 22px 2px no-repeat,
    linear-gradient(#fffaf0, #fffaf0) right top / 2px 22px no-repeat,
    linear-gradient(#fffaf0, #fffaf0) left bottom / 22px 2px no-repeat,
    linear-gradient(#fffaf0, #fffaf0) left bottom / 2px 22px no-repeat,
    linear-gradient(#fffaf0, #fffaf0) right bottom / 22px 2px no-repeat,
    linear-gradient(#fffaf0, #fffaf0) right bottom / 2px 22px no-repeat;
  opacity: 0.75;
}

/* ---------- Stats under the laptop ---------- */

/* The standard three stat cards from the residential service section. */
.drone-story__stats.home-service-hub {
  width: min(100%, 1120px);
  margin: clamp(-26px, -1.6vw, -8px) auto 0;
  padding: 0;
  overflow: visible;
  isolation: auto;
  background: transparent;
}

.drone-story__stats .service-switcher__stats {
  margin-top: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 560px) {
  .ds-label {
    padding: 3px 7px;
  }

  /* The phone screen is too small for every tag: keep the outline, pool and patio, drop the rest. */
  .ds-hud,
  .ds-label:nth-of-type(2),
  .ds-label:nth-of-type(4),
  .ds-label:nth-of-type(5) {
    display: none;
  }

  .ds-corners {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .drone-story *,
  .drone-story *::before,
  .drone-story *::after {
    animation: none !important;
    transition: none !important;
  }
}
