/* Project Archive — Domain Memory Projection.
   Extends the existing archive controller with a conduit, closing seal,
   scan reconstruction, and a quiet projected-image idle state. */
.unified-interface .project-archive.domain-memory-ready {
  --memory-accent: #9ed7c1;
  --memory-gold: #f4dda0;
  isolation: isolate;
}

.unified-interface .domain-memory-conduit {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  overflow: visible;
  color: var(--memory-accent);
  pointer-events: none;
}

.unified-interface .domain-memory-route,
.unified-interface .domain-memory-current {
  fill: none;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
}

.unified-interface .domain-memory-route {
  opacity: .2;
  stroke: currentColor;
  stroke-width: 1;
  stroke-dasharray: 2 7;
  transition: opacity .3s ease, stroke .3s ease;
}

.unified-interface .domain-memory-current {
  opacity: 0;
  stroke: var(--memory-gold);
  stroke-width: 1.7;
  stroke-dasharray: 32 520;
  filter: drop-shadow(0 0 5px currentColor);
}

.unified-interface .domain-memory-origin,
.unified-interface .domain-memory-destination {
  fill: var(--memory-gold);
  opacity: .64;
  filter: drop-shadow(0 0 4px var(--memory-accent));
}

.unified-interface .project-archive.memory-switching .domain-memory-route { opacity: .42; }
.unified-interface .project-archive.memory-switching .domain-memory-current {
  animation: domain-memory-conduit-flow .72s var(--archive-ease) both;
}
.unified-interface .project-archive.memory-switching .domain-memory-origin,
.unified-interface .project-archive.memory-switching .domain-memory-destination {
  animation: domain-memory-node-flare .72s var(--archive-ease) both;
}

.unified-interface .project-archive-nav > button::before {
  content: '';
  position: absolute;
  z-index: 2;
  right: -5px;
  top: 50%;
  width: 7px;
  height: 7px;
  border: 1px solid rgba(244, 221, 160, .62);
  background: #12384a;
  opacity: 0;
  transform: translateY(-50%) rotate(45deg) scale(.55);
  transition: opacity .24s ease, transform .34s var(--archive-ease), box-shadow .3s ease;
}

.unified-interface .project-archive-nav > button[aria-selected='true']::before {
  opacity: .9;
  transform: translateY(-50%) rotate(45deg) scale(1);
  box-shadow: 0 0 0 4px rgba(112, 216, 237, .06), 0 0 13px rgba(112, 216, 237, .48);
}

.unified-interface .project-archive.memory-switching .project-archive-nav > button.memory-sending::before {
  animation: domain-memory-origin-pulse .78s var(--archive-ease) both;
}

.unified-interface .project-archive-stage {
  position: relative;
  isolation: isolate;
}

.unified-interface .domain-memory-projection {
  position: absolute;
  z-index: 8;
  top: 63px;
  right: 25px;
  bottom: 25px;
  left: 25px;
  overflow: hidden;
  border-radius: 3px 17px 3px 17px;
  opacity: 0;
  pointer-events: none;
}

.unified-interface .domain-memory-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 22, 35, .92), rgba(15, 49, 64, .8) 48%, rgba(5, 22, 35, .92)),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(123, 221, 239, .07) 6px);
  opacity: 0;
}

.unified-interface .domain-memory-veil::before,
.unified-interface .domain-memory-veil::after {
  content: '';
  position: absolute;
  pointer-events: none;
}

.unified-interface .domain-memory-veil::before {
  top: 0;
  bottom: 0;
  width: 16%;
  left: -18%;
  background: linear-gradient(90deg, transparent, rgba(117, 220, 240, .2), rgba(255, 235, 177, .82), rgba(117, 220, 240, .14), transparent);
  filter: blur(1px);
}

.unified-interface .domain-memory-veil::after {
  inset: 12px;
  border: 1px solid color-mix(in srgb, var(--memory-accent) 30%, transparent);
  border-radius: 2px 13px 2px 13px;
}

.unified-interface .domain-memory-seal {
  position: absolute;
  left: 50%;
  top: 48%;
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--memory-accent) 74%, transparent);
  box-shadow: 0 0 38px color-mix(in srgb, var(--memory-accent) 25%, transparent);
  opacity: 0;
  transform: translate(-50%, -50%) rotate(45deg) scale(.56);
}

