/* The Attention Field — Direction 1
   Visual layer styles (palette, typography, web-of-connections) */

:root {
  /* Palette (matches Direction 2 for coherence) */
  --indigo: #23216C;        /* Deep Indigo */
  --twilight: #6C3F99;      /* Twilight Purple */
  --electric: #54C3FB;      /* Electric Blue */
  --neon: #13FFD5;          /* Neon Cyan */
  --sunrise: #FFB570;       /* Sunrise Orange */
  --pink: #F97CA7;          /* Soft Pink */
  --white: #F7F9FA;         /* Ethereal White */
  --shadow: #1C1E22;        /* Shadow Grey */

  --text: var(--white);
  --glow: rgba(84, 195, 251, 0.28);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  color: var(--text);
  background: radial-gradient(1200px 800px at 50% 60%, #1c1e22 0%, #121317 60%, #0a0b0f 100%);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  line-height: 1.5;
  overflow: hidden;
  overscroll-behavior: none;
}

/* Full-viewport canvas sits under the text layer */
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

/* Floating text fragments (poem) */
#text-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* Individual fragment styling */
.text-fragment {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.98);
  color: var(--text);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-weight: 300;
  letter-spacing: 0.02em;
  font-size: clamp(12px, 1.2vw, 18px);
  white-space: nowrap;
  opacity: 0;
  text-shadow:
    0 0 0.5px rgba(247, 249, 250, 0.5),
    0 0 10px var(--glow);
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 12px rgba(19, 255, 213, 0.08));
  animation: float-fade 4800ms ease-out forwards;
}

.text-fragment.resolve {
  font-weight: 400;
  letter-spacing: 0.012em;
  animation-duration: 6600ms;
}

/* Tiny pulse glyph (optional) */
.pulse-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  margin-top: -3px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, var(--electric), rgba(84, 195, 251, 0.12) 60%);
  opacity: 0.0;
  filter: blur(0.6px);
  animation: pulse-pop 320ms ease-out forwards;
}

/* Motion */
@keyframes float-fade {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.98);
    filter: blur(0.8px) drop-shadow(0 0 4px rgba(84, 195, 251, 0.14));
  }
  10% {
    opacity: 0.92;
    transform: translate(-50%, calc(-50% - 2px)) scale(1.0);
  }
  70% {
    opacity: 0.9;
    transform: translate(-50%, calc(-50% - 2px)) scale(1.01);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 4px)) scale(1.02);
    filter: blur(1.6px) drop-shadow(0 0 18px rgba(84, 195, 251, 0.10));
  }
}

@keyframes pulse-pop {
  0% { opacity: 0.0; transform: scale(0.7); }
  40% { opacity: 0.6; transform: scale(1.0); }
  100% { opacity: 0.0; transform: scale(1.4); }
}

/* Reduced-motion accessibility */
@media (prefers-reduced-motion: reduce) {
  .text-fragment,
  .text-fragment.resolve,
  .pulse-dot {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
  
  #cursor-prompt {
    animation-duration: 1ms !important;
  }
  
  .blinking-cursor {
    animation: none !important;
    opacity: 1 !important;
  }
}
