/* HpSpecialists — "A full clinic staff. None of them clock out."
   REIMAGINED as the living isometric clinic: five rooms, one per AI teammate.
   All selectors namespaced .spec-*. Light section, sand-blue shades only per
   teammate (--spec-tint); teal #2f9e8f reserved for tiny live/verified dots.

   Composition (de-boxed — hairlines + one softly elevated stage):
   1. board  — five teammates on one hairline strip (the tour nav) with a dwell
      progress bar on the active one;
   2. stage  — the isometric clinic (the one elevated surface) + the active
      desk's now-line and streaming record beside it;
   3. foot   — one-record message · flat-price fact · tour hint.
   The scene itself (rooms, camera zoom, wires, toasts) is built + driven by
   /marketing/home2/spec.js into [data-spec-scene]. */

.spec {
  padding-block: clamp(64px, 9vw, 116px);
  background:
    radial-gradient(120% 90% at 88% 0%, color-mix(in srgb, #5a82c2 7%, transparent), transparent 60%),
    var(--white);
}

.spec-head {
  max-width: 66ch;
  margin-bottom: clamp(24px, 3.5vw, 38px);
}
.spec-head .eyebrow { display: block; margin-bottom: 14px; }

/* ---- 1. shift board (tour nav) ---- */
.spec-board { margin-bottom: clamp(20px, 3vw, 32px); }
.spec-staff {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.spec-mate {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 15px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: background 0.25s ease;
}
.spec-mate + .spec-mate { border-left: 1px solid var(--line-2); }
.spec-mate:hover { background: color-mix(in srgb, var(--spec-tint) 4%, transparent); }
.spec-mate.on {
  background: linear-gradient(180deg, transparent 15%, color-mix(in srgb, var(--spec-tint) 8%, transparent));
}

.spec-mate-av {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: color-mix(in srgb, var(--spec-tint) 82%, var(--indigo));
  background: color-mix(in srgb, var(--spec-tint) 12%, #fff);
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}
.spec-mate-av svg { width: 22px; height: 22px; }
.spec-mate.on .spec-mate-av {
  color: #fff;
  background: color-mix(in srgb, var(--spec-tint) 88%, var(--indigo));
  box-shadow: 0 10px 20px -10px var(--spec-tint);
}

.spec-mate-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.spec-mate-name {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}
.spec-mate-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
.spec-mate.on .spec-mate-dot {
  background: var(--spec-tint);
  box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--spec-tint) 18%, transparent);
  animation: spec-blink 1.8s ease-in-out infinite;
}
.spec-mate-role {
  font-size: 11.5px;
  color: var(--ink-40);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* dwell progress: the active teammate's shift filling the bottom hairline */
.spec-mate-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--spec-tint);
}

@media (max-width: 1060px) {
  .spec-mate-name { font-size: 13px; }
  .spec-mate-role { display: none; }
}
@media (max-width: 900px) {
  .spec-staff {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    border: 0;
    padding: 2px 2px 8px;
    scrollbar-width: none;
  }
  .spec-staff::-webkit-scrollbar { display: none; }
  .spec-mate {
    flex: 0 0 auto;
    gap: 10px;
    padding: 8px 14px 8px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    /* placeholder — overridden below on phones to stack full-width */
    background: #fff;
  }
  .spec-mate + .spec-mate { border-left: 1px solid var(--line); }
  .spec-mate.on {
    border-color: color-mix(in srgb, var(--spec-tint) 55%, var(--line));
    background: color-mix(in srgb, var(--spec-tint) 6%, #fff);
  }
  .spec-mate-av { width: 30px; height: 30px; border-radius: 50%; }
  .spec-mate-av svg { width: 17px; height: 17px; }
  .spec-mate-bar { height: 2.5px; border-radius: 999px; }
}
/* Phones: stack the five teammate tabs vertically instead of a cut-off
   horizontal scroll strip. */
@media (max-width: 700px) {
  .spec-staff {
    flex-direction: column;
    overflow: visible;
    gap: 9px;
    padding: 0;
  }
  .spec-mate {
    flex: 1 1 auto;
    width: 100%;
    border-radius: 14px;
    padding: 11px 14px;
  }
  .spec-mate + .spec-mate { border-left: 1px solid var(--line); }
  .spec-mate-role { display: block; }
}

/* ---- 2. stage: the clinic + the active desk's record ---- */
.spec-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr);
  gap: clamp(18px, 3vw, 44px);
  align-items: start;
}

