/* ==============================================
   eMarket — Base: Variables + Reset + Tipografía
   ============================================== */

/* ---------- VARIABLES ESTÁTICAS (independientes del tema) ---------- */
:root {
  --radius-sm:  .5rem;
  --radius-md:  .75rem;
  --radius-lg:  1.25rem;
  --radius-xl:  1.75rem;
  --radius-full: 999px;
}

/* ---------- VARIABLES MODO CLARO ---------- */
@media (prefers-color-scheme: light) {
  :root {
    /* Azul corporativo — ligeramente más profundo para pasar contraste AA como texto */
    --primary-400: #4fa3ff;
    --primary-500: #0070d1;
    --primary-600: #0059a8;
    --primary-700: #004285;

    --secondary-400: #33bbff;
    --secondary-500: #00aaff;
    --secondary-600: #0088cc;

    /* Índigo moderno — reemplaza el #0800ff eléctrico */
    --accent-500: #4f46e5;
    --accent-600: #4338ca;

    --bg-page:       #f9faff;   /* casi blanco — secciones normales */
    --bg-card:       #ffffff;
    --bg-card-alt:   #e8ecff;  /* azul claro visible — secciones alternadas */
    --bg-dark:       #0a0a29;
    --bg-dark-2:     #141452;

    /* Texto en tonos fríos, consistentes con la paleta azulada */
    --text-main:    #111827;   /* negro limpio sin tinte cálido */
    --text-muted:   #4b5563;   /* gris frío — 5.9:1 sobre blanco ✓ */
    --text-light:   #6b7280;   /* gris frío — 4.6:1 sobre blanco ✓ (era 2.9:1) */
    --text-inverse: #ffffff;

    --border-color: #c4c9df;   /* claramente visible sobre fondo claro */

    --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
    --shadow-md:  0 4px 16px rgba(0,0,0,.10);
    --shadow-lg:  0 8px 32px rgba(0,0,0,.14);
    --shadow-xl:  0 16px 48px rgba(0,0,0,.18);

    --navbar-bg:  rgba(255,255,255,.95);
  }
}

/* ---------- VARIABLES MODO OSCURO ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --primary-400: #3396ff;
    --primary-500: #007bff;
    --primary-600: #0063cc;
    --primary-700: #004a99;

    --secondary-400: #33bbff;
    --secondary-500: #00aaff;
    --secondary-600: #0088cc;

    --accent-500: #3a33ff;
    --accent-600: #0800ff;

    --bg-page:       #080820;
    --bg-card:       #0e0e2e;
    --bg-card-alt:   #141445;
    --bg-dark:       #050514;
    --bg-dark-2:     #0a0a29;

    --text-main:    #e6e6e5;
    --text-muted:   #b3b3b2;
    --text-light:   #81817e;
    --text-inverse: #ffffff;

    --border-color: #1f1f60;

    --shadow-sm:  0 1px 3px rgba(0,0,0,.3);
    --shadow-md:  0 4px 16px rgba(0,0,0,.4);
    --shadow-lg:  0 8px 32px rgba(0,0,0,.5);
    --shadow-xl:  0 16px 48px rgba(0,0,0,.6);

    --navbar-bg:  rgba(8,8,32,.94);
  }
}

/* ---------- OVERRIDE MANUAL DE TEMA ---------- */
:root[data-theme="light"] {
  --primary-400: #4fa3ff;
  --primary-500: #0070d1;
  --primary-600: #0059a8;
  --primary-700: #004285;
  --secondary-400: #33bbff;
  --secondary-500: #00aaff;
  --secondary-600: #0088cc;
  --accent-500: #4f46e5;
  --accent-600: #4338ca;
  --bg-page:       #f9faff;
  --bg-card:       #ffffff;
  --bg-card-alt:   #e8ecff;
  --bg-dark:       #0a0a29;
  --bg-dark-2:     #141452;
  --text-main:    #111827;
  --text-muted:   #4b5563;
  --text-light:   #6b7280;
  --text-inverse: #ffffff;
  --border-color: #c4c9df;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.14);
  --shadow-xl:  0 16px 48px rgba(0,0,0,.18);
  --navbar-bg:  rgba(255,255,255,.95);
}

:root[data-theme="dark"] {
  --primary-400: #3396ff;
  --primary-500: #007bff;
  --primary-600: #0063cc;
  --primary-700: #004a99;
  --secondary-400: #33bbff;
  --secondary-500: #00aaff;
  --secondary-600: #0088cc;
  --accent-500: #3a33ff;
  --accent-600: #0800ff;
  --bg-page:       #080820;
  --bg-card:       #0e0e2e;
  --bg-card-alt:   #141445;
  --bg-dark:       #050514;
  --bg-dark-2:     #0a0a29;
  --text-main:    #e6e6e5;
  --text-muted:   #b3b3b2;
  --text-light:   #81817e;
  --text-inverse: #ffffff;
  --border-color: #1f1f60;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.3);
  --shadow-md:  0 4px 16px rgba(0,0,0,.4);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.5);
  --shadow-xl:  0 16px 48px rgba(0,0,0,.6);
  --navbar-bg:  rgba(8,8,32,.94);
}

/* gradient-text en modo claro manual */
[data-theme="light"] .gradient-text {
  background: linear-gradient(135deg, #60aeff, #00d4ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

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

a {
  color: var(--primary-500);
  text-decoration: none;
  transition: color .2s;
}
a:hover { color: var(--primary-400); }

ul, ol { list-style: none; }

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

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ---------- TIPOGRAFÍA ---------- */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  font-weight: 700;
  color: var(--text-main);
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.1rem; }

p { color: var(--text-muted); }

/* ---------- LAYOUT UTILITIES ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  padding: 5rem 0;
}

.section--dark {
  background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-dark-2) 100%);
  color: #fff;
}
.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 { color: #fff; }
.section--dark p    { color: rgba(255,255,255,.7); }

.section--alt {
  background: var(--bg-card-alt);
}

/* ---------- UTILIDADES ---------- */
.hidden      { display: none !important; }
.sr-only     { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.mt-md       { margin-top: 1rem; }
.mt-xl       { margin-top: 2.5rem; }

.gradient-text {
  background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
/* En modo claro el gradient-text aparece sobre fondo oscuro (hero),
   se usan colores claros/brillantes para que sea legible */
@media (prefers-color-scheme: light) {
  .gradient-text {
    background: linear-gradient(135deg, #60aeff, #00d4ff);
    -webkit-background-clip: text;
    background-clip: text;
  }
}

/* ---------- SECTION HEADER ---------- */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}
.section-header h2  { margin-bottom: .75rem; }
.section-header p   { max-width: 560px; margin: 0 auto; font-size: 1.05rem; }

/* ---------- REVEAL ANIMATION ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .55s ease, transform .55s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- LOADING SKELETON ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--border-color) 25%, var(--bg-card-alt) 50%, var(--border-color) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-loading {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- SCROLLBAR ---------- */
::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-page); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-500); }

@keyframes spin { to { transform: rotate(360deg); } }
