/* =====================================================
   EMERGENTALENTS · modern glass sobre seda líquida
   Tema: oscuro fijo (decisión de marca).
   Tipografía: Instrument Sans · Instrument Serif itálica (acentos)
               JetBrains Mono (micro-etiquetas)
   Acento único: carmín #e23b57.
   Formas: tarjetas 20px · imágenes 14px · interactivos píldora.
   Escala z: 10 nav · 20 menú móvil · 60 grano.
   ===================================================== */

:root {
  --bg: #0e0a0d;
  --text: #f2f1ef;
  --muted: #9d9aa0;
  --accent: #e23b57;
  --rose: #f2778c;
  --line: rgba(255, 255, 255, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.045);
  --glass-line: rgba(255, 255, 255, 0.12);
  --r-card: 20px;
  --r-img: 14px;
  --font-sans: "Instrument Sans", system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --pad-x: clamp(1.25rem, 5vw, 4rem);
  --measure: 54ch;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%; /* evita que iOS infle tipografías por su cuenta */
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  /* Fallback si WebGL no está disponible: degradado vino profundo */
  background:
    radial-gradient(120% 90% at 70% 10%, #2a0f18 0%, transparent 55%),
    radial-gradient(100% 80% at 10% 90%, #1d0b12 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.02rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Fondo 3D (seda líquida, WebGL) */
#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* Grano fino de textura */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
p { color: var(--muted); }

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.04;
}
h2 { font-size: clamp(2.3rem, 5vw, 4.2rem); }
h3 { font-size: 1.3rem; letter-spacing: -0.015em; }

h1 em, h2 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  background: linear-gradient(100deg, var(--accent), var(--rose));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.04em;
  white-space: nowrap; /* la frase acento salta de línea como bloque, nunca partida */
}

/* ---------- Utilidades ---------- */
.kicker {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--muted);
  margin-bottom: 1.4rem;
}

