/* ============================================================
   Magic Partner — Web corporativa
   Shared styling for index + legal + 404.
   Relies on colors_and_type.css for tokens.
   ============================================================ */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--surface-canvas);
  color: var(--fg-1);
  overflow-x: hidden;
  font-family: var(--font-body);
  font-weight: var(--weight-light);
}

img { max-width: 100%; display: block; }

::selection { background: var(--mp-cyan); color: var(--mp-navy-900); }

/* Container ---------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-lg);
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 640px) { .container { padding: 0 20px; } }

/* ============================================================
   Magic Wand cursor trail (canvas, full-screen, fixed)
   ============================================================ */
#wand-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
  mix-blend-mode: screen;
}
/* hide on touch / coarse pointers */
@media (hover: none), (pointer: coarse) {
  #wand-canvas { display: none; }
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 0;
  transition: background-color var(--dur-base) var(--ease-out),
              backdrop-filter var(--dur-base) var(--ease-out),
              padding var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(4, 18, 44, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 12px 0;
  border-bottom-color: rgba(255,255,255,0.08);
}
/* Header light variant for white-bg legal pages */
.site-header.is-light {
  border-bottom-color: var(--border-subtle);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
}
.site-header.is-light .nav-link { color: var(--fg-2); }
.site-header.is-light .nav-link:hover { color: var(--mp-navy); }
.site-header.is-light .brand-wm { color: var(--mp-navy); }
.site-header.is-light .brand-wm small { color: var(--mp-gray-500); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
}
.brand-iso {
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 4px 16px rgba(33,212,217,0.35));
  transition: transform var(--dur-base) var(--ease-out);
}
.brand:hover .brand-iso { transform: rotate(-6deg) scale(1.05); }
.brand-wm {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: 16px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mp-cyan);
  line-height: 1;
}
.brand-wm small {
  display: block;
  font-family: var(--font-body);
  font-weight: var(--weight-thin);
  font-size: 9.5px;
  letter-spacing: 0.42em;
  color: var(--mp-gray-300);
  margin-top: 4px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 36px;
}
.nav-link {
  font-size: 13px;
  font-weight: var(--weight-light);
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
  letter-spacing: 0.02em;
}
.nav-link:hover { color: var(--mp-cyan); }
.nav .btn-pill {
  margin-left: 8px;
}

.nav-toggle {
  display: none;
  appearance: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 18px;
  height: 1.5px;
  background: #fff;
  position: relative;
  transition: transform var(--dur-base) var(--ease-out);
}
.nav-toggle span::before { position: absolute; top: -6px; left: 0; }
.nav-toggle span::after  { position: absolute; top: 6px; left: 0; }
.is-light .nav-toggle { border-color: var(--border-default); }
.is-light .nav-toggle span,
.is-light .nav-toggle span::before,
.is-light .nav-toggle span::after { background: var(--fg-1); }

@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: fixed;
    inset: 0 0 0 0;
    top: 0;
    background: var(--mp-navy-900);
    flex-direction: column;
    justify-content: center;
    gap: 32px;
    transform: translateX(100%);
    transition: transform var(--dur-slow) var(--ease-out);
    padding: 80px 32px;
    z-index: 90;
  }
  .nav.is-open { transform: translateX(0); }
  .nav-link {
    font-size: 22px;
    color: #fff;
  }
  .nav .btn-pill { margin: 12px 0 0; }
  body.nav-open { overflow: hidden; }
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: var(--weight-bold);
  font-size: 14px;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all var(--dur-base) var(--ease-out);
  white-space: nowrap;
}
.btn .arrow {
  display: inline-block;
  transition: transform var(--dur-base) var(--ease-out);
}
.btn:hover .arrow { transform: translateX(4px); }

.btn-primary {
  background: var(--mp-cyan);
  color: var(--mp-navy-900);
}
.btn-primary:hover {
  background: #fff;
  box-shadow: var(--shadow-cyan-glow);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.22);
}
.btn-ghost:hover {
  border-color: var(--mp-cyan);
  color: var(--mp-cyan);
  background: rgba(33,212,217,0.06);
}
.btn-outline {
  background: transparent;
  color: var(--mp-navy);
  border: 1.5px solid var(--mp-navy-200);
}
.btn-outline:hover {
  background: var(--mp-navy);
  color: #fff;
  border-color: var(--mp-navy);
}
.btn-pill { padding: 11px 22px; font-size: 13px; }

