/*
 * Custom CSS for personal portfolio site
 * Dark theme with developer lab vibe
 */

/* Custom properties */
:root {
  --bg-primary: #0b0d12;
  --bg-secondary: #0d1117;
  --text-primary: #e6edf3;
  --text-secondary: #7d8590;
  --accent: #00e5ff;
  --border: #30363d;
  --hover-bg: #161b22;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom selection color */
::selection {
  background-color: var(--accent);
  color: var(--bg-primary);
}

::-moz-selection {
  background-color: var(--accent);
  color: var(--bg-primary);
}

/* Focus visible styles for accessibility */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: var(--bg-primary);
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 0 0 4px 0;
  font-weight: 600;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* Typography enhancements */
body {
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Code blocks */
code,
pre {
  font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
}

/* Link hover effects */
a.link-glow:hover {
  text-shadow: 0 0 2px var(--accent), 0 0 4px var(--accent);
}

/* Card hover effects */
.card-hover {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px var(--accent);
}

/* Terminal-style cursor animation */
.terminal-cursor {
  display: inline-block;
  width: 10px;
  height: 20px;
  background-color: var(--accent);
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

/* Section dividers */
.section-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
}

/* Image lazy loading placeholder */
img[loading="lazy"] {
  background: var(--hover-bg);
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .terminal-cursor {
    animation: none;
    opacity: 1;
  }
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  a {
    text-decoration: underline;
  }

  a[href]:after {
    content: " (" attr(href) ")";
  }
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Modal overlay */
.modal-overlay {
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

/* Chip/tag styles */
.chip {
  transition: all 0.2s ease;
}

.chip:hover {
  transform: scale(1.05);
}

/* Hero text gradient effect */
.gradient-text {
  background: linear-gradient(135deg, var(--text-primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Grid loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--hover-bg) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Utility classes */
.text-balance {
  text-wrap: balance;
}

.text-shadow-glow {
  text-shadow: 0 0 8px var(--accent);
}

/* Mobile nav transitions */
.mobile-nav {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-nav.closed {
  transform: translateX(100%);
  opacity: 0;
}

/* Card grid responsive gaps */
.project-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

@media (min-width: 768px) {
  .project-grid {
    gap: 2rem;
  }
}

/* Highlight effect for active filters */
.filter-active {
  box-shadow: 0 0 0 2px var(--accent);
  background-color: var(--accent);
  color: var(--bg-primary);
}
