/* ============================================
   ORB AI — Landing Page · Premium styles
   Montserrat · negro + crema + ember (naranja)
   ============================================ */

:root {
  --obs-0:    #000000;
  --obs-50:   #08080a;
  --obs-100:  #0c0c0f;
  --obs-200:  #101015;
  --obs-300:  #16161c;
  --cream:    #F5F1E8;
  --cream-200:#E8DDC4;
  --ember:    #FF7847;
  --ember-soft:#FFA37C;
  --ember-dark:#E5562A;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  cursor: none;
}

@media (max-width: 1024px) {
  body { cursor: auto; }
  .cursor-dot,
  .cursor-ring { display: none; }
}

/* ----- Custom scrollbar ----- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--obs-0); }
::-webkit-scrollbar-thumb {
  background: var(--obs-300);
  border-radius: 8px;
  border: 2px solid var(--obs-0);
}
::-webkit-scrollbar-thumb:hover { background: var(--ember-dark); }

/* ============== CUSTOM CURSOR ============== */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate3d(-50%, -50%, 0);
  transition: opacity 0.3s ease, width 0.3s ease, height 0.3s ease, border-color 0.3s ease, background 0.3s ease;
  mix-blend-mode: difference;
}
.cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--cream);
  border-radius: 50%;
}
.cursor-ring {
  width: 32px;
  height: 32px;
  border: 1px solid var(--cream);
  border-radius: 50%;
  opacity: 0.5;
}
body.cursor-hover .cursor-ring {
  width: 56px;
  height: 56px;
  opacity: 0.85;
  border-color: var(--ember);
  border-width: 1.5px;
}
body.cursor-hover .cursor-dot {
  background: var(--ember);
}

/* ============== AMBIENT BACKGROUND ============== */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.ambient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.22;
  will-change: transform;
}
.ambient-blob--1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(255, 120, 71, 0.55), transparent 70%);
  top: -200px; left: -200px;
  animation: blobFloat1 22s ease-in-out infinite;
}
.ambient-blob--2 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(245, 241, 232, 0.18), transparent 70%);
  top: 40%; right: -250px;
  animation: blobFloat2 26s ease-in-out infinite;
}
.ambient-blob--3 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255, 120, 71, 0.35), transparent 70%);
  bottom: -200px; left: 30%;
  animation: blobFloat3 30s ease-in-out infinite;
}
.ambient-blob--cta {
  position: absolute;
  width: 700px; height: 700px;
  filter: blur(150px);
  opacity: 0.25;
  background: radial-gradient(circle, rgba(255, 120, 71, 0.6), transparent 70%);
  top: -200px; right: -150px;
  border-radius: 50%;
  pointer-events: none;
}

@keyframes blobFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(80px, 60px) scale(1.1); }
  66%      { transform: translate(-40px, 100px) scale(0.95); }
}
@keyframes blobFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-100px, -80px) scale(1.15); }
}
@keyframes blobFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(60px, -80px) scale(1.05); }
}

body > *:not(.ambient-bg):not(.cursor-dot):not(.cursor-ring):not(.grain-overlay) {
  position: relative;
  z-index: 1;
}

/* ============== GRAIN TEXTURE ============== */
.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 250 250' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E");
}