.unified-interface .domain-memory-seal::before,
.unified-interface .domain-memory-seal::after,
.unified-interface .domain-memory-seal > i {
  content: '';
  position: absolute;
  pointer-events: none;
}

.unified-interface .domain-memory-seal::before {
  inset: 9px;
  border: 1px solid rgba(244, 221, 160, .56);
}

.unified-interface .domain-memory-seal::after {
  inset: 24px;
  border: 1px solid color-mix(in srgb, var(--memory-accent) 72%, transparent);
  border-radius: 50%;
}

.unified-interface .domain-memory-seal > i:first-child {
  inset: -13px;
  border: 1px dashed color-mix(in srgb, var(--memory-accent) 52%, transparent);
  border-radius: 50%;
}

.unified-interface .domain-memory-seal > i:last-child {
  left: 50%;
  top: -28px;
  bottom: -28px;
  width: 1px;
  background: linear-gradient(transparent, var(--memory-gold), transparent);
}

.unified-interface .domain-memory-seal > b {
  color: #fff0bc;
  font: 500 19px/1 var(--serif);
  text-shadow: 0 0 12px var(--memory-accent);
  transform: rotate(-45deg);
}

.unified-interface .domain-memory-label {
  position: absolute;
  left: 50%;
  top: calc(48% + 82px);
  display: grid;
  gap: 5px;
  color: rgba(221, 240, 241, .82);
  text-align: center;
  text-transform: uppercase;
  opacity: 0;
  transform: translateX(-50%);
}

.unified-interface .domain-memory-label small {
  color: var(--memory-gold);
  font-size: 6px;
  letter-spacing: .28em;
}

.unified-interface .domain-memory-label strong {
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .2em;
  white-space: nowrap;
}

.unified-interface .domain-memory-fragments { position: absolute; inset: 0; }
.unified-interface .domain-memory-fragments i {
  position: absolute;
  left: var(--fragment-x);
  top: var(--fragment-y);
  width: var(--fragment-size);
  height: var(--fragment-size);
  border: 1px solid color-mix(in srgb, var(--memory-accent) 70%, transparent);
  opacity: 0;
  transform: rotate(45deg);
}

.unified-interface .project-archive.memory-switching .domain-memory-projection {
  animation: domain-memory-projection-visible 1.08s ease-out both;
}
.unified-interface .project-archive.memory-switching .domain-memory-veil {
  animation: domain-memory-veil-close 1.02s var(--archive-ease) both;
}
.unified-interface .project-archive.memory-switching .domain-memory-veil::before {
  animation: domain-memory-scan 1.02s .12s var(--archive-ease) both;
}
.unified-interface .project-archive.memory-switching .domain-memory-seal {
  animation: domain-memory-seal-cycle .92s var(--archive-ease) both;
}
.unified-interface .project-archive.memory-switching .domain-memory-seal > i:first-child {
  animation: domain-memory-ring-spin 1.05s linear both;
}
.unified-interface .project-archive.memory-switching .domain-memory-label {
  animation: domain-memory-label-cycle .88s .08s ease-out both;
}
.unified-interface .project-archive.memory-switching .domain-memory-fragments i {
  animation: domain-memory-fragment 1s var(--fragment-delay) var(--archive-ease) both;
}

.unified-interface .project-archive .work-card.panel-entering .work-art::before {
  content: '';
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 0 42%, rgba(244, 221, 160, .55) 49%, rgba(111, 216, 237, .34) 52%, transparent 58%),
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(119, 218, 237, .06) 5px);
  mix-blend-mode: screen;
  animation: domain-memory-art-scan .82s .06s var(--archive-ease) both;
}

.unified-interface .project-archive .work-card.panel-entering .work-art > img {
  animation: domain-memory-image-reconstruct .82s .08s var(--archive-ease) both !important;
}

.unified-interface .project-archive.domain-memory-ready:not(.memory-switching) .work-card.is-active .work-art {
  transform: perspective(1100px) rotateX(var(--memory-tilt-y, 0deg)) rotateY(var(--memory-tilt-x, 0deg));
  transition: transform .62s var(--archive-ease), border-color .35s ease, box-shadow .35s ease;
}