/* ============================================================
   Sections
   ============================================================ */
.section {
  position: relative;
  padding: 120px 0;
}
@media (max-width: 880px) { .section { padding: 80px 0; } }

.section-eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: var(--weight-bold);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mp-cyan-700);
}
.on-dark .section-eyebrow { color: var(--mp-cyan); }

.section-title {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 16px 0 24px;
  color: var(--fg-1);
}
.on-dark .section-title { color: #fff; }

.section-lead {
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.6;
  color: var(--fg-2);
  max-width: 58ch;
}
.on-dark .section-lead { color: rgba(255,255,255,0.8); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--mp-navy-900);
  color: rgba(255,255,255,0.7);
  padding: 80px 0 32px;
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--mp-cyan), transparent);
  opacity: 0.4;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
}
@media (max-width: 880px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-col h4 {
  font-family: var(--font-body);
  font-weight: var(--weight-bold);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mp-cyan);
  margin: 0 0 18px;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-col a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: var(--weight-light);
  transition: color var(--dur-fast) var(--ease-out);
}
.footer-col a:hover { color: var(--mp-cyan); }
.footer-brand p {
  font-size: 14px;
  line-height: 1.6;
  margin: 18px 0;
  max-width: 32ch;
  color: rgba(255,255,255,0.65);
}
.footer-brand .brand-wm small { color: rgba(255,255,255,0.55); }

.footer-bottom {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.04em;
}
.footer-bottom .legal-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-bottom .legal-links a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
}
.footer-bottom .legal-links a:hover { color: var(--mp-cyan); }

/* ============================================================
   Cookie banner (capa 1)
   ============================================================ */
.cookie-banner {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  background: var(--mp-navy-900);
  color: #fff;
  border: 1px solid rgba(33,212,217,0.25);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  max-width: 1100px;
  margin: 0 auto;
  transform: translateY(140%);
  opacity: 0;
  transition: transform var(--dur-slow) var(--ease-out),
              opacity var(--dur-slow) var(--ease-out);
}
.cookie-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
}
.cookie-banner .cb-text {
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(255,255,255,0.82);
  max-width: 56ch;
  margin: 0;
}
.cookie-banner .cb-text a {
  color: var(--mp-cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cookie-banner .cb-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.cookie-banner .cb-btn {
  appearance: none;
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
  font-weight: var(--weight-bold);
  font-size: 13px;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  transition: all var(--dur-base) var(--ease-out);
}
.cookie-banner .cb-accept {
  background: var(--mp-cyan);
  color: var(--mp-navy-900);
}
.cookie-banner .cb-accept:hover { background: #fff; }
.cookie-banner .cb-reject,
.cookie-banner .cb-config {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.2);
}
.cookie-banner .cb-reject:hover,
.cookie-banner .cb-config:hover {
  border-color: var(--mp-cyan);
  color: var(--mp-cyan);
}
@media (max-width: 720px) {
  .cookie-banner { flex-direction: column; align-items: stretch; left: 16px; right: 16px; bottom: 16px; padding: 18px 20px; }
  .cookie-banner .cb-actions { justify-content: stretch; }
  .cookie-banner .cb-btn { flex: 1; text-align: center; }
}

/* ============================================================
   Reveal on scroll
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal[data-delay="1"] { transition-delay: 80ms; }
.reveal[data-delay="2"] { transition-delay: 160ms; }
.reveal[data-delay="3"] { transition-delay: 240ms; }
.reveal[data-delay="4"] { transition-delay: 320ms; }

/* prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  #wand-canvas { display: none; }
}

/* ============================================================
   Skip link (a11y)
   ============================================================ */
.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 10px 16px;
  background: var(--mp-cyan);
  color: var(--mp-navy-900);
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  transform: translateY(-200%);
  z-index: 999;
  transition: transform var(--dur-base) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }
