.c12-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  background:
    linear-gradient(180deg, rgba(155, 216, 255, 0.04), transparent 46%, rgba(85, 183, 255, 0.04)),
    #020712;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.c12-transition-overlay::before,
.c12-transition-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
}

.c12-transition-overlay::before {
  background: repeating-linear-gradient(0deg, rgba(155, 216, 255, 0.07) 0 1px, transparent 1px 9px);
  transform: translateY(-100%);
}

.c12-transition-overlay::after {
  background:
    linear-gradient(90deg, transparent 0 8%, rgba(85, 183, 255, 0.18) 8% 8.5%, transparent 8.5% 16%),
    linear-gradient(0deg, transparent 0 46%, rgba(246, 251, 255, 0.11) 46% 47%, transparent 47% 100%);
  clip-path: polygon(0 44%, 100% 36%, 100% 64%, 0 58%);
}

.c12-transition-core {
  position: relative;
  display: grid;
  place-items: center;
  gap: 0.8rem;
  color: #d7f3ff;
  text-align: center;
  transform: scale(0.92);
}

.c12-transition-core img {
  width: 116px;
  height: 116px;
  filter: drop-shadow(0 0 24px rgba(85, 183, 255, 0.45));
}

.c12-transition-label {
  min-height: 1.2rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #9bd8ff;
}

.is-transitioning {
  cursor: progress;
}

.is-transitioning body {
  pointer-events: none;
}

.is-transitioning .c12-transition-overlay,
.is-materializing .c12-transition-overlay {
  visibility: visible;
  opacity: 1;
}

.is-transitioning main,
.is-transitioning .site-header,
.is-transitioning .site-footer {
  animation: c12-page-dematerialize 360ms ease forwards;
}

.is-transitioning .c12-transition-overlay::before {
  animation: c12-sweep 360ms ease forwards;
}

.is-transitioning .c12-transition-overlay::after {
  animation: c12-fragments 360ms ease forwards;
}

.is-transitioning .c12-transition-core img {
  animation: c12-chip-pulse 360ms ease forwards;
}

.is-materializing main,
.is-materializing .site-header,
.is-materializing .site-footer {
  animation: c12-page-materialize 300ms ease forwards;
}

.is-materializing .c12-transition-overlay {
  animation: c12-overlay-clear 300ms ease forwards;
}

.is-materializing .c12-transition-core img {
  animation: c12-chip-arrive 260ms ease forwards;
}

@keyframes c12-page-dematerialize {
  0% { filter: brightness(1) saturate(1); opacity: 1; transform: none; clip-path: inset(0); }
  18% { filter: brightness(1.22) saturate(1.15) drop-shadow(0 0 8px rgba(85, 183, 255, 0.28)); }
  74% { filter: grayscale(0.55) hue-rotate(172deg) saturate(1.35); opacity: 0.32; clip-path: inset(12% 0 18% 0); }
  100% { filter: brightness(0) saturate(0.4); opacity: 0; transform: scale(0.992); clip-path: inset(48% 0 49% 0); }
}

@keyframes c12-page-materialize {
  0% { opacity: 0; filter: brightness(0.25) saturate(0.8); clip-path: inset(48% 0 49% 0); }
  45% { opacity: 0.55; filter: brightness(0.8) saturate(1.1); clip-path: inset(8% 0 10% 0); }
  100% { opacity: 1; filter: none; clip-path: inset(0); }
}

@keyframes c12-sweep {
  0% { opacity: 0; transform: translateY(-100%); }
  40% { opacity: 0.45; }
  100% { opacity: 0; transform: translateY(100%); }
}

@keyframes c12-fragments {
  0% { opacity: 0; transform: scaleX(0.98); }
  45% { opacity: 0.7; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(0.82); }
}

@keyframes c12-chip-pulse {
  0% { opacity: 0; transform: scale(0.88); }
  45% { opacity: 1; transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes c12-chip-arrive {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.08); }
}

@keyframes c12-overlay-clear {
  0% { opacity: 1; visibility: visible; }
  100% { opacity: 0; visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .is-transitioning main,
  .is-transitioning .site-header,
  .is-transitioning .site-footer,
  .is-materializing main,
  .is-materializing .site-header,
  .is-materializing .site-footer {
    animation: c12-reduced-fade 120ms ease forwards;
  }

  .c12-transition-overlay::before,
  .c12-transition-overlay::after {
    display: none;
  }

  .c12-transition-core img {
    animation: none !important;
  }
}

@keyframes c12-reduced-fade {
  from { opacity: 0.65; }
  to { opacity: 1; }
}
