/* ═══════════════════════════════════════════════════════
   INSANITY MEDIA — Premium Visual Layer v2.0
   Capa de mejoras: Custom Cursor · Card Tilt Glare ·
   Hero Visual Upgrades · Nav Dark Mode · Split Text
   ═══════════════════════════════════════════════════════ */

/* ─── CUSTOM CURSOR ─── */
#im-cursor {
  position: fixed;
  top: 0; left: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
#im-cursor.visible { opacity: 1; }

.cursor-dot {
  position: absolute;
  width: 6px; height: 6px;
  background: #ffffff;
  border-radius: 50%;
  top: 0; left: 0;
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, height 0.2s ease, background 0.2s ease;
  will-change: transform;
}
.cursor-ring {
  position: absolute;
  width: 38px; height: 38px;
  border: 1.5px solid rgba(255,255,255,0.5);
  border-radius: 50%;
  top: 0; left: 0;
  transform: translate(-50%, -50%);
  transition: width 0.35s cubic-bezier(.22,.68,0,1.2),
              height 0.35s cubic-bezier(.22,.68,0,1.2),
              border-color 0.3s ease,
              background 0.3s ease;
  will-change: transform;
}
.cursor-label {
  position: absolute;
  top: 0; left: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  background: rgba(0,0,0,0.7);
  padding: 3px 6px;
  backdrop-filter: blur(4px);
}
#im-cursor.has-label .cursor-label { opacity: 1; }

/* Hover state: ring crece */
#im-cursor.hover .cursor-ring {
  width: 58px; height: 58px;
  border-color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.04);
}
#im-cursor.hover .cursor-dot {
  width: 4px; height: 4px;
  background: rgba(255,255,255,0.6);
}

/* Press state */
#im-cursor.pressed .cursor-ring {
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.15);
}

/* Ocultar cursor nativo solo en desktop */
@media (pointer: fine) {
  html, body, a, button, input, select, textarea, [role="button"] {
    cursor: none !important;
  }
}

/* ─── HERO VISUAL UPGRADES ─── */

/* Glow pulsante detrás del logo */
.hero-logo-glow {
  position: absolute;
  width: 700px; height: 300px;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.06) 0%, transparent 70%);
  pointer-events: none;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: glow-pulse 4s ease-in-out infinite;
  z-index: 0;
}
@keyframes glow-pulse {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  50%       { opacity: 1;   transform: translate(-50%, -50%) scale(1.08); }
}

/* Logo wrap posicionamiento correcto */
.hero-logo-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.hero-logo {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 60px rgba(255,255,255,0.08));
  transition: filter 0.5s ease;
}
.hero-logo:hover {
  filter: drop-shadow(0 0 80px rgba(255,255,255,0.15));
}

/* Hero v2 vertical layout mejorado */
.hero-v2 {
  gap: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.025) 0%, transparent 60%),
              #0a0a0a;
  text-align: center;
}

/* Hero claim: clip reveal */
.word-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  line-height: 1.1;
  margin-right: 0.2em;
}
.word-inner {
  display: inline-block;
}

/* Hero claim styling (el h1) */
.hero-claim {
  font-family: 'Anton', sans-serif;
  font-size: clamp(36px, 5.5vw, 80px);
  text-transform: uppercase;
  line-height: 1;
  letter-spacing: 0.01em;
  margin-bottom: 20px;
  background: linear-gradient(180deg, #ffffff 40%, #888888 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-claim .accent-line {
  background: linear-gradient(180deg, #ffffff, #aaaaaa 60%, #555);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}
.hero-sub {
  font-size: clamp(15px, 1.4vw, 18px);
  color: #888;
  max-width: 580px;
  margin: 0 auto 40px;
  line-height: 1.65;
}

/* Hero logo rule (línea divisoria) */
.hero-logo-rule {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.1) 30%, rgba(255,255,255,0.25) 50%, rgba(255,255,255,0.1) 70%, transparent 100%);
  margin-top: 32px;
  margin-bottom: 32px;
}

/* Hero metrics refinados */
.hero-metrics {
  display: flex;
  gap: 48px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.hero-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  padding: 16px 24px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.02);
  backdrop-filter: blur(6px);
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
  min-width: 90px;
}
.hero-metric:hover {
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.05);
  transform: translateY(-3px);
}
.hero-metric-platform svg { width: 18px; height: 18px; color: rgba(255,255,255,0.4); }
.hero-metric-num {
  font-family: 'Anton', sans-serif;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1;
  background: linear-gradient(180deg, #fff, #aaa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-metric-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #666;
}

/* Hero CTAs */
.hero-ctas {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(.22,.68,0,1.2), background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
  will-change: transform;
}
.hero-cta.primary {
  background: #fff;
  color: #000;
  border: 1px solid #fff;
}
.hero-cta.primary:hover {
  background: rgba(255,255,255,0.88);
  box-shadow: 0 8px 32px rgba(255,255,255,0.15);
}
.hero-cta.ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
}
.hero-cta.ghost:hover {
  border-color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.04);
}
.hero-cta svg { width: 16px; height: 16px; transition: transform 0.25s ease; }
.hero-cta:hover svg { transform: translateX(4px); }

