:root {
  /* Compliance text: IntersectionObserver` with `threshold: 0.15` to trigger entries on both panels independently. Stagger delays within groups: each successive element adds `80ms` to its `animation-delay`. */
  --void-indigo: #0d0a14;
  --nebula-dark: #1a1026;
  --circuit-purple-dark: #2d1b4e;
  --circuit-purple: #3a2a5c;
  --phosphor-cream: #e8e0f0;
  --muted-lavender: #7b6f9e;
  --synth-rose: #e05c8a;
  --neon-teal: #45d9c8;
  --electric-amber: #f0b840;
  --left-scroll: 0px;
}

* { box-sizing: border-box; }

html {
  background: var(--void-indigo);
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  font-smooth: never;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--phosphor-cream);
  background: var(--void-indigo);
  font-family: "Jost", Futura, Inter, sans-serif;
  font-weight: 300;
  line-height: 1.85;
}

.diptych {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(rgba(58, 42, 92, 0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(58, 42, 92, 0.10) 1px, transparent 1px),
    var(--void-indigo);
  background-size: 16px 16px;
  transition: grid-template-columns 800ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.diptych::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 1px);
  width: 2px;
  z-index: 6;
  background: repeating-linear-gradient(to bottom, #2d1b4e 0 2px, #1a1026 2px 4px);
}

.diptych.converging { grid-template-columns: 0.0001fr 1fr; }
.diptych.converging::after { opacity: 0; }

.panel {
  height: 100vh;
  min-width: 0;
  background: rgba(13, 10, 20, 0.92);
}

.signal-panel {
  overflow-y: auto;
  padding: 64px clamp(28px, 5vw, 72px) 96px;
  scrollbar-width: thin;
  scrollbar-color: #3a2a5c #0d0a14;
}

.signal-panel::-webkit-scrollbar { width: 8px; background: #0d0a14; }
.signal-panel::-webkit-scrollbar-track { background: #0d0a14; }
.signal-panel::-webkit-scrollbar-thumb { background: #3a2a5c; border-radius: 0; transition: background-color 200ms ease; }
.signal-panel::-webkit-scrollbar-thumb:hover { background: #45d9c8; }

.response-panel { overflow: hidden; }

.response-track {
  min-height: 500vh;
  transform: translateY(calc(var(--left-scroll) * -0.3));
  transition: transform 80ms linear;
}

.signal-phase,
.response-phase {
  min-height: 100vh;
  position: relative;
}

.signal-phase {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 0;
}

.response-phase {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  overflow: hidden;
}

.domain-title,
.phase-title {
  margin: 0 0 24px;
  font-family: "Silkscreen", "VT323", monospace;
  font-size: clamp(1.5rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #e8e0f0;
  text-shadow: 4px 4px 0 #1a1026;
  -webkit-font-smoothing: none;
  font-smooth: never;
}

.system-label,
.boot-text,
.microcopy,
.concentric-note {
  font-family: "VT323", monospace;
  font-size: clamp(0.85rem, 1vw, 1rem);
  line-height: 1.6;
  letter-spacing: 0.05em;
  color: #7b6f9e;
  -webkit-font-smoothing: none;
}

.system-label { margin: 0 0 16px; }
.boot-text { display: inline; color: #f0b840; margin: 0; white-space: pre-wrap; }
.microcopy { max-width: 560px; margin: 24px 0 0; }

p {
  max-width: 660px;
  margin: 0 0 24px;
  font-size: clamp(0.95rem, 1.2vw, 1.15rem);
  font-kerning: normal;
  font-feature-settings: "kern" 1, "liga" 1;
}

.final-message { font-size: clamp(1rem, 1.3vw, 1.25rem); line-height: 2; }

.pixel-frame,
.concentric-note {
  position: relative;
  width: min(100%, 620px);
  padding: 32px;
  background: #1a1026;
  border: 2px solid #3a2a5c;
  box-shadow: 8px 8px 0 #0d0a14, inset 0 0 0 8px #120b1d;
}

.pixel-frame::before,
.concentric-note::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px solid #2d1b4e;
  pointer-events: none;
}

.cursor-block {
  display: inline-block;
  width: 8px;
  height: 16px;
  margin-left: 8px;
  background: #f0b840;
  animation: blink 1s steps(2, end) infinite;
  vertical-align: -2px;
}

.dither-bar {
  width: min(100%, 420px);
  height: 8px;
  margin: 32px 0 0;
  background: repeating-linear-gradient(90deg, #3a2a5c 0 2px, #1a1026 2px 4px, #45d9c8 4px 6px, #1a1026 6px 8px);
}

.prompt {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 16px;
  align-items: start;
  max-width: 660px;
  margin: 0 0 32px;
  padding: 24px;
  background: rgba(26, 16, 38, 0.72);
  border-left: 4px solid #3a2a5c;
  font-size: clamp(0.95rem, 1.1vw, 1.1rem);
  font-style: italic;
}

.prompt span {
  width: 12px;
  height: 12px;
  margin-top: 10px;
  background: #45d9c8;
  transform: rotate(45deg);
  box-shadow: 16px 0 0 #e05c8a, 0 16px 0 #f0b840;
}

canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
#radar-canvas, #resting-canvas { width: min(76vmin, 560px); height: min(76vmin, 560px); }
#orbital-canvas { width: min(92vw, 900px); height: min(76vh, 700px); }

.phase-1-response::before,
.phase-2-response::before,
.phase-3-response::before,
.phase-5-response::before {
  content: "";
  position: absolute;
  inset: 12%;
  border: 2px solid #2d1b4e;
  box-shadow: inset 0 0 0 8px rgba(26, 16, 38, 0.7);
}

.ico {
  width: 320px;
  height: 320px;
  position: relative;
  transform-style: preserve-3d;
  animation: rotateIco 20s linear infinite;
}

.ico span {
  position: absolute;
  left: 50%;
  top: 50%;
  height: 4px;
  transform-origin: 0 2px;
  background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 8px);
  box-shadow: 0 0 14px currentColor;
}

.tessellation-grid {
  display: grid;
  grid-template-columns: repeat(4, 80px);
  gap: 16px;
  padding: 32px;
  background: #1a1026;
  border: 2px solid #3a2a5c;
}

.tile {
  width: 80px;
  height: 80px;
  border: 2px solid #3a2a5c;
  background-color: #1a1026;
  transition: background 300ms steps(4, end), transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.phase-indicator {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 20;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #f0b840;
  background: #1a1026;
  border: 2px solid #3a2a5c;
  font-family: "VT323", monospace;
  font-size: 18px;
  line-height: 1;
  animation: blink 1s steps(2, end) infinite;
}

.divider-pixels {
  position: absolute;
  left: calc(50% - 1px);
  top: 0;
  bottom: 0;
  width: 2px;
  pointer-events: none;
  z-index: 12;
}

.divider-pixels span {
  position: absolute;
  left: 0;
  width: 2px;
  height: 2px;
  background: #e05c8a;
  opacity: 0;
}

.converging .divider-pixels span { animation: scatter 800ms ease-out forwards; }

.will-bounce { opacity: 0; transform: scale(0.85); }
.bounce-enter { animation: bounceEnter 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

@keyframes bounceEnter {
  0% { transform: scale(0.85); opacity: 0; }
  60% { transform: scale(1.03); opacity: 1; }
  80% { transform: scale(0.98); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes rotateIco {
  from { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
  to { transform: rotateX(360deg) rotateY(360deg) rotateZ(180deg); }
}

@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0.32; } }

@keyframes scatter {
  0% { transform: translate(0, 0); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)); opacity: 0; }
}

@media (max-width: 768px) {
  body { overflow: auto; }
  .diptych { display: block; height: auto; overflow: visible; }
  .diptych::after {
    top: auto;
    left: 0;
    bottom: auto;
    width: 100%;
    height: 4px;
    background: repeating-linear-gradient(90deg, #2d1b4e 0 2px, #1a1026 2px 4px);
  }
  .panel { height: auto; }
  .signal-panel { overflow: visible; padding: 40px 24px 56px; }
  .response-track { transform: none; min-height: 0; }
  .signal-phase, .response-phase { min-height: 72vh; }
  .response-phase { padding: 32px 20px; border-top: 4px solid #2d1b4e; }
  .tessellation-grid { grid-template-columns: repeat(3, 64px); gap: 12px; }
  .tile { width: 64px; height: 64px; }
  .divider-pixels { display: none; }
}
