/* Estilos de las páginas de servicios. Mismos tokens que index.html. */
@font-face {
  font-family: 'Raleway'; font-style: normal; font-weight: 700 800; font-display: swap;
  src: url('/fonts/raleway.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans'; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url('/fonts/dm-sans.woff2') format('woff2');
}

:root {
  --bg: #0a0a0a;
  --bg2: #111111;
  --bg3: #161616;
  --border: #222222;
  --accent: #9b8fff;
  --accent2: #7655f8;
  --accent-strong: #6846ec;
  --text: #f0f0f0;
  --text-muted: #a0a0a0;
  --text-dim: #808080;
  --white: #ffffff;
  --wa: #0f8243;
  --wa-strong: #0c6f39;
  --surface-glass: rgba(10,10,10,0.92);
  --gutter: max(5%, 20px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--accent2); color: var(--white); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; }
a { color: inherit; }

/* ── NAV ── */
nav {
  position: sticky; top: 0; z-index: 100;
  height: 64px;
  padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 28px;
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-logo { display: flex; align-items: center; min-height: 44px; margin-right: auto; }
.nav-logo img { height: 48px; width: auto; display: block; }
.nav-links { display: flex; gap: 28px; list-style: none; }
.nav-links a {
  display: block;
  padding: 12px 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--white); }
.btn-nav {
  background: var(--accent2);
  color: var(--white);
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-nav:hover { background: var(--accent-strong); }

/* ── BOTONES ── */
.btn-primary, .btn-wa, .btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px;
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease-out);
}
.btn-primary { background: var(--accent2); color: var(--white); }
.btn-primary:hover { background: var(--accent-strong); transform: translateY(-2px); }
.btn-wa { background: var(--wa); color: var(--white); }
.btn-wa:hover { background: var(--wa-strong); transform: translateY(-2px); }
.btn-outline { border: 1px solid var(--border); color: var(--text); font-weight: 400; }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btns { display: flex; gap: 14px; flex-wrap: wrap; }

/* ── ESTRUCTURA ── */
section { padding: 88px var(--gutter); }
.inner { max-width: 1100px; margin: 0 auto; }
.alt { background: var(--bg2); border-block: 1px solid var(--border); }

.crumbs {
  display: flex; flex-wrap: wrap; gap: 8px;
  list-style: none;
  margin-bottom: 28px;
  font-size: 0.8rem;
  color: var(--text-dim);
}
.crumbs li + li::before { content: '/'; margin-right: 8px; }
.crumbs a { color: var(--text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

.hero {
  padding-top: 64px;
  background: radial-gradient(ellipse 60% 70% at 85% 30%, color-mix(in srgb, var(--accent2) 12%, transparent) 0%, transparent 70%);
}
h1 {
  font-family: 'Raleway', sans-serif;
  font-weight: 800;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--white);
  max-width: 820px;
  margin-bottom: 24px;
}
h1 em { font-style: normal; color: var(--accent); }
.lead {
  max-width: 600px;
  margin-bottom: 40px;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-muted);
}
.facts {
  display: flex; flex-wrap: wrap; gap: 12px 32px;
  list-style: none;
  margin-top: 48px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.facts strong { display: block; font-family: 'Raleway', sans-serif; font-size: 1.4rem; color: var(--white); }

h2 {
  font-family: 'Raleway', sans-serif;
  font-weight: 800;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--white);
  margin-bottom: 16px;
}
.sub { max-width: 620px; margin-bottom: 48px; color: var(--text-muted); line-height: 1.7; }

