/* Kimi-inspired motion layer — grain, cursor, GSAP scroll & entrance */

/* Film grain overlay */
.kimi-grain {
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
}
.kimi-grain canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Flashlight cursor (Kimi-style mouse follow) */
.kimi-cursor-light {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(100, 255, 218, 0.09) 0%, transparent 65%);
  transition: opacity 0.4s;
  opacity: 0;
}
body.kimi-ready .kimi-cursor-light { opacity: 1; }
@media (max-width: 768px), (pointer: coarse) {
  .kimi-cursor-light { display: none; }
}

/* Custom cursor ring */
.kimi-cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--jellyfish);
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  opacity: 0;
  transition: opacity 0.3s;
}
.kimi-cursor-ring {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(100, 255, 218, 0.45);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9997;
  transform: translate(-50%, -50%);
  transition: width 0.25s, height 0.25s, border-color 0.25s, opacity 0.3s;
  opacity: 0;
}
body.kimi-ready .kimi-cursor-dot,
body.kimi-ready .kimi-cursor-ring { opacity: 1; }
body.kimi-cursor-hover .kimi-cursor-ring {
  width: 52px;
  height: 52px;
  border-color: rgba(100, 255, 218, 0.8);
}
@media (max-width: 768px), (pointer: coarse) {
  .kimi-cursor-dot, .kimi-cursor-ring { display: none; }
}

/* Bottom orb — Kimi moon equivalent */
.kimi-orb {
  position: fixed;
  bottom: -28vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(70vw, 520px);
  height: min(70vw, 520px);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 38% 32%, rgba(100, 255, 218, 0.18) 0%, transparent 35%),
    radial-gradient(circle at 62% 58%, rgba(42, 157, 143, 0.12) 0%, transparent 30%),
    radial-gradient(circle, rgba(15, 42, 74, 0.95) 0%, rgba(10, 25, 47, 0.6) 55%, transparent 72%);
  box-shadow: 0 0 80px rgba(100, 255, 218, 0.08);
  filter: blur(0.5px);
}
.kimi-orb::before {
  content: '';
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, transparent 0deg 8deg, rgba(100, 255, 218, 0.03) 8deg 9deg);
  animation: orbSpin 60s linear infinite;
}
.kimi-orb::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-image: radial-gradient(circle at 25% 30%, rgba(0,0,0,0.25) 0%, transparent 8%),
    radial-gradient(circle at 55% 45%, rgba(0,0,0,0.2) 0%, transparent 6%),
    radial-gradient(circle at 70% 65%, rgba(0,0,0,0.15) 0%, transparent 5%);
}
@keyframes orbSpin {
  to { transform: rotate(360deg); }
}

/* Marquee band — Kimi "Build Your Own Job" style */
.kimi-marquee {
  position: fixed;
  bottom: 48px;
  left: 0;
  right: 0;
  z-index: 2;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  pointer-events: none;
}
.kimi-marquee__track {
  display: flex;
  width: max-content;
  animation: kimiMarquee 28s linear infinite;
}
.kimi-marquee__track span {
  font-family: var(--font-title);
  font-size: clamp(0.7rem, 1.5vw, 0.85rem);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(224, 231, 255, 0.22);
  white-space: nowrap;
  padding-right: 4em;
}
@keyframes kimiMarquee {
  to { transform: translateX(-50%); }
}

/* Page enter — blur fade like Kimi route transition */
body.kimi-enter {
  animation: kimiPageEnter 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes kimiPageEnter {
  from { opacity: 0; filter: blur(12px); }
  to { opacity: 1; filter: blur(0); }
}

body.kimi-leave {
  animation: kimiPageLeave 0.55s ease forwards;
  pointer-events: none;
}
@keyframes kimiPageLeave {
  to { opacity: 0; filter: blur(10px) scale(1.02); }
}

/* GSAP reveal helpers */
.gs-reveal {
  opacity: 0;
  transform: translateY(40px);
}
.gs-reveal-left {
  opacity: 0;
  transform: translateX(-40px);
}
.gs-reveal-scale {
  opacity: 0;
  transform: scale(0.85);
}

/* Split chars for cover title */
.cover__title .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(60px) rotateX(-40deg);
}

/* Scanline subtle — retro Kimi pixel feel */
.kimi-scanlines {
  position: fixed;
  inset: 0;
  z-index: 9989;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  opacity: 0.35;
}

/* Horizontal category strip on cover */
.kimi-categories {
  display: flex;
  justify-content: center;
  gap: clamp(12px, 3vw, 32px);
  margin-bottom: clamp(20px, 4vw, 40px);
  flex-wrap: wrap;
  opacity: 0;
}
.kimi-cat {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: rgba(224, 231, 255, 0.35);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.3s, border-color 0.3s;
  cursor: default;
}
.kimi-cat.active {
  color: var(--jellyfish);
  border-bottom-color: var(--jellyfish);
}

@media (prefers-reduced-motion: reduce) {
  .kimi-marquee__track { animation: none; }
  .kimi-orb::before { animation: none; }
  body.kimi-enter, body.kimi-leave { animation: none; }
}
