/* ============================================================
   VECTORYAL — Tokens v2 + librería de efectos (fx-*)
   - Solo transform / opacity (y filter en el reveal): sin layout.
   - Todo respeta prefers-reduced-motion.
   - Se carga únicamente en las páginas rediseñadas; el resto del
     sitio (landings de ciudad, servicio×ciudad…) no cambia.
   ============================================================ */

/* ── 1. TOKENS ─────────────────────────────────────────────── */
:root {
  --vy-ink: #09101f;
  --vy-ink-2: #475166;
  --vy-mute: #94a3b8;
  --vy-bg: #fff;
  --vy-bg-soft: #f7f7fb;
  --vy-dark-2: #0b1224;
  --vy-line: rgb(9 16 31 / 8%);
  --vy-line-dark: rgb(255 255 255 / 8%);
  --vy-r-sm: 10px;
  --vy-r-md: 16px;
  --vy-r-lg: 24px;
  --vy-r-xl: 32px;
  --vy-shadow-1: 0 1px 2px rgb(9 16 31 / 4%), 0 8px 24px rgb(9 16 31 / 6%);
  --vy-shadow-2: 0 2px 4px rgb(9 16 31 / 4%), 0 24px 64px rgb(37 99 235 / 10%);
  --vy-ease: cubic-bezier(.22, 1, .36, 1);
  --vy-dur: 480ms;
  --vy-mono: ui-monospace, "JetBrains Mono", sfmono-regular, menlo, consolas, monospace;
}

/* Los nombres --vy-blue/cyan/indigo/dark ya existen en main.css con otros
   valores y los usan ~830 páginas. Los valores del brief se aplican SOLO
   dentro de las secciones nuevas (.vy-x) para no alterar el resto. */
