/* Grupo Empresarial Fox — base: tokens, tipografía, botones, aparición, intro, anuncio y header.
   El movimiento replica legacybridge.software (ver 00-ingenieria-inversa-legacybridge.md); la marca sale del manual v1.1. */

:root {
  /* marca (manual v1.1, 7 nov 2026) */
  --marino: #101B35;
  --marino-2: #14223F;      /* tarjetas sobre marino */
  --marino-3: #1C2C4F;      /* hover sobre marino */
  --perla: #F4F6FA;
  --blanco: #FFFFFF;
  --acero: #365780;
  --naranja: #F4511E;
  --naranja-2: #DC4415;     /* naranja presionado */
  --rojo: #C63D2F;          /* solo errores */
  --verde: #1F8A5B;         /* estado "pagado" en las mini pantallas */
  --ambar: #B7791F;         /* estado "pendiente" */
  --celeste: #A9C1E0;       /* texto secundario sobre marino */

  /* derivados: grises = marino con transparencia */
  --texto: var(--marino);
  --texto-2: #535B6E;       /* marino 72 % */
  --sutil: #E3E6EC;         /* marino 12 % — fondos de contraste y líneas */
  --sutil-2: #D3D8E1;
  --linea: #E3E6EC;

  --r8: 8px; --r12: 12px; --r16: 16px; --r-full: 999px;

  --f-titulo: "Bricolage Grotesque", ui-sans-serif, system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --f-texto: "Instrument Sans", ui-sans-serif, system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --f-mono: "Spline Sans Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --page-pad: max(100px, 5.2vw);
  --section-pad: 120px;

  /* curvas de la referencia */
  --rise: 110px;
  --rise-ease: cubic-bezier(0, 1, .4, 1);
  --expo: cubic-bezier(.16, 1, .3, 1);
  --wipe: cubic-bezier(.23, 1, .32, 1);
}
@media (max-width: 1599px) { :root { --page-pad: 40px; } }
@media (max-width: 767px)  { :root { --page-pad: 16px; --section-pad: 64px; --rise: 60px; } }

/* ---------- tipografía ---------- */
.h1 { font: 700 68px/72px var(--f-titulo); letter-spacing: -0.045em; }
.h2 { font: 700 54px/58px var(--f-titulo); letter-spacing: -0.04em; }
.h3 { font: 700 38px/42px var(--f-titulo); letter-spacing: -0.03em; }
.h4 { font: 700 32px/36px var(--f-titulo); letter-spacing: -0.03em; }
.h5 { font: 700 24px/28px var(--f-titulo); letter-spacing: -0.02em; }
.text-lg { font: 400 26px/32px var(--f-texto); letter-spacing: -0.02em; }
.text-md { font: 400 20px/26px var(--f-texto); letter-spacing: -0.01em; }
.body { font: 400 16px/22px var(--f-texto); letter-spacing: -0.005em; }
.body-sb { font: 600 16px/22px var(--f-texto); letter-spacing: -0.005em; }
.caption { font: 400 14px/18px var(--f-texto); }
.caption-sb { font: 600 14px/18px var(--f-texto); }
.eyebrow { font: 600 13px/16px var(--f-texto); letter-spacing: .12em; text-transform: uppercase; }
@media (max-width: 1200px) {
  .h1 { font-size: 54px; line-height: 58px; }
  .h2 { font-size: 44px; line-height: 48px; }
}
@media (max-width: 767px) {
  .h1 { font-size: 40px; line-height: 44px; letter-spacing: -0.04em; }
  .h2 { font-size: 32px; line-height: 36px; letter-spacing: -0.03em; }
  .h3 { font-size: 28px; line-height: 32px; }
  .h4 { font-size: 24px; line-height: 28px; }
  .h5 { font-size: 20px; line-height: 24px; }
  .text-lg, .text-md { font-size: 18px; line-height: 24px; }
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--blanco); color: var(--texto);
  font: 400 16px/22px var(--f-texto);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
