/* ==================================================================
   COMPONENTS — glass, buttons, pills, filters, badges, toast
   ================================================================== */

/* ---------- Glass surfaces ---------- */

.glass {
  position: relative;
  isolation: isolate;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--grad-surface);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    var(--shadow-sm);
  -webkit-backdrop-filter: blur(16px) saturate(125%);
  backdrop-filter: blur(16px) saturate(125%);
}

.glass--hover {
  transition:
    transform 0.5s var(--ease-out),
    border-color 0.4s ease,
    box-shadow 0.5s var(--ease-out),
    background 0.4s ease;
}

.glass--hover:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.062),
    rgba(255, 255, 255, 0.022)
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    var(--shadow-md),
    var(--shadow-glow);
}

/* Pointer-follow spotlight, only on elements that opt in. */
[data-spotlight]::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    460px circle at var(--mx, 50%) var(--my, 0%),
    rgba(129, 140, 248, 0.17),
    rgba(34, 211, 238, 0.05) 38%,
    transparent 62%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
}

[data-spotlight]:hover::after,
[data-spotlight]:focus-within::after {
  opacity: 1;
}

/* Hairline top highlight used on premium cards. */
.hairline-top::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(167, 139, 250, 0.65),
    rgba(34, 211, 238, 0.45),
    transparent
  );
  opacity: 0.65;
  pointer-events: none;
}

/* ---------- Buttons ---------- */

.btn {
  --tx: 0px;
  --ty: 0px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.8rem 1.35rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.008em;
  line-height: 1;
  white-space: nowrap;
  transform: translate3d(var(--tx), var(--ty), 0);
  transition:
    transform 0.24s var(--ease-out),
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.4s var(--ease-out),
    color 0.3s ease;
  isolation: isolate;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.btn .icon {
  width: 16px;
  height: 16px;
  transition: transform 0.35s var(--ease-out);
}

.btn--primary {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 52%, #4f46e5 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 14px 36px -16px rgba(99, 102, 241, 0.75);
}

.btn--primary::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    110deg,
    transparent 26%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 74%
  );
  transform: translateX(-140%);
  transition: transform 0.75s var(--ease-out);
}

.btn--primary:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 18px 46px -16px rgba(124, 58, 237, 0.8);
}

.btn--primary:hover::before {
  transform: translateX(140%);
}

.btn--primary:hover .icon--arrow {
  transform: translate(2px, -2px);
}

.btn--glass {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.035);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.btn--glass:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 12px 34px -20px rgba(0, 0, 0, 0.9);
}

.btn--glass:hover .icon--arrow {
  transform: translate(2px, -2px);
}

.btn--ghost {
  min-height: 44px;
  padding-inline: 0.35rem;
  color: var(--muted);
  border-color: transparent;
}

.btn--ghost:hover {
  color: var(--text);
}

.btn--ghost .icon {
  width: 15px;
  height: 15px;
  color: var(--indigo-bright);
  transition: transform 0.35s var(--ease-out);
}

.btn--ghost:hover .icon {
  transform: translate(2px, -2px);
}

.btn--sm {
  min-height: 40px;
  padding: 0.62rem 0.95rem;
  font-size: 0.81rem;
}

.btn--icon {
  width: 46px;
  min-height: 46px;
  padding: 0;
}

/* ---------- Pills & badges ---------- */

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
  max-width: 100%;
  padding: 0.42rem 0.85rem 0.42rem 0.68rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.032);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.status-pill__sep {
  width: 1px;
  height: 11px;
  background: var(--border-strong);
  flex: none;
}

.status-pill__loc {
  color: var(--muted);
  white-space: nowrap;
}

.status-pill--sm {
  padding: 0.32rem 0.62rem 0.32rem 0.55rem;
  font-size: 0.6rem;
  letter-spacing: 0.09em;
}

.live-dot {
  position: relative;
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
}

.live-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 1px solid rgba(52, 211, 153, 0.5);
  border-radius: inherit;
  animation: live-ping 2.8s var(--ease-out) infinite;
}

@keyframes live-ping {
  0% {
    transform: scale(0.6);
    opacity: 0.75;
  }
  68%,
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
  white-space: nowrap;
}

.status__dot {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 9px rgba(52, 211, 153, 0.65);
}

.status--violet .status__dot {
  background: var(--violet-bright);
  box-shadow: 0 0 9px rgba(167, 139, 250, 0.7);
}

.status--cyan .status__dot {
  background: var(--cyan-bright);
  box-shadow: 0 0 9px rgba(34, 211, 238, 0.65);
}

.status--amber .status__dot {
  background: var(--amber);
  box-shadow: 0 0 9px rgba(251, 191, 36, 0.6);
}

