/* =========================================
   HERO CONTROLS SYSTEM
   Base control dock + legacy control fallback
   ========================================= */

/* Single source of truth for --hero-dock-height.
   Responsive adjustments below are authoritative for this variable.
   hero.css must NOT redeclare --hero-dock-height. */
:root {
  --hero-dock-height: 3.85rem;
  --hero-dock-line: rgba(125, 211, 252, 0.16);
}

/* =============================
   BASE CONTROL DOCK
   ============================= */

.hero-control-dock {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: 0;
  z-index: 20;
  width: 100vw;
  max-width: none;
  height: var(--hero-dock-height);
  min-height: var(--hero-dock-height);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 2.55rem 1fr 1fr 2.55rem;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
  padding: 0.65rem clamp(1rem, 3vw, 3rem);
  background: rgba(2, 6, 23, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 -12px 30px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(var(--blur-mid)) saturate(var(--sat-shuttle));
  -webkit-backdrop-filter: blur(var(--blur-mid)) saturate(var(--sat-shuttle));
  transition: border-color 380ms ease, background 380ms ease, box-shadow 380ms ease;
  pointer-events: auto;
  overflow: visible;
  isolation: isolate;
}

.hero-control-dock::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(125, 211, 252, 0.045), transparent 20%, transparent 80%, rgba(125, 211, 252, 0.045)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 62%);
  opacity: 0.58;
  z-index: 0;
}

.hero-control-dock::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(52rem, calc(100vw - clamp(8rem, 14vw, 16rem)));
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(125, 211, 252, 0.22) 20%,
    rgba(125, 211, 252, 0.18) 45%,
    transparent 50%,
    transparent 50%,
    rgba(125, 211, 252, 0.18) 55%,
    rgba(125, 211, 252, 0.22) 80%,
    transparent 100%
  );
  opacity: 0.4;
  z-index: 0;
}

.hero-control-dock > * {
  position: relative;
  z-index: 1;
}

.hero-control-dock .hero-dock-arrow:first-of-type {
  grid-column: 1;
}

.hero-control-dock .hero-dock-copy {
  grid-column: 2;
}

.hero-control-dock .hero-dock-progress {
  grid-column: 3;
}

.hero-control-dock .hero-dock-arrow:last-of-type {
  grid-column: 4;
}

/* =============================
   BUTTONS
   ============================= */

.hero-dock-arrow {
  appearance: none;
  display: grid;
  place-items: center;
  width: 2.32rem;
  height: 2.32rem;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    rgba(2, 6, 23, 0.58);
  color: rgba(229, 237, 248, 0.94);
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 8px 18px rgba(0, 0, 0, 0.2);
  /* REFINED: Snappier response */
  transition:
    transform 220ms cubic-bezier(.22,.61,.36,1),
    border-color 220ms ease,
    background 220ms ease,
    color 220ms ease,
    box-shadow 220ms ease;
}

.hero-dock-arrow:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(56, 189, 248, 0.35);
  color: #fff;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.14);
}

.hero-dock-arrow:active {
  transform: scale(0.93);
  transition-duration: 80ms;
}

.hero-dock-arrow svg {
  width: 1.12rem;
  height: 1.12rem;
}

.hero-dock-arrow:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.82);
  outline-offset: 4px;
}

/* =============================
   COPY + PROGRESS
   ============================= */

.hero-dock-copy {
  min-width: 0;
  padding-left: 0.45rem;
}

.hero-dock-label,
.hero-dock-count {
  display: block;
  color: rgba(125, 211, 252, 0.68);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  line-height: 1.1;
  text-transform: uppercase;
}

.hero-dock-title {
  display: block;
  margin-top: 0.22rem;
  color: rgba(248, 250, 252, 0.84);
  font-size: clamp(0.76rem, 0.95vw, 0.82rem);
  font-weight: 560;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-dock-progress {
  display: grid;
  grid-template-columns: auto;
  align-items: center;
  justify-self: end;
  min-width: 0;
}

.hero-dock-line {
  display: none;
}

.hero-dock-count {
  white-space: nowrap;
  color: rgba(159, 177, 201, 0.66);
  text-align: right;
}

/* =============================
   RESPONSIVE
   ============================= */

@media (max-width: 980px) {
  :root {
    --hero-dock-height: 3.7rem;
  }

  .hero-control-dock {
    grid-template-columns: 2.32rem minmax(0, 1fr) 2.32rem;
    gap: clamp(0.7rem, 2.5vw, 1rem);
    padding-inline: clamp(1rem, 4vw, 1.6rem);
    border-radius: 0;
  }

  .hero-dock-progress {
    display: none;
  }

  .hero-dock-arrow {
    width: 2.32rem;
    height: 2.32rem;
  }

  .hero-control-dock .hero-dock-arrow:first-of-type {
    grid-column: 1;
  }

  .hero-control-dock .hero-dock-copy {
    grid-column: 2;
  }

  .hero-control-dock .hero-dock-arrow:last-of-type {
    grid-column: 3;
  }
}

@media (max-width: 640px) {
  .hero-control-dock {
    gap: clamp(0.55rem, 2.5vw, 0.85rem);
    padding: 0.55rem clamp(0.75rem, 4vw, 1.1rem);
  }

  .hero-dock-title {
    font-size: 0.76rem;
  }
}

@media (max-width: 560px) {
  :root {
    --hero-dock-height: 3.55rem;
  }

  .hero-control-dock {
    grid-template-columns: 2.45rem 1fr 2.45rem;
    gap: 0.65rem;
    padding: 0.38rem 0.85rem;
  }

  .hero-dock-label {
    display: none;
  }

  .hero-dock-title {
    margin-top: 0;
    font-size: 0.76rem;
    line-height: 1.15;
  }

  .hero-dock-arrow {
    width: 2.45rem;
    height: 2.45rem;
    justify-self: center;
  }

  .hero-control-dock .hero-dock-arrow:first-of-type {
    grid-column: 1;
  }

  .hero-control-dock .hero-dock-copy {
    grid-column: 2;
  }
}

@media (max-width: 420px) {
  .hero-control-dock {
    grid-template-columns: 2.25rem 1fr 1fr 2.25rem;
    gap: 0.5rem;
    padding-inline: 0.7rem;
  }

  .hero-dock-copy {
    display: block !important;
    padding-left: 0;
  }

  .hero-dock-progress {
    display: grid !important;
  }

  .hero-dock-title {
    font-size: 0.7rem;
  }

  .hero-control-dock .hero-dock-arrow:last-of-type {
    grid-column: 4;
  }
}

@media (max-width: 360px) {
  .hero-control-dock {
    grid-template-columns: 2.5rem minmax(0, 1fr) 2.5rem;
    column-gap: 0.75rem;
    padding-inline: 0.85rem;
  }

  .hero-dock-arrow {
    width: 2.5rem;
    height: 2.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-dock-arrow {
    transition: none;
  }
}
