/* ================================================================
   SPECIALIZATIONS SECTION — "The Luminous Orbit"
   A 120vh canvas section. 24 glass pills are scattered in the
   negative space around a centered text stage. GSAP drives the
   illumination via a dual-source light engine (ambient scanner +
   mouse proximity). No CSS transitions — GSAP owns all motion.
================================================================ */

/* ── Section canvas ─────────────────────────────────────────── */
.hs-spec {
  position: relative;
  min-height: 120vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  background-color: transparent;
  /* Subtle section padding for very small screens */
  padding-block: var(--hs-space-20);
}

/* ── Full-bleed tag canvas ──────────────────────────────────── */
/* Sits behind the stage. pointer-events: none so tags never    */
/* block interaction with the CTA or any clickable stage content */
.hs-spec__canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

/* ── Individual scattered tag ───────────────────────────────── */
.hs-spec__tag {
  position: absolute;
  left: var(--tx);
  top:  var(--ty);
  /* NO CSS transform here — GSAP sets xPercent/yPercent/scale/opacity/filter */

  /* Glass surface */
  background:             var(--hs-glass-bg);
  backdrop-filter:        var(--hs-glass-blur);
  -webkit-backdrop-filter: var(--hs-glass-blur);
  border:                 var(--hs-border-1) solid var(--hs-glass-border);
  border-radius:          var(--hs-radius-full);
  box-shadow:             var(--hs-glass-shadow);
  padding:                var(--hs-space-3) var(--hs-space-7);

  /* Typography */
  font-family:            var(--hs-font-body);
  font-size:              var(--hs-text-base);
  font-weight:            var(--hs-font-semibold);
  color:                  var(--hs-color-text-brand);
  white-space:            nowrap;
  letter-spacing:         var(--hs-tracking-wide);

  /* No CSS transition — GSAP is the sole animation controller */
  cursor: default;
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
  position: absolute; /* explicit for stacking context */
  overflow: hidden;
}

/* Edge-light on pill surface */
.hs-spec__tag::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    130deg,
    var(--hs-glass-edge-top)  0%,
    transparent               55%
  );
  pointer-events: none;
}

/* ── Centered stage ─────────────────────────────────────────── */
/* Lives above the canvas. Needs a legible backdrop.            */
.hs-spec__stage {
  position: relative;
  z-index: 10;
  text-align: center;
  max-width: var(--hs-container-md);
  padding: var(--hs-space-12) var(--hs-container-pad-x);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--hs-space-6);
  /* No background — text reads directly against the living sky */
}

.hs-spec__eyebrow {
  display: block;
  color: var(--hs-color-text-accent);
  letter-spacing: var(--hs-tracking-wider);
  margin-bottom: 0;
}

.hs-spec__headline {
  font-family: var(--hs-font-display);
  font-size: var(--hs-text-section-h);
  font-weight: var(--hs-font-extrabold);
  line-height: var(--hs-leading-heading);
  letter-spacing: var(--hs-tracking-tight);
  color: var(--hs-color-text-brand);
}

.hs-spec__sub {
  font-family: var(--hs-font-body);
  font-size: var(--hs-text-base);
  line-height: var(--hs-leading-relaxed);
  color: var(--hs-color-text-secondary);
  max-width: 48ch;
}

/* ── Group legend ───────────────────────────────────────────── */
.hs-spec__legend {
  display: flex;
  align-items: center;
  gap: var(--hs-space-4);
  flex-wrap: wrap;
  justify-content: center;
}

.hs-spec__legend-item {
  display: flex;
  align-items: center;
  gap: var(--hs-space-2);
  font-family: var(--hs-font-body);
  font-size: var(--hs-text-xs);
  font-weight: var(--hs-font-semibold);
  color: var(--hs-color-text-accent);
  letter-spacing: var(--hs-tracking-wider);
  text-transform: uppercase;
}

.hs-spec__legend-sep {
  color: var(--hs-color-border-accent-subtle);
  font-size: var(--hs-text-lg);
  line-height: 1;
}

/* ── Closing line ───────────────────────────────────────────── */
.hs-spec__closing {
  font-family: var(--hs-font-display);
  font-size: var(--hs-text-base);
  font-weight: var(--hs-font-medium);
  line-height: var(--hs-leading-relaxed);
  color: var(--hs-color-text-secondary);
  font-style: italic;
  max-width: 52ch;
}

/* ── Tab UI hidden by default (desktop) ─────────────────────── */
.hs-spec__tabs { display: none; }