.vy-x {
  --vy-blue: #2563eb;
  --vy-cyan: #0ea5e9;
  --vy-indigo: #6366f1;
  --vy-dark: #07070f;
  --vy-grad: linear-gradient(120deg, #0ea5e9 0%, #2563eb 70%);
}

/* ── 2. VIEW TRANSITIONS (navegadores compatibles) ─────────── */
@view-transition { navigation: auto; }

/* ── 3. PRIMITIVAS DE SECCIÓN ──────────────────────────────── */
.vy-x { color: var(--vy-ink); }
/* los títulos heredan el color de su sección (main.css pinta h1-h4 en claro
   para el tema oscuro antiguo) */
.vy-x :is(h1, h2, h3, h4) { color: inherit; }

.vx-section { padding: 144px 24px; position: relative; }
.vx-section--soft { background: var(--vy-bg-soft); }
.vx-section--dark { background: var(--vy-dark); color: #fff; }
.vx-wrap { max-width: 1200px; margin: 0 auto; }
.vx-wrap--wide { max-width: 1320px; }

.vx-eyebrow {
  display: inline-block; font-family: var(--vy-mono); font-size: .75rem; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--vy-blue); margin: 0 0 16px;
}
.vx-section--dark .vx-eyebrow { color: #7dd3fc; }

.vx-h2 {
  font-size: clamp(2rem, 4.2vw, 3.1rem); font-weight: 700; letter-spacing: -.04em;
  line-height: 1.08; margin: 0 0 20px; color: inherit; text-wrap: balance;
}
.vx-lead { font-size: 1.125rem; line-height: 1.6; color: var(--vy-ink-2); max-width: 680px; margin: 0; }
.vx-section--dark .vx-lead { color: #a8b3c7; }
.vx-head { margin-bottom: 56px; }
.vx-head--center { text-align: center; }
.vx-head--center .vx-lead { margin: 0 auto; }

.vx-grad {
  background: var(--vy-grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--vy-blue);
}
.vx-section--dark .vx-grad { background: linear-gradient(120deg, #7dd3fc 0%, #93c5fd 60%, #a5b4fc 100%); -webkit-background-clip: text; background-clip: text; }

.vx-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 14px 24px; border-radius: 999px;
  font-weight: 600; font-size: 1rem; text-decoration: none; line-height: 1.2;
  transition: transform .25s var(--vy-ease), box-shadow .25s var(--vy-ease), background-color .25s;
}
.vx-btn:focus-visible { outline: 3px solid #93c5fd; outline-offset: 3px; }
.vx-btn--primary { background: var(--vy-blue); color: #fff; box-shadow: 0 6px 18px rgb(37 99 235 / 28%); }
.vx-btn--primary:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgb(37 99 235 / 36%); background: #1d4ed8; color: #fff; }
.vx-btn--ghost { background: transparent; color: var(--vy-ink); box-shadow: inset 0 0 0 1px rgb(9 16 31 / 16%); }
.vx-btn--ghost:hover { box-shadow: inset 0 0 0 1px var(--vy-blue); color: var(--vy-blue); }
.vx-section--dark .vx-btn--ghost { color: #fff; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 24%); }
.vx-section--dark .vx-btn--ghost:hover { color: #fff; box-shadow: inset 0 0 0 1px #7dd3fc; }
.vx-btns { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.vx-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  font-size: .85rem; font-weight: 500; color: var(--vy-ink-2); background: #fff;
  box-shadow: inset 0 0 0 1px var(--vy-line);
}
.vx-chip--mono { font-family: var(--vy-mono); font-size: .75rem; letter-spacing: .02em; }
.vx-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.vx-ico { width: 22px; height: 22px; stroke: currentcolor; stroke-width: 1.5; fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.vx-card {
  position: relative; background: #fff; border-radius: var(--vy-r-lg); padding: 32px;
  box-shadow: inset 0 0 0 1px var(--vy-line), var(--vy-shadow-1);
}
.vx-section--dark .vx-card { background: rgb(255 255 255 / 3%); box-shadow: inset 0 0 0 1px var(--vy-line-dark); }

.vx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 768px) {
  .vx-section { padding: 88px 16px; }
  .vx-head { margin-bottom: 40px; }
  .vx-card { padding: 24px; }
}

/* ── 4. fx-reveal ──────────────────────────────────────────── */
html.fx-js .fx-reveal > *, html.fx-js .fx-reveal-self {
  opacity: 0; transform: translateY(16px); filter: blur(4px);
  transition: opacity var(--vy-dur) var(--vy-ease), transform var(--vy-dur) var(--vy-ease), filter var(--vy-dur) var(--vy-ease);
  transition-delay: calc(var(--fx-i, 0) * 60ms);
}
html.fx-js .fx-reveal.fx-in > *, html.fx-js .fx-reveal-self.fx-in { opacity: 1; transform: none; filter: none; }

/* ── 5. fx-spotlight ───────────────────────────────────────── */
.fx-spotlight { isolation: isolate; overflow: hidden; }
.fx-spotlight::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgb(37 99 235 / 9%), transparent 60%);
  transition: opacity .35s var(--vy-ease);
}
.fx-spotlight::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  padding: 1px;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgb(37 99 235 / 55%), transparent 70%);
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  transition: opacity .35s var(--vy-ease);
}
.fx-spotlight:hover::before, .fx-spotlight:hover::after { opacity: 1; }
.vx-section--dark .fx-spotlight::before { background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgb(56 189 248 / 10%), transparent 60%); }

/* ── 6. fx-border-beam ─────────────────────────────────────── */
@property --fx-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.fx-beam { position: relative; }
.fx-beam::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--fx-angle), transparent 0deg 250deg, #0ea5e9 300deg, #2563eb 340deg, transparent 360deg);
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: fx-beam 6s linear infinite;
}
@keyframes fx-beam { to { --fx-angle: 360deg; } }

/* ── 7. fx-flow (SVG) ──────────────────────────────────────── */
.fx-flow .fx-flow-path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.2s var(--vy-ease); transition-delay: calc(var(--fx-i, 0) * 120ms); }
.fx-flow.fx-in .fx-flow-path { stroke-dashoffset: 0; }
.fx-flow .fx-flow-broken { transition: opacity .6s var(--vy-ease); }
.fx-flow.fx-in .fx-flow-broken { opacity: 0; }
.fx-flow .fx-flow-node { opacity: .55; transition: opacity .5s var(--vy-ease); transition-delay: calc(var(--fx-i, 0) * 120ms + 300ms); }
.fx-flow.fx-in .fx-flow-node { opacity: 1; }
.fx-flow .fx-pulse { opacity: 0; }
.fx-flow.fx-in .fx-pulse { opacity: 1; transition: opacity .4s 1.2s; }

