/* ═══════════════════════════════════════════════════════════════════
   base.css — Reset, layout primitivo y tipografía base
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Reset moderno (Andy Bell + custom) ───────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  /* Evita que el navegador "rubberbande" en los extremos */
  overscroll-behavior: none;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--text);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Background sutil con gradiente radial */
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(200, 162, 60, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 50%, rgba(52, 152, 219, 0.03) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg-base) 0%, var(--bg-elev-1) 100%);
  background-attachment: fixed;
}

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

a {
  color: var(--gold-light);
  text-decoration: none;
  transition: color var(--t-fast);
}

a:hover {
  color: var(--gold);
}

a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

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

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

ul, ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

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

.display {
  font-family: var(--font-display);
  font-weight: var(--fw-black);
}

p {
  line-height: var(--lh-normal);
}

strong, b {
  font-weight: var(--fw-bold);
  color: var(--text);
}

em, i {
  font-style: italic;
}

/* ─── Utilidades de color ──────────────────────────────────────── */
.gold       { color: var(--gold-light); }
.gold-d     { color: var(--gold); }
.muted      { color: var(--text-muted); }
.soft       { color: var(--text-soft); }
.text-blue  { color: var(--accent-blue); }
.text-green { color: var(--accent-green); }
.text-red   { color: var(--accent-red); }

/* ─── Utilidades de tipografía ─────────────────────────────────── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--gold);
}

.lead {
  font-size: var(--fs-md);
  line-height: var(--lh-loose);
  color: var(--text-soft);
  max-width: 65ch;
}

/* ─── Layout helpers ───────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
}

.stack > * + * { margin-top: var(--sp-4); }
.stack-sm > * + * { margin-top: var(--sp-2); }
.stack-lg > * + * { margin-top: var(--sp-6); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}

.grid {
  display: grid;
  gap: var(--sp-5);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

@media (max-width: 768px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

.gold-line {
  width: 56px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 2px;
  margin: var(--sp-3) 0 var(--sp-5);
}

/* ─── Skip link (accesibilidad) ─────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--sp-4);
  background: var(--gold);
  color: var(--ed-primary);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-sm);
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  z-index: var(--z-modal);
  transition: top var(--t-base);
}
.skip-link:focus {
  top: var(--sp-3);
  color: var(--ed-primary);
}

/* ─── Selection color ──────────────────────────────────────────── */
::selection {
  background: var(--gold);
  color: var(--ed-primary);
}

/* ─── Scrollbar (modo lectura interno de slide) ────────────────── */
.slide::-webkit-scrollbar {
  width: 6px;
}
.slide::-webkit-scrollbar-track {
  background: transparent;
}
.slide::-webkit-scrollbar-thumb {
  background: var(--gold-glow);
  border-radius: 3px;
}
.slide::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* ─── Animations primitives ─────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.fade-up { animation: fadeUp 0.6s var(--easing) both; }
.fade-in { animation: fadeIn 0.6s var(--easing) both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
