/* ═══════════════════════════════════════════════════════════════════
   ENHANCEMENTS — shared professional interaction styles
   Scroll progress · back-to-top · click lightbox · portfolio filter
   ═══════════════════════════════════════════════════════════════════ */

/* ── SCROLL PROGRESS BAR ─────────────────────────────────────────── */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 2px;
  background: var(--gradient);
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 2001;
  pointer-events: none;
}

/* ── BACK TO TOP ─────────────────────────────────────────────────── */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border-hover);
  color: var(--accent);
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease),
              visibility 0.3s, border-color 0.3s var(--ease);
  box-shadow: var(--shadow-sm);
}
.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.to-top:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.to-top:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── CLICK LIGHTBOX ──────────────────────────────────────────────── */
.lbx {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  background: rgba(16, 36, 66, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s var(--ease), visibility 0.28s;
}
.lbx.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.lbx__figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 92vw;
  max-height: 90vh;
}
.lbx__img {
  max-width: 92vw;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hover);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.65);
  transform: scale(0.96);
  transition: transform 0.3s var(--ease);
}
.lbx.is-open .lbx__img { transform: scale(1); }
.lbx__caption {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-align: center;
}
.lbx__close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #eef6ff;
  transition: all 0.25s var(--ease);
}
.lbx__close:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  transform: rotate(90deg);
}
.lbx__close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── PORTFOLIO FILTER ────────────────────────────────────────────── */
.pfilter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 40px;
}
.pfilter__btn {
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all var(--dur) var(--ease);
}
.pfilter__btn:hover {
  color: var(--text);
  border-color: var(--border-hover);
}
.pfilter__btn.active {
  color: #fff;
  background: var(--gradient);
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.pfilter__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pcard {
  transition: all 0.4s var(--ease), opacity 0.35s var(--ease);
}
.pcard.is-filtered-out {
  display: none;
}

/* ── SERVICE-CARD SPOTLIGHT (cursor-follow highlight) ────────────── */
.service-card.has-spotlight {
  --mx: 50%;
  --my: 50%;
}
.service-card.has-spotlight::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 0;
  background: radial-gradient(220px circle at var(--mx) var(--my),
              rgba(0, 182, 255, 0.12), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}
.service-card.has-spotlight:hover::after { opacity: 1; }

/* ── QUALITY-OF-LIFE POLISH (all versions) ───────────────────────── */

/* Pause the marquee on hover so it can actually be read */
.marquee-strip:hover .marquee-track { animation-play-state: paused; }

/* Fade the marquee edges for a cleaner look */
.marquee-strip {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

/* Visible keyboard focus everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ── VERSION SWITCHER (preview aid — remove before publishing) ───── */
.vswitch {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(20, 40, 70, 0.95);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-hover);
  border-radius: 999px;
  z-index: 1600;
  box-shadow: var(--shadow);
  font-family: var(--font-mono);
}
.vswitch__label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0 6px;
}
.vswitch a {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--dur) var(--ease);
}
.vswitch a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.vswitch a.current {
  color: #fff;
  background: var(--gradient);
}
@media (max-width: 600px) {
  .vswitch { bottom: 12px; padding: 5px 8px; }
  .vswitch__label { display: none; }
}
