/* ============================================================
   R.E.S.O.L.V.E. — Shared stylesheet  ·  v2 "The Cycle"
   Dark-first, cinematic. Brand palette authoritative. Manrope.
   ============================================================ */

:root {
  /* Brand palette (mandatory) */
  --navy:      #1A2332;
  --navy-2:    #141C29;   /* deeper */
  --navy-3:    #0E141E;   /* deepest */
  --navy-lift: #232F44;   /* raised surfaces */
  --yellow:    #FFC107;
  --yellow-d:  #E8AE00;
  --red:       #E74C3C;
  --orange:    #F39C12;
  --green:     #27AE60;
  --blue:      #3498DB;
  --purple:    #8E44AD;
  --indigo:    #5C6BC0;
  --white:     #FFFFFF;
  --gray-bg:   #F8F9FA;
  --ink-soft:  #C9D2E0;   /* body text on navy */
  --ink-dim:   #8A97AC;   /* dimmer on navy */
  --muted:     #5b6675;
  --muted-2:   #8a93a3;
  --line:      #E6E9EE;
  --line-dk:   rgba(255,255,255,.10);

  --maxw: 1240px;
  --shadow-md: 0 18px 50px rgba(8,12,20,.18);
  --shadow-lg: 0 40px 90px rgba(8,12,20,.28);
  --glow-y: 0 0 0 1px rgba(255,193,7,.4), 0 10px 40px rgba(255,193,7,.35);
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Manrope", system-ui, -apple-system, sans-serif;
  font-weight: 400;
  color: var(--navy);
  background: var(--navy-2);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1,h2,h3,h4 { margin: 0; font-weight: 800; line-height: 1.05; letter-spacing: -0.025em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--yellow); color: var(--navy); }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
section { padding: clamp(64px, 9vw, 128px) 0; position: relative; }

.sec-navy  { background: var(--navy); color: var(--ink-soft); }
.sec-deep  { background: var(--navy-2); color: var(--ink-soft); }
.sec-white { background: var(--white); }
.sec-gray  { background: var(--gray-bg); }
.topbar-accent { border-top: 3px solid var(--yellow); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 800; letter-spacing: .28em;
  text-transform: uppercase; color: var(--yellow);
}
.eyebrow::before { content:""; width: 26px; height: 2px; background: var(--yellow); display:inline-block; }
.eyebrow.center-eb::before { display:none; }
.center { text-align: center; }

/* Grain + mesh helpers */
.grain::after {
  content:""; position:absolute; inset:0; pointer-events:none; opacity:.5; z-index:0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--yellow); color: var(--navy);
  font-weight: 800; font-size: 14px; letter-spacing: .08em; text-transform: uppercase;
  padding: 16px 32px; border: none; border-radius: 6px; cursor: pointer;
  position: relative; isolation: isolate; overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
  box-shadow: 0 10px 30px rgba(255,193,7,.30);
}
.btn::before {
  content:""; position:absolute; inset:0; z-index:-1; background: var(--yellow-d);
  transform: translateY(100%); transition: transform .3s var(--ease);
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(255,193,7,.42); }
.btn:hover::before { transform: translateY(0); }
.btn:active { transform: translateY(-1px); }
.btn .arr { transition: transform .25s var(--ease); }
.btn:hover .arr { transform: translateX(5px); }

.btn-ghost {
  background: transparent; color: var(--yellow);
  border: 1.5px solid rgba(255,193,7,.45); box-shadow: none; padding: 14.5px 30px;
}
.btn-ghost::before { background: rgba(255,193,7,.12); }
.btn-ghost:hover { box-shadow: none; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background .3s var(--ease), backdrop-filter .3s, border-color .3s, box-shadow .3s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(20,28,41,.82); backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line-dk); box-shadow: 0 8px 30px rgba(0,0,0,.30);
}
.header-inner { display:flex; align-items:center; justify-content:space-between; height: 80px; }
.brand { display:flex; align-items:center; gap:13px; }
.brand img { width: 42px; height: 42px; transition: transform .5s var(--ease); }
.brand:hover img { transform: rotate(60deg); }
.brand .wordmark { color: var(--yellow); font-weight: 800; font-size: 19px; letter-spacing: .04em; }
.nav { display:flex; align-items:center; gap:4px; }
.nav a {
  color: rgba(255,255,255,.78); font-weight: 700; font-size: 13px;
  letter-spacing: .12em; text-transform: uppercase; white-space: nowrap;
  padding: 10px 18px; border-radius: 6px; position: relative;
  transition: color .15s;
}
.nav a:not(.nav-cta)::after {
  content:""; position:absolute; left:18px; right:18px; bottom:4px; height:2px;
  background: var(--yellow); transform: scaleX(0); transform-origin:left; transition: transform .25s var(--ease);
}
.nav a:not(.nav-cta):hover { color:#fff; }
.nav a:not(.nav-cta):hover::after { transform: scaleX(1); }
.nav a.active { color: var(--yellow); }
.nav a.active::after { transform: scaleX(1); }
.nav a.nav-cta { background: var(--yellow); color: var(--navy); margin-left:10px; box-shadow: 0 8px 22px rgba(255,193,7,.28); transition: transform .2s var(--ease), box-shadow .2s; }
.nav a.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255,193,7,.4); }

.nav-toggle { display:none; background:none; border:none; cursor:pointer; width:46px; height:46px; padding:11px; }
.nav-toggle span { display:block; height:2px; background: var(--yellow); border-radius:2px; transition:.25s; }
.nav-toggle span + span { margin-top:6px; }
.nav-toggle.open span:nth-child(1){ transform:translateY(8px) rotate(45deg); }
.nav-toggle.open span:nth-child(2){ opacity:0; }
.nav-toggle.open span:nth-child(3){ transform:translateY(-8px) rotate(-45deg); }