/* ── TARJETAS ── */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.card {
  padding: 28px 24px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.alt .card { background: var(--bg); }
.card h3 {
  font-family: 'Raleway', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}
.card p { font-size: 0.875rem; line-height: 1.6; color: var(--text-muted); }

/* ── EJEMPLOS ── */
.reels { display: grid; grid-template-columns: repeat(3, minmax(0, 260px)); gap: 16px; }
.reels figure { margin: 0; }
.reels video {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.reels figcaption { margin-top: 10px; font-size: 0.8rem; color: var(--text-dim); }
.more-link { display: inline-block; margin-top: 32px; padding: 12px 0; color: var(--accent); font-weight: 500; text-decoration: none; }
.more-link:hover { text-decoration: underline; }

/* ── PROCESO ── */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; list-style: none; counter-reset: paso; }
.steps li { counter-increment: paso; }
.steps li::before {
  content: '0' counter(paso);
  display: block;
  margin-bottom: 12px;
  font-family: 'Raleway', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
}
.steps h3 { font-family: 'Raleway', sans-serif; font-size: 1rem; color: var(--white); margin-bottom: 6px; }
.steps p { font-size: 0.875rem; color: var(--text-muted); }

/* ── FAQ ── */
.faq { display: flex; flex-direction: column; gap: 4px; max-width: 760px; }
.faq details { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; }
.alt .faq details { background: var(--bg); }
.faq details[open] { border-color: var(--accent2); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 22px;
  font-weight: 500;
  color: var(--white);
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.4rem; line-height: 1; color: var(--accent); }
.faq details[open] summary::after { content: '–'; }
.faq p { padding: 0 22px 18px; font-size: 0.9rem; line-height: 1.7; color: var(--text-muted); }

/* ── CIERRE ── */
.cta { text-align: center; }
.cta .sub { margin-inline: auto; }
.cta .btns { justify-content: center; }
.others { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; }
.others a {
  display: block;
  padding: 14px 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.others a:hover { border-color: var(--accent); color: var(--accent); }

footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
  padding: 36px var(--gutter) calc(36px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
}
.foot-links { display: flex; flex-wrap: wrap; gap: 0 16px; }
footer a { display: inline-block; padding: 12px 0; color: var(--text-dim); text-decoration: none; }
footer a:hover { color: var(--accent); }

.wa-float {
  position: fixed;
  right: 20px; bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 99;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: var(--wa);
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}
.wa-float:hover { background: var(--wa-strong); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-logo img { height: 34px; }
  .cards { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; row-gap: 36px; }
}
@media (max-width: 600px) {
  section { padding-block: 64px; }
  .hero { padding-top: 40px; }
  .cards { grid-template-columns: 1fr; }
  .reels { grid-template-columns: repeat(3, 72vw); overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
  .reels figure { scroll-snap-align: center; }
  .btns > a { flex: 1 1 100%; }
}
@media (hover: none) {
  .btn-primary:hover, .btn-wa:hover { transform: none; }
}
/* ── MOTION (mismo lenguaje que la página principal) ── */
/* El scroll se lee como un timeline: la línea del nav es el playhead */
.scroll-progress {
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  pointer-events: none;
}
.btn-primary svg, .btn-wa svg { transition: transform 0.25s var(--ease-out); }
.card, .faq details { transition: border-color 0.25s, background 0.25s; }
@media (hover: hover) {
  .card:hover { border-color: var(--accent2); background: var(--bg3); }
}

@keyframes rise-in { from { opacity: 0; transform: translateY(24px); } }

@media (prefers-reduced-motion: no-preference) {
  .js .fade-up {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  }
  .js .fade-up.visible { opacity: 1; transform: none; }

  /* Titulares: cada palabra entra con desenfoque */
  .js .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(0.45em);
    filter: blur(6px);
    transition: opacity 0.6s var(--ease-out), transform 0.7s var(--ease-out), filter 0.6s var(--ease-out);
    transition-delay: calc(var(--w, 0) * 45ms);
  }
  .js .in .word { opacity: 1; transform: none; filter: none; }

  /* Listas: los items entran uno tras otro */
  .js .stagger > * { opacity: 0; }
  .js .stagger.visible > * {
    opacity: 1;
    animation: rise-in 0.7s var(--ease-out) backwards;
    animation-delay: calc(var(--i, 0) * 70ms);
  }

  /* Hero: secuencia de entrada */
  .crumbs { animation: rise-in 0.6s var(--ease-out) backwards; }
  .lead { animation: rise-in 0.7s var(--ease-out) 0.35s backwards; }
  .hero .btns { animation: rise-in 0.7s var(--ease-out) 0.45s backwards; }
  .facts { animation: rise-in 0.7s var(--ease-out) 0.55s backwards; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ── VIDEOS DE YOUTUBE (se cargan al tocar) ── */
.sub a { color: var(--accent); }
.yt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 24px 16px; }
.yt-grid figure, .yt-case figure { margin: 0; }
.yt {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.yt-v { aspect-ratio: 9 / 16; }
.yt img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s var(--ease-out); }
.yt-play {
  position: absolute; left: 50%; top: 50%;
  width: 64px; height: 44px;
  transform: translate(-50%, -50%);
  background: rgba(10,10,10,0.8);
  border-radius: 12px;
  transition: background 0.2s;
}
.yt-play::after {
  content: '';
  position: absolute; left: 26px; top: 13px;
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent var(--white);
}
a.yt:hover .yt-play { background: var(--accent2); }
@media (hover: hover) { a.yt:hover img { transform: scale(1.03); } }
iframe.yt { border: 1px solid var(--border); }
.yt-grid figcaption, .yt-case figcaption { margin-top: 10px; font-size: 0.8rem; color: var(--text-dim); }
.yt-grid figcaption strong, .yt-case figcaption strong { display: block; margin-bottom: 2px; font-size: 0.9rem; font-weight: 500; color: var(--text); }

.yt-case {
  display: grid; grid-template-columns: 1fr 1.6fr; gap: 32px; align-items: center;
  margin-top: 48px;
  padding: 32px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
}
.yt-case h3 { font-family: 'Raleway', sans-serif; font-size: 1.3rem; line-height: 1.25; color: var(--white); margin-bottom: 12px; }
.yt-case p { font-size: 0.9rem; color: var(--text-muted); }
.yt-case-media { display: grid; grid-template-columns: 2.2fr 1fr; gap: 16px; align-items: start; }
.yt-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .yt-case { grid-template-columns: 1fr; padding: 24px 20px; }
  .yt-grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .yt-grid-4 { grid-template-columns: 1fr; }
  .yt-case-media { grid-template-columns: 1fr; gap: 24px; }
  .yt-case-media figure:last-child { width: 60%; }
}