/* ---------- Headings & labels ---------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  margin-bottom: 1.05rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow__index {
  display: inline-grid;
  place-items: center;
  min-width: 2rem;
  height: 1.5rem;
  padding-inline: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--indigo-bright);
  font-size: 0.61rem;
  letter-spacing: 0.1em;
}

.eyebrow__line {
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, var(--border-strong), transparent);
  flex: none;
}

.section-title {
  font-size: clamp(2rem, 3.7vw, 3.35rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.section-title span {
  color: var(--text-soft);
}

.section-count {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.72rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.11em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: nowrap;
}

.section-count strong {
  color: var(--text);
  font-weight: 500;
}

/* ---------- Icon tiles ---------- */

.icon-tile {
  --tile-rgb: 129, 140, 248;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid rgba(var(--tile-rgb), 0.24);
  border-radius: 13px;
  background: linear-gradient(
    145deg,
    rgba(var(--tile-rgb), 0.18),
    rgba(var(--tile-rgb), 0.045)
  );
  color: rgb(var(--tile-rgb));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 8px 20px -12px rgba(var(--tile-rgb), 0.5);
}

.icon-tile .icon {
  width: 20px;
  height: 20px;
}

.icon-tile--cyan {
  --tile-rgb: 34, 211, 238;
}

.icon-tile--violet {
  --tile-rgb: 167, 139, 250;
}

.icon-tile--emerald {
  --tile-rgb: 52, 211, 153;
}

.icon-tile--amber {
  --tile-rgb: 251, 191, 36;
}

.icon-tile--rose {
  --tile-rgb: 251, 113, 133;
}

.icon-tile--sm {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.icon-tile--sm .icon {
  width: 17px;
  height: 17px;
}

/* ---------- Tags ---------- */

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.5;
  white-space: nowrap;
}

.tag--accent {
  border-color: rgba(129, 140, 248, 0.24);
  background: rgba(129, 140, 248, 0.08);
  color: var(--text-soft);
}

/* ---------- Filters ---------- */

.filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: clamp(24px, 3vw, 34px);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-soft);
}

.filter__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.filter__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
  transition:
    color 0.25s ease,
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.filter__btn::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--faint);
  opacity: 0.55;
  transition:
    background 0.25s ease,
    box-shadow 0.25s ease,
    opacity 0.25s ease;
}

.filter__btn span {
  color: var(--faint);
  font-size: 0.57rem;
  letter-spacing: 0.04em;
  transition: color 0.25s ease;
}

.filter__btn:hover {
  color: var(--text-soft);
  background: var(--surface);
}

.filter__btn.is-active {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface-raised);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.filter__btn.is-active::before {
  background: var(--cyan-bright);
  opacity: 1;
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.75);
}

.filter__btn.is-active span {
  color: var(--indigo-bright);
}

.filter__status {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.61rem;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}

/* Cards animate in/out when a filter is applied. */
.is-entering {
  animation: card-in 0.42s var(--ease-out) both;
}

.is-leaving {
  opacity: 0 !important;
  transform: translateY(6px) scale(0.985) !important;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Credential chip ---------- */

.cred {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  max-width: 100%;
  padding: 0.3rem 0.48rem;
  border: 1px solid rgba(129, 140, 248, 0.16);
  border-radius: 6px;
  background: rgba(129, 140, 248, 0.055);
  color: var(--muted);
  transition:
    color 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease;
}

.cred:hover {
  color: var(--text);
  border-color: rgba(129, 140, 248, 0.34);
  background: rgba(129, 140, 248, 0.11);
}

.cred__label {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.53rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cred code {
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.01em;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}

.cred .icon {
  width: 12px;
  height: 12px;
  opacity: 0.65;
  transition: opacity 0.25s ease;
}

.cred:hover .icon {
  opacity: 1;
}

.cred.is-copied {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.09);
}

.cred.is-copied .icon {
  color: var(--emerald);
  opacity: 1;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  max-width: calc(100vw - 32px);
  padding: 0.68rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: rgba(11, 14, 23, 0.94);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    var(--shadow-md);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition:
    opacity 0.3s ease,
    transform 0.4s var(--ease-out);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast .icon {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--emerald);
}

/* ---------- Utility bits ---------- */

.skip-link {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 300;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  transform: translateY(-170%);
  transition: transform 0.25s var(--ease-out);
}

.skip-link:focus {
  transform: translateY(0);
}

.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 120;
  height: 2px;
  pointer-events: none;
}

.scroll-progress__bar {
  height: 100%;
  background: var(--grad-brand);
  box-shadow: 0 0 10px rgba(129, 140, 248, 0.8);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.mono-muted {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.divider {
  width: 100%;
  height: 1px;
  border: 0;
  background: linear-gradient(
    90deg,
    transparent,
    var(--border),
    transparent
  );
}

@media (hover: none) {
  [data-spotlight]::after {
    display: none;
  }
}
