/* ═══════════════════════════════════════════════════════════
   TECHLAB HUB — Defense-Grade Futuristic Interface
   Cyber warfare aesthetic · HUD elements · Neon tactical grid
   ═══════════════════════════════════════════════════════════ */

.techlab {
  /* Core colors inherited from central theme.css bridge */
  /* --tl-bg, --tl-surface, --tl-surface-2, --tl-surface-3 come from theme */
  /* --tl-text, --tl-text-sec, --tl-text-dim come from theme */
  /* --tl-accent, --tl-accent-light come from theme */
  /* --tl-border, --tl-border-accent come from theme */

  /* Techlab-specific neon palette (not in global theme) */
  --tl-cyan: #00e5ff;
  --tl-green: #00ff88;
  --tl-red: #ff3d57;
  --tl-purple: #bf5af2;
  --tl-blue: #3b82f6;
  --tl-orange: #ff6b35;
  --tl-glow-cyan: rgba(0, 229, 255, 0.15);
  --tl-glow-green: rgba(0, 255, 136, 0.12);
  --tl-glow-red: rgba(255, 61, 87, 0.12);
  --tl-glow-purple: rgba(191, 90, 242, 0.12);
  --tl-radius: 12px;
  --tl-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --tl-font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  min-height: 100vh;
  background: var(--tl-bg);
  color: var(--tl-text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

.techlab .container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ═══ SCANLINE OVERLAY (CRT effect) ═══ */
.techlab::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 229, 255, 0.008) 2px,
    rgba(0, 229, 255, 0.008) 4px
  );
  pointer-events: none;
  z-index: 9998;
}

/* ═══ HERO SECTION ═══ */
.tl-hero {
  position: relative;
  padding: 5rem 0 3rem;
  overflow: hidden;
  text-align: center;
}

/* Tactical grid background */
.tl-hero-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(0,229,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,255,0.04) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 70%);
  animation: gridScan 12s linear infinite;
}

@keyframes gridScan {
  0% { background-position: 0 0; }
  100% { background-position: 80px 80px; }
}

/* Radar sweep */
.tl-hero-radar {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(0,229,255,0.06) 40deg, transparent 80deg);
  animation: radarSweep 6s linear infinite;
  pointer-events: none;
  opacity: 0.5;
}

@keyframes radarSweep {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Floating particles */
.tl-hero-particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.tl-particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--tl-cyan);
  border-radius: 50%;
  animation: particleFloat 8s linear infinite;
  opacity: 0;
}

.tl-particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 10s; }
.tl-particle:nth-child(2) { left: 25%; animation-delay: 2s; animation-duration: 8s; }
.tl-particle:nth-child(3) { left: 45%; animation-delay: 1s; animation-duration: 12s; }
.tl-particle:nth-child(4) { left: 65%; animation-delay: 3s; animation-duration: 9s; }
.tl-particle:nth-child(5) { left: 80%; animation-delay: 0.5s; animation-duration: 11s; }
.tl-particle:nth-child(6) { left: 90%; animation-delay: 4s; animation-duration: 7s; }

@keyframes particleFloat {
  0%   { transform: translateY(100vh); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.6; }
  100% { transform: translateY(-20vh); opacity: 0; }
}

/* Status badge */
.tl-hero-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 20px;
  background: rgba(0,229,255,0.06);
  border: 1px solid rgba(0,229,255,0.15);
  border-radius: 9999px;
  font-family: var(--tl-font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--tl-cyan);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
}

.tl-hero-status .status-dot {
  width: 6px;
  height: 6px;
  background: var(--tl-green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--tl-green);
  animation: statusBlink 2s ease-in-out infinite;
}

@keyframes statusBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.tl-hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 2;
}

.tl-hero .text-cyan { color: var(--tl-cyan); text-shadow: 0 0 30px rgba(0,229,255,0.3); }
.tl-hero .text-green { color: var(--tl-green); text-shadow: 0 0 30px rgba(0,255,136,0.3); }
.tl-hero .text-amber { color: var(--tl-accent-light); text-shadow: 0 0 30px rgba(251,191,36,0.3); }

