/* CSS Variables */
:root {
  --fg: #ffffff;
  --muted: #cccccc;
  --bg: #282828;
  --panel: #1d2021;
  --border: #444444;
  --acc: #b8bb26;
}

/* Typography */
h1, h2, h3 {
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
}

h2 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  line-height: 1.2;
}

p {
  line-height: 1.7;
}

.small {
  font-size: 0.9375rem;
}

.text-sub {
  color: var(--muted);
}

/* Navigation */
.nav-link {
  transition: color .2s ease;
}

.dark .nav-link {
  color: #ffffff;
}

.nav-link {
  color: #374151;
}

.nav-link:hover {
  color: #059669;
}

.dark .nav-link:hover {
  color: #b8bb26;
}

.nav-link[aria-current="page"] {
  color: #b8bb26;
  font-weight: 600;
  position: relative;
}

.nav-link[aria-current="page"]::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: #b8bb26;
  opacity: 0.7;
  border-radius: 2px;
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.fade-target {
  opacity: 0;
  transition: opacity 0.6s ease-out;
}

.fade-target.visible {
  opacity: 1;
}

/* Utility Classes */
html {
  scroll-behavior: smooth;
}

.hover-lift {
  transition: transform .25s ease, box-shadow .25s ease;
}

.hover-lift:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

/* Card Component */
.card {
  background: #1d2021;
  border: 1px solid #3a3a3a;
  border-radius: 12px;
}

.card:hover {
  border-color: #b8bb26;
}

/* Focus States */
.focus-ring:focus {
  outline: 2px solid #9fb023;
  outline-offset: 2px;
}
.dark .focus-ring:focus {
  outline-color: #b8bb26;
}

/* Status Badge */
.status-badge {
  background-color: rgba(184,187,38,.12);
  color: #c6d052;
  padding: .25rem .6rem;
  border: 1px solid rgba(184,187,38,.35);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-block;
}

/* Light mode badge */
html:not(.dark) .status-badge {
  background-color: rgba(159,176,35,0.10);
  color: #7b861a;
  border: 1px solid rgba(159,176,35,0.35);
}

/* Hero Video Background */
.hero-section {
  position: relative;
  overflow: hidden;
  background: #282828;
}

.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .35;
  filter: none;
  border-radius: 12px;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, rgba(29,32,33,.88), rgba(29,32,33,.72));
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  animation: fadeIn 0.3s ease;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
}

.modal-close:hover {
  color: #b8bb26;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Performance & Accessibility */
img[loading="lazy"], iframe[loading="lazy"] {
  color: transparent;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .hero-video {
    display: none;
  }
  
  .hero-content {
    background: rgba(40, 40, 40, 0.9);
  }
  
  .hover-lift:hover {
    transform: none;
    box-shadow: none;
  }
  
  .fade-in {
    animation: none !important;
    opacity: 1 !important;
  }
  
  .fade-target {
    transition: none;
    opacity: 1;
  }
  
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Feature cards theme-aware */
.feature-card {
  padding: 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid var(--feature-border, #444444);
  background-color: var(--feature-bg, #1d2021);
}

html:not(.dark) .feature-card {
  --feature-bg: #ffffff;
  --feature-border: #e5e7eb;
}
html.dark .feature-card {
  --feature-bg: #1d2021;
  --feature-border: #444444;
}

/* Gallery backgrounds light mode */
html:not(.dark) .gallery-main,
html:not(.dark) .gallery-thumbnail {
  background-color: #f3f4f6;
}

/* Filter buttons light mode */
html:not(.dark) .filter-btn {
  background: rgba(255,255,255,0.9);
  border: 1px solid #e5e7eb;
  color: #475569;
}
html:not(.dark) .filter-btn:hover {
  border-color: #9fb023;
  color: #7b861a;
}
html:not(.dark) .filter-btn.active {
  background: #9fb023;
  color: #282828;
  border-color: #9fb023;
}

/* Response badge light mode */
html:not(.dark) .response-badge {
  background: rgba(159,176,35,0.10);
  border: 1px solid rgba(159,176,35,0.30);
  color: #7b861a;
}

/* Enhanced hover effects for light mode */
html:not(.dark) .hover-lift:hover {
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.12), 0 4px 12px rgba(2, 6, 23, 0.08);
}

html:not(.dark) .gallery-thumbnail:hover {
  border-color: #9fb023;
  box-shadow: 0 0 0 4px rgba(159,176,35,0.12), 0 4px 12px rgba(159,176,35,0.08);
}

/* Enhanced shadow effects for cards in light mode */
html:not(.dark) .contact-card:hover,
html:not(.dark) .project-card:hover,
html:not(.dark) .feature-card:hover {
  box-shadow: 0 10px 25px rgba(2, 6, 23, 0.15), 0 4px 10px rgba(2, 6, 23, 0.08);
}

/* Project thumbnail backgrounds */
:root {
  --thumb-bg: #f3f4f6;
}
html.dark {
  --thumb-bg: #282828;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .hero-content {
    padding: 2rem 0;
  }
  
  .modal-close {
    top: 10px;
    right: 20px;
    font-size: 30px;
  }
}