@media (max-width: 800px) {
  .nav-toggle { display:block; }
  .nav {
    position:absolute; top:80px; left:0; right:0; flex-direction:column; align-items:stretch; gap:2px;
    background: rgba(14,20,30,.96); backdrop-filter: blur(14px); padding:0 22px; overflow:hidden;
    max-height:0; transition: max-height .35s var(--ease), padding .35s var(--ease);
    border-bottom:1px solid var(--line-dk);
  }
  .nav.open { max-height: 380px; padding:14px 22px 24px; }
  .nav a { padding: 14px; }
  .nav a:not(.nav-cta)::after { display:none; }
  .nav a.nav-cta { margin-left:0; margin-top:8px; text-align:center; }
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer { background: var(--navy-3); color: var(--ink-soft); padding: 80px 0 32px; position: relative; overflow: hidden; }
.site-footer .spectrum { position:absolute; top:0; left:0; right:0; height:3px;
  background: linear-gradient(90deg, var(--red), var(--orange), var(--green), var(--blue), var(--purple), var(--indigo)); }
.footer-grid { display:grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 48px; padding-bottom: 44px; position: relative; }
.footer-brand .brand { margin-bottom: 16px; }
.footer-brand p { color: var(--ink-dim); max-width: 300px; }
.footer-col h4 { color: var(--yellow); font-size: 12px; letter-spacing:.16em; text-transform:uppercase; margin-bottom:18px; font-weight:800; }
.footer-col a, .footer-col p { color: var(--ink-soft); display:block; margin-bottom:12px; font-size:15px; transition:color .15s, transform .15s; }
.footer-col a:hover { color: var(--yellow); transform: translateX(3px); }
.footer-divider { height:1px; background: var(--line-dk); }
.footer-bottom { padding-top:24px; font-size:13px; color: var(--ink-dim); display:flex; flex-wrap:wrap; gap:6px 22px; justify-content:space-between; }
@media (max-width: 800px){ .footer-grid { grid-template-columns:1fr; gap:36px; } }

/* ============================================================
   Scroll reveal
   ============================================================ */
.reveal { opacity:0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity:1; transform:none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity:1 !important; transform:none !important; }
  * { animation: none !important; }
}

/* ============================================================
   Language switch (EN ⇆ ES)
   ============================================================ */
.brand { margin-right: auto; }
.lang-switch {
  display: inline-flex; align-items: center; gap: 2px;
  background: rgba(255,255,255,.07); border: 1px solid var(--line-dk);
  border-radius: 999px; padding: 3px; margin-left: 16px;
}
.lang-switch button {
  font-family: inherit; border: none; background: none;
  color: rgba(255,255,255,.62); font-size: 12px; font-weight: 800;
  letter-spacing: .06em; padding: 6px 12px; border-radius: 999px;
  cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease);
}
.lang-switch button:hover { color: #fff; }
.lang-switch button.active { background: var(--yellow); color: var(--navy); }
@media (max-width: 800px) {
  .lang-switch { margin-left: 8px; margin-right: 6px; }
  .lang-switch button { padding: 6px 10px; }
}
/* smooth blur-fade while swapping languages */
main, .site-footer { transition: opacity .22s var(--ease), filter .22s var(--ease); }
body.lang-switching main, body.lang-switching .site-footer { opacity: .22; filter: blur(5px); }
@media (prefers-reduced-motion: reduce) {
  body.lang-switching main, body.lang-switching .site-footer { opacity: 1; filter: none; }
}

/* ============================================================
   WhatsApp floating button
   ============================================================ */
.wa-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 200;
  width: 60px; height: 60px; border-radius: 50%;
  background: #25D366; color: #fff; display: grid; place-items: center;
  box-shadow: 0 12px 30px rgba(37,211,102,.45), 0 4px 14px rgba(0,0,0,.28);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.wa-fab:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 18px 40px rgba(37,211,102,.55), 0 6px 18px rgba(0,0,0,.3); }
.wa-fab svg { width: 33px; height: 33px; }
.wa-fab::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; z-index: -1;
  box-shadow: 0 0 0 0 rgba(37,211,102,.55);
  animation: waPulse 2.6s ease-out infinite;
}
@keyframes waPulse {
  0%   { box-shadow: 0 0 0 0 rgba(37,211,102,.5); }
  70%  { box-shadow: 0 0 0 18px rgba(37,211,102,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}
.wa-fab .wa-label {
  position: absolute; right: 74px; top: 50%;
  transform: translateY(-50%) translateX(8px);
  background: var(--navy); color: #fff; font-weight: 700; font-size: 14px;
  padding: 9px 15px; border-radius: 9px; white-space: nowrap;
  opacity: 0; pointer-events: none;
  box-shadow: 0 10px 28px rgba(0,0,0,.3);
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.wa-fab .wa-label::after {
  content: ""; position: absolute; right: -5px; top: 50%;
  width: 11px; height: 11px; background: var(--navy);
  transform: translateY(-50%) rotate(45deg);
}
.wa-fab:hover .wa-label { opacity: 1; transform: translateY(-50%) translateX(0); }
@media (max-width: 620px) {
  .wa-fab { right: 16px; bottom: 16px; width: 56px; height: 56px; }
  .wa-fab .wa-label { display: none; }
}
@media (prefers-reduced-motion: reduce) { .wa-fab::before { animation: none; } }
