/* ==========================================================
   ESTUDIO BYR — HOJA DE ESTILOS
   Estética: oscura, minimalista, hairlines y mucho aire.
   Toda la paleta se controla desde :root
   ========================================================== */

:root {
  --bg: #0a0b0e;
  --bg-soft: #0d0f13;
  --surface: rgba(255, 255, 255, 0.022);
  --line: rgba(255, 255, 255, 0.085);
  --line-2: rgba(255, 255, 255, 0.16);

  --accent: #9fe6cf;

  --text: #f3f4f6;
  --muted: #9ba2ae;
  --faint: #838b98;

  --shell: 1120px;
  --r: 4px;

  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  letter-spacing: -0.005em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.nav-open { overflow: hidden; }

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

h1, h2, h3 {
  margin: 0;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.14;
}

h1, h2 { font-family: var(--serif); }
h1 em, h2 em { font-style: italic; color: var(--accent); }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 32px;
}

.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;
}

.skip-link {
  position: absolute; left: -9999px; top: 12px; z-index: 200;
  padding: 9px 16px; border-radius: 999px;
  background: var(--accent); color: #06120e; font-weight: 500;
}
.skip-link:focus { left: 16px; }

:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }

/* Velo de fondo, muy sutil */
.veil {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(760px 460px at 82% -6%, rgba(159, 230, 207, 0.055), transparent 66%),
    radial-gradient(620px 420px at 6% 96%, rgba(159, 230, 207, 0.035), transparent 66%),
    var(--bg);
}

/* ==========================================================
   HEADER
   ========================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background .4s var(--ease), border-color .4s var(--ease);
}
.site-header.stuck {
  background: rgba(10, 11, 14, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--line);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 78px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); }
.brand-mark { width: 30px; height: 30px; overflow: visible; }
.brand-orbit {
  transform-origin: 20px 20px;
  animation: spin 9s linear infinite;
}
.brand-core { animation: beat 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.brand-name {
  font-family: var(--serif);
  font-size: 1.24rem;
  letter-spacing: 0.005em;
}

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  position: relative;
  padding: 8px 14px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 400;
  transition: color .3s;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 4px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s var(--ease);
}
.nav a:hover { color: var(--text); }
.nav a:hover::after, .nav a.here::after { transform: scaleX(1); }

.nav-mail { color: var(--text) !important; }
.nav-mail::after { background: var(--line-2); transform: scaleX(1); }
.nav-mail:hover::after { background: var(--accent); }

.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 38px; height: 38px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.menu-btn span {
  display: block;
  width: 22px; height: 1px;
  margin-left: auto;
  background: var(--text);
  transition: transform .35s var(--ease), width .35s var(--ease);
}
.menu-btn span:last-child { width: 14px; }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { width: 22px; transform: translateY(-3.5px) rotate(-45deg); }

/* ==========================================================
   TIPOS DE TEXTO COMUNES
   ========================================================== */

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 26px;
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  animation: beat 3s ease-in-out infinite;
}

.lead {
  max-width: 54ch;
  color: var(--muted);
  font-size: 1.06rem;
  font-weight: 300;
}
.lead-sm { font-size: 1rem; max-width: 46ch; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.93rem;
  font-weight: 400;
  background: transparent;
  cursor: pointer;
  transition: border-color .4s, color .4s, background .4s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(159, 230, 207, 0.04); }
