/**
 * TrustClarity Animation Library
 * Reusable keyframes, scroll reveal, ticker, orbs, card lifts, badges
 * Scoped with .js-enabled for no-JS safety on reveal utilities
 */

/* ═══════════════════════════════════════════════════════
   A — Keyframes
   ═══════════════════════════════════════════════════════ */

@keyframes tc-fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes tc-fade-right {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

@keyframes tc-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.95); }
}

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

@keyframes tc-float-up {
  0%   { opacity: 0; transform: translateY(20px) scale(0.5); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-90px) scale(1.1) rotate(25deg); }
}

@keyframes tc-row-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes tc-tag-in {
  from { opacity: 0; transform: scale(0.8) translateY(4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes tc-lens-float {
  0%   { transform: translate(0, 0) rotate(0deg); }
  30%  { transform: translate(14px, 8px) rotate(5deg); }
  60%  { transform: translate(20px, -4px) rotate(-3deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes tc-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes tc-panel-enter {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes tc-panel-exit-up {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-14px); }
}

@keyframes tc-modal-slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════
   B — Scroll Reveal (.js-enabled scoped for no-JS safety)
   ═══════════════════════════════════════════════════════ */

.js-enabled .tc-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.js-enabled .tc-reveal-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.tc-reveal.tc-revealed,
.tc-reveal-right.tc-revealed {
  opacity: 1;
  transform: none;
}

.tc-reveal-delay-100 { transition-delay: 0.1s; }
.tc-reveal-delay-200 { transition-delay: 0.2s; }
.tc-reveal-delay-300 { transition-delay: 0.3s; }
.tc-reveal-delay-400 { transition-delay: 0.4s; }
.tc-reveal-delay-500 { transition-delay: 0.5s; }

/* ═══════════════════════════════════════════════════════
   C — Infinite Brand Ticker
   ═══════════════════════════════════════════════════════ */

/* Section wrapper: py-12, border-y, bg-secondary/20 */
.explore-sec {
  padding: 48px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(177, 211, 228, 0.2);
}

/* "Trusted by Industry Leaders" label above ticker */
.tc-ticker-label {
  text-align: center;
  padding: 0;
  margin-bottom: 32px;
  background: transparent;
  border: none;
}

.tc-ticker-label p {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

/* Ticker content area */
.tc-ticker-section {
  overflow: hidden;
  position: relative;
}

.tc-ticker-wrap {
  overflow: hidden;
  position: relative;
}

.tc-ticker-wrap:hover .tc-ticker-track {
  animation-play-state: paused;
}

.tc-ticker-track {
  display: flex;
  animation: tc-scroll 40s linear infinite;
  white-space: nowrap;
  width: max-content;
}

.tc-ticker-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 200px;
  z-index: 2;
  pointer-events: none;
}

/* Match explore-sec background (rgba(177,211,228,0.2) over white ≈ #f0f7fb) */
.tc-ticker-fade--left {
  left: 0;
  background: linear-gradient(to right, #f0f7fb 0%, rgba(240, 247, 251, 0.6) 40%, transparent 100%);
}

.tc-ticker-fade--right {
  right: 0;
  background: linear-gradient(to left, #f0f7fb 0%, rgba(240, 247, 251, 0.6) 40%, transparent 100%);
}

.tc-ticker-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 220px;
  min-width: 220px;
  padding: 0 28px;
  font-size: 18px;
  font-weight: 700;
  opacity: 0.5;
  transition: opacity 0.2s ease;
  text-decoration: none;
}

.tc-ticker-item:hover {
  opacity: 1;
}

.tc-ticker-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
  filter: grayscale(100%);
  transition: filter 0.3s ease;
  display: block;
}

.tc-ticker-item:hover img {
  filter: grayscale(100%);
}

/* Corning: ensure full logo visible, no clipping */
.tc-ticker-item--corning {
  overflow: visible;
  max-height: 100%;
}
.tc-ticker-item--corning img {
  max-width: 100%;
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

/* OFS: transparent SVG — standard ticker styling */
.tc-ticker-item--ofs img {
  object-fit: contain;
  object-position: center;
}

/* ═══════════════════════════════════════════════════════
   D — Background Patterns
   ═══════════════════════════════════════════════════════ */

/* SVG grid overlay — from Trust-clarity-redesign DESIGN_SYSTEM.md */
.tc-bg-grid {
  position: relative;
}

.tc-bg-grid::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M0 32V.5H32' fill='none' stroke='%231a2d57' stroke-width='0.5'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
}

.tc-bg-grid > * {
  position: relative;
  z-index: 1;
}

/* White dot mesh (for dark sections) */
.tc-bg-dots {
  position: relative;
}

.tc-bg-dots::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Ccircle cx='1' cy='1' r='1' fill='white'/%3E%3C/svg%3E");
  opacity: 0.10;
  pointer-events: none;
  z-index: 0;
}

.tc-bg-dots > * {
  position: relative;
  z-index: 1;
}

/* Reusable decorative orb */
.tc-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  animation: tc-pulse 4s ease-in-out infinite;
}

.tc-orb-accent {
  background: rgba(10, 172, 228, 0.07);
  width: 400px;
  height: 400px;
}

.tc-orb-navy {
  background: rgba(26, 45, 87, 0.06);
  width: 400px;
  height: 400px;
}

.tc-orb--top-right {
  top: -80px;
  right: -80px;
}

.tc-orb--value-accent {
  top: -60px;
  right: -60px;
}

.tc-orb--value-navy {
  bottom: -80px;
  left: -60px;
}

/* ═══════════════════════════════════════════════════════
   E — Card Hover Lift Utilities
   ═══════════════════════════════════════════════════════ */

.tc-card-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.tc-card-lift:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow:
    0 20px 40px rgba(26, 45, 87, 0.12),
    0 0 0 1px rgba(10, 172, 228, 0.2);
}

.tc-icon-animate {
  transition: transform 0.3s ease;
}

.tc-card-lift:hover .tc-icon-animate {
  transform: scale(1.1) rotate(6deg);
}

/* ═══════════════════════════════════════════════════════
   F — Live Badge with Pulse Dot
   ═══════════════════════════════════════════════════════ */

.tc-badge-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid rgba(10, 172, 228, 0.5);
  color: var(--accent-text);
  background: rgba(10, 172, 228, 0.07);
  font-family: var(--font-body);
  margin-bottom: 12px;
}

.tc-badge-live .tc-pulse-dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: tc-blink 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════
   G — prefers-reduced-motion Overrides
   ═══════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .js-enabled .tc-reveal,
  .js-enabled .tc-reveal-right {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .tc-ticker-track,
  .tc-orb {
    animation: none;
  }

  .tc-card-lift {
    transition: box-shadow 0.1s;
  }

  .tc-card-lift:hover {
    transform: none;
  }

  .tc-badge-live .tc-pulse-dot {
    animation: none;
  }
}
