/* =============================================================
   BASE.CSS — eden agency · sistema de diseño "liquid glass"
   Fuente única de tokens, fuentes y utilidades de vidrio.
   Lo cargan TODAS las páginas públicas antes que su CSS propio.
   ============================================================= */

/* ── Fuentes self-hosted ─────────────────────────────────── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/cormorant-garamond-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/cormorant-garamond-700-italic.woff2') format('woff2');
}

/* ── Tokens ──────────────────────────────────────────────── */
:root {
  /* Fondo */
  --bg: #050507;
  --bg-deep: #030304;
  --bg-elevated: #0b0b12;
  --text: #f4f6f5;
  --text-muted: rgba(230, 238, 235, 0.62);
  --text-faint: rgba(230, 238, 235, 0.38);

  /* Acento verde lima — identidad de marca */
  --accent: #a8ff3e;
  --accent-bright: #c1fd7b;
  --accent-deep: #8ee62e;
  --accent-glow: rgba(168, 255, 62, 0.16);
  --accent-ink: #0c1802;

  /* Vidrio */
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-bg-strong: rgba(255, 255, 255, 0.10);
  --glass-bg-hover: rgba(255, 255, 255, 0.09);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-highlight: rgba(255, 255, 255, 0.28);
  --glass-blur: 30px;
  --glass-saturate: 180%;

  /* Sombras */
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-float: 0 24px 64px rgba(0, 0, 0, 0.55);
  --shadow-accent: 0 8px 40px var(--accent-glow);

  /* Radios */
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  /* Movimiento */
  --ease-glass: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 0.2s;
  --dur-med: 0.45s;

  /* Alias de compatibilidad con el CSS legado */
  --primary: var(--accent);
  --primary-light: var(--accent-bright);
  --primary-glow: var(--accent-glow);
  --purple: var(--accent-bright);
  --purple-light: #7ff0dd;
  --purple-glow: rgba(94, 234, 212, 0.10);
  --bg-card: var(--glass-bg);
  --bg-card-hover: var(--glass-bg-hover);
  --glass: var(--glass-bg);
  --nav-bg: rgba(5, 5, 7, 0.55);
  --nav-bg-scrolled: rgba(5, 5, 7, 0.72);
  --card-shadow: var(--shadow-glass);
  --testimonial-bg: var(--glass-bg);
  --code-bg: rgba(168, 255, 62, 0.10);
  --particle-color: 168, 255, 62;
}

/* ── Reset y base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* overflow-x: clip (no hidden) — hidden crea un scroll container
   y rompe position: sticky en los descendientes */
html { scroll-behavior: smooth; scroll-padding-top: 72px; overflow-x: clip; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  /* Cuadrícula sutil de marca (coherente con las historias de IG) */
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.032) 1px, transparent 1px);
  background-size: 56px 56px;
  color: var(--text);
  line-height: 1.65;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent-deep); border-radius: var(--radius-pill); }

::selection { background: var(--accent-glow); color: var(--text); }

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

/* ── Utilidades liquid glass ─────────────────────────────── */
.glass {
  position: relative;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 0 var(--glass-highlight),
              inset 0 -1px 0 0 rgba(255, 255, 255, 0.04),
              var(--shadow-glass);
}

/* Borde de gradiente luminoso (refracción) — para superficies destacadas */
.glass-edge::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: linear-gradient(180deg,
              rgba(255, 255, 255, 0.35),
              rgba(255, 255, 255, 0.05) 40%,
              rgba(255, 255, 255, 0.12));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.glass-hover {
  transition: transform var(--dur-med) var(--ease-glass),
              background var(--dur-fast) ease,
              border-color var(--dur-fast) ease,
              box-shadow var(--dur-med) var(--ease-glass);
}
.glass-hover:hover {
  transform: translateY(-4px);
  background: var(--glass-bg-hover);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.4), var(--shadow-float);
}

@supports not (backdrop-filter: blur(1px)) {
  .glass { background: rgba(12, 12, 18, 0.92); }
}

/* ── Botones compartidos ─────────────────────────────────── */
.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
  color: var(--accent-ink);
  text-decoration: none;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), var(--shadow-accent);
  transition: transform var(--dur-fast) var(--ease-glass), box-shadow var(--dur-med) ease;
}
.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 12px 50px var(--accent-glow);
}

.btn-glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--glass-bg);
  color: var(--text);
  text-decoration: none;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--glass-border);
  cursor: pointer;
  -webkit-backdrop-filter: blur(16px) saturate(var(--glass-saturate));
  backdrop-filter: blur(16px) saturate(var(--glass-saturate));
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.18);
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease,
              transform var(--dur-fast) var(--ease-glass);
}
.btn-glass:hover {
  background: var(--glass-bg-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ── Cookie banner: entrada/salida animada ───────────────── */
#cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  z-index: 9999;
  border-radius: var(--radius-md);
  transform: translateX(-50%) translateY(24px) scale(0.97);
  opacity: 0;
  transition: transform 0.5s var(--ease-out), opacity 0.4s ease;
}
#cookie-banner.cb-visible {
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  #cookie-banner { transition: opacity 0.3s ease; transform: translateX(-50%); }
}

/* ── Barra de progreso de scroll ─────────────────────────── */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-bright));
  box-shadow: 0 0 8px var(--accent-glow);
  z-index: 1100;
  transform-origin: left;
  transition: width 0.1s linear;
}
@media (prefers-reduced-motion: reduce) { #scroll-progress { display: none; } }

/* ── Botón volver arriba ─────────────────────────────────── */
#back-to-top {
  position: fixed;
  right: clamp(16px, 4vw, 32px);
  bottom: clamp(16px, 4vw, 32px);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.9);
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-glass),
              visibility 0.35s, border-color 0.3s ease, box-shadow 0.3s ease;
}
#back-to-top svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
#back-to-top:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-glow), 0 8px 24px rgba(0,0,0,0.35); transform: translateY(-3px) scale(1); }
@media (prefers-reduced-motion: reduce) {
  #back-to-top { transition: opacity 0.2s ease, visibility 0.2s; transform: none !important; }
}

/* ── Iconos SVG (sprite inline) ──────────────────────────── */
.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.125em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ── Accesibilidad: movimiento reducido ──────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
