/* ═══════════════════════════════════════════════════════════════════
   ReguLink Design System — CSS Custom Properties & Foundation
   Import once per app. Every component inherits from these tokens.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* ── Neutral palette ─────────────────────── */
  --rl-bg-primary:    #0a0a0b;
  --rl-bg-secondary:  #141416;
  --rl-bg-card:       #1a1a1d;
  --rl-bg-card-hover: #222226;
  --rl-bg-overlay:    rgba(0, 0, 0, 0.6);
  --rl-border:        #27272a;
  --rl-border-focus:  #3b82f6;

  /* ── Text ────────────────────────────────── */
  --rl-text-primary:   #f4f4f5;
  --rl-text-secondary: #a1a1aa;
  --rl-text-muted:     #71717a;
  --rl-text-inverse:   #0a0a0b;

  /* ── Semantic ────────────────────────────── */
  --rl-blue:    #3b82f6;
  --rl-green:   #10b981;
  --rl-amber:   #f59e0b;
  --rl-red:     #ef4444;
  --rl-purple:  #8b5cf6;
  --rl-cyan:    #06b6d4;

  --rl-color-blocking:  #ef4444;
  --rl-color-warning:   #f59e0b;
  --rl-color-info:      #3b82f6;
  --rl-color-pass:      #10b981;

  /* ── Typography scale ────────────────────── */
  --rl-font-sans:  -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
  --rl-font-mono:  'SF Mono', 'Fira Code', 'JetBrains Mono', Menlo, monospace;
  --rl-font-xs:    0.70rem;
  --rl-font-sm:    0.82rem;
  --rl-font-base:  0.90rem;
  --rl-font-lg:    1.10rem;
  --rl-font-xl:    1.50rem;
  --rl-font-2xl:   1.80rem;

  /* ── Spacing scale ───────────────────────── */
  --rl-space-1: 4px;
  --rl-space-2: 8px;
  --rl-space-3: 12px;
  --rl-space-4: 16px;
  --rl-space-5: 20px;
  --rl-space-6: 24px;
  --rl-space-8: 32px;
  --rl-space-10: 40px;

  /* ── Radii ───────────────────────────────── */
  --rl-radius-sm: 6px;
  --rl-radius-md: 8px;
  --rl-radius-lg: 10px;
  --rl-radius-xl: 14px;
  --rl-radius-full: 9999px;

  /* ── Shadows ─────────────────────────────── */
  --rl-shadow-card: 0 1px 3px rgba(0,0,0,0.3);
  --rl-shadow-dropdown: 0 4px 16px rgba(0,0,0,0.4);
  --rl-shadow-modal: 0 8px 32px rgba(0,0,0,0.5);

  /* ── Transitions ─────────────────────────── */
  --rl-transition-fast: 120ms ease;
  --rl-transition-base: 200ms ease;
  --rl-transition-slow: 300ms ease;

  /* ── Layout ──────────────────────────────── */
  --rl-max-width: 1200px;
  --rl-footer-height: 80px;

  /* ── Focus ring (shared across all interactive elements) ── */
  --rl-focus-ring: 0 0 0 2px var(--rl-bg-primary), 0 0 0 4px var(--rl-border-focus);
}

/* ── Global reset & base ────────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--rl-font-sans);
  font-size: var(--rl-font-base);
  background: var(--rl-bg-primary);
  color: var(--rl-text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Focus visible (keyboard users only) ────────────────────────── */
:focus-visible {
  outline: none;
  box-shadow: var(--rl-focus-ring);
}

:focus:not(:focus-visible) { outline: none; }

/* ── Reduced motion ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Screen reader only ─────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Container ──────────────────────────────────────────────────── */
.rl-container {
  max-width: var(--rl-max-width);
  margin: 0 auto;
  padding: var(--rl-space-6);
}

/* ── Responsive grid helper ──────────────────────────────────────── */
.rl-grid {
  display: grid;
  gap: var(--rl-space-3);
}
.rl-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.rl-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.rl-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
.rl-grid--auto { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

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

/* ── Section heading ─────────────────────────────────────────────── */
.rl-section-title {
  font-size: var(--rl-font-lg);
  font-weight: 600;
  color: var(--rl-text-secondary);
  margin: 0 0 var(--rl-space-3) 0;
}
