/* ═══════════════════════════════════════════════
   BASE — Reset, fuentes, body, layout global
   ═══════════════════════════════════════════════ */

/* ── Fuentes self-hosted (antes Google Fonts) ─── */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/assets/fonts/space-grotesk-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/space-mono-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/space-mono-700.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Space Mono';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/space-mono-400i.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* Cross-fade entre páginas (progressive enhancement, Chrome 126+) */
  @view-transition {
    navigation: auto;
  }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: .22s;
}

img, video, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; }
ul, ol { list-style: none; }
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1; }

/* ── Selección de texto — acento NES ──────────── */
::selection {
  background: var(--accent);
  color: var(--nes-negro);
}

/* ── Focus visible global (teclado) ───────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── Skip link (visible solo con foco de teclado) ── */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: calc(var(--z-nav) + 1);
  background: var(--accent);
  color: var(--nes-negro);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 12px 18px;
  border-radius: var(--r-sm);
  text-decoration: none;
  transform: translateY(calc(-100% - 16px));
  transition: transform var(--dur-sm) var(--ease);
}

.skip-link:focus { transform: translateY(0); }

/* ── Body ─────────────────────────────────────── */
body {
  background-color: var(--bg);
  /* Dot grid sutil — misma que la landing */
  background-image: radial-gradient(circle, rgba(242,242,242,.035) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--fg);
  font-family: var(--font-display);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ── Container ────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--pad-page);
}

.container--text {
  max-width: var(--max-w-text);
}

/* ── Section spacing ──────────────────────────── */
.section {
  padding-block: var(--sp-20);
}

.section--lg {
  padding-block: var(--sp-32);
}

.section--sm {
  padding-block: var(--sp-12);
}

/* ── Grid helpers ─────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-6);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
}

/* ── Eyebrow label ────────────────────────────── */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.eyebrow::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--accent);
  opacity: .6;
}

/* ── Section heading ──────────────────────────── */
.section-title {
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: .94;
  color: var(--fg);
}

.section-title .dim {
  color: var(--dim);
}

/* ── Divider ──────────────────────────────────── */
.divider {
  width: 100%;
  height: 1px;
  background: var(--rule);
}

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

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

.anim-up {
  opacity: 0;
  transform: translateY(20px);
}

.anim-up.in-view {
  animation: fadeUp var(--dur-lg) var(--ease) forwards;
}

.anim-up:nth-child(1) { animation-delay: .05s; }
.anim-up:nth-child(2) { animation-delay: .12s; }
.anim-up:nth-child(3) { animation-delay: .19s; }
.anim-up:nth-child(4) { animation-delay: .26s; }
.anim-up:nth-child(5) { animation-delay: .33s; }
.anim-up:nth-child(6) { animation-delay: .40s; }

@media (prefers-reduced-motion: reduce) {
  .anim-up { animation: none; opacity: 1; transform: none; }
}

/* ── Mobile responsive grids ─────────────────── */
@media (max-width: 768px) {
  .grid-3, .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

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