/* ========================================================================
   GLOBAL RESET + BASE
   ======================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html,
body {
  background: var(--color-void);
  color: var(--color-text-body);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

html {
  scroll-behavior: auto;
}

/* Lenis owns scroll */
body {
  min-height: 100vh;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

input,
textarea,
select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

::selection {
  background: rgba(245, 200, 66, 0.35);
  color: var(--color-film-white);
}

:focus-visible {
  outline: 2px solid var(--color-halation);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ========================================================================
   TYPOGRAPHIC PRIMITIVES
   ======================================================================== */

.t-display {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 0.95;
  color: var(--color-accent);
}

.t-display-glow {
  text-shadow: var(--glow-full);
}

.t-display-glow-mid {
  text-shadow: var(--glow-mid);
}

.t-mono {
  font-family: var(--font-body);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 11px;
  color: var(--color-text-secondary);
}

.t-eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  text-shadow: var(--glow-soft);
}

.t-body-l {
  font-size: 18px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--color-text-muted);
}

.t-body {
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--color-text-body);
}

.t-body-s {
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-text-muted);
}

.t-caption {
  font-size: 13px;
  line-height: 1.4;
  color: var(--color-text-muted);
}

/* ========================================================================
   LAYOUT PRIMITIVES
   ======================================================================== */

.container {
  width: 100%;
  max-width: var(--container-default);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.container--wide {
  max-width: var(--container-wide);
}

section {
  position: relative;
}

/* ========================================================================
   SCROLL REVEAL — shared
   ======================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition:
    opacity var(--duration-reveal) var(--easing-cinematic),
    transform var(--duration-reveal) var(--easing-cinematic);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal--fade {
  clip-path: none;
  transform: translateY(20px);
}

.reveal--fade.is-visible {
  transform: translateY(0);
}

/* staggered children helpers */
.stagger>*.reveal {
  transition-delay: 0ms;
}

.stagger>*.reveal:nth-child(2) {
  transition-delay: var(--stagger-base);
}

.stagger>*.reveal:nth-child(3) {
  transition-delay: calc(var(--stagger-base) * 2);
}

.stagger>*.reveal:nth-child(4) {
  transition-delay: calc(var(--stagger-base) * 3);
}

.stagger>*.reveal:nth-child(5) {
  transition-delay: calc(var(--stagger-base) * 4);
}

/* ========================================================================
   BUTTONS — primary CTA "halation fill"
   ======================================================================== */

/* Unified CTA — teal (interaction color). All primary CTAs share this look. */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--brand-teal);
  color: var(--brand-teal);
  background: rgba(63, 224, 208, 0.12);
  padding: 16px 40px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: none;
  overflow: hidden;
  cursor: pointer;
  transition:
    color var(--duration-micro) var(--easing-film),
    box-shadow var(--duration-base) var(--easing-film);
  isolation: isolate;
  white-space: nowrap;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--brand-teal);
  transform: translateX(-101%);
  transition: transform var(--duration-base) var(--easing-film);
  z-index: -1;
}

.btn:hover {
  color: var(--bg-deep);
  text-shadow: none;
  box-shadow: 0 0 24px var(--brand-teal-glow);
}

.btn:hover::before {
  transform: translateX(0);
}

.btn--block {
  display: flex;
  justify-content: center;
  width: 100%;
}

/* Featured plan CTA — already-filled teal that reverses on hover. */
.btn--cyan {
  border-color: var(--brand-teal);
  color: var(--bg-deep);
  background: var(--brand-teal);
}

.btn--cyan::before {
  background: var(--bg-deep);
}

.btn--cyan:hover {
  color: var(--brand-teal);
  box-shadow: 0 0 24px var(--brand-teal-glow);
}

/* Ghost — same teal CTA language as base. The legacy tungsten variant
   (beige/crema) is retired; "AGENDA CON NOSOTROS" inherits the unified look. */
.btn--ghost {
  border-color: var(--brand-teal);
  color: var(--brand-teal);
  background: rgba(63, 224, 208, 0.12);
}

.btn--ghost::before {
  background: var(--brand-teal);
}

