/* ============================================================
   TalentSync — main.css
   Global Design Tokens · Reset · Typography · Shared Layout
   ============================================================ */

/* ── Design Tokens ───────────────────────────────────────── */
:root {
  /* Structural surfaces */
  --clr-navy-950: #0d1220;
  --clr-navy-900: #111827;
  --clr-navy-800: #1a2540;
  --clr-navy-700: #243052;
  --clr-navy-600: #2e3d66;

  /* Canvas & readable areas */
  --clr-ice-50:   #f5f7ff;
  --clr-ice-100:  #eef1fb;
  --clr-ice-200:  #dde3f5;
  --clr-white:    #ffffff;

  /* Primary CTA — Royal Indigo */
  --clr-indigo-500: #4f46e5;
  --clr-indigo-600: #4338ca;
  --clr-indigo-700: #3730a3;
  --clr-indigo-glow: rgba(79, 70, 229, 0.25);

  /* Success / High Match — Emerald */
  --clr-emerald-400: #34d399;
  --clr-emerald-500: #10b981;
  --clr-emerald-600: #059669;
  --clr-emerald-bg:  rgba(16, 185, 129, 0.10);

  /* Warning / Mid Match — Amber */
  --clr-amber-400: #fbbf24;
  --clr-amber-500: #f59e0b;
  --clr-amber-bg:  rgba(245, 158, 11, 0.12);

  /* Danger / Missing Skills — Crimson */
  --clr-crimson-400: #f87171;
  --clr-crimson-500: #ef4444;
  --clr-crimson-600: #dc2626;
  --clr-crimson-bg:  rgba(239, 68, 68, 0.10);

  /* Electric Blue accent */
  --clr-blue-400: #60a5fa;
  --clr-blue-500: #3b82f6;
  --clr-blue-bg:  rgba(59, 130, 246, 0.10);

  /* Text scale */
  --clr-text-primary:   #f0f3ff;
  --clr-text-secondary: #94a3b8;
  --clr-text-muted:     #64748b;
  --clr-text-dark:      #1e293b;
  --clr-text-body:      #334155;

  /* Border & dividers */
  --clr-border-subtle:  rgba(255, 255, 255, 0.07);
  --clr-border-medium:  rgba(255, 255, 255, 0.12);
  --clr-border-light:   #e2e8f0;

  /* Typography */
  --font-display: 'Inter', 'SF Pro Display', system-ui, -apple-system, sans-serif;
  --font-body:    'Inter', 'SF Pro Text', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Type scale */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;

  /* Spacing scale */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Radius */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.18), 0 1px 2px rgba(0,0,0,0.12);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.25), 0 2px 6px rgba(0,0,0,0.15);
  --shadow-lg:  0 10px 40px rgba(0,0,0,0.35), 0 4px 16px rgba(0,0,0,0.20);
  --shadow-indigo: 0 4px 20px rgba(79, 70, 229, 0.35);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.12);

  /* Transitions */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:    cubic-bezier(0.7, 0, 0.84, 0);
  --trans-fast: 150ms var(--ease-out);
  --trans-base: 250ms var(--ease-out);
  --trans-slow: 400ms var(--ease-out);

  /* Layout */
  --max-width:      1280px;
  --content-width:  760px;
  --header-height:  64px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--clr-text-primary);
  background-color: var(--clr-navy-950);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

img, svg, video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

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

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* ── Focus Ring ───────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--clr-indigo-500);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--clr-navy-900); }
::-webkit-scrollbar-thumb {
  background: var(--clr-navy-600);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--clr-indigo-500); }

