/* ============================================
   ZERO OS — LIVING TEXT
   Pre-authored text that rewrites itself.
   Character-level phosphor dissolve + typewriter retype.
   + Status pulse, cursor blink, counter support.
   ============================================ */

/* Living text container */
.living-text {
  position: relative;
  display: inline;
  white-space: pre-wrap;
}

/* Individual character during dissolve */
.lt-char {
  display: inline;
  transition: none;
}

.lt-char.dissolving {
  color: rgba(200, 255, 0, 0.4);
  text-shadow: 0 0 4px rgba(200, 255, 0, 0.2);
}

.lt-char.ghost {
  color: rgba(200, 255, 0, 0.1);
  filter: blur(0.5px);
}

.lt-char.gone {
  display: none;
}

.lt-char.arriving {
  color: #4dff74;
  text-shadow: 0 0 6px rgba(200, 255, 0, 0.6);
}

.lt-char.settled {
  color: inherit;
  text-shadow: none;
}

/* Cursor between dissolve and retype */
.lt-cursor {
  display: inline;
  animation: lt-cursor-blink 1.06s step-end infinite;
  color: var(--phosphor, #c8ff00);
}

@keyframes lt-cursor-blink {
  0%, 49.9% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Living zone indicator */
.living-zone {
  border-left: 1px solid transparent;
  transition: border-color 0.3s;
}

.living-zone.active {
  border-left-color: rgba(200, 255, 0, 0.08);
}


/* ── STATUS LIVE PULSE (heartbeat) ── */
@keyframes status-pulse {
  0%, 100% {
    transform: scale(1);
    text-shadow: 0 0 4px rgba(200, 255, 0, 0.2);
  }
  50% {
    transform: scale(1.15);
    text-shadow: 0 0 12px rgba(200, 255, 0, 0.5), 0 0 24px rgba(200, 255, 0, 0.15);
  }
}

.status-live {
  display: inline-block;
  animation: status-pulse 2s ease-in-out infinite;
}


/* ── TERMINAL CURSOR (block blink) ── */
.terminal-cursor::after {
  content: '\2588';
  color: var(--phosphor, #c8ff00);
  animation: lt-cursor-blink 1s step-end infinite;
}


/* ── TYPEWRITER (reserve space, no CLS) ── */
.typewriter {
  visibility: visible;
}

.typewriter[data-tw-ready] {
  visibility: visible;
}


/* ── COPY TOOLTIP ── */
[data-copy] {
  cursor: pointer;
  position: relative;
}

[data-copy].copied {
  border-color: var(--phosphor, #c8ff00) !important;
  box-shadow: 0 0 6px rgba(200, 255, 0, 0.2);
}

[data-copy]::before {
  content: 'copied';
  position: absolute;
  top: -1.6em;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: var(--phosphor, #c8ff00);
  background: var(--bg, #0a0a0a);
  padding: 1px 6px;
  border: 1px solid var(--phosphor, #c8ff00);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
  white-space: nowrap;
}

[data-copy].copied::before {
  opacity: 1;
}


/* ── ACCESSIBILITY ── */
@media (prefers-reduced-motion: reduce) {
  .living-text,
  .lt-char {
    transition: none !important;
  }
  .lt-cursor {
    animation: none !important;
    opacity: 1;
  }
  .status-live {
    animation: none !important;
    transform: none !important;
  }
  .terminal-cursor::after {
    animation: none !important;
    opacity: 1;
  }
  .typewriter {
    visibility: visible !important;
  }
}
