/* Apply smooth scrolling when user clicks on anchor links */
html {
  scroll-behavior: smooth;
  /* Adjust scroll position to account for sticky header */
  scroll-padding-top: 5rem; 
}

/* Custom styles that complement Tailwind */
body {
    /* Start with body invisible to prevent FOUC, JS will make it visible */
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

body.loaded {
    opacity: 1;
}

/* 1. Visually hide an element, but leave it available for screen readers.
  2. The element becomes visible on focus (e.g., keyboard navigation).
*/
.skip-to-content {
  position: absolute;
  left: -9999px; /* 1 */
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: -999;
}
.skip-to-content:focus {
  position: fixed; /* 2 */
  top: 1rem;
  left: 1rem;
  z-index: 51; /* Higher than header */
  width: auto;
  height: auto;
  padding: 0.75rem 1.25rem;
  background-color: #1e3a8a; /* brand-blue-900 */
  color: white;
  border-radius: 0.375rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Custom focus-visible styles for better accessibility */
:focus-visible {
  outline: 2px solid #3b82f6; /* brand-blue-500 */
  outline-offset: 2px;
  border-radius: 4px;
}
/* Don't apply focus ring to theme toggle button to avoid double-ringing */
#theme-toggle:focus-visible {
    outline: none;
}


/* Subtle reveal animation for sections */
.animated-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animated-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Custom @apply classes for repeated patterns */
.nav-link {
    @apply text-slate-700 dark:text-slate-300 hover:text-brand-blue-600 dark:hover:text-brand-blue-400 transition-colors;
}
.nav-link[aria-current="page"] {
    @apply text-brand-blue-600 dark:text-brand-blue-400;
}

.mobile-nav-link {
    @apply text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-800 hover:text-brand-blue-600 dark:hover:text-brand-blue-400;
}
.mobile-nav-link[aria-current="page"] {
    @apply bg-brand-blue-50 dark:bg-slate-800/50 text-brand-blue-600 dark:text-brand-blue-400;
}

.skill-category {
    @apply p-6 bg-white dark:bg-slate-900 rounded-lg shadow-sm;
}
.skill-tags {
    @apply mt-3 flex flex-wrap gap-2;
}
.skill-tags span {
    @apply inline-block bg-slate-200 dark:bg-slate-700 text-slate-700 dark:text-slate-300 text-sm font-medium px-3 py-1 rounded-full;
}

.work-card {
    @apply bg-white dark:bg-slate-800/50 rounded-xl p-6 shadow-sm hover:shadow-lg transition-shadow duration-300;
}
.work-card-icon {
    @apply inline-block p-3 bg-brand-blue-100 dark:bg-brand-blue-900/50 text-brand-blue-600 dark:text-brand-blue-400 rounded-lg;
}
.work-card-title {
    @apply mt-4 text-lg font-semibold text-slate-900 dark:text-white;
}
.work-card-text {
    @apply mt-2 text-base text-slate-600 dark:text-slate-400;
}
.work-card-metric {
    @apply mt-4 inline-block bg-green-100 dark:bg-green-900/50 text-green-800 dark:text-green-300 text-xs font-bold px-3 py-1 rounded-full uppercase tracking-wider;
}

.timeline-item {
    @apply transition-opacity duration-500;
}
.timeline-dot {
    @apply absolute flex items-center justify-center w-6 h-6 bg-slate-200 rounded-full -left-3.5 ring-8 ring-white dark:ring-slate-900 dark:bg-brand-blue-900;
}
.timeline-title {
    @apply text-xl font-semibold text-gray-900 dark:text-white;
}
.timeline-subtitle {
    @apply block mb-1 text-sm font-normal leading-none text-gray-500 dark:text-gray-400;
}
.timeline-date {
    @apply block mb-2 text-sm font-normal leading-none text-gray-400 dark:text-gray-500;
}
.timeline-body {
    @apply mt-3 list-disc list-inside space-y-2 text-base text-slate-600 dark:text-slate-400;
}

.service-item {
    @apply p-4 text-center bg-white dark:bg-slate-900 rounded-lg shadow-sm font-medium;
}