.arrow { width: 17px; height: 17px; transition: transform .45s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

.btn-quiet {
  display: inline-flex;
  align-items: center;
  padding: 13px 6px;
  border: 0;
  background: none;
  color: var(--faint);
  font-family: var(--sans);
  font-size: 0.93rem;
  font-weight: 300;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: color .35s, border-color .35s;
}
.btn-quiet:hover { color: var(--text); border-bottom-color: var(--line-2); }

/* Reveal: el contenido queda visible si JavaScript no carga. */
[data-reveal] {
  opacity: 1;
  transform: none;
}
[data-reveal].will-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
[data-reveal].will-reveal.shown { opacity: 1; transform: none; }
[data-reveal-delay="1"] { transition-delay: .09s; }
[data-reveal-delay="2"] { transition-delay: .18s; }
[data-reveal-delay="3"] { transition-delay: .27s; }
[data-reveal-delay="4"] { transition-delay: .36s; }

/* ==========================================================
   HERO
   ========================================================== */

.hero { padding: 96px 0 0; }

.hero-inner { position: relative; }

.hero h1 {
  font-size: clamp(2.5rem, 6.2vw, 4.6rem);
  letter-spacing: -0.03em;
  margin-bottom: 30px;
  max-width: 20ch;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 40px;
}

/* Órbita decorativa */
.hero-orbit {
  position: absolute;
  top: -40px; right: -70px;
  width: 380px; height: 380px;
  pointer-events: none;
}
.ring {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.ring-1 { animation: spin 46s linear infinite; border-top-color: rgba(159, 230, 207, 0.32); }
.ring-2 { inset: 16%; animation: spin 34s linear infinite reverse; border-left-color: rgba(159, 230, 207, 0.26); }
.ring-3 { inset: 32%; animation: spin 58s linear infinite; border-bottom-color: rgba(159, 230, 207, 0.2); }

.sat {
  position: absolute;
  top: 50%; left: 50%;
  width: 5px; height: 5px;
  margin: -2.5px;
  border-radius: 50%;
  background: var(--accent);
  transform-origin: 2.5px 2.5px;
}
.sat-1 { animation: orbit1 22s linear infinite; }
.sat-2 { animation: orbit2 32s linear infinite reverse; opacity: .6; }

@keyframes orbit1 {
  from { transform: rotate(0deg) translateX(190px); }
  to   { transform: rotate(360deg) translateX(190px); }
}
@keyframes orbit2 {
  from { transform: rotate(0deg) translateX(128px); }
  to   { transform: rotate(360deg) translateX(128px); }
}

/* Cifras */
.figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 104px;
  border-top: 1px solid var(--line);
}
.figures li {
  padding: 30px 26px 30px 0;
  border-right: 1px solid var(--line);
}
.figures li:last-child { border-right: 0; }
.figures li:not(:first-child) { padding-left: 26px; }

.figures strong {
  display: block;
  font-family: var(--serif);
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.figures span {
  display: block;
  margin-top: 10px;
  color: var(--faint);
  font-size: 0.83rem;
  line-height: 1.5;
}

/* ==========================================================
   BANDAS / SECCIONES
   ========================================================== */

.band { padding: 128px 0; }
.band-line { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-soft); }

.band-head { margin-bottom: 68px; }
.band-head h2 {
  font-size: clamp(1.85rem, 3.9vw, 2.9rem);
  max-width: 24ch;
}

/* ==========================================================
   TARJETAS DE SERVICIO
   ========================================================== */

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.card {
  padding: 40px 30px 44px;
  background: var(--bg);
  transition: background .5s var(--ease);
}
.card:hover { background: var(--bg-soft); }

.card-ico {
  width: 46px; height: 46px;
  margin-bottom: 30px;
  color: var(--muted);
  transition: color .5s;
}
.card:hover .card-ico { color: var(--text); }
.card-ico svg { width: 100%; height: 100%; overflow: visible; }

.card h3 {
  font-size: 1.06rem;
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.card p { color: var(--faint); font-size: 0.91rem; line-height: 1.6; }

/* ==========================================================
   ERP
   ========================================================== */

.erp-row {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 76px;
  align-items: start;
}
.erp-copy h2 { font-size: clamp(1.8rem, 3.7vw, 2.7rem); margin-bottom: 22px; }

.erp-list { display: grid; }
.erp-list li {
  display: flex;
  align-items: flex-start;
  gap: 22px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
}
.erp-list li:last-child { border-bottom: 1px solid var(--line); }

.erp-ico {
  flex: 0 0 34px;
  width: 34px; height: 34px;
  color: var(--muted);
  transition: color .5s;
}
.erp-list li:hover .erp-ico { color: var(--text); }
.erp-ico svg { width: 100%; height: 100%; overflow: visible; }

.erp-list strong {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 5px;
}
.erp-list p { color: var(--faint); font-size: 0.9rem; }

/* ==========================================================
   MÉTODO
   ========================================================== */

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 52px;
}
.steps li { position: relative; padding-top: 34px; border-top: 1px solid var(--line); }

.step-ico {
  display: block;
  width: 36px; height: 36px;
  margin-bottom: 26px;
  color: var(--muted);
  transition: color .5s;
}
.steps li:hover .step-ico { color: var(--text); }
.step-ico svg { width: 100%; height: 100%; overflow: visible; }

.step-n {
  position: absolute;
  top: 30px; right: 0;
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--faint);
  letter-spacing: 0.08em;
}
.steps h3 {
  font-family: var(--sans);
  font-size: 1.04rem;
  font-weight: 500;
  margin-bottom: 9px;
}
.steps p { color: var(--faint); font-size: 0.91rem; }

/* ==========================================================
   CIERRE
   ========================================================== */

.closing {
  padding: 132px 0 138px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.closing-inner { display: grid; justify-items: center; }
.closing h2 {
  font-size: clamp(2rem, 4.6vw, 3.3rem);
  margin-bottom: 24px;
  max-width: 22ch;
}
.closing .lead { text-align: center; }

.closing-cta {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 40px;
}
.copy-status {
  min-height: 22px;
  margin-top: 14px;
  color: var(--accent);
  font-size: 0.82rem;
}

/* ==========================================================
   FOOTER
   ========================================================== */

.site-footer { border-top: 1px solid var(--line); padding: 32px 0; }
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  color: var(--faint);
  font-size: 0.82rem;
}
.footer-brand { font-family: var(--serif); font-size: 1rem; color: var(--text); }
.footer-mid { letter-spacing: 0.02em; }
.footer-meta { white-space: nowrap; }

