/* ════════════════════════════════════════════════════════════════
   FUTSALA MEX · DESIGN TOKENS + BASE
   Fuente única de verdad. Paleta única (modo oscuro emerald).
   ════════════════════════════════════════════════════════════════ */

:root {
  color-scheme: dark;

  /* ── Superficies ── */
  --bg-0: #0b0e14;
  --bg-1: #10141c;
  --bg-2: #161b25;
  --bg-3: #1c2230;
  --bg-4: #232a3a;

  /* ── Bordes ── */
  --border-1: #1e2533;
  --border-2: #2a3345;
  --border-3: #394458;

  /* ── Texto ── */
  --text:    #e7ebf2;
  --text-2:  #a7b0c2;
  --muted:   #949cb3;
  --muted-2: #4a5266;

  /* ── Acento — verde emerald ── */
  --accent:      #34d399;
  --accent-2:    #10b981;
  --accent-dim:  rgba(52,211,153,0.10);
  --accent-mid:  rgba(52,211,153,0.22);
  --on-accent:   #052e1a;

  /* ── Estados ── */
  --danger:      #f43f5e;
  --danger-2:    #be123c;
  --danger-dim:  rgba(244,63,94,0.10);
  --danger-mid:  rgba(244,63,94,0.22);

  --warn:     #f59e0b;
  --warn-dim: rgba(245,158,11,0.10);

  --info:     #60a5fa;
  --info-dim: rgba(96,165,250,0.10);

  --gold:      #fbbf24;
  --gold-dim:  rgba(251,191,36,0.10);
  --gold-mid:  rgba(251,191,36,0.25);

  --ok:     #10b981;
  --ok-dim: rgba(16,185,129,0.10);

  /* ── Sombras ── */
  --shadow-sm: 0 1px 2px rgba(8,11,17,0.45);
  --shadow-md: 0 4px 16px rgba(8,11,17,0.45);
  --shadow-lg: 0 16px 48px rgba(8,11,17,0.60);

  /* ── Radio ── */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* ── Tipografía ── */
  --font-sans:  'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Instrument Serif', 'Newsreader', Georgia, serif;
  --font-mono:  'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* ── Curva de animación ── */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--border-3) var(--bg-1);
  scrollbar-width: thin;
  -webkit-text-size-adjust: 100%;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 6px; border: 2px solid var(--bg-1); }
::-webkit-scrollbar-thumb:hover { background: var(--border-3); }

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-0);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent-mid); color: var(--text); }

/* ── Grano sutil (fixed, pointer-events-none, no repinta) ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* ── Anillo de foco accesible ── */
button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:active:not(:disabled) { transform: translateY(1px) scale(0.98); }

/* ── Keystroke micro-UI ── */
kbd {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 2px 6px;
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-bottom-width: 2px;
  border-radius: 4px;
}

/* ── Solo lector de pantalla / skip-link ── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 10000;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 0 0 var(--r-md) 0;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ── Respeto por preferencia de movimiento reducido ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