/* ============== NAVBAR ============== */
.nav {
  background: rgba(8, 8, 10, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(245, 241, 232, 0.06);
  z-index: 40;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.nav.is-scrolled {
  background: rgba(8, 8, 10, 0.85);
  border-bottom-color: rgba(255, 120, 71, 0.15);
}

.link-underline {
  position: relative;
}
.link-underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 1px;
  background: var(--ember);
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.link-underline:hover::after {
  width: 100%;
}

/* Ember CTA shadow */
.shadow-ember {
  box-shadow: 0 10px 40px -12px rgba(255, 120, 71, 0.5),
              0 0 0 1px rgba(255, 120, 71, 0.1);
}

/* ============== REVEAL ANIMATIONS ============== */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 1.05s cubic-bezier(0.22, 1, 0.36, 1),
              transform 1.05s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-line {
  opacity: 0;
  transform: translateY(110%);
  display: block;
  transition: opacity 1.1s cubic-bezier(0.22, 1, 0.36, 1),
              transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal-line.is-visible {
  opacity: 1;
  transform: translateY(0);
}
h1 .reveal-line:nth-child(1),
h2 .reveal-line:nth-child(1) { transition-delay: 0.05s; }
h1 .reveal-line:nth-child(2),
h2 .reveal-line:nth-child(2) { transition-delay: 0.18s; }
h1 .reveal-line:nth-child(3),
h2 .reveal-line:nth-child(3) { transition-delay: 0.32s; }
h1 .reveal-line:nth-child(4),
h2 .reveal-line:nth-child(4) { transition-delay: 0.46s; }

/* ============== SCROLL INDICATOR ============== */
.scroll-indicator {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 22px;
  border: 1px solid currentColor;
  border-radius: 8px;
}
.scroll-indicator::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 5px;
  width: 1px;
  height: 5px;
  background: currentColor;
  transform: translateX(-50%);
  animation: scrollPulse 1.6s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: translate(-50%, 0); }
  50%      { opacity: 1; transform: translate(-50%, 6px); }
}

/* ============== MARQUEE LOGOS ============== */
/* Técnica correcta: invert + mix-blend-mode lighten
   El blanco invertido se vuelve negro y el blend lo descarta sobre el bg oscuro,
   dejando solo el logo visible. Para logos que YA son blancos (Terra), usamos
   .is-white para saltarse el invert. */
.marquee {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 0;
  width: max-content;
  animation: marqueeScroll 55s linear infinite;
}
.marquee:hover .marquee-track {
  animation-play-state: paused;
}
.marquee-item {
  flex-shrink: 0;
  height: 70px;
  padding: 0 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s ease;
}

/* Logos oscuros sobre fondo blanco (mayoría: JPGs y PNGs como HubSpot, BMW, etc.) */
.marquee-item img {
  height: 100%;
  width: auto;
  max-width: 170px;
  object-fit: contain;
  filter: invert(1) brightness(1.1) contrast(1.05);
  mix-blend-mode: lighten;
  opacity: 0.8;
  transition: opacity 0.4s ease, transform 0.4s ease, filter 0.4s ease;
}
.marquee-item:hover img {
  opacity: 1;
  transform: scale(1.08);
  filter: invert(1) brightness(1.2) contrast(1.1) sepia(0.4) saturate(3) hue-rotate(335deg);
}

/* Logos que YA son blancos sobre transparente (Terra, etc.): no invertir */
.marquee-item.is-white img {
  filter: brightness(1.05);
  mix-blend-mode: normal;
}
.marquee-item.is-white:hover img {
  filter: brightness(1.05) sepia(0.4) saturate(3) hue-rotate(335deg);
}

/* Separador vertical naranja sutil */
.marquee-sep {
  flex-shrink: 0;
  display: inline-block;
  width: 1px;
  height: 28px;
  background: linear-gradient(180deg, transparent, rgba(255, 120, 71, 0.5), transparent);
}

@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ============== AGENT CARDS (Sección "Revoluciona tu industria") ============== */
.agent-card {
  position: relative;
  transition: background-color 0.5s ease;
  overflow: hidden;
}
.agent-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255, 120, 71, 0.08), transparent 60%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.agent-card:hover {
  background-color: var(--obs-200) !important;
}
.agent-card:hover::before {
  opacity: 1;
}

.agent-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 120, 71, 0.08);
  border: 1px solid rgba(255, 120, 71, 0.25);
  color: var(--ember);
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.4s ease;
}
.agent-icon svg {
  width: 26px;
  height: 26px;
}
.agent-card:hover .agent-icon {
  background: rgba(255, 120, 71, 0.18);
  border-color: rgba(255, 120, 71, 0.55);
  transform: scale(1.05) rotate(-3deg);
}
.agent-icon--featured {
  background: linear-gradient(135deg, rgba(255, 120, 71, 0.25), rgba(255, 120, 71, 0.08));
  border-color: rgba(255, 120, 71, 0.5);
}

.agent-card--featured {
  position: relative;
}
.agent-card--featured::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  height: 40px;
  width: 1px;
  background: linear-gradient(180deg, var(--ember), transparent);
}

/* ============== STAGE CARDS ============== */
.stage-card {
  transition: background-color 0.5s ease;
}
.stage-card:hover {
  background-color: var(--obs-200) !important;
}

/* ============== RESULT CARDS ============== */
.result-card {
  position: relative;
}
.result-card__inner {
  background: linear-gradient(180deg, var(--obs-100), var(--obs-50));
  border: 1px solid rgba(245, 241, 232, 0.08);
  border-radius: 16px;
  padding: 24px;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.4s ease,
              box-shadow 0.5s ease;
  height: 100%;
}
.result-card:hover .result-card__inner {
  transform: translateY(-6px);
  border-color: rgba(255, 120, 71, 0.35);
  box-shadow: 0 30px 60px -30px rgba(255, 120, 71, 0.3);
}
.result-card--highlight .result-card__inner {
  border-color: rgba(255, 120, 71, 0.4);
  background: linear-gradient(180deg, rgba(255, 120, 71, 0.1), var(--obs-50));
  box-shadow: 0 0 80px -20px rgba(255, 120, 71, 0.35);
}
.result-card--highlight:hover .result-card__inner {
  border-color: rgba(255, 120, 71, 0.7);
  box-shadow: 0 0 100px -10px rgba(255, 120, 71, 0.5);
}
.result-card img {
  background: #fff;
  padding: 12px;
}

/* ============== FOCUS ACCESSIBILITY ============== */
:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 4px;
  border-radius: 6px;
}

/* ============== REDUCED MOTION ============== */
@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;
  }
  .reveal, .reveal-line {
    opacity: 1 !important;
    transform: none !important;
  }
  .ambient-blob, .marquee-track {
    animation: none !important;
  }
}

/* ============== UTILITIES ============== */
.text-balance { text-wrap: balance; }

/* Overrides finos para Montserrat (extra-bold se ve mejor en titulares) */
h1, h2, h3 {
  font-family: 'Montserrat', system-ui, sans-serif;
  letter-spacing: -0.025em;
}

/* Italic accent — Montserrat italic con peso liviano se ve editorial */
em, .italic {
  font-style: italic;
  font-family: 'Montserrat', system-ui, sans-serif;
}