/* Panel de cristal (aprox. glassmorphism web, no Liquid Glass oficial) */
.glass {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-line);
  border-radius: var(--r-card);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 24px 60px rgba(0, 0, 0, 0.35);
}
@media (prefers-reduced-transparency: reduce) {
  .glass {
    background: rgba(24, 18, 22, 0.96);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* Borde-foco que sigue al cursor (spotlight) */
[data-spot] { overflow: hidden; }
[data-spot]::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%),
              rgba(226, 59, 87, 0.14), transparent 65%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
[data-spot]:hover::before { opacity: 1; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding: 0.85rem 2rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease),
              border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.btn:active { transform: scale(0.98); }

.btn--solid { background: var(--accent); color: #fff; }
.btn--solid:hover {
  background: #ef4b66;
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(226, 59, 87, 0.35);
}

.btn--line { border: 1px solid var(--line); color: var(--text); }
.btn--line:hover { border-color: rgba(255, 255, 255, 0.45); transform: translateY(-2px); }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 2.5rem;
  height: 68px;
  padding: 0 var(--pad-x);
  border-bottom: 1px solid transparent;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease);
}
.nav.is-scrolled {
  background: rgba(14, 10, 13, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: var(--line);
}

.nav__logo, .footer__logo {
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
}
.nav__logo span, .footer__logo span { color: var(--accent); }

.nav__links { display: flex; gap: 2.2rem; margin-left: auto; }
.nav__links a {
  font-size: 0.92rem;
  color: var(--muted);
  transition: color 0.25s var(--ease);
}
.nav__links a:hover { color: var(--text); }

.nav__cta { padding: 0.55rem 1.5rem; font-size: 0.88rem; }

.nav__burger {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
}
.nav__burger span {
  width: 24px; height: 1.5px;
  background: var(--text);
  transition: transform 0.3s var(--ease);
}
.nav__burger[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

.mobile-menu[hidden] { display: none; }
.mobile-menu {
  position: fixed;
  inset: 68px 0 auto 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.mobile-menu a {
  padding: 1.05rem var(--pad-x);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-top: 1px solid var(--line);
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  max-width: 1440px;
  margin: 0 auto;
  padding: 100px var(--pad-x) 3rem;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: clamp(2.5rem, 6vw, 6rem);
  width: 100%;
}

.hero__title {
  font-size: clamp(2.9rem, 5.6vw, 5.2rem);
  margin-bottom: 1.8rem;
}
.hero__title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.09em;
  margin-bottom: -0.09em;
}
.hero__title .line__in { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .js .hero__title .line__in { transform: translateY(115%); }
}

.hero__sub {
  max-width: 44ch;
  font-size: 1.12rem;
  margin-bottom: 2.6rem;
}

.hero__actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* Tarjetas de cifras flotantes */
.stack {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  perspective: 900px;
}
.stat-card {
  padding: 1.5rem 1.7rem;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 1.3rem;
  will-change: transform;
}
.stat-card:nth-child(1) { transform: rotate(-1.2deg); margin-right: 8%; }
.stat-card:nth-child(2) { transform: rotate(0.8deg); margin-left: 6%; }
.stat-card:nth-child(3) { transform: rotate(-0.6deg); margin-right: 4%; }

.stat-card__num {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(2.4rem, 3.6vw, 3.2rem);
  line-height: 1;
  background: linear-gradient(110deg, var(--accent), var(--rose));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  min-width: 3.2ch;
}
.stat-card p { font-size: 0.92rem; line-height: 1.5; }
.stat-card strong { color: var(--text); font-weight: 600; }

/* ---------- Secciones ---------- */
.section {
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(6rem, 11vw, 9rem) var(--pad-x) 0;
}
.section--full { max-width: none; padding-left: 0; padding-right: 0; }
.section__head { margin-bottom: clamp(2.8rem, 5.5vw, 4rem); }
.section__head--pad {
  max-width: 1440px;
  margin: 0 auto clamp(2.5rem, 5vw, 3.5rem);
  padding: 0 var(--pad-x);
}

/* ---------- Bento de servicios ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1.1rem;
}
.cell {
  padding: 2.2rem;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.8rem;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease);
}
.cell:hover { transform: translateY(-4px); border-color: rgba(226, 59, 87, 0.35); }
.cell--a, .cell--d { grid-column: span 7; }
.cell--b, .cell--c { grid-column: span 5; }
.cell p { font-size: 0.96rem; max-width: 50ch; }

.cell__ghost {
  position: absolute;
  top: 1.1rem;
  right: 1.6rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(4.5rem, 8vw, 7rem);
  line-height: 1;
  color: rgba(255, 255, 255, 0.055);
  pointer-events: none;
}

/* ---------- Talento ---------- */
.talent__nav { display: flex; gap: 0.6rem; margin-top: 1.8rem; }
.talent__arrow {
  width: 46px; height: 46px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.talent__arrow:hover { border-color: rgba(226, 59, 87, 0.5); background: rgba(226, 59, 87, 0.12); }

.talent__scroller {
  display: flex;
  gap: 1.1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 var(--pad-x) 0.5rem;
  scrollbar-width: none;
}
.talent__scroller::-webkit-scrollbar { display: none; }

.talent__card {
  position: relative;
  flex: 0 0 clamp(260px, 28vw, 360px);
  scroll-snap-align: start;
  border-radius: var(--r-img);
  overflow: hidden;
}
.talent__card img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
  width: 100%;
  filter: grayscale(1) contrast(1.05);
  transition: filter 0.5s var(--ease), transform 0.7s var(--ease);
}
@media (prefers-reduced-motion: no-preference) {
  .js .talent__card img { clip-path: inset(0 0 100% 0); }
}
.talent__card:hover img {
  transform: scale(1.04);
  filter: grayscale(0.4) contrast(1.05);
}
.talent__card figcaption {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 2.2rem 1.3rem 1.1rem;
  background: linear-gradient(to top, rgba(10, 7, 9, 0.85), transparent);
}
.talent__card strong { font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; }
.talent__card figcaption span { color: rgba(242, 241, 239, 0.75); font-size: 0.85rem; }

/* ---------- Método ---------- */
.principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
}
.principle {
  border-top: 1px solid var(--line);
  padding-top: 1.6rem;
}
.principle__num {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.14em;
  margin-bottom: 1rem;
}
.principle h3 { margin-bottom: 0.7rem; }
.principle p { font-size: 0.95rem; }

/* ---------- Proceso ---------- */
.phases {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
}
.phase {
  padding: 1.8rem;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease);
}
.phase:hover { transform: translateY(-4px); border-color: rgba(226, 59, 87, 0.35); }
.phase__num {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.9rem;
  background: linear-gradient(110deg, var(--accent), var(--rose));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.phase h3 { font-size: 1.15rem; }
.phase p { font-size: 0.9rem; }

/* ---------- Contacto ---------- */
.contact {
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(6rem, 11vw, 9rem) var(--pad-x) clamp(4rem, 8vw, 6rem);
}
.contact__big {
  display: inline-block;
  font-size: clamp(2.6rem, 7.5vw, 6rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 1.5rem 0 1.8rem;
  transition: color 0.35s var(--ease), text-shadow 0.35s var(--ease);
}
.contact__big:hover {
  color: var(--accent);
  text-shadow: 0 0 60px rgba(226, 59, 87, 0.35);
}
.contact__arrow {
  display: inline-block;
  color: var(--accent);
  transition: transform 0.35s var(--ease);
}
.contact__big:hover .contact__arrow { transform: translateX(12px); }

.contact__mail { font-size: 0.95rem; }
.contact__mail a {
  color: var(--text);
  border-bottom: 1px solid var(--accent);
  transition: color 0.25s var(--ease);
}
.contact__mail a:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 2.6rem var(--pad-x) 2rem;
  max-width: 1440px;
  margin: 0 auto;
}
.footer__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2.2rem;
}
.footer__links { display: flex; gap: 1.8rem; flex-wrap: wrap; }
.footer__links a {
  font-size: 0.88rem;
  color: var(--muted);
  transition: color 0.25s var(--ease);
}
.footer__links a:hover { color: var(--text); }