/* ── Tablet: ≤1024px — flex split, doctors above, dentists below */
@media (max-width: 1024px) {
  .hs-spec {
    min-height: auto;
    display: flex;
    flex-direction: column;
    padding-block: var(--hs-section-pad-y-lg);
  }

  .hs-spec__canvas--top { order: 1; }
  .hs-spec__stage       { order: 2; }
  .hs-spec__canvas--btm { order: 3; }

  /* Both canvases become centred flex-wrap pill rows */
  .hs-spec__canvas {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: var(--hs-space-2-5);
    justify-content: center;
    padding: var(--hs-space-5) var(--hs-container-pad-x);
    pointer-events: auto;
    overflow: visible;
  }

  /* Pills — fully visible, no blur */
  .hs-spec__tag {
    position: static;
    opacity: 1;
    filter: none !important;
    transform: none;
    padding: var(--hs-space-2) var(--hs-space-5);
    font-size: var(--hs-text-sm);
  }

  .hs-spec__stage {
    position: relative;
    background: none;
    max-width: var(--hs-container-md);
    margin-inline: auto;
    width: 100%;
    padding: var(--hs-space-6) var(--hs-container-pad-x);
    border-radius: 0;
  }
}

/* ── Mobile: ≤425px — tab UI replaces pill rows ─────────────── */
@media (max-width: 425px) {
  .hs-spec {
    padding-block: var(--hs-section-pad-y);
  }

  /* Canvases replaced by tab UI */
  .hs-spec__canvas { display: none; }

  .hs-spec__stage {
    padding: var(--hs-space-6) var(--hs-container-pad-x) var(--hs-space-4);
    gap: var(--hs-space-4);
  }

  .hs-spec__sub { font-size: var(--hs-text-sm); }

  /* Legend: tighter so each label stays on one line */
  .hs-spec__legend {
    flex-direction: column;
    align-items: center;
    gap: var(--hs-space-2);
  }
  .hs-spec__legend-item {
    gap: var(--hs-space-1-5);
    letter-spacing: var(--hs-tracking-normal);
    font-size: var(--hs-text-eyebrow);
  }
  .hs-spec__legend-sep { display: none; }

  .hs-spec__cta { width: 100%; justify-content: center; }

  /* ── Tab UI ── */
  .hs-spec__tabs {
    display: flex;
    flex-direction: column;
    gap: var(--hs-space-5);
    order: 4;
    width: 100%;
    padding-inline: var(--hs-container-pad-x);
    padding-bottom: var(--hs-space-4);
  }

  /* Pill-shaped tab bar */
  .hs-spec__tab-bar {
    display: flex;
    gap: var(--hs-space-1);
    background: var(--hs-glass-bg);
    border: var(--hs-border-1) solid var(--hs-glass-border);
    border-radius: var(--hs-radius-full);
    padding: var(--hs-space-1);
  }

  .hs-spec__tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--hs-space-1-5);
    font-family: var(--hs-font-body);
    font-size: var(--hs-text-sm);
    font-weight: var(--hs-font-semibold);
    color: var(--hs-color-text-secondary);
    padding: var(--hs-space-2-5) var(--hs-space-3);
    border-radius: var(--hs-radius-full);
    transition: var(--hs-transition-colors);
    border: none;
    background: none;
    cursor: pointer;
  }

  .hs-spec__tab-btn.is-active {
    background: var(--hs-palette-navy-800);
    color: var(--hs-color-text-inverse);
  }

  .hs-spec__tab-btn.is-active .hs-icon {
    color: var(--hs-palette-accent-500);
  }

  /* Panels: centred flex-wrap cloud — pills fill rows organically */
  .hs-spec__tab-panel {
    display: none;
    flex-wrap: wrap;
    gap: var(--hs-space-2);
    justify-content: center;
  }

  .hs-spec__tab-panel.is-active { display: flex; }

  .hs-spec__mobile-pill {
    display: inline-flex;
    align-items: center;
    background: var(--hs-glass-bg);
    backdrop-filter: var(--hs-glass-blur);
    -webkit-backdrop-filter: var(--hs-glass-blur);
    border: var(--hs-border-1) solid var(--hs-glass-border);
    border-radius: var(--hs-radius-full);
    box-shadow: var(--hs-glass-shadow);
    padding: var(--hs-space-2) var(--hs-space-4);
    font-family: var(--hs-font-body);
    font-size: var(--hs-text-xs);
    font-weight: var(--hs-font-semibold);
    color: var(--hs-color-text-brand);
    letter-spacing: var(--hs-tracking-wide);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
  }

  .hs-spec__mobile-pill::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
      130deg,
      var(--hs-glass-edge-top) 0%,
      transparent 55%
    );
    pointer-events: none;
  }
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .hs-spec__tag {
    opacity: 0.75 !important;
    filter: none !important;
    transform: none !important;
  }
}
