.project-status {
  position: absolute !important;
  top: 21px;
  right: 21px;
  bottom: auto !important;
  left: auto !important;
  z-index: 20;
  display: flex;
  margin: 0;
  overflow: hidden;
  border-radius: 999px;
  color: #121212 !important;
  pointer-events: none;
}

.project-status__surface {
  position: relative !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  display: flex;
  width: 116px;
  overflow: visible;
  border-radius: inherit;
  background: linear-gradient(-75deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.05));
  box-shadow:
    inset 0 1.75px 1.75px rgba(0, 0, 0, 0.05),
    inset 0 -1.75px 1.75px rgba(255, 255, 255, 0.5),
    0 3.5px 1.75px -1.75px rgba(0, 0, 0, 0.2),
    inset 0 0 1.4px 3.5px rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.project-status__surface::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -80%;
  left: -55%;
  width: 34%;
  height: 260%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  filter: blur(1px);
  opacity: 0;
  transform: translateX(-220%) skewX(-22deg);
  pointer-events: none;
}

.project-status__surface::after {
  content: "";
  position: absolute;
  inset: -0.5px 0 0 -0.5px;
  padding: 1px;
  border-radius: inherit;
  background:
    conic-gradient(from -75deg, rgba(0, 0, 0, 0.5), transparent 5%, transparent 40%, rgba(0, 0, 0, 0.5) 50%, transparent 60%, transparent 95%, rgba(0, 0, 0, 0.5)),
    linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5));
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.5);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.project-status__content {
  position: relative !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  z-index: 1;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 5.25px;
  padding: 8.75px 17.5px;
  color: inherit !important;
  font-family: PPNeue, "PP Neue Montreal", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 10.5px;
  font-weight: 400;
  line-height: 10.5px;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.project-status__dot {
  position: static !important;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #22c55e;
  animation: project-status-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.project-status--on-dark {
  color: #fff !important;
}

/* Project 1 uses a deeper blue glass badge over its blue cover. */
.case-card[data-card="1"] .project-status {
  color: #fff !important;
}

.case-card[data-card="1"] .project-status__surface {
  background: linear-gradient(
    -75deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.14),
    rgba(255, 255, 255, 0.02)
  );
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  backdrop-filter: blur(10px) saturate(1.15);
}

.case-card[data-card="1"] .case-blur-stack span:nth-child(1) {
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.case-card[data-card="1"] .case-blur-stack span:nth-child(2) {
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.case-card[data-card="1"] .case-blur-stack span:nth-child(3) {
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

.case-card[data-card="1"] .case-blur-stack span:nth-child(4) {
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

@media (hover: hover) {
  .case-link:hover .project-status__surface::before,
  .case-link:focus-visible .project-status__surface::before {
    animation: glass-sheen 850ms cubic-bezier(0.2, 0.75, 0.2, 1);
  }
}

.theme-toggle,
.theme-toggle[aria-pressed="true"] {
  isolation: isolate;
  overflow: hidden;
  border: 0;
  background: linear-gradient(-75deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.05));
  box-shadow:
    inset 0 1.75px 1.75px rgba(0, 0, 0, 0.05),
    inset 0 -1.75px 1.75px rgba(255, 255, 255, 0.5),
    0 3.5px 1.75px -1.75px rgba(0, 0, 0, 0.2),
    inset 0 0 1.4px 3.5px rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.theme-toggle::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -80%;
  left: -55%;
  width: 34%;
  height: 260%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  filter: blur(1px);
  opacity: 0;
  transform: translateX(-220%) skewX(-22deg);
  pointer-events: none;
}

.theme-toggle::after {
  content: "";
  position: absolute;
  z-index: 3;
  inset: -0.5px 0 0 -0.5px;
  padding: 1px;
  border-radius: inherit;
  background:
    conic-gradient(from -75deg, rgba(0, 0, 0, 0.5), transparent 5%, transparent 40%, rgba(0, 0, 0, 0.5) 50%, transparent 60%, transparent 95%, rgba(0, 0, 0, 0.5)),
    linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5));
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.5);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

@media (hover: hover) {
  .theme-toggle:hover::before,
  .theme-toggle:focus-visible::before {
    animation: glass-sheen 850ms cubic-bezier(0.2, 0.75, 0.2, 1);
  }
}

@keyframes project-status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes glass-sheen {
  0% {
    opacity: 0;
    transform: translateX(-220%) skewX(-22deg);
  }
  18% { opacity: 0.9; }
  72% { opacity: 0.65; }
  100% {
    opacity: 0;
    transform: translateX(620%) skewX(-22deg);
  }
}

@media (max-width: 700px) {
  .project-status {
    top: 16px;
    right: 16px;
  }

  .project-status__content {
    gap: 5px;
    padding: 8px 14px;
    font-size: 11px;
    line-height: 11px;
  }

  .project-status__dot {
    width: 7px;
    height: 7px;
    flex-basis: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-status__dot {
    animation: none;
  }

  .project-status__surface::before,
  .theme-toggle::before {
    animation: none !important;
  }
}
