/* ============================================================
   base.css — Reset + estilos HTML primitivos
   Importar después de tokens.css
   ============================================================ */

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

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

body {
  font-family: var(--font-base);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: #232d36;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Tipografía primitiva ────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--color-text);
}

h1 { font-size: clamp(var(--text-2xl), 5vw, var(--text-3xl)); font-weight: var(--weight-extrabold); }
h2 { font-size: clamp(var(--text-xl), 3vw, var(--text-2xl)); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-md); }
h5 { font-size: var(--text-base); }
h6 { font-size: var(--text-sm); }

p {
  line-height: var(--leading-relaxed);
  color: var(--color-text-soft);
}

a {
  color: var(--color-green);
  text-decoration: none;
  transition: opacity var(--transition-base);
}
a:hover { opacity: 0.8; }
a:focus-visible { outline: 2px solid var(--color-green); outline-offset: 2px; border-radius: var(--radius-sm); }

strong { font-weight: var(--weight-semibold); color: var(--color-text); }
em     { font-style: normal; }

small  { font-size: var(--text-xs); }

/* ── Imágenes ────────────────────────────────────────────────── */
img, video, svg {
  display: block;
  max-width: 100%;
}

img { height: auto; }

/* ── Inputs base ─────────────────────────────────────────────── */
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}
button:focus-visible { outline: 2px solid var(--color-green); outline-offset: 2px; border-radius: var(--radius-sm); }
button:disabled { cursor: not-allowed; opacity: 0.5; }

input, textarea, select {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  padding: var(--space-3) var(--space-4);
  width: 100%;
  outline: none;
  transition: border-color var(--transition-base);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--color-green);
}
input::placeholder, textarea::placeholder {
  color: var(--color-text-muted);
}

/* ── Listas ──────────────────────────────────────────────────── */
ul, ol { list-style: none; }

/* ── Separadores ─────────────────────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
}

/* ── Scrollbar (Webkit) ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: var(--radius-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

/* ── Selección de texto ──────────────────────────────────────── */
::selection { background: var(--color-green-glow); color: var(--color-text); }

/* ── Layout base ─────────────────────────────────────────────── */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content-area {
  flex: 1;
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
  padding: var(--space-10) var(--content-padding);
}

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

/* ── Animaciones primitivas ──────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes shimmer {
  from { background-position: -200% center; }
  to   { background-position:  200% center; }
}

/* ── Reducción de movimiento ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