.tl-hero-sub {
  font-size: 1rem;
  color: var(--tl-text-sec);
  max-width: 620px;
  margin: 0 auto 3rem;
  line-height: 1.7;
  position: relative;
  z-index: 2;
}

/* Typing code line */
.tl-code-line {
  font-family: var(--tl-font-mono);
  font-size: 0.75rem;
  color: var(--tl-text-dim);
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
}
.tl-code-line .prompt { color: var(--tl-green); }
.tl-code-line .cmd { color: var(--tl-cyan); }
.tl-code-line .flag { color: var(--tl-purple); }
.tl-code-line .cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--tl-cyan);
  margin-left: 4px;
  vertical-align: text-bottom;
  animation: cursorBlink 1s step-end infinite;
}

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

/* ═══ STATS — HUD style ═══ */
.tl-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(0,229,255,0.06);
  border: 1px solid var(--tl-border);
  border-radius: var(--tl-radius);
  overflow: hidden;
  margin-bottom: 4rem;
  position: relative;
  z-index: 2;
}

.tl-stat {
  background: var(--tl-surface);
  padding: 1.5rem 1rem;
  text-align: center;
  position: relative;
  transition: background 0.3s ease;
}

.tl-stat::before {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tl-cyan);
  opacity: 0.3;
}

.tl-stat:hover {
  background: var(--tl-surface-2);
}
.tl-stat:hover::before { opacity: 1; box-shadow: 0 0 6px var(--tl-cyan); }

.tl-stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--tl-font-mono);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.tl-stat:nth-child(1) .tl-stat-value { color: var(--tl-cyan); }
.tl-stat:nth-child(2) .tl-stat-value { color: var(--tl-green); }
.tl-stat:nth-child(3) .tl-stat-value { color: var(--tl-accent-light); }
.tl-stat:nth-child(4) .tl-stat-value { color: var(--tl-purple); }

.tl-stat-label {
  font-family: var(--tl-font-mono);
  font-size: 0.625rem;
  color: var(--tl-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 6px;
}

/* ═══ SECTION HEADERS ═══ */
.tl-section { margin-bottom: 4rem; }

.tl-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--tl-border);
}

.tl-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
}

.tl-section-title .hud-icon {
  width: 32px;
  height: 32px;
  border: 1px solid var(--tl-border-accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  color: var(--tl-cyan);
  background: rgba(0,229,255,0.04);
}

.tl-section-title .hud-tag {
  font-family: var(--tl-font-mono);
  font-size: 0.5625rem;
  color: var(--tl-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  background: rgba(0,229,255,0.04);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--tl-border);
  margin-left: 8px;
}

.tl-section-link {
  color: var(--tl-cyan);
  text-decoration: none;
  font-family: var(--tl-font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}
.tl-section-link:hover { color: var(--tl-green); }

/* ═══ CATEGORY CARDS ═══ */
.tl-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.tl-cat-card {
  background: var(--tl-surface);
  border: 1px solid var(--tl-border);
  border-radius: var(--tl-radius);
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: all 0.35s var(--tl-ease);
  position: relative;
  overflow: hidden;
}

.tl-cat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--cat-color, var(--tl-cyan));
  opacity: 0.3;
  transition: opacity 0.3s;
}

.tl-cat-card::after {
  content: '';
  position: absolute;
  bottom: 8px; right: 8px;
  width: 16px; height: 16px;
  border-right: 2px solid var(--cat-color, var(--tl-cyan));
  border-bottom: 2px solid var(--cat-color, var(--tl-cyan));
  opacity: 0.15;
  transition: opacity 0.3s;
}

