@import "tailwindcss";

@custom-variant dark (&:where(.dark, .dark *));

@theme {
  --color-primary: #0096C7;
  --color-primary-dark: #0077B6;
  --color-primary-light: #48CAE4;
  --color-accent: #FF6B35;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

:root {
  /* Brand colors */
  --color-primary: #0096C7;
  --color-primary-light: #48CAE4;
  --color-primary-dark: #0077A8;
  --color-accent-yellow: #FCD34D;
  --color-accent-red: #EF4444;
  --color-bg-light: #F0F9FF;
  --color-bg-dark: #0C1222;

  /* Spacing scale (4px base) */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */

  /* Typography scale */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 1.875rem;   /* 30px */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

  /* Semantic tokens */
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 222.2 84% 4.9%;
  --primary-hsl: 197 100% 39%;
  --muted: 210 40% 96%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --radius: 0.5rem;
}

.dark {
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;
  --card: 222.2 84% 4.9%;
  --card-foreground: 210 40% 98%;
  --popover: 222.2 84% 4.9%;
  --popover-foreground: 210 40% 98%;
  --muted: 217.2 32.6% 17.5%;
  --muted-foreground: 215 20.2% 65.1%;
  --border: 217.2 32.6% 17.5%;
  --input: 217.2 32.6% 17.5%;
  --tw-bg-dark: #0C1222;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

code, pre {
  font-family: var(--font-mono);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes pocket-drop {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  50% { transform: translateY(20px) scale(0.95); opacity: 0.8; }
  100% { transform: translateY(40px) scale(0.8); opacity: 0; }
}

.animate-pocket-drop {
  animation: pocket-drop 0.6s ease-in forwards;
}

@keyframes pocket-open {
  0% { transform: scale(0.8) translateY(10px); opacity: 0; }
  60% { transform: scale(1.05) translateY(-4px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.animate-pocket-open {
  animation: pocket-open 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
  .animate-fade-in,
  .animate-pocket-drop,
  .animate-pocket-open {
    animation: none;
  }
}

/* Focus-visible utility for keyboard navigation */
.focus-ring {
  outline: none;
}
.focus-ring:focus-visible {
  outline: 2px solid #0096C7;
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* Skip-to-content link (visually hidden until focused) */
.skip-to-content {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 100;
}
.skip-to-content:focus {
  position: fixed;
  top: var(--space-4);
  left: var(--space-4);
  width: auto;
  height: auto;
  padding: var(--space-3) var(--space-4);
  background: #0096C7;
  color: white;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
}

/* Safe area for iOS notch devices */
.pb-safe {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
