/*
 * ================================================================
 *  EL MAPA DEL DINERO — global.css
 *  Variables CSS, reset, tipografía base, utilidades y botones
 *  Autor  : G.G. Alassia
 *  Versión: 1.0.0
 * ================================================================
 */

/* ----------------------------------------------------------------
   1. GOOGLE FONTS
---------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

/* ----------------------------------------------------------------
   2. VARIABLES GLOBALES
---------------------------------------------------------------- */
:root {
  /* Fondos */
  --bg   : #1A2340;
  --bg-2 : #0F1B33;
  --bg-3 : #0D1828;

  /* Superficies */
  --surface   : rgba(255,255,255,0.04);
  --surface-2 : rgba(255,255,255,0.07);

  /* Bordes */
  --border   : rgba(255,255,255,0.08);
  --border-2 : rgba(255,255,255,0.13);

  /* Paleta de marca */
  --navy     : #1A2340;
  --gold     : #C9A84C;
  --gold-dim : rgba(201,168,76,0.15);
  --gold-glow: rgba(201,168,76,0.08);
  --cream    : #FAF7F0;
  --white    : #FFFFFF;

  /* Texto */
  --text   : rgba(255,255,255,0.92);
  --muted  : rgba(255,255,255,0.40);
  --muted2 : rgba(255,255,255,0.60);

  /* Acento por volumen */
  --vol1     : #C0392B;
  --vol1-dim : rgba(192,57,43,0.15);
  --vol2     : #2980B9;
  --vol2-dim : rgba(41,128,185,0.15);
  --vol3     : #27AE60;
  --vol3-dim : rgba(39,174,96,0.15);

  /* Tipografía */
  --font-display : 'Playfair Display', Georgia, serif;
  --font-body    : 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Radios */
  --r-sm : 8px;
  --r-md : 14px;
  --r-lg : 20px;
  --r-xl : 28px;

  /* Curvas de animación */
  --ease     : cubic-bezier(0.4,0,0.2,1);
  --ease-out : cubic-bezier(0,0,0.2,1);

  /* Espaciado modular */
  --sp-xs :  8px;
  --sp-sm : 16px;
  --sp-md : 32px;
  --sp-lg : 64px;
  --sp-xl : 120px;
}

/* ----------------------------------------------------------------
   3. RESET
---------------------------------------------------------------- */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

html {
  scroll-behavior : smooth;
  font-size       : 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background              : var(--bg);
  color                   : var(--text);
  font-family             : var(--font-body);
  font-weight             : 300;
  line-height             : 1.6;
  overflow-x              : hidden;
  -webkit-font-smoothing  : antialiased;
  -moz-osx-font-smoothing : grayscale;
}

img, video, svg { display:block; max-width:100%; }
a   { color:inherit; text-decoration:none; }
ul  { list-style:none; }
button { font-family:inherit; cursor:pointer; }
input, textarea { font-family:inherit; }

/* ----------------------------------------------------------------
   4. CONTENEDORES
---------------------------------------------------------------- */
.container        { max-width:1200px; margin:0 auto; padding:0 32px; }
.container--narrow{ max-width:800px;  margin:0 auto; padding:0 32px; }
.container--wide  { max-width:1400px; margin:0 auto; padding:0 32px; }

/* ----------------------------------------------------------------
   5. TIPOGRAFÍA BASE
---------------------------------------------------------------- */
h1,h2,h3,h4,h5,h6 {
  font-family    : var(--font-display);
  font-weight    : 500;
  line-height    : 1.15;
  letter-spacing : -0.01em;
  color          : var(--white);
}

p {
  font-weight : 300;
  line-height : 1.7;
  color       : var(--muted2);
}

em { font-style:italic; }

/* ----------------------------------------------------------------
   6. ETIQUETAS DE SECCIÓN
---------------------------------------------------------------- */
.section-label {
  display        : block;
  font-size      : 11px;
  font-weight    : 500;
  letter-spacing : 0.20em;
  text-transform : uppercase;
  color          : var(--gold);
  margin-bottom  : 16px;
}

.section-title {
  font-family    : var(--font-display);
  font-size      : clamp(28px, 4vw, 48px);
  font-weight    : 500;
  line-height    : 1.15;
  letter-spacing : -0.01em;
  color          : var(--white);
  margin-bottom  : 16px;
}

.section-title em { font-style:italic; color:var(--gold); }

.section-desc {
  font-size     : 16px;
  color         : var(--muted2);
  line-height   : 1.7;
  font-weight   : 300;
  max-width     : 560px;
  margin-bottom : 60px;
}

/* ----------------------------------------------------------------
   7. BOTONES
---------------------------------------------------------------- */
.btn {
  display        : inline-flex;
  align-items    : center;
  gap            : 8px;
  font-family    : var(--font-body);
  font-weight    : 500;
  font-size      : 14px;
  border         : none;
  cursor         : pointer;
  transition     : all 0.25s var(--ease);
  white-space    : nowrap;
  text-decoration: none;
  border-radius  : var(--r-sm);
  padding        : 13px 24px;
}