.tl-cat-card:hover {
  transform: translateY(-2px);
  border-color: var(--tl-border-accent);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 1px rgba(0,229,255,0.15);
}
.tl-cat-card:hover::before { opacity: 1; }
.tl-cat-card:hover::after { opacity: 0.5; }

.tl-cat-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.tl-cat-info h3 { font-size: 0.9375rem; font-weight: 600; margin-bottom: 4px; }
.tl-cat-info p { font-size: 0.6875rem; color: var(--tl-text-dim); margin: 0; line-height: 1.5; }
.tl-cat-count {
  font-family: var(--tl-font-mono);
  font-size: 0.625rem;
  color: var(--tl-cyan);
  font-weight: 600;
  margin-top: 8px;
  letter-spacing: 0.05em;
}

/* ═══ PROJECT CARDS ═══ */
.tl-projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
}

.tl-project-card {
  background: var(--tl-surface);
  border: 1px solid var(--tl-border);
  border-radius: var(--tl-radius);
  overflow: hidden;
  transition: all 0.35s var(--tl-ease);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Corner HUD brackets */
.tl-project-card::before,
.tl-project-card::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.tl-project-card::before {
  top: 6px; left: 6px;
  border-left: 2px solid var(--tl-cyan);
  border-top: 2px solid var(--tl-cyan);
}
.tl-project-card::after {
  bottom: 6px; right: 6px;
  border-right: 2px solid var(--tl-cyan);
  border-bottom: 2px solid var(--tl-cyan);
}

.tl-project-card:hover {
  transform: translateY(-4px);
  border-color: var(--tl-border-accent);
  box-shadow:
    0 16px 48px rgba(0,0,0,0.4),
    0 0 1px rgba(0,229,255,0.2),
    inset 0 1px 0 rgba(0,229,255,0.05);
}
.tl-project-card:hover::before,
.tl-project-card:hover::after { opacity: 0.6; }

/* Cover */
.tl-project-cover {
  height: 200px;
  background: linear-gradient(135deg, var(--tl-surface-2), var(--tl-surface-3));
  position: relative;
  overflow: hidden;
}

.tl-project-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--tl-ease), filter 0.5s ease;
}

.tl-project-card:hover .tl-project-cover img {
  transform: scale(1.06);
  filter: brightness(1.1) saturate(1.1);
}

.tl-project-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20,28,46,0.95) 0%, rgba(20,28,46,0.3) 40%, transparent 70%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
}

.tl-project-badges { display: flex; gap: 6px; flex-wrap: wrap; }

