/* ==========================================================================
   Tekzo — custom styles (supplements Tailwind CDN)
   Animations, ambient background, code window, reveal
   ========================================================================== */

html { -webkit-text-size-adjust: 100%; }

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* -- Selection -- */
::selection {
  background: rgba(245, 158, 11, 0.25);
  color: #fff;
}

/* -- Focus visible -- */
:focus-visible {
  outline: 2px solid #F59E0B;
  outline-offset: 3px;
  border-radius: 2px;
}

/* ==========================================================================
   Ambient background — dot grid + aurora blobs
   ========================================================================== */

.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

/* Dot grid — masked, subtle, slowly drifting */
.dot-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 100% 80% at 50% 30%, black 20%, transparent 80%);
  mask-image: radial-gradient(ellipse 100% 80% at 50% 30%, black 20%, transparent 80%);
  animation: grid-drift 40s linear infinite;
}

@keyframes grid-drift {
  0% { background-position: 0 0; }
  100% { background-position: 28px 28px; }
}

/* Aurora blobs — large, blurred, slow-moving */
.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  will-change: transform;
}

.aurora-1 {
  width: 500px;
  height: 500px;
  background: rgba(245, 158, 11, 0.06);
  top: -100px;
  right: 10%;
  animation: aurora-move-1 18s ease-in-out infinite;
}

.aurora-2 {
  width: 600px;
  height: 600px;
  background: rgba(217, 119, 6, 0.04);
  top: 30%;
  left: -150px;
  animation: aurora-move-2 22s ease-in-out infinite;
}

.aurora-3 {
  width: 450px;
  height: 450px;
  background: rgba(245, 158, 11, 0.03);
  bottom: 10%;
  right: 20%;
  animation: aurora-move-3 25s ease-in-out infinite;
}

@keyframes aurora-move-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-30px, 40px) scale(1.1); }
  66% { transform: translate(20px, -20px) scale(0.95); }
}

@keyframes aurora-move-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, -30px) scale(1.15); }
}

@keyframes aurora-move-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* ==========================================================================
   Header — scroll state
   ========================================================================== */

#header.scrolled {
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ==========================================================================
   Code window — floating animation + cursor blink
   ========================================================================== */

.float-anim {
  animation: float 6s ease-in-out infinite;
}

.float-anim-delayed {
  animation: float 6s ease-in-out infinite;
  animation-delay: 3s;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.cursor-blink {
  animation: blink 1s steps(1) infinite;
  color: #F59E0B;
}

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

/* ==========================================================================
   Reveal on scroll
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .float-anim, .float-anim-delayed, .aurora, .dot-grid, .cursor-blink {
    animation: none !important;
  }
}