/* Primario — dorado */
.btn-primary {
  background : var(--gold);
  color      : #0D1117;
}
.btn-primary:hover {
  background : #d4b05e;
  transform  : translateY(-2px);
  box-shadow : 0 8px 28px rgba(201,168,76,0.28);
}

/* Fantasma */
.btn-ghost {
  background : transparent;
  color      : var(--muted2);
  border     : 1px solid var(--border-2);
}
.btn-ghost:hover {
  color      : var(--white);
  border-color: rgba(255,255,255,0.25);
  background : var(--surface);
}

/* Contorno dorado */
.btn-outline-gold {
  background : transparent;
  color      : var(--gold);
  border     : 1px solid rgba(201,168,76,0.40);
}
.btn-outline-gold:hover {
  background : var(--gold-dim);
  border-color: var(--gold);
}

/* Tamaño grande */
.btn-lg { padding:16px 32px; font-size:16px; }

/* ----------------------------------------------------------------
   8. FORMULARIOS
---------------------------------------------------------------- */
.form-group    { margin-bottom:16px; }

.form-label {
  display        : block;
  font-size      : 12px;
  font-weight    : 500;
  color          : var(--muted2);
  letter-spacing : 0.05em;
  margin-bottom  : 8px;
}

.form-input {
  width       : 100%;
  background  : rgba(255,255,255,0.05);
  border      : 1px solid var(--border);
  border-radius: var(--r-sm);
  padding     : 13px 16px;
  color       : var(--white);
  font-family : var(--font-body);
  font-size   : 15px;
  font-weight : 300;
  transition  : border-color 0.2s, background 0.2s;
  outline     : none;
}
.form-input::placeholder { color:var(--muted); }
.form-input:focus {
  border-color: rgba(201,168,76,0.40);
  background  : rgba(255,255,255,0.07);
}

.form-submit {
  width         : 100%;
  background    : var(--gold);
  color         : #0D1117;
  border        : none;
  padding       : 15px 24px;
  border-radius : var(--r-sm);
  font-family   : var(--font-body);
  font-size     : 15px;
  font-weight   : 500;
  cursor        : pointer;
  margin-top    : 8px;
  transition    : all 0.25s var(--ease);
}
.form-submit:hover {
  background : #d4b05e;
  transform  : translateY(-1px);
  box-shadow : 0 8px 28px rgba(201,168,76,0.30);
}
.form-submit:disabled { opacity:0.7; cursor:not-allowed; transform:none; }

/* ----------------------------------------------------------------
   9. EFECTOS VISUALES GLOBALES
---------------------------------------------------------------- */
/* Grano de textura (overlay fijo) */
.grain-overlay {
  position       : fixed;
  inset          : 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events : none;
  z-index        : 9999;
  opacity        : 0.45;
}

/* Grid sutil de fondo */
.grid-bg {
  position       : absolute;
  inset          : 0;
  background-image:
    linear-gradient(rgba(201,168,76,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,168,76,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events : none;
}

/* ----------------------------------------------------------------
   10. ANIMACIONES
---------------------------------------------------------------- */
/* Scroll reveal
   IMPORTANTE: solo se ocultan los elementos cuando JS confirmó que cargó
   (.js-ready en <html>). Sin JS, todo el contenido es visible por defecto. */
.js-ready .reveal {
  opacity   : 0;
  transform : translateY(30px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.js-ready .reveal.visible { opacity:1; transform:translateY(0); }

/* Delays — también gateados para evitar contenido invisible sin animación */
.js-ready .delay-1 { transition-delay:0.10s; }
.js-ready .delay-2 { transition-delay:0.20s; }
.js-ready .delay-3 { transition-delay:0.30s; }
.js-ready .delay-4 { transition-delay:0.40s; }

@keyframes float {
  0%,100% { transform:translateY(0); }
  50%      { transform:translateY(-10px); }
}

@keyframes pulse-gold {
  0%,100% { box-shadow:0 0 0 0   rgba(201,168,76,0); }
  50%      { box-shadow:0 0 0 8px rgba(201,168,76,0.08); }
}

/* Toast de confirmación */
.toast {
  position      : fixed;
  bottom        : 32px;
  right         : 32px;
  background    : rgba(39,174,96,0.15);
  border        : 1px solid rgba(39,174,96,0.30);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius : var(--r-md);
  padding       : 16px 24px;
  color         : var(--vol3);
  font-size     : 14px;
  font-weight   : 500;
  z-index       : 9000;
  transform     : translateY(100px);
  opacity       : 0;
  transition    : all 0.4s var(--ease-out);
  pointer-events: none;
}
.toast.show { transform:translateY(0); opacity:1; }

/* ----------------------------------------------------------------
   11. RESPONSIVE BASE
---------------------------------------------------------------- */
@media (max-width:1024px) {
  .container,.container--narrow,.container--wide { padding:0 24px; }
}
@media (max-width:768px) {
  :root { --sp-xl:80px; --sp-lg:48px; }
  .container,.container--narrow,.container--wide { padding:0 20px; }
}
@media (max-width:480px) {
  :root { --sp-xl:60px; --sp-lg:40px; }
}