.top-link {
  position: fixed;
  right: 26px; bottom: 26px;
  z-index: 90;
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(10, 11, 14, 0.8);
  backdrop-filter: blur(10px);
  color: var(--muted);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .45s, transform .45s var(--ease), visibility .45s, color .3s, border-color .3s;
}
.top-link svg { width: 17px; height: 17px; }
.top-link.shown { opacity: 1; visibility: visible; transform: none; }
.top-link:hover { color: var(--accent); border-color: var(--accent); }

/* ==========================================================
   ANIMACIONES DE ICONOS (continuas y lentas)
   ========================================================== */

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes beat {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .4; transform: scale(1.35); }
}

/* Línea que barre de arriba a abajo, tipo lectura de documento */
@keyframes scanY {
  0%   { transform: translateY(0); opacity: 0; }
  12%  { opacity: 1; }
  50%  { transform: translateY(15px); opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translateY(0); opacity: 0; }
}
.scan-line { animation: scanY 4.6s var(--ease) infinite; }

/* Check que se redibuja en loop */
@keyframes tickDraw {
  0%   { stroke-dashoffset: 30; }
  30%  { stroke-dashoffset: 0; }
  82%  { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 30; }
}
.loop-tick {
  stroke-dasharray: 30;
  animation: tickDraw 5.2s var(--ease) infinite;
}

/* Tendencia que se redibuja en loop */
@keyframes trendDraw {
  0%   { stroke-dashoffset: 60; }
  35%  { stroke-dashoffset: 0; }
  85%  { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 60; }
}
.loop-trend {
  stroke-dasharray: 60;
  animation: trendDraw 6s var(--ease) infinite;
}

/* Barras que respiran */
@keyframes breathe {
  0%, 100% { transform: scaleY(1); }
  50%      { transform: scaleY(1.14); }
}
.breathe { transform-origin: bottom; animation: breathe 4.4s ease-in-out infinite; }
.b2 { animation-delay: .35s; }
.b3 { animation-delay: .7s; }

/* Órbita punteada lenta */
.slow-orbit { transform-origin: 32px 32px; animation: spin 24s linear infinite; }

/* Punto que late */
.beat { transform-box: fill-box; transform-origin: center; animation: beat 3.4s ease-in-out infinite; }

/* Flotación suave */
@keyframes floatSoft {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2.5px); }
}
.float-soft { animation: floatSoft 4s ease-in-out infinite; }

/* Engranaje */
.spin-slow { transform-origin: 24px 24px; animation: spin 20s linear infinite; }

/* Aristas internas del cubo */
@keyframes edgeFade {
  0%, 100% { opacity: .35; }
  50%      { opacity: 1; }
}
.cube-in { animation: edgeFade 5s ease-in-out infinite; }

.layer { animation: floatSoft 4.2s ease-in-out infinite; }
.l3 { animation-delay: .5s; }

/* Aguja de reloj / barrido del buscador */
.sweep { transform-origin: 18px 18px; animation: spin 8s linear infinite; }

/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 1080px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-orbit { width: 300px; height: 300px; right: -110px; opacity: .7; }
}

@media (max-width: 940px) {
  .erp-row { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .band { padding: 96px 0; }
  .figures { margin-top: 76px; }
}

@media (max-width: 820px) {
  .menu-btn { display: flex; }

  .nav {
    position: fixed;
    inset: 78px 20px auto 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 0;
    border: 1px solid var(--line);
    background: rgba(10, 11, 14, 0.97);
    backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity .4s var(--ease), transform .4s var(--ease), visibility .4s;
  }
  .nav.open { opacity: 1; visibility: visible; transform: none; }
  .nav a { padding: 15px 22px; font-size: 1rem; }
  .nav a::after { display: none; }

  .hero-orbit { display: none; }
  .hero { padding-top: 70px; }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures li { border-bottom: 1px solid var(--line); }
  .figures li:nth-child(2n) { border-right: 0; }
  .figures li:nth-child(n+3) { border-bottom: 0; }
}

@media (max-width: 620px) {
  .shell { padding: 0 22px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 34px 26px 38px; }
  .band { padding: 82px 0; }
  .band-head { margin-bottom: 46px; }
  .closing { padding: 92px 0 100px; }
  .figures { grid-template-columns: minmax(0, 1fr); }
  .figures li { border-right: 0; padding-left: 0 !important; }
  .figures li:not(:last-child) { border-bottom: 1px solid var(--line); }
  .footer-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .top-link { right: 16px; bottom: 16px; }
}

/* ==========================================================
   MOVIMIENTO REDUCIDO
   ========================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .loop-tick, .loop-trend { stroke-dashoffset: 0; }
  .scan-line { opacity: 1; }
}

/* ==========================================================
   IMPRESIÓN
   ========================================================== */

@media print {
  .veil, .top-link, .menu-btn, .hero-orbit { display: none !important; }
  body { background: #fff; color: #111; }
  .site-header { position: static; }
}
