/* =========================================================
   RG Soluciones — Sistema de diseño
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Manrope:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Brand colors (logo) */
  --navy: #1E2E6E;
  --navy-2: #2A3F8F;
  --navy-deep: #14215A;
  --cyan: #1FA7DC;
  --cyan-2: #38BEF0;
  --cyan-soft: #B8E4F7;

  /* Light mode */
  --bg: #FBFBFD;
  --bg-2: #F4F5FA;
  --bg-3: #ECEEF6;
  --surface: #FFFFFF;
  --ink: #0B0F2C;
  --ink-2: #2A3047;
  --muted: #6B7088;
  --line: rgba(30, 46, 110, 0.10);
  --line-strong: rgba(30, 46, 110, 0.18);
  --shadow-sm: 0 2px 8px rgba(20, 33, 90, 0.06);
  --shadow-md: 0 12px 32px rgba(20, 33, 90, 0.10);
  --shadow-lg: 0 30px 80px rgba(20, 33, 90, 0.18);
  --glow: 0 0 0 6px rgba(31, 167, 220, 0.14);

  /* Type */
  --font-display: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --font-sans: 'Manrope', ui-sans-serif, system-ui, sans-serif;

  /* Radii & motion */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 36px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-out: cubic-bezier(.16,1,.3,1);

  /* Layout */
  --container: 1240px;
  --gutter: clamp(20px, 4vw, 48px);
}

[data-theme="dark"] {
  --bg: #07091A;
  --bg-2: #0B0F26;
  --bg-3: #121736;
  --surface: #0F1430;
  --ink: #F2F4FF;
  --ink-2: #C8CCE5;
  --muted: #8A91B4;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 30px 100px rgba(0, 0, 0, 0.7);
  --glow: 0 0 0 6px rgba(31, 167, 220, 0.22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background .5s var(--ease), color .5s var(--ease);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* =========================================================
   Type
   ========================================================= */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 .4em;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: clamp(1.9rem, 3.4vw, 3rem); font-weight: 600; letter-spacing: -0.04em; }
h2 { font-size: clamp(1.6rem, 2.5vw, 2.3rem); font-weight: 600; letter-spacing: -0.035em; }
h3 { font-size: clamp(1.3rem, 2vw, 1.65rem); }
h4 { font-size: 1.05rem; font-weight: 600; }
p  { color: var(--ink-2); text-wrap: pretty; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: .82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--cyan);
}
.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--cyan);
  display: inline-block;
}

/* =========================================================
   Header
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.site-header.scrolled {
  border-bottom-color: var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--cyan) 100%);
  color: white;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .88rem;
  letter-spacing: -0.04em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 8px 20px rgba(31,167,220,.25);
  position: relative;
  overflow: hidden;
}
.brand-mark::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(120% 70% at 30% 0%, rgba(255,255,255,.45), transparent 60%);
}
.brand-name { white-space: nowrap; }
.brand-name span { color: var(--cyan); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.nav-links a {
  position: relative;
  padding: 10px 14px;
  font-size: .95rem;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: 10px;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav-links a:hover { color: var(--ink); background: var(--bg-2); }
.nav-links a.active {
  color: var(--ink);
}
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 14px; right: 14px; bottom: 4px;
  height: 2px;
  background: var(--cyan);
  border-radius: 2px;
}

.nav-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: transform .25s var(--ease), background .25s var(--ease);
}
.theme-toggle:hover { transform: translateY(-2px); background: var(--bg-3); }
.theme-toggle svg { width: 18px; height: 18px; transition: opacity .35s var(--ease), transform .5s var(--ease); }
.theme-toggle .sun, .theme-toggle .moon { grid-area: 1 / 1; }
[data-theme="dark"] .theme-toggle .sun { opacity: 1; transform: rotate(0); }
[data-theme="dark"] .theme-toggle .moon { opacity: 0; transform: rotate(-90deg); }
.theme-toggle .sun { opacity: 0; transform: rotate(90deg); }
.theme-toggle .moon { opacity: 1; transform: rotate(0); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: -0.005em;
  transition: transform .25s var(--ease), box-shadow .3s var(--ease), background .25s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: 0 10px 24px rgba(11,15,44,0.18);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(11,15,44,0.28); }
.btn-cyan {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--navy) 110%);
  color: white;
  box-shadow: 0 12px 30px rgba(31,167,220,.35);
}
.btn-cyan:hover { transform: translateY(-2px); box-shadow: 0 18px 44px rgba(31,167,220,.5); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { background: var(--bg-2); }
.btn .arrow { transition: transform .3s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }

.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  position: relative;
}
.nav-toggle span {
  position: absolute;
  left: 11px; right: 11px;
  height: 1.5px;
  background: var(--ink);
  transition: transform .3s var(--ease), opacity .3s var(--ease), top .3s var(--ease);
}
.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 20px; }
.nav-toggle span:nth-child(3) { top: 26px; }
body.menu-open .nav-toggle span:nth-child(1) { top: 20px; transform: rotate(45deg); }
body.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.menu-open .nav-toggle span:nth-child(3) { top: 20px; transform: rotate(-45deg); }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  margin-top: 120px;
  padding: 80px 0 32px;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: '';
  position: absolute;
  inset: auto 0 -50% 0;
  height: 80%;
  background: radial-gradient(50% 50% at 50% 100%, rgba(31,167,220,.18) 0%, transparent 70%);
  pointer-events: none;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 60px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.footer-col h4 {
  font-family: var(--font-sans);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.footer-col a { color: var(--ink-2); font-size: .98rem; transition: color .2s var(--ease); }
.footer-col a:hover { color: var(--cyan); }
.footer-brand p { color: var(--muted); font-size: .95rem; max-width: 32ch; margin: 18px 0 0; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  font-size: .86rem;
  color: var(--muted);
  position: relative;
  flex-wrap: wrap;
  gap: 14px;
}
.footer-legal { display: flex; gap: 22px; }
.footer-legal a:hover { color: var(--cyan); }

/* =========================================================
   Reveal animation
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }
.reveal[data-delay="5"] { transition-delay: .4s; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1080px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed;
    inset: 76px 0 0 0;
    flex-direction: column;
    align-items: stretch;
    padding: 28px var(--gutter);
    gap: 4px;
    background: var(--bg);
    border-top: 1px solid var(--line);
    transform: translateX(100%);
    transition: transform .35s var(--ease);
  }
  body.menu-open .nav-links { transform: none; }
  .nav-links a { padding: 16px; font-size: 1.15rem; }
  .nav-actions .btn-cta { display: none; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-brand { grid-column: 1 / -1; }
}

/* =========================================================
   Floating WhatsApp button
   ========================================================= */
.wa-float {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 14px 14px;
  border-radius: 999px;
  background: #25D366;
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(37, 211, 102, .45), 0 4px 10px rgba(0,0,0,.18);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.wa-float:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(37, 211, 102, .55), 0 6px 14px rgba(0,0,0,.22);
}
.wa-float svg { width: 28px; height: 28px; flex: 0 0 28px; fill: #fff; }
.wa-float .wa-label { white-space: nowrap; }
.wa-float::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, .5);
  animation: waPulse 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes waPulse {
  0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, .5); }
  70%  { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}
@media (max-width: 560px) {
  .wa-float { right: 16px; bottom: 16px; padding: 14px; }
  .wa-float .wa-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .wa-float::after { animation: none; }
}