/* Hero footer meta */
.hero-footer-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}
.hero-footer-meta strong { color: rgba(255,255,255,0.55); }
.hero-footer-meta .pipe {
  width: 1px; height: 12px;
  background: rgba(255,255,255,0.12);
}

/* ─── CARD GLARE EFFECT ─── */
.service, .industry-card {
  --glare-x: 50%;
  --glare-y: 50%;
}
.service::before,
.industry-card::before {
  background:
    radial-gradient(circle at var(--glare-x) var(--glare-y), rgba(255,255,255,0.07) 0%, transparent 55%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.015) 0px, rgba(255,255,255,0.015) 1px, transparent 1px, transparent 3px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.015) 0px, rgba(255,255,255,0.015) 1px, transparent 1px, transparent 3px) !important;
}
.service.tilting, .industry-card.tilting {
  z-index: 5;
}

/* ─── NAV DARK MODE (cuando está sobre secciones oscuras) ─── */
nav.over-dark {
  background: rgba(10,10,10,0.92) !important;
  border-bottom-color: rgba(255,255,255,0.07) !important;
  color: #fff !important;
}
nav.over-dark .nav-links > a,
nav.over-dark .nav-links > .nav-dropdown > a {
  color: rgba(255,255,255,0.8) !important;
}
nav.over-dark .nav-links > a:hover {
  color: #fff !important;
}
nav.over-dark .nav-links > a::after {
  background: #fff !important;
}
nav.over-dark .nav-cta {
  background: #fff !important;
  color: #000 !important;
  border-color: #fff !important;
}
nav.over-dark .nav-cta:hover {
  background: transparent !important;
  color: #fff !important;
}
nav.over-dark .nav-mobile-toggle {
  color: #fff !important;
}
nav.over-dark .theme-toggle {
  color: #fff !important;
  border-color: rgba(255,255,255,0.2) !important;
}
nav.over-dark .nav-brand-logo {
  filter: invert(1) brightness(2);
}

/* ─── HERO EYEBROW ─── */
.hero-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 40px;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 8px 18px;
  backdrop-filter: blur(4px);
  background: rgba(255,255,255,0.02);
}
.hero-eyebrow .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(255,255,255,0.8);
}

/* ─── MARQUEE VELOCITY STATE ─── */
.marquee-track.velocity-fast { opacity: 0.85; }

/* ─── SECTION TITLE REFINAMIENTO ─── */
.section-title {
  font-family: 'Anton', sans-serif;
  font-size: clamp(40px, 5.5vw, 80px);
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.005em;
  margin-bottom: 24px;
  color: var(--text);
}

/* ─── FEATURED SERVICE CARD ─── */
.featured-service-card {
  position: relative;
  overflow: hidden;
}
.featured-service-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 50%);
  pointer-events: none;
  transition: opacity 0.3s ease;
  opacity: 0;
}
.featured-service-card:hover::after { opacity: 1; }

/* ─── PROCESS STEP HOVER ─── */
.process-step {
  transition: border-color 0.3s ease, background 0.3s ease;
}
.process-step:hover {
  border-color: rgba(255,255,255,0.15) !important;
  background: rgba(255,255,255,0.025) !important;
}

/* ─── INDUSTRY CARD REFINAMIENTO ─── */
.industry-card {
  transition: transform 0.3s cubic-bezier(.22,.68,0,1.2),
              border-color 0.3s ease,
              background 0.3s ease,
              box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}
.industry-card::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
  transition: left 0.6s ease;
  pointer-events: none;
}
.industry-card:hover::after {
  left: 150%;
}

/* ─── SCROLL PROGRESS BAR ─── */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,0.2), rgba(255,255,255,0.8), rgba(255,255,255,0.2));
  z-index: 10000;
  width: 0%;
  transition: width 0.05s linear;
  pointer-events: none;
}

/* ─── RESPONSIVO: ocultar cursor en touch ─── */
@media (pointer: coarse) {
  #im-cursor { display: none !important; }
}

/* ─── REDUCE MOTION: apagar todo lo cinético ─── */
@media (prefers-reduced-motion: reduce) {
  .hero-logo-glow { animation: none; opacity: 0.4; }
  .industry-card::after { display: none; }
  nav { transition: none !important; }
}
