/* IXMOTO Motion & Animation System */

/* Keyframe Definitions */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes pulseSubtle {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

@keyframes revBarPulse {
  0% { width: 0%; }
  60% { width: 75%; }
  100% { width: 100%; }
}

/* Preloader Screen */
.preloader {
  position: fixed;
  inset: 0;
  background-color: #07080B;
  z-index: var(--z-preloader);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s var(--ease-standard), visibility 0.5s var(--ease-standard);
}

.preloader.dismissed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none !important;
}

.preloader-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.preloader-logo {
  width: 180px;
  height: auto;
  filter: drop-shadow(0 0 16px rgba(255, 90, 31, 0.3));
}

.preloader-rev-container {
  width: 220px;
  height: 3px;
  background-color: var(--carbon);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}

.preloader-rev-bar {
  height: 100%;
  width: 0%;
  background: var(--gradient-ignition);
  border-radius: var(--radius-pill);
  transition: width 0.2s linear;
}

.preloader-label {
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--mute);
  text-transform: uppercase;
}

/* Marquee / Ticker */
.marquee-container {
  overflow: hidden;
  width: 100%;
  background-color: var(--carbon);
  border-block: 1px solid var(--border);
  padding-block: 0.875rem;
  position: relative;
  user-select: none;
}

.marquee-container:hover .marquee-track,
.marquee-container:focus-within .marquee-track {
  animation-play-state: paused;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 28s linear infinite;
}

.marquee-content {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding-right: 2.5rem;
}

.marquee-item {
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--bone);
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.marquee-divider {
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--ignition);
  border-radius: 50%;
}

/* Headlight Reveal Signature Interaction */
.headlight-reveal-section {
  position: relative;
  width: 100%;
  min-height: 80vh;
  overflow: hidden;
  background-color: #07080B;
  display: flex;
  align-items: center;
  justify-content: center;
}

.headlight-viewport {
  position: relative;
  width: 100%;
  max-width: 1200px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  touch-action: none;
  cursor: crosshair;
}

@media (max-width: 768px) {
  .headlight-viewport {
    aspect-ratio: 4 / 5;
    cursor: default;
  }
}

.headlight-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.headlight-base-img,
.headlight-lit-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.headlight-lit-layer {
  /* Default mask setup: revealed at pointer center or auto-sweep */
  --hl-x: 50%;
  --hl-y: 50%;
  --hl-size: 260px;
  -webkit-mask-image: radial-gradient(circle var(--hl-size) at var(--hl-x) var(--hl-y), black 25%, transparent 75%);
  mask-image: radial-gradient(circle var(--hl-size) at var(--hl-x) var(--hl-y), black 25%, transparent 75%);
  transition: opacity var(--duration-ui) var(--ease-standard);
  pointer-events: none;
}

.headlight-lit-layer.lit-override {
  -webkit-mask-image: none !important;
  mask-image: none !important;
  opacity: 1 !important;
}

.headlight-ui-overlay {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 5;
  pointer-events: auto;
  background: rgba(7, 8, 11, 0.7);
  backdrop-filter: blur(8px);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

.headlight-caption {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #FFFFFF;
  letter-spacing: 0.05em;
}

/* Custom Interactive Cursor (Desktop Only) */
.custom-cursor-dot,
.custom-cursor-ring {
  display: none;
}

@media (pointer: fine) and (min-width: 1024px) {
  .custom-cursor-dot {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    background-color: var(--ignition);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s;
  }

  .custom-cursor-ring {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99998;
    transform: translate(-50%, -50%);
    transition: width 0.25s var(--ease-out), height 0.25s var(--ease-out), border-color 0.25s, background-color 0.25s;
    font-family: var(--font-display);
    font-size: 0.625rem;
    font-weight: 700;
    color: #FFFFFF;
    text-transform: uppercase;
  }

  .custom-cursor-ring.cursor-active {
    width: 64px;
    height: 64px;
    background-color: rgba(255, 90, 31, 0.15);
    border-color: var(--ignition);
  }
}

/* Reveal Observer Classes */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-reveal) var(--ease-standard), transform var(--duration-reveal) var(--ease-standard);
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Reduced Motion Accessibility Override (WCAG 2.2 AA)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .marquee-track {
    animation: none !important;
    transform: none !important;
  }

  .preloader {
    display: none !important;
  }

  .custom-cursor-dot,
  .custom-cursor-ring {
    display: none !important;
  }

  .headlight-lit-layer {
    -webkit-mask-image: none !important;
    mask-image: none !important;
    opacity: 1 !important;
  }

  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}