.footer__bottom { display: flex; flex-direction: column; gap: 0.4rem; }
.footer__bottom p { font-size: 0.78rem; }
.footer__legal { max-width: 76ch; }

/* ---------- Estado inicial para reveals ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal],
  .js [data-hero-item] {
    opacity: 0;
    transform: translateY(24px);
  }
  /* La inclinación base de las stat-cards se anima desde JS */
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .nav__links, .nav__cta { display: none; }
  .nav__burger { display: flex; }
  .hero__grid { grid-template-columns: 1fr; gap: 3rem; }
  .stack { max-width: 480px; }
  .principles { grid-template-columns: 1fr; gap: 2rem; }
  .phases { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  /* Hero compacto: mensaje + cifras en la primera pantalla */
  .hero { padding-top: 84px; padding-bottom: 1.6rem; }
  .hero__grid { gap: 2rem; }
  .hero__title { font-size: clamp(2.5rem, 11.5vw, 2.9rem); margin-bottom: 1.2rem; }
  .hero__sub { font-size: 1.02rem; margin-bottom: 1.6rem; }
  .btn { padding: 0.75rem 1.6rem; font-size: 0.9rem; }

  .stack { gap: 0.8rem; max-width: none; }
  .stat-card { padding: 1rem 1.2rem; gap: 1rem; }
  .stat-card__num { font-size: 1.9rem; min-width: 3ch; }
  .stat-card p { font-size: 0.85rem; }
  .stat-card:nth-child(1), .stat-card:nth-child(2), .stat-card:nth-child(3) {
    margin: 0; transform: none;
  }

  .bento { grid-template-columns: 1fr; }
  .cell--a, .cell--b, .cell--c, .cell--d { grid-column: auto; }
  .cell { min-height: 0; padding: 3rem 1.6rem 1.6rem; }
  .cell__ghost { font-size: 3.2rem; top: 0.9rem; right: 1.2rem; }

  .phases { grid-template-columns: 1fr; }
  .phase { min-height: 0; }

  .talent__card { flex-basis: 76vw; }

  .section { padding-top: 4.5rem; }
  .section__head { margin-bottom: 2.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
}