/* ── 8. fx-marquee ─────────────────────────────────────────── */
.fx-marquee { overflow: hidden; mask: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.fx-marquee-track { display: flex; gap: 56px; width: max-content; animation: fx-marquee var(--fx-marquee-dur, 40s) linear infinite; }
.fx-marquee:hover .fx-marquee-track, .fx-marquee:focus-within .fx-marquee-track { animation-play-state: paused; }
.fx-marquee-item {
  display: inline-flex; align-items: center; gap: 10px; color: var(--vy-mute); font-weight: 600; font-size: 1rem;
  white-space: nowrap; filter: grayscale(1); opacity: .75; transition: filter .3s, opacity .3s, color .3s;
}
.fx-marquee-item img { width: 22px; height: 22px; }
.fx-marquee-item:hover { filter: none; opacity: 1; color: var(--vy-ink); }
@keyframes fx-marquee { to { transform: translateX(calc(-50% - 28px)); } }

/* ── 9. fx-tabs ────────────────────────────────────────────── */
.fx-tablist { position: relative; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 4px; border-radius: 999px; }
.fx-tablist::-webkit-scrollbar { display: none; }
.fx-tab {
  position: relative; z-index: 1; flex-shrink: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: .9rem; font-weight: 600; padding: 10px 16px; border-radius: 999px;
  color: var(--vy-ink-2); transition: color .25s;
}
.fx-tab[aria-selected="true"] { color: var(--vy-ink); }
.fx-tab:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }
.fx-tab-ind {
  position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 0; width: 100px; border-radius: 999px;
  background: #fff; box-shadow: var(--vy-shadow-1); transform-origin: 0 50%;
  transition: transform .45s var(--vy-ease);
}
.fx-tab-prog { position: absolute; left: 16px; right: 16px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--vy-blue); transform: scaleX(0); transform-origin: 0 50%; opacity: 0; }
.fx-tabs.is-auto .fx-tab[aria-selected="true"] .fx-tab-prog { opacity: 1; animation: fx-prog var(--fx-auto, 6s) linear forwards; }
.fx-tabs.is-paused .fx-tab-prog { animation-play-state: paused; }
@keyframes fx-prog { to { transform: scaleX(1); } }
.fx-panel { animation: fx-panel-in .45s var(--vy-ease); }
.fx-panel[hidden] { display: none; }
@keyframes fx-panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── 10. fx-terminal ───────────────────────────────────────── */
.fx-terminal {
  font-family: var(--vy-mono); font-size: .8rem; line-height: 1.7; color: #cbd5e1;
  background: #0b1224; border-radius: var(--vy-r-md); padding: 0; overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--vy-line-dark), 0 24px 64px rgb(7 7 15 / 30%);
}
.fx-terminal-bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--vy-line-dark); color: #64748b; font-size: .72rem; }
.fx-terminal-bar i { width: 9px; height: 9px; border-radius: 50%; background: #334155; }
.fx-terminal-bar span { margin-left: 8px; }
.fx-terminal ol { list-style: none; margin: 0; padding: 16px; height: calc(1.7em * 8 + 32px); overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.fx-terminal li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-terminal li .ok { color: #4ade80; }
.fx-terminal li .t { color: #64748b; }
.fx-terminal li .k { color: #7dd3fc; }
html.fx-js .fx-terminal[data-fx-run] li { display: none; }
html.fx-js .fx-terminal[data-fx-run] li.on { display: block; }
html.fx-js .fx-terminal[data-fx-run] .fx-src { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.fx-caret { display: inline-block; width: 7px; height: 1em; background: #7dd3fc; vertical-align: -2px; margin-left: 2px; animation: fx-caret 1s steps(1) infinite; }
@keyframes fx-caret { 50% { opacity: 0; } }

/* ── 11. fx-stack ──────────────────────────────────────────── */
.fx-stack { display: grid; gap: 24px; }
@media (min-width: 900px) {
  .fx-stack-item { position: sticky; top: calc(110px + var(--fx-i, 0) * 18px); transform-origin: 50% 0; will-change: transform; }
}

/* ── 12. fx-tilt ───────────────────────────────────────────── */
.fx-tilt { transform: perspective(1200px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s var(--vy-ease); }
.fx-tilt.is-tilting { transition: transform .12s linear; }

/* ── 13. ACORDEÓN (<details>) ──────────────────────────────── */
.vx-faq { display: grid; gap: 12px; max-width: 860px; margin: 0 auto; }
.vx-faq details { background: #fff; border-radius: var(--vy-r-md); box-shadow: inset 0 0 0 1px var(--vy-line); transition: box-shadow .25s; }
.vx-faq details[open] { box-shadow: inset 0 0 0 1px rgb(37 99 235 / 30%), var(--vy-shadow-1); }
.vx-faq summary {
  list-style: none; cursor: pointer; padding: 22px 56px 22px 24px; font-weight: 600; font-size: 1.05rem;
  position: relative; border-radius: var(--vy-r-md);
}
.vx-faq summary::-webkit-details-marker { display: none; }
.vx-faq summary::after {
  content: ""; position: absolute; right: 24px; top: 50%; width: 12px; height: 12px; margin-top: -8px;
  border-right: 1.5px solid var(--vy-ink-2); border-bottom: 1.5px solid var(--vy-ink-2);
  transform: rotate(45deg); transition: transform .3s var(--vy-ease);
}
.vx-faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.vx-faq summary:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }
.vx-faq .vx-faq-a { padding: 0 24px 22px; color: var(--vy-ink-2); line-height: 1.65; margin: 0; }

/* animaciones en bucle pausadas mientras su sección no está en pantalla (fx.js) */
.fx-off, .fx-off *, .fx-off ::before, .fx-off ::after { animation-play-state: paused !important; }

/* ── 14. REDUCED MOTION ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }

  html.fx-js .fx-reveal > *, html.fx-js .fx-reveal-self { opacity: 1; transform: none; filter: none; transition: none; }
  .fx-beam::after, .fx-marquee-track, .fx-caret, .fx-tab-prog { animation: none; }
  .fx-marquee-track { flex-wrap: wrap; width: auto; justify-content: center; gap: 24px 40px; }
  .fx-marquee { mask: none; }
  .fx-marquee [aria-hidden="true"] { display: none; }
  .fx-flow .fx-flow-path { stroke-dashoffset: 0; transition: none; }
  .fx-flow .fx-flow-node { opacity: 1; transition: none; }
  .fx-flow .fx-pulse { display: none; }
  .fx-panel { animation: none; }
  .fx-tab-ind, .fx-tilt { transition: none; }
  .fx-stack-item { position: static; }
}