.unified-interface .project-archive.domain-memory-ready:not(.memory-switching) .work-card.is-active .work-art:hover {
  border-color: rgba(239, 218, 164, .36);
  box-shadow: inset 0 0 46px rgba(4, 18, 33, .46), 0 0 25px color-mix(in srgb, var(--memory-accent) 10%, transparent);
}

body.is-scrolling .project-archive.domain-memory-ready *,
body.is-scrolling .project-archive.domain-memory-ready::before {
  animation-play-state: paused !important;
}

@keyframes domain-memory-conduit-flow {
  0% { opacity: 0; stroke-dashoffset: 560; }
  18% { opacity: 1; }
  78% { opacity: .9; }
  100% { opacity: 0; stroke-dashoffset: 0; }
}
@keyframes domain-memory-node-flare {
  0%, 100% { opacity: .55; transform: scale(1); transform-origin: center; }
  45% { opacity: 1; transform: scale(2.1); }
}
@keyframes domain-memory-origin-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(112, 216, 237, .06), 0 0 13px rgba(112, 216, 237, .48); }
  45% { box-shadow: 0 0 0 11px rgba(112, 216, 237, .08), 0 0 28px var(--memory-accent); }
}
@keyframes domain-memory-projection-visible {
  0%, 100% { opacity: 0; }
  8%, 80% { opacity: 1; }
}
@keyframes domain-memory-veil-close {
  0% { opacity: 0; clip-path: inset(50% 0 50% 0); }
  28%, 48% { opacity: .92; clip-path: inset(0 0 0 0); }
  100% { opacity: 0; clip-path: inset(0 0 0 100%); }
}
@keyframes domain-memory-scan {
  from { transform: translateX(0); }
  to { transform: translateX(760%); }
}
@keyframes domain-memory-seal-cycle {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(15deg) scale(.36); }
  34%, 55% { opacity: 1; transform: translate(-50%, -50%) rotate(45deg) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(105deg) scale(1.48); }
}
@keyframes domain-memory-ring-spin {
  from { transform: rotate(0); }
  to { transform: rotate(180deg); }
}
@keyframes domain-memory-label-cycle {
  0%, 18% { opacity: 0; transform: translate(-50%, 7px); letter-spacing: .06em; }
  40%, 70% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -4px); }
}
@keyframes domain-memory-fragment {
  0% { opacity: 0; translate: 0 12px; scale: .6; }
  38% { opacity: .78; }
  100% { opacity: 0; translate: var(--fragment-drift) -22px; scale: 1.3; }
}
@keyframes domain-memory-art-scan {
  0% { opacity: 0; transform: translateY(-62%); }
  26% { opacity: .75; }
  100% { opacity: 0; transform: translateY(62%); }
}
@keyframes domain-memory-image-reconstruct {
  0% { opacity: .12; clip-path: inset(0 0 100% 0); filter: brightness(1.7) saturate(.55); transform: scale(1.045); }
  42% { opacity: .75; filter: brightness(1.28) saturate(.8); }
  100% { opacity: 1; clip-path: inset(0); filter: none; transform: none; }
}

@media (max-width: 800px), (pointer: coarse) {
  .unified-interface .domain-memory-conduit,
  .unified-interface .domain-memory-fragments { display: none; }
  .unified-interface .domain-memory-projection { top: 55px; right: 16px; bottom: 16px; left: 16px; }
  .unified-interface .domain-memory-seal { width: 68px; height: 68px; }
  .unified-interface .domain-memory-seal::after { inset: 18px; }
  .unified-interface .domain-memory-label { top: calc(48% + 64px); }
  .unified-interface .project-archive.domain-memory-ready:not(.memory-switching) .work-card.is-active .work-art { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .unified-interface .domain-memory-conduit,
  .unified-interface .domain-memory-projection,
  .unified-interface .project-archive .work-card.panel-entering .work-art::before {
    display: none !important;
  }
  .unified-interface .project-archive .work-card.panel-entering .work-art > img {
    opacity: 1;
    clip-path: none;
    filter: none;
    animation: none !important;
  }
}