.btn--ghost:hover {
  color: var(--bg-deep);
}

/* ========================================================================
   GLOW LINK — used for nav, footer, in-body anchors
   ======================================================================== */

.glow-link {
  transition:
    text-shadow var(--duration-micro) var(--easing-film),
    color var(--duration-micro) var(--easing-film);
}

.glow-link:hover {
  text-shadow: var(--glow-soft);
  color: var(--color-tungsten);
}

/* ========================================================================
   GRAIN OVERLAY — body-level texture
   ======================================================================== */

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: calc(0.10 * var(--tweak-grain, 1));
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.95  0 0 0 0 0.86  0 0 0 0 0.78  0 0 0 0.8 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
}

/* ========================================================================
   CUSTOM CURSOR
   ======================================================================== */

@media (hover: hover) and (pointer: fine) {
  body {
    cursor: none;
  }

  a,
  button,
  [data-cursor] {
    cursor: none;
  }

  .cursor-dot,
  .cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    will-change: transform, width, height;
  }

  .cursor-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-halation);
    box-shadow: 0 0 12px rgba(245, 200, 66, 0.8), 0 0 24px rgba(245, 200, 66, 0.4);
    mix-blend-mode: difference;
    transition: width var(--duration-micro) var(--easing-spring),
      height var(--duration-micro) var(--easing-spring);
  }

  .cursor-ring {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--color-halation);
    opacity: 0.4;
    transition: width var(--duration-micro) var(--easing-spring),
      height var(--duration-micro) var(--easing-spring),
      opacity var(--duration-micro) var(--easing-film);
  }

  .cursor-dot.is-hover {
    width: 24px;
    height: 24px;
  }

  .cursor-ring.is-hover {
    width: 56px;
    height: 56px;
    opacity: 0.8;
  }

  .cursor-dot.is-press {
    width: 6px;
    height: 6px;
  }
}

@media (hover: none),
(pointer: coarse) {

  .cursor-dot,
  .cursor-ring {
    display: none;
  }
}

/* ========================================================================
   FLOATING WHATSAPP
   ======================================================================== */

.whatsapp {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 90;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--color-halation);
  background: var(--color-void);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px rgba(245, 200, 66, 0.30), 0 0 28px rgba(245, 200, 66, 0.18), 0 0 64px rgba(245, 200, 66, 0.06);
  opacity: 0;
  transform: scale(0.6);
  pointer-events: none;
  transition:
    opacity var(--duration-base) var(--easing-film),
    transform var(--duration-base) var(--easing-spring),
    box-shadow var(--duration-base) var(--easing-film);
}

.whatsapp.is-visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.whatsapp:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 1px var(--color-halation), 0 0 40px rgba(245, 200, 66, 0.45), 0 0 90px rgba(245, 200, 66, 0.12);
}

.whatsapp svg {
  color: var(--color-halation);
  width: 22px;
  height: 22px;
}

@media (max-width: 768px) {
  .whatsapp {
    width: 64px;
    height: 64px;
    bottom: 24px;
    right: 24px;
  }

  .whatsapp svg {
    width: 26px;
    height: 26px;
  }
}

/* ========================================================================
   NAVBAR
   ======================================================================== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 76px;
  width: 100%;
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8, 10, 12, 0.72);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 0.5px solid var(--color-border);
}

.navbar__logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 2px;
}

.navbar__wordmark {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 400;
  font-size: 18px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent);
  text-shadow: var(--glow-soft);
  margin-left: 14px;
}

.navbar__left {
  display: flex;
  align-items: center;
}

.navbar__right {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar__pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-teal);
  box-shadow: 0 0 8px var(--brand-teal-glow);
  animation: nav-pulse 2.4s var(--easing-in-out) infinite;
}

@keyframes nav-pulse {

  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.3);
  }
}

@media (max-width: 640px) {
  .navbar__wordmark {
    display: none;
  }

  .navbar__right {
    font-size: 9px;
  }
}

/* ========================================================================
   LOADING SCREEN
   ======================================================================== */

.loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--color-void);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 32px;
  transition:
    opacity var(--duration-cinematic) var(--easing-cinematic),
    transform var(--duration-cinematic) var(--easing-cinematic),
    visibility 0s linear var(--duration-cinematic);
}

.loader.is-gone {
  opacity: 0;
  transform: scale(1.06);
  visibility: hidden;
}

.loader__logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  filter: drop-shadow(0 0 24px rgba(245, 200, 66, 0.35));
}

.loader__bar {
  width: 180px;
  height: 1px;
  background: var(--color-border);
  position: relative;
  overflow: hidden;
}

.loader__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-halation);
  transform: translateX(-100%);
  animation: loader-fill 2.4s var(--easing-cinematic) forwards;
}

@keyframes loader-fill {
  to {
    transform: translateX(0);
  }
}

.loader__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

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

.footer {
  padding: var(--space-8) 0 var(--space-6);
  background: var(--color-void);
  border-top: 0.5px solid var(--color-border);
  position: relative;
  z-index: 2;
}

.footer__grid {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: grid;
  grid-template-columns: 2fr 3fr 2fr;
  gap: var(--space-6);
  align-items: center;
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer__brand video {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.footer__legal {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.footer__tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-halation);
  text-align: center;
}

.footer__socials {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

.footer__socials a {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-tungsten);
  transition: color var(--duration-micro) var(--easing-film), text-shadow var(--duration-micro) var(--easing-film);
}

.footer__socials a:hover {
  color: var(--color-halation);
  text-shadow: var(--glow-soft);
}

.footer__socials svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 768px) {
  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
    text-align: center;
  }

  .footer__socials {
    justify-content: center;
  }

  .footer__socials a {
    width: 44px;
    height: 44px;
  }

  .footer__socials svg {
    width: 22px;
    height: 22px;
  }
}

@media (max-width: 480px) {
  .btn {
    min-height: 48px;
    padding: 14px 20px;
    white-space: normal;
    text-align: center;
    justify-content: center;
  }
}

/* ========================================================================
   REDUCED MOTION
   ======================================================================== */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .cursor-dot,
  .cursor-ring {
    display: none;
  }
}

/* ========================================================================
   CURSOR GLASS — gradient arrow cursor
   ======================================================================== */

:root {
  --cursor-size: 32px;
  --cursor-hover-scale: 1.4;
  --cursor-active-scale: 0.85;
  --cursor-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html, body,
a, button, input, textarea, select, label,
[role="button"], [data-cursor] {
  cursor: none !important;
}

.cursor-glass {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--cursor-size);
  height: var(--cursor-size);
  margin-left: calc(var(--cursor-size) / -2);
  margin-top: calc(var(--cursor-size) / -2);
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  will-change: transform, opacity;
  transition: opacity 220ms ease-out;
}
.cursor-glass.is-visible { opacity: 1; }

.cursor-glass__inner {
  width: 100%;
  height: 100%;
  transform: scale(1) rotate(0deg);
  transition: transform 360ms var(--cursor-ease), filter 360ms var(--cursor-ease);
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.15));
  mix-blend-mode: plus-lighter;
}
.cursor-glass__inner svg { display: block; width: 100%; height: 100%; overflow: visible; }

.cursor-glass.is-hover .cursor-glass__inner {
  transform: scale(var(--cursor-hover-scale)) rotate(-8deg);
  filter: drop-shadow(0 0 14px rgba(63, 224, 208, 0.55));
}
.cursor-glass.is-active .cursor-glass__inner {
  transform: scale(var(--cursor-active-scale));
  transition-duration: 120ms;
}
.cursor-glass.is-hover.is-active .cursor-glass__inner {
  transform: scale(calc(var(--cursor-hover-scale) * var(--cursor-active-scale))) rotate(-8deg);
}

@media (pointer: coarse), (max-width: 767px) {
  .cursor-glass { display: none !important; }
  html, body, a, button, input, textarea, select, label,
  [role="button"], [data-cursor] { cursor: auto !important; }
  a, button, [role="button"], [data-cursor] { cursor: pointer !important; }
}
@media (prefers-reduced-motion: reduce) {
  .cursor-glass__inner { transition: none; }
}
