/* ═══════════════════════════════════════════════════════════
   LATOM RESEARCH — PREMIUM ENHANCEMENT LAYER
   Adds WebGL background, custom cursor, letter animations,
   scroll reveals, and cinematic interactions on top of the
   existing site.
   ═══════════════════════════════════════════════════════════ */

/* ===== HIDE NATIVE CURSOR ON DESKTOP ===== */
@media (min-width: 768px) {
  body, a, button, input, select, textarea { cursor: none !important; }
}

/* ===== CUSTOM CURSOR ===== */
.lx-cursor {
  position: fixed; top: 0; left: 0;
  width: 36px; height: 36px;
  border: 1.5px solid rgba(200, 169, 110, 0.5);
  border-radius: 50%; pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, border-color 0.3s, background 0.3s;
  mix-blend-mode: difference;
}
.lx-cursor.hover {
  width: 70px; height: 70px;
  border-color: #c8a96e;
  background: rgba(200, 169, 110, 0.12);
}
.lx-cursor-dot {
  position: fixed; top: 0; left: 0;
  width: 4px; height: 4px;
  background: #c8a96e;
  border-radius: 50%;
  pointer-events: none; z-index: 99999;
  transform: translate(-50%, -50%);
}
@media (max-width: 768px) {
  .lx-cursor, .lx-cursor-dot { display: none; }
}

/* ===== WEBGL BACKGROUND CANVAS ===== */
#lx-webgl {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  z-index: -1; pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: screen;
  will-change: transform;
}
body.light #lx-webgl {
  opacity: 0.15;
  mix-blend-mode: multiply;
}

/* ===== PREMIUM LOADER ===== */
.lx-loader {
  position: fixed; inset: 0;
  background: #050508;
  z-index: 999999;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity 1s cubic-bezier(0.77, 0, 0.18, 1),
              visibility 1s cubic-bezier(0.77, 0, 0.18, 1);
}
.lx-loader.done { opacity: 0; visibility: hidden; pointer-events: none; }

.lx-loader-letters {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 400; letter-spacing: 0.2em;
  color: #c8a96e;
  display: flex; gap: 0.1em;
  margin-bottom: 3rem;
  text-shadow: 0 0 30px rgba(200, 169, 110, 0.4);
}
.lx-loader-letters span {
  display: inline-block;
  animation: lxLoaderPulse 1.4s ease-in-out infinite;
}
.lx-loader-letters span:nth-child(1) { animation-delay: 0s; }
.lx-loader-letters span:nth-child(2) { animation-delay: 0.1s; }
.lx-loader-letters span:nth-child(3) { animation-delay: 0.2s; }
.lx-loader-letters span:nth-child(4) { animation-delay: 0.3s; }
.lx-loader-letters span:nth-child(5) { animation-delay: 0.4s; }
@keyframes lxLoaderPulse {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-12px); }
}

.lx-loader-bar {
  width: 240px; height: 1px;
  background: rgba(200, 169, 110, 0.15);
  position: relative; overflow: hidden;
}
.lx-loader-fill {
  position: absolute; inset: 0;
  width: 0; background: #c8a96e;
  animation: lxLoaderFill 2.2s cubic-bezier(0.77, 0, 0.18, 1) forwards;
  box-shadow: 0 0 15px rgba(200, 169, 110, 0.6);
}
@keyframes lxLoaderFill {
  to { width: 100%; }
}

.lx-loader-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem; letter-spacing: 2px;
  color: rgba(200, 169, 110, 0.5);
  margin-top: 1.2rem; text-transform: uppercase;
}

/* ===== LETTER REVEAL ANIMATION ===== */
.lx-split { display: inline-block; overflow: hidden; }
.lx-split-inner {
  display: inline-block;
  transform: translateY(110%);
  animation: lxWordUp 1.2s cubic-bezier(0.77, 0, 0.18, 1) forwards;
}
@keyframes lxWordUp {
  to { transform: translateY(0); }
}

/* ===== SCROLL REVEAL (non-destructive) ===== */
.lx-reveal {
  opacity: 0; transform: translateY(40px);
  transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.lx-reveal.visible {
  opacity: 1; transform: translateY(0);
}

/* ===== HOVER GLOW ON COMPOUND CARDS ===== */
[class*="card"]:hover,
[class*="compound"]:hover,
.compound-card:hover,
.card:hover {
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}

/* ===== LIVE INDICATOR PULSE ===== */
.lx-live {
  position: fixed; top: 84px; right: 24px;
  z-index: 90;
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.4rem 0.9rem;
  background: rgba(9, 9, 15, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(200, 169, 110, 0.2);
  border-radius: 50px;
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem; letter-spacing: 1.2px;
  color: rgba(240, 237, 232, 0.7);
  text-transform: uppercase;
  animation: lxLiveFade 1s 2.5s ease forwards;
  opacity: 0;
}
.lx-live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #2dd4bf;
  box-shadow: 0 0 10px #2dd4bf;
  animation: lxBlink 2s ease infinite;
}
@keyframes lxBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
@keyframes lxLiveFade {
  to { opacity: 1; }
}
@media (max-width: 768px) {
  .lx-live { display: none; }
}

/* ===== MARQUEE STRIP ===== */
.lx-marquee {
  position: relative;
  padding: 2.5rem 0;
  border-top: 1px solid rgba(200, 169, 110, 0.1);
  border-bottom: 1px solid rgba(200, 169, 110, 0.1);
  overflow: hidden;
  background: rgba(9, 9, 15, 0.5);
  margin: 3rem 0;
}
.lx-marquee-track {
  display: flex; gap: 3rem; align-items: center;
  white-space: nowrap;
  animation: lxScroll 40s linear infinite;
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2rem, 5vw, 4rem);
  letter-spacing: 0.15em;
  color: rgba(200, 169, 110, 0.25);
  padding-right: 3rem;
}
.lx-marquee-track .star {
  color: #c8a96e;
  animation: lxRotate 10s linear infinite;
  display: inline-block;
  font-size: 0.7em;
}
@keyframes lxScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes lxRotate {
  to { transform: rotate(360deg); }
}

/* ===== SMOOTH ANCHOR LINK UNDERLINE ===== */
.lx-link-underline {
  position: relative;
  display: inline-block;
}
.lx-link-underline::after {
  content: ''; position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.6s cubic-bezier(0.77, 0, 0.18, 1);
}
.lx-link-underline:hover::after {
  transform: scaleX(1); transform-origin: left;
}

/* ===== CLOCK IN NAV ===== */
.lx-clock {
  position: fixed; bottom: 24px; left: 24px;
  z-index: 90;
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem; letter-spacing: 1.5px;
  color: rgba(200, 169, 110, 0.5);
  text-transform: uppercase;
  opacity: 0;
  animation: lxLiveFade 1s 2.8s ease forwards;
}
@media (max-width: 768px) {
  .lx-clock { display: none; }
}

/* ===== FIX BODY TO HIDE SCROLLBAR DURING LOAD ===== */
body.lx-loading { overflow: hidden; }
