/* ==========================================================================
   VELOCITY AI // MOTION, HALFTONE TEXTURE & SCROLL POP-UP STYLING
   Auto text typing · Halftone dot raster · Spring pop-up badges · 3D canvas
   ========================================================================== */

/* ==========================================================================
   1. HALFTONE SCREENTONE TEXTURES (From Halftone Design Reference 07/09)
   ========================================================================== */
.halftone-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.18;
  background-image: radial-gradient(var(--color-dark-grey) 1.5px, transparent 1.5px);
  background-size: 8px 8px;
}

.halftone-overlay-white {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.14;
  background-image: radial-gradient(var(--color-white) 1.5px, transparent 1.5px);
  background-size: 8px 8px;
}

/* Duotone / Halftone Print Registration Crosshair Marks */
.reg-mark {
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
  z-index: 10;
  opacity: 0.45;
}

.reg-mark::before,
.reg-mark::after {
  content: '';
  position: absolute;
  background: currentColor;
}

.reg-mark::before {
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  transform: translateY(-50%);
}

.reg-mark::after {
  left: 50%;
  top: 0;
  height: 100%;
  width: 1px;
  transform: translateX(-50%);
}

/* ==========================================================================
   2. AUTO TEXT TYPING ENGINE (User Request: Auto text writing)
   ========================================================================== */
.typewriter-container {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.typewriter-headline {
  font-family: var(--font-display-punch);
  font-size: clamp(1.45rem, 5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--color-white);
  display: inline;
  word-break: normal;
  overflow-wrap: break-word;
}

@media (max-width: 768px) {
  .typewriter-headline {
    font-size: clamp(1.35rem, 5.8vw, 2.1rem);
    line-height: 1.15;
  }
  .typewriter-container {
    min-height: 90px;
  }
}

.typewriter-cursor {
  display: inline-block;
  width: 0.12em;
  height: 0.9em;
  background-color: var(--color-gold);
  margin-left: 6px;
  vertical-align: middle;
  animation: cursor-blink 0.85s steps(2, start) infinite;
}

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

/* Dynamic pop-up badge upon typing completion */
.typewriter-popup-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-gold);
  color: var(--color-dark-grey);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border: 2px solid var(--color-dark-grey);
  box-shadow: 3px 3px 0px var(--color-dark-grey);
  border-radius: var(--radius-sharp);
  margin-top: var(--space-xs);
  transform: scale(0);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: left center;
}

.typewriter-popup-badge.is-popped {
  transform: scale(1) rotate(-1.5deg);
}

/* ==========================================================================
   3. SCROLL-TRIGGERED POP-UP EFFECTS (User Request: Scrolling pop-up effects)
   ========================================================================== */
/* Pop-up sticker badges */
.popup-sticker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: var(--radius-sharp);
  border: 2px solid var(--color-dark-grey);
  box-shadow: 4px 4px 0px var(--color-dark-grey);
  user-select: none;
  z-index: 20;
}

@media (max-width: 768px) {
  .popup-sticker {
    padding: 5px 10px;
    font-size: 9.5px;
    letter-spacing: 0.03em;
    box-shadow: 2px 2px 0px var(--color-dark-grey);
  }
}

.sticker-gold {
  background: var(--color-gold);
  color: var(--color-dark-grey);
}

.sticker-ocean {
  background: var(--color-ocean);
  color: var(--color-white);
  border-color: var(--color-dark-grey);
}

.sticker-white {
  background: var(--color-white);
  color: var(--color-dark-grey);
}

/* Generic scroll pop-up class */
.scroll-popup {
  will-change: transform, opacity;
}

/* Fallback pop animation when GSAP not firing */
.scroll-popup.is-popped {
  animation: spring-pop var(--duration-pop) var(--ease-spring) forwards;
}

@keyframes spring-pop {
  0% {
    transform: scale(0.7) translateY(40px);
    opacity: 0;
  }
  70% {
    transform: scale(1.06) translateY(-4px);
    opacity: 1;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}


/* ==========================================================================
   5. KINETIC TICKER STRIP
   ========================================================================== */
.ticker-strip {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  padding: 12px 0;
  background: var(--color-dark-grey);
  color: var(--color-gold);
  border-top: 2px solid var(--color-dark-grey);
  border-bottom: 2px solid var(--color-dark-grey);
  user-select: none;
}

.ticker-track {
  display: inline-flex;
  gap: var(--space-2xl);
  animation: ticker-slide 28s linear infinite;
}

.ticker-item {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
}

.ticker-item span {
  color: var(--color-white);
}

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

@media (prefers-reduced-motion: reduce) {
  .ticker-track {
    animation: none !important;
  }
}