/* the ONE softly elevated surface (DEBOX: everything else is open/hairline) */
.spec-scene {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 1120 / 760;
  background:
    radial-gradient(120% 100% at 50% -8%, color-mix(in srgb, #5a82c2 12%, transparent), transparent 62%),
    linear-gradient(180deg, #f4f7fd 0%, #e9f0fb 100%);
  box-shadow: 0 34px 64px -44px rgba(38, 58, 98, 0.55), inset 0 0 0 1px var(--line);
}
.spec-scene svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.spec-scene:empty::after {
  /* pre-JS / no-JS: quiet placeholder so the stage never looks broken */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 40% at 50% 45%, color-mix(in srgb, #5a82c2 14%, transparent), transparent 70%);
}

/* rooms: active lifts + brightens, others dim & recede */
.spec-room { cursor: pointer; transition: opacity 0.55s ease, filter 0.55s ease; }
.spec-room-lift { transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.spec-world.is-touring .spec-room { opacity: 0.34; filter: saturate(0.72) brightness(1.04); }
.spec-world.is-touring .spec-room.is-active { opacity: 1; filter: none; }
.spec-room.is-active .spec-room-lift { transform: translateY(-9px); }
.spec-room { outline: none; }
.spec-room:focus { outline: none; }
.spec-room:focus-visible .spec-room-lift { transform: translateY(-9px); }
.spec-floor-glow { opacity: 0; transition: opacity 0.55s ease; }
.spec-room.is-active .spec-floor-glow { opacity: 1; }

/* the in-room "now doing X" toast */
.spec-toast { opacity: 0; transition: opacity 0.5s ease; pointer-events: none; }
.spec-room.is-active .spec-toast { opacity: 1; }
.spec-toast-dot { transform-box: fill-box; transform-origin: center; animation: spec-toastdot 1.8s ease-out infinite; }

/* shared-record wires — active one flows toward the core */
.spec-wire {
  fill: none;
  stroke: color-mix(in srgb, #5a82c2 55%, var(--line));
  stroke-width: 1.6;
  stroke-dasharray: 3 6;
  opacity: 0.3;
  transition: opacity 0.5s ease, stroke 0.5s ease;
}
.spec-world.is-touring .spec-wire { opacity: 0.16; }
.spec-wire.is-active {
  opacity: 0.95;
  stroke: var(--indigo);
  animation: spec-flow 0.8s linear infinite;
}

/* scene ambient animations (all disabled under reduced motion) */
.spec-idle { animation: spec-bob 3.6s ease-in-out infinite; }
.spec-core-glow { animation: spec-glow 3s ease-in-out infinite; }
.spec-led { animation: spec-led 1.5s ease-in-out infinite; }
.spec-led.b2 { animation-delay: 0.25s; }
.spec-led.b3 { animation-delay: 0.5s; }
.spec-cone { animation: spec-cone 4s ease-in-out infinite; }
.spec-flicker { animation: spec-flicker 2.6s steps(2) infinite; }
.spec-xsweep { animation: spec-sweep 2.4s ease-in-out infinite; }
.spec-ping { transform-box: fill-box; transform-origin: center; animation: spec-ping 1.9s ease-out infinite; }
.spec-bar { transform-box: fill-box; transform-origin: bottom; animation: spec-barp 1.9s ease-in-out infinite; }
.spec-bar.b2 { animation-delay: 0.3s; }
.spec-bar.b3 { animation-delay: 0.6s; }
.spec-wave { transform-box: fill-box; transform-origin: bottom; animation: spec-wave 0.9s ease-in-out infinite; }
.spec-wave.w2 { animation-delay: 0.12s; }
.spec-wave.w3 { animation-delay: 0.24s; }
.spec-wave.w4 { animation-delay: 0.36s; }
.spec-eob { transform-box: fill-box; transform-origin: center; animation: spec-pop 3s ease-in-out infinite; }

/* ---- side column: now-line + streaming record ---- */
.spec-side { min-width: 0; padding-top: 2px; }

.spec-caps {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0 0 6px;
  min-height: 52px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  animation: spec-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}
.spec-caps-now {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: color-mix(in srgb, var(--spec-tint) 72%, var(--ink));
}
/* reserved teal: the tiny "live right now" dot */
.spec-caps-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2f9e8f;
  box-shadow: 0 0 0 0 color-mix(in srgb, #2f9e8f 55%, transparent);
  animation: spec-pingdot 1.8s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}
.spec-caps-tags { font-size: 12.5px; letter-spacing: 0.01em; color: var(--ink-60); }
.spec-caps-note { font-size: 12px; font-style: normal; font-weight: 500; color: #3d63a4; }
.spec-caps-note::before { content: "◈ "; color: color-mix(in srgb, var(--spec-tint) 80%, var(--indigo)); }

.spec-feed {
  --spec-railx: 62px; /* time col 46 + gap 12 + half node 8 */
  position: relative;
  list-style: none;
  margin: 0;
  padding: 6px 0 0;
}
.spec-feed::before {
  content: "";
  position: absolute;
  left: var(--spec-railx);
  top: 12px;
  bottom: 12px;
  width: 1px;
  margin-left: -0.5px;
  background: linear-gradient(180deg, transparent, var(--line) 22px, var(--line) calc(100% - 22px), transparent);
  pointer-events: none;
}
.spec-frow {
  display: grid;
  grid-template-columns: 46px 16px minmax(0, 1fr);
  grid-template-areas:
    "t node pill"
    "t node txt";
  column-gap: 12px;
  row-gap: 2px;
  align-items: center;
  min-height: 46px;
  padding: 8px 2px 8px 0;
  animation: spec-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}
.spec-frow-t {
  grid-area: t;
  align-self: center;
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  color: var(--ink-40);
}
.spec-frow-node {
  grid-area: node;
  position: relative;
  z-index: 1;
  align-self: start;
  margin-top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--spec-tint);
  background: #fff;
}
.spec-frow-node::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--spec-tint);
}
.spec-frow:first-child .spec-frow-node { animation: spec-tick 1.6s ease-in-out infinite; }
.spec-frow-txt { grid-area: txt; min-width: 0; font-size: 13px; line-height: 1.35; color: var(--ink); }
.spec-pill {
  grid-area: pill;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: color-mix(in srgb, var(--spec-tint) 74%, var(--ink));
  background: color-mix(in srgb, var(--spec-tint) 12%, #fff);
  border: 1px solid color-mix(in srgb, var(--spec-tint) 28%, transparent);
  padding: 3px 10px;
  border-radius: var(--r-pill);
}
/* reserved teal: tiny verified/done dot inside a pill */
.spec-okdot { width: 5px; height: 5px; border-radius: 50%; background: #2f9e8f; }

@media (max-width: 900px) {
  .spec-stage { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 520px) {
  .spec-feed { --spec-railx: 8px; }
  .spec-frow { grid-template-columns: 16px minmax(0, 1fr); grid-template-areas: "node pill" "node txt"; }
  .spec-frow-t { display: none; }
}

/* ---- 3. foot ---- */
.spec-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin-top: clamp(18px, 3vw, 30px);
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.spec-foot-one { flex: 1 1 320px; font-size: 12.5px; line-height: 1.5; color: var(--ink-60); }
.spec-foot-one b { font-weight: 600; color: var(--ink); }
.spec-foot-one::before { content: "◈ "; color: #4f74b8; }
.spec-foot-fact {
  flex: none;
  font-size: 11.5px;
  font-weight: 600;
  color: #3d63a4;
  background: color-mix(in srgb, #5a82c2 12%, #fff);
  border: 1px solid color-mix(in srgb, #5a82c2 26%, transparent);
  padding: 4px 10px;
  border-radius: var(--r-pill);
}
.spec-foot-hint { flex: none; font-size: 11px; letter-spacing: 0.02em; color: var(--ink-40); }
@media (max-width: 760px) { .spec-foot-hint { display: none; } }

/* ---- keyframes ---- */
@keyframes spec-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes spec-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes spec-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
@keyframes spec-pingdot {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, #2f9e8f 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 4px transparent; }
}
@keyframes spec-tick {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--spec-tint) 42%, transparent); }
  60% { box-shadow: 0 0 0 5px transparent; }
}
@keyframes spec-flow { to { stroke-dashoffset: -18; } }
@keyframes spec-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.4px); } }
@keyframes spec-glow { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes spec-led { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
@keyframes spec-cone { 0%, 100% { opacity: 0.5; } 50% { opacity: 0.32; } }
@keyframes spec-flicker { 50% { opacity: 0.42; } }
@keyframes spec-sweep {
  0% { transform: translateX(-12px); }
  50% { transform: translateX(12px); }
  100% { transform: translateX(-12px); }
}
@keyframes spec-ping { 0% { opacity: 0.95; } 70%, 100% { opacity: 0.18; } }
@keyframes spec-barp { 0%, 100% { transform: scaleY(0.55); } 50% { transform: scaleY(1); } }
@keyframes spec-wave { 0%, 100% { transform: scaleY(0.5); } 50% { transform: scaleY(1); } }
@keyframes spec-pop { 0%, 100% { transform: scale(0.85); opacity: 0.6; } 50% { transform: scale(1); opacity: 1; } }
@keyframes spec-toastdot {
  0% { transform: scale(0.7); }
  50% { transform: scale(1.15); }
  100% { transform: scale(0.7); }
}

@media (prefers-reduced-motion: reduce), (max-width: 700px) {
  .spec-mate.on .spec-mate-dot,
  .spec-caps, .spec-caps-dot, .spec-frow,
  .spec-frow:first-child .spec-frow-node,
  .spec-idle, .spec-core-glow, .spec-led, .spec-cone, .spec-flicker,
  .spec-xsweep, .spec-ping, .spec-bar, .spec-wave, .spec-eob,
  .spec-toast-dot, .spec-wire.is-active {
    animation: none !important;
  }
  .spec-room, .spec-room-lift, .spec-floor-glow, .spec-toast, .spec-wire { transition: none !important; }
}
