@import "tailwindcss";
@source "../index.html";
@source "./**/*.{js,ts,jsx,tsx}";
@source "../scripts/**/*.{js,ts}";

@theme {
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, monospace;

  /* WCAG 2.2 AA compliant contrast tokens */
  --color-neutral-100: #f4f4f5;
  --color-neutral-200: #e4e4e7;
  --color-neutral-300: #d4d4d8;
  --color-neutral-400: #b8b8be;
  --color-neutral-500: #9ca3af;
  --color-neutral-600: #8a8f9d;
}

@layer base {
  :root {
    color-scheme: dark light;
  }

  body {
    font-family:
      'Inter',
      system-ui,
      -apple-system,
      BlinkMacSystemFont,
      'Segoe UI',
      Roboto,
      'Helvetica Neue',
      Arial,
      sans-serif;
    color-scheme: dark;
    background-color: #090a0f;
    color: #f4f4f5;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  main#main-content {
    flex: 1 1 0%;
    min-width: 0;
  }

  code,
  pre,
  .font-mono {
    font-family:
      'JetBrains Mono',
      'Fira Code',
      ui-monospace,
      SFMono-Regular,
      Menlo,
      Monaco,
      Consolas,
      monospace;
    font-variant-numeric: tabular-nums;
  }

  /* Accessible visible focus indicator for keyboard navigation (WCAG 2.2 AA 2.4.7 / 2.4.11) */
  *:focus-visible {
    outline: 2px solid #38bdf8 !important;
    outline-offset: 2px !important;
  }

  /* Respect user OS motion preferences (WCAG 2.2 2.3.3) */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }

  /* Custom refined dark scrollbar */
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  ::-webkit-scrollbar-track {
    background: transparent;
  }
  ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
  }

  /* Refined Light Theme styling without breaking image contrast */
  html[data-theme='light'] body {
    color-scheme: light;
    background-color: #f8fafc;
    color: #0f172a;
  }

  html[data-theme='light'] header {
    background-color: rgba(255, 255, 255, 0.94);
    border-color: #e2e8f0;
  }

  html[data-theme='light'] footer {
    background-color: #ffffff;
    border-color: #e2e8f0;
    color: #475569;
  }

  html[data-theme='light'] .bg-neutral-950 {
    background-color: #f1f5f9;
  }

  html[data-theme='light'] .bg-neutral-900 {
    background-color: #ffffff;
  }

  html[data-theme='light'] .bg-neutral-800 {
    background-color: #e2e8f0;
  }

  html[data-theme='light'] .hover\:bg-neutral-800:hover {
    background-color: #cbd5e1 !important;
  }

  html[data-theme='light'] .hover\:bg-neutral-700:hover {
    background-color: #94a3b8 !important;
  }

  html[data-theme='light'] .border-neutral-800 {
    border-color: #e2e8f0;
  }

  html[data-theme='light'] .border-neutral-700 {
    border-color: #cbd5e1;
  }

  html[data-theme='light'] .text-white {
    color: #0f172a;
  }

  html[data-theme='light'] .text-neutral-100 {
    color: #1e293b;
  }

  html[data-theme='light'] .text-neutral-200 {
    color: #334155;
  }

  html[data-theme='light'] .text-neutral-300 {
    color: #475569;
  }

  html[data-theme='light'] .text-neutral-400 {
    color: #64748b;
  }
}