/* ── Header ──────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(13, 18, 32, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--clr-border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 700;
  font-size: var(--text-xl);
  letter-spacing: -0.03em;
  color: var(--clr-text-primary);
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--clr-indigo-500), var(--clr-blue-500));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.logo span {
  background: linear-gradient(90deg, var(--clr-indigo-500), var(--clr-blue-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-link {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--clr-text-secondary);
  transition: color var(--trans-fast), background var(--trans-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--clr-text-primary);
  background: var(--clr-border-subtle);
}

.nav-cta {
  padding: var(--space-2) var(--space-5);
  background: var(--clr-indigo-500);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: background var(--trans-fast), box-shadow var(--trans-fast);
}

.nav-cta:hover {
  background: var(--clr-indigo-600);
  box-shadow: var(--shadow-indigo);
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  transition: background var(--trans-fast);
}

.mobile-menu-btn:hover { background: var(--clr-border-subtle); }

.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--clr-text-secondary);
  border-radius: 2px;
  transition: transform var(--trans-base);
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  background: var(--clr-navy-900);
  border-top: 1px solid var(--clr-border-subtle);
  padding: var(--space-16) 0 var(--space-8);
  margin-top: var(--space-24);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-10);
  margin-bottom: var(--space-12);
}

.footer-brand p {
  font-size: var(--text-sm);
  color: var(--clr-text-secondary);
  line-height: 1.7;
  margin-top: var(--space-4);
  max-width: 280px;
}

.footer-col h4 {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--clr-text-muted);
  margin-bottom: var(--space-4);
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-col a {
  font-size: var(--text-sm);
  color: var(--clr-text-secondary);
  transition: color var(--trans-fast);
}

.footer-col a:hover { color: var(--clr-text-primary); }

.footer-bottom {
  padding-top: var(--space-8);
  border-top: 1px solid var(--clr-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-bottom p {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
}

.footer-legal-links {
  display: flex;
  gap: var(--space-4);
}

.footer-legal-links a {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  transition: color var(--trans-fast);
}

.footer-legal-links a:hover { color: var(--clr-text-secondary); }

/* ── Badges & Tags ───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge-indigo {
  background: var(--clr-indigo-glow);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.badge-emerald {
  background: var(--clr-emerald-bg);
  color: var(--clr-emerald-400);
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.badge-amber {
  background: var(--clr-amber-bg);
  color: var(--clr-amber-400);
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.badge-crimson {
  background: var(--clr-crimson-bg);
  color: var(--clr-crimson-400);
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.badge-blue {
  background: var(--clr-blue-bg);
  color: var(--clr-blue-400);
  border: 1px solid rgba(96, 165, 250, 0.25);
}

/* ── Button System ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: all var(--trans-base);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--clr-indigo-500);
  color: #fff;
}

.btn-primary:hover {
  background: var(--clr-indigo-600);
  box-shadow: var(--shadow-indigo);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--clr-border-subtle);
  color: var(--clr-text-secondary);
  border: 1px solid var(--clr-border-medium);
}

.btn-secondary:hover {
  background: var(--clr-navy-700);
  color: var(--clr-text-primary);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

/* ── Section Labels ──────────────────────────────────────── */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-indigo-500);
  margin-bottom: var(--space-4);
}

.section-eyebrow::before {
  content: '';
  display: block;
  width: 16px;
  height: 2px;
  background: var(--clr-indigo-500);
  border-radius: 2px;
}

.section-title {
  font-size: var(--text-3xl);
  color: var(--clr-text-primary);
  margin-bottom: var(--space-4);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--clr-text-secondary);
  font-weight: 400;
  line-height: 1.6;
  max-width: 600px;
}

/* ── Skeleton Loading ─────────────────────────────────────── */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.skeleton {
  animation: skeleton-pulse 1.8s ease-in-out infinite;
  background: var(--clr-navy-700);
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 0.875rem;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-sm);
}

.skeleton-text.wide { width: 100%; }
.skeleton-text.medium { width: 70%; }
.skeleton-text.short { width: 40%; }

.skeleton-img {
  width: 100%;
  aspect-ratio: 16/9;
}

/* ── Legal Page Layout ───────────────────────────────────── */
.legal-page {
  background: var(--clr-ice-50);
  color: var(--clr-text-body);
  min-height: 100vh;
}

.legal-page .site-header {
  background: rgba(255,255,255,0.90);
  border-bottom: 1px solid var(--clr-border-light);
}

.legal-page .logo,
.legal-page .nav-link {
  color: var(--clr-text-dark);
}

.legal-page .nav-link:hover {
  background: var(--clr-ice-200);
}

.legal-hero {
  background: var(--clr-navy-900);
  color: var(--clr-text-primary);
  padding: var(--space-16) 0 var(--space-12);
  text-align: center;
}

.legal-hero h1 {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-3);
}

.legal-hero p {
  color: var(--clr-text-secondary);
  font-size: var(--text-lg);
}

.legal-content {
  max-width: 780px;
  margin: 0 auto;
  padding: var(--space-16) var(--space-6);
}

.legal-content h2 {
  font-size: var(--text-2xl);
  color: var(--clr-text-dark);
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--clr-border-light);
}

.legal-content h3 {
  font-size: var(--text-lg);
  color: var(--clr-text-dark);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

.legal-content p,
.legal-content li {
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--clr-text-body);
  margin-bottom: var(--space-4);
}

.legal-content ul {
  list-style: disc;
  padding-left: var(--space-6);
}

.legal-content a {
  color: var(--clr-indigo-600);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Notification / Toast ────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  background: var(--clr-navy-800);
  border: 1px solid var(--clr-border-medium);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-sm);
  color: var(--clr-text-primary);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  pointer-events: auto;
  transform: translateY(8px);
  opacity: 0;
  animation: toastIn 300ms var(--ease-out) forwards;
}

.toast.success { border-left: 3px solid var(--clr-emerald-500); }
.toast.error { border-left: 3px solid var(--clr-crimson-500); }
.toast.info { border-left: 3px solid var(--clr-indigo-500); }

@keyframes toastIn {
  to { transform: translateY(0); opacity: 1; }
}

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

/* ── Responsive Header ────────────────────────────────────── */
@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; }

  .header-nav {
    position: fixed;
    inset: var(--header-height) 0 auto 0;
    background: var(--clr-navy-900);
    border-bottom: 1px solid var(--clr-border-subtle);
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-4);
    gap: var(--space-2);
    display: none;
  }

  .header-nav.open { display: flex; }

  .nav-link {
    padding: var(--space-3) var(--space-4);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}