main > section, main > footer { width: 100%; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.nowrap { white-space: nowrap; }
@media (max-width: 767px) { .br-desktop { display: none; } }
:focus-visible { outline: 2px solid var(--naranja); outline-offset: 3px; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 28px; border-radius: var(--r12);
  font: 600 16px/24px var(--f-texto); letter-spacing: -0.005em; text-align: center;
  text-decoration: none; cursor: pointer; border: 1px solid transparent; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .25s ease, box-shadow .25s ease;
}
/* barrido del texto: sale por arriba mientras su copia entra desde abajo */
.btn-wipe { overflow: hidden; }
.btn-wipe .btn__label { position: relative; display: inline-block; white-space: nowrap; }
.btn-wipe .btn__label::before {
  content: attr(data-label); position: absolute; left: 0; top: 0;
  transform: translateY(100%); clip-path: inset(0 0 100%);
  transition: transform .3s var(--wipe), clip-path .3s var(--wipe);
}
.btn-wipe .btn__text { display: inline-block; clip-path: inset(0); transition: transform .3s var(--wipe) .1s, clip-path .3s var(--wipe) .1s; }
.btn-wipe:hover .btn__text, .btn-wipe:focus-visible .btn__text { transform: translateY(-100%); clip-path: inset(100% 0 0); transition-delay: 0s; }
.btn-wipe:hover .btn__label::before, .btn-wipe:focus-visible .btn__label::before { transform: none; clip-path: inset(0); transition-delay: .1s; }

/* acción principal: naranja, texto SIEMPRE blanco y en negrita (manual) */
.btn-primary { background: var(--naranja); border-color: var(--naranja); color: #fff; font-weight: 700; }
.btn-primary:hover { background: var(--marino); border-color: var(--marino); color: #fff; }
.btn-primary:active { background: var(--naranja-2); }
.btn-dark { background: var(--marino); border-color: var(--marino); color: #fff; }
.btn-dark:hover { background: var(--naranja); border-color: var(--naranja); color: #fff; font-weight: 700; }
.btn-outline { background: transparent; border-color: var(--marino); color: var(--marino); }
.btn-outline:hover { background: var(--marino); border-color: var(--marino); color: #fff; }
/* sobre fondos oscuros */
.on-dark .btn-primary:hover, .btn-primary.on-dark:hover { background: #fff; border-color: #fff; color: var(--marino); }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,.7); color: #fff; }
.btn-ghost:hover { background: #fff; border-color: #fff; color: var(--marino); }
.btn-white { background: #fff; border-color: #fff; color: var(--marino); }
.btn-white:hover { background: var(--naranja); border-color: var(--naranja); color: #fff; font-weight: 700; }
.btn-lg { padding: 16px 36px; font-size: 18px; }
.cta-pair { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
@media (max-width: 767px) {
  .cta-pair { width: 100%; flex-direction: column; align-items: stretch; }
  .cta-pair .btn { width: 100%; }
}
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; }
.link-arrow svg { width: 16px; height: 16px; transition: transform .25s ease; }
.link-arrow:hover svg { transform: translateX(3px); }

/* ---------- aparición al hacer scroll ---------- */
.is-offscreen *, .is-offscreen *::before, .is-offscreen *::after { animation-play-state: paused !important; }
[data-reveal] { opacity: 0; transform: translateY(var(--rise)); transition: opacity 1s var(--rise-ease), transform 1s var(--rise-ease); transition-delay: calc(var(--i, 0) * 90ms); will-change: opacity, transform; }
[data-reveal].is-visible { opacity: 1; transform: none; }
/* títulos partidos: cada palabra sube desde debajo de su propia línea, 35 ms entre palabras */
.split .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .1em; margin-bottom: -.1em; }
.split .w > span { display: inline-block; transform: translateY(115%); transition: transform .9s var(--rise-ease); transition-delay: calc(var(--i, 0) * 90ms + var(--wi, 0) * 35ms); }
.is-visible.split .w > span, .is-visible .split .w > span { transform: none; }
.no-js [data-reveal] { opacity: 1; transform: none; }
.no-js .split .w > span { transform: none; }

/* ---------- intro: contador 1 → 100 % ---------- */
.intro { position: fixed; inset: 0; z-index: 200; background: var(--marino); display: none; pointer-events: auto; touch-action: none; }
.intro::after { /* el patrón del zorro, apenas visible */
  content: ""; position: absolute; inset: 0; opacity: .5;
  background: url("../assets/marca/patron-marino.svg") 0 0 / 160px 160px repeat;
}
.intro.is-done { pointer-events: none; }
html.intro-armed .intro, html.intro-running .intro, html.intro-settling .intro { display: block; }
.intro__logo { position: fixed; inset: 0; z-index: 201; display: none; color: #fff; pointer-events: none; overflow: hidden; }
html.intro-armed .intro__logo, html.intro-running .intro__logo, html.intro-settling .intro__logo { display: block; }
.intro__counter {
  --p: 0;
  position: absolute; left: var(--page-pad); right: var(--page-pad); top: 0;
  display: flex; align-items: baseline; gap: .06em;
  font: 800 clamp(88px, 17vw, 300px)/0.9 var(--f-titulo);
  letter-spacing: -0.05em; font-variant-numeric: tabular-nums;
  transform: translateY(calc(100vh - 1.5em - var(--p) * (100vh - 2.1em)));
  will-change: transform;
}
.intro__num { display: inline-block; }
.intro__pct { color: var(--naranja); }
.intro__fox { position: absolute; right: var(--page-pad); bottom: 40px; width: 56px; height: auto; opacity: .95; }
.intro__tag { position: absolute; left: var(--page-pad); bottom: 44px; font: 600 13px/16px var(--f-texto); letter-spacing: .14em; text-transform: uppercase; color: var(--celeste); }
.intro__logo.is-fade { transition: opacity .5s ease; opacity: 0; }
.intro.is-fade { transition: opacity 1s ease .15s; opacity: 0; }
.intro.is-done, .intro__logo.is-done { display: none !important; }
html.intro-armed .site-header, html.intro-armed .announce,
html.intro-running .site-header, html.intro-running .announce { transform: translateY(-110%); opacity: 0; }
.site-header, .announce { transition: transform .8s var(--rise-ease), opacity .6s ease; }
html.intro-armed body, html.intro-running body, html.intro-settling body { overflow: hidden; }

/* ---------- barra de anuncio ---------- */
.announce {
  position: sticky; top: 0; z-index: 51;
  background: var(--marino); color: #fff;
  height: 44px; padding: 0 64px 0 var(--page-pad);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  transition: transform .45s var(--expo);
}
.announce.is-tucked { transform: translateY(-100%); }
.announce.is-hidden { display: none; }
.announce__inner { display: flex; align-items: center; gap: 16px; min-width: 0; }
.announce__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--naranja); flex: none; box-shadow: 0 0 0 0 rgba(244,81,30,.6); animation: announce-ping 2.4s ease-out infinite; }
@keyframes announce-ping { 0% { box-shadow: 0 0 0 0 rgba(244,81,30,.55); } 70%, 100% { box-shadow: 0 0 0 10px rgba(244,81,30,0); } }
.announce__text { font: 600 15px/20px var(--f-texto); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.announce__link { display: inline-flex; align-items: center; gap: 6px; font: 500 14px/18px var(--f-texto); color: #fff; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.5); white-space: nowrap; }
.announce__link svg { width: 14px; height: 14px; transition: transform .25s ease; }
.announce__link:hover svg { transform: translateX(3px); }
.announce__close { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-full); transition: background-color .25s ease; }
.announce__close:hover { background: rgba(255,255,255,.12); }
.announce__close svg { width: 16px; height: 16px; }
@media (max-width: 767px) {
  .announce { height: 36px; padding: 0 44px 0 16px; justify-content: flex-start; }
  .announce__text { font-size: 13px; }
  .announce__link { font-size: 13px; }
  .announce__close { right: 6px; }
}
@media (max-width: 420px) { .announce__text { display: none; } }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: var(--announce-h, 0px); z-index: 50; width: 100%;
  background: rgba(255,255,255,.96); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: transform .45s var(--expo), box-shadow .3s ease;
}
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--linea); }
.site-header.is-tucked { transform: translateY(calc(-100% - var(--announce-h, 0px))); }
.site-header__inner { padding: 14px var(--page-pad); display: flex; align-items: center; justify-content: center; gap: 40px; }
.site-header__logo { display: block; flex-shrink: 0; line-height: 0; transition: opacity .25s ease; }
.site-header__logo:hover { opacity: .8; }
.site-header__logo img { width: auto; height: 40px; }
.site-header__nav { flex: 1 0 0; min-width: 1px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.site-header__link { position: relative; display: block; padding: 8px 14px; font: 500 16px/22px var(--f-texto); color: var(--texto); text-decoration: none; white-space: nowrap; }
.site-header__link::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 5px; height: 1.5px; background: var(--naranja); transform: scaleX(0); transform-origin: right; transition: transform .45s var(--expo); }
.site-header__link:hover::after, .site-header__link.is-current::after { transform: scaleX(1); transform-origin: left; }
.site-header__actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.site-header .btn { height: 48px; padding: 11px 22px; }
.site-header__menu { display: none; position: relative; width: 44px; height: 44px; align-items: center; justify-content: center; border-radius: var(--r12); transition: background-color .25s ease; }
.site-header__menu:hover { background: var(--perla); }
.site-header__burger { position: relative; display: block; width: 24px; height: 24px; }
.site-header__burger i { position: absolute; left: 3px; right: 3px; height: 1.5px; border-radius: 1px; background: var(--texto); transition: transform .45s var(--expo), opacity .2s ease; }
.site-header__burger i:nth-child(1) { top: 6px; }
.site-header__burger i:nth-child(2) { top: 11.25px; }
.site-header__burger i:nth-child(3) { top: 16.5px; }
.site-header.is-open .site-header__menu { background: var(--sutil); }
.site-header.is-open .site-header__burger i:nth-child(1) { transform: translateY(5.25px) rotate(45deg); }
.site-header.is-open .site-header__burger i:nth-child(2) { opacity: 0; transform: scaleX(.4); }
.site-header.is-open .site-header__burger i:nth-child(3) { transform: translateY(-5.25px) rotate(-45deg); }

/* menú móvil: el panel baja con un barrido y sus filas suben una a una */
.site-header__mobile-nav { display: none; flex-direction: column; flex: 1 0 0; min-height: 1px; overflow-y: auto; background: var(--perla); clip-path: inset(0 0 100% 0); transition: clip-path .6s var(--expo); }
.site-header.is-open .site-header__mobile-nav { clip-path: inset(0 0 0 0); }
.m-link, .m-sub, .site-header__mobile-cta .btn { opacity: 0; transform: translateY(28px); }
.m-link, .m-sub { transition: color .25s ease, opacity .5s ease, transform .7s var(--expo); }
.site-header__mobile-cta .btn { transition: opacity .5s ease, transform .7s var(--expo), background-color .25s ease, color .25s ease, border-color .25s ease; }
.site-header.is-open .m-link, .site-header.is-open .m-sub, .site-header.is-open .site-header__mobile-cta .btn { opacity: 1; transform: none; }
.site-header.is-open .m-link { transition-delay: calc(.1s + var(--n, 0) * .06s); }
.m-link:nth-child(2), .m-sub:nth-child(2) { --n: 1; } .m-link:nth-child(3) { --n: 2; } .m-link:nth-child(4) { --n: 3; } .m-link:nth-child(5) { --n: 4; } .m-link:nth-child(6) { --n: 5; }
.site-header.is-open .m-sub { transition-delay: calc(.46s + var(--n, 0) * .04s); }
.site-header.is-open .site-header__mobile-cta .btn:nth-child(1) { transition-delay: .54s; }
.site-header.is-open .site-header__mobile-cta .btn:nth-child(2) { transition-delay: .6s; }
.site-header__mobile-content { flex: 1 0 0; min-height: 1px; display: flex; flex-direction: column; padding: 24px 16px; overflow-y: auto; }
.site-header__mobile-group { display: flex; flex-direction: column; gap: 14px; padding: 8px 0 22px; }
.m-link { display: block; font: 700 30px/34px var(--f-titulo); letter-spacing: -0.03em; color: var(--texto); text-decoration: none; }
.m-link:hover { color: var(--naranja); }
.m-divider { width: 100%; height: 1px; background: var(--sutil-2); flex-shrink: 0; transform: scaleX(0); transform-origin: left; transition: transform .6s var(--expo) .42s; }
.site-header.is-open .m-divider { transform: none; }
.site-header__mobile-footer { display: flex; flex-direction: column; gap: 12px; padding-top: 20px; }
.m-sub { color: var(--texto-2); text-decoration: none; }
.m-sub:hover { color: var(--texto); }
.site-header__mobile-cta { flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; padding: 16px 16px 32px; }
.site-header__mobile-cta .btn { width: 100%; }

@media (max-width: 1399px) {
  .site-header__link { padding: 8px 10px; font-size: 15px; }
  .site-header__link::after { left: 10px; right: 10px; }
  .site-header__inner { gap: 24px; }
}
@media (max-width: 1199px) {
  .site-header__inner { justify-content: space-between; }
  .site-header__nav { display: none; }
  .site-header__menu { display: flex; }
  .site-header.is-armed { position: fixed; inset: 0; z-index: 60; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--perla); overflow: hidden; }
  .site-header.is-armed .site-header__inner { background: var(--perla); flex-shrink: 0; width: 100%; }
  .site-header.is-armed .site-header__actions .btn { display: none; }
  .site-header.is-armed .site-header__mobile-nav { display: flex; }
  body:has(.site-header.is-armed) { overflow: hidden; }
}
@media (max-width: 767px) {
  .site-header__inner { padding: 10px 16px; gap: 12px; }
  .site-header__logo img { height: 32px; }
  .site-header__actions { gap: 8px; }
  .site-header .btn { height: 40px; padding: 7px 16px; font-size: 15px; }
}
@media (max-width: 559px) { .site-header__contact { display: none; } }
@media (max-width: 359px) { .site-header__demo { display: none; } }

/* volver arriba */
.to-top { position: fixed; right: 32px; bottom: 32px; z-index: 50; width: 56px; height: 56px; border-radius: var(--r-full); background: var(--naranja); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(16,27,53,.25); opacity: 0; transform: translateY(16px); pointer-events: none; transition: opacity .35s ease, transform .35s ease, background-color .25s ease; }
.to-top svg { width: 22px; height: 22px; }
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--marino); }
@media (max-width: 767px) { .to-top { right: 16px; bottom: 16px; width: 48px; height: 48px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .intro, .intro__logo { display: none !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .split .w > span { transform: none !important; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