.tl-badge {
  padding: 3px 10px;
  border-radius: 4px;
  font-family: var(--tl-font-mono);
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tl-badge-featured { background: rgba(245,158,11,0.2); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.tl-badge-opensource { background: rgba(0,255,136,0.1); color: #00ff88; border: 1px solid rgba(0,255,136,0.2); }
.tl-badge-difficulty { background: rgba(0,229,255,0.08); color: var(--tl-cyan); border: 1px solid rgba(0,229,255,0.15); }

/* DEFCON threat level badges */
.tl-badge-defcon { font-family: var(--tl-font-mono); font-weight: 700; letter-spacing: 0.08em; }
.tl-badge-defcon::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; background: currentColor; }
.tl-badge-defcon[data-level="green"]  { background: rgba(0,255,136,0.08); color: #00ff88; border: 1px solid rgba(0,255,136,0.2); }
.tl-badge-defcon[data-level="blue"]   { background: rgba(59,130,246,0.08); color: #3b82f6; border: 1px solid rgba(59,130,246,0.2); }
.tl-badge-defcon[data-level="yellow"] { background: rgba(251,191,36,0.08); color: #fbbf24; border: 1px solid rgba(251,191,36,0.2); }
.tl-badge-defcon[data-level="orange"] { background: rgba(255,107,53,0.08); color: #ff6b35; border: 1px solid rgba(255,107,53,0.2); }
.tl-badge-defcon[data-level="red"]    { background: rgba(255,61,87,0.08); color: #ff3d57; border: 1px solid rgba(255,61,87,0.2); animation: defconPulse 2s ease-in-out infinite; }

@keyframes defconPulse {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 8px rgba(255,61,87,0.3); }
}
.tl-badge-defense { background: rgba(255,61,87,0.1); color: #ff3d57; border: 1px solid rgba(255,61,87,0.2); }
.tl-badge-ai { background: rgba(191,90,242,0.1); color: #bf5af2; border: 1px solid rgba(191,90,242,0.2); }

/* Body */
.tl-project-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tl-project-cat {
  font-family: var(--tl-font-mono);
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}

.tl-project-title {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
}

.tl-project-sub {
  font-size: 0.75rem;
  color: var(--tl-text-sec);
  line-height: 1.6;
  margin-bottom: 1rem;
  flex: 1;
}

/* Tech stack pills */
.tl-stack { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 1rem; }
.tl-stack-pill {
  padding: 2px 8px;
  border-radius: 3px;
  font-family: var(--tl-font-mono);
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.tl-stack-pill:nth-child(6n+1) { background: rgba(0,229,255,0.08); color: var(--tl-cyan); border: 1px solid rgba(0,229,255,0.12); }
.tl-stack-pill:nth-child(6n+2) { background: rgba(0,255,136,0.06); color: var(--tl-green); border: 1px solid rgba(0,255,136,0.1); }
.tl-stack-pill:nth-child(6n+3) { background: rgba(191,90,242,0.08); color: var(--tl-purple); border: 1px solid rgba(191,90,242,0.12); }
.tl-stack-pill:nth-child(6n+4) { background: rgba(245,158,11,0.08); color: var(--tl-accent-light); border: 1px solid rgba(245,158,11,0.12); }
.tl-stack-pill:nth-child(6n+5) { background: rgba(255,107,53,0.08); color: var(--tl-orange); border: 1px solid rgba(255,107,53,0.12); }
.tl-stack-pill:nth-child(6n+6) { background: rgba(59,130,246,0.08); color: var(--tl-blue); border: 1px solid rgba(59,130,246,0.12); }

/* Meta footer */
.tl-project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--tl-border);
  font-family: var(--tl-font-mono);
  font-size: 0.625rem;
  color: var(--tl-text-dim);
}

.tl-project-stats { display: flex; gap: 1rem; }
.tl-project-stats span { display: inline-flex; align-items: center; gap: 4px; }
.tl-project-stats .fa-eye { color: var(--tl-cyan); }
.tl-project-stats .fa-heart { color: var(--tl-red); }
.tl-project-stats .fa-star { color: var(--tl-accent-light); }

.tl-project-author { display: flex; align-items: center; gap: 6px; }
.tl-author-avatar {
  width: 18px; height: 18px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--tl-border);
}

/* Placeholder cover */
.tl-cover-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--tl-text-dim); opacity: 0.15;
  background: radial-gradient(circle at center, rgba(0,229,255,0.03) 0%, transparent 50%);
}

/* ═══ EMPTY STATE ═══ */
.tl-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--tl-text-dim);
}
.tl-empty i { font-size: 3rem; margin-bottom: 1rem; display: block; opacity: 0.2; }
.tl-empty h3 { color: var(--tl-text); margin-bottom: 0.5rem; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1024px) {
  .tl-stats { grid-template-columns: repeat(2, 1fr); }
  .tl-projects { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}

@media (max-width: 768px) {
  .tl-hero { padding: 3.5rem 0 2rem; }
  .tl-hero-radar { display: none; }
  .tl-categories { grid-template-columns: 1fr; }
  .tl-projects { grid-template-columns: 1fr; }
  .tl-section-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
}

@media (max-width: 480px) {
  .techlab .container { padding: 0 1rem; }
  .tl-stats { grid-template-columns: 1fr 1fr; }
  .tl-stat { padding: 1rem; }
  .tl-stat-value { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .techlab::after { display: none; }
}
