/* Clean Cyber Tech Theme (Legible Variant) */
:root {
  --bg-dark: #0a0a0f;
  --bg-surface: #12121a;
  --bg-card: #1a1a24;
  --accent-primary: #00d4ff;
  --accent-secondary: #ff006e;
  --accent-tertiary: #00ff88;
  --text-primary: #ffffff;
  --text-secondary: #b8b8c8;
  --text-muted: #7a7a8e;
  --border: rgba(100, 100, 120, 0.2);
  --glow: 0 0 20px rgba(0, 212, 255, 0.3);
}
:root.light {
  --bg-dark: #ffffff;
  --bg-surface: #f8f8fb;
  --bg-card: #ffffff;
  --accent-primary: #0099cc;
  --accent-secondary: #d60055;
  --accent-tertiary: #00b366;
  --text-primary: #1a1a24;
  --text-secondary: #4a4a5e;
  --text-muted: #7a7a8e;
  --border: rgba(100, 100, 120, 0.15);
  --glow: 0 0 20px rgba(0, 153, 204, 0.1);
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition:
    background 0.3s ease,
    color 0.3s ease;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}
h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 1rem;
}
h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}
h3 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 24px;
  background: var(--accent-primary);
  color: var(--bg-dark);
  padding: 12px 24px;
  text-decoration: none;
  font-weight: 600;
  z-index: 9999;
  border-radius: 4px;
}
.skip-link:focus {
  top: 24px;
}

.global-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: 0.3s ease;
}
/* Light mode navbar refinement for stronger contrast & clarity */
.light .global-nav {
  background: linear-gradient(90deg, #f4f7fa 0%, #eef2f6 45%, #e6edf3 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: saturate(180%) blur(14px);
}
.light .brand {
  color: #0f1720;
  text-shadow: none;
}
.light .nav-links a {
  color: #334756;
  font-weight: 600;
}
.light .nav-links a:hover {
  color: var(--accent-primary);
}
.light .nav-links a:after {
  background: var(--accent-primary);
}
.light .theme-toggle {
  border-color: #0099cc;
  color: #0f1720;
  background: rgba(0, 153, 204, 0.08);
}
.light .theme-toggle:hover {
  background: #0099cc;
  color: #ffffff;
}
/* Explicit focus visibility */
.global-nav a:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
  border-radius: 4px;
}
.global-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 2rem;
}
.brand {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  font-family: "Share Tech Mono", monospace;
  letter-spacing: 2px;
  position: relative;
  text-shadow:
    0 0 6px var(--accent-primary),
    0 0 18px var(--accent-secondary);
  transition:
    text-shadow 0.4s ease,
    filter 0.4s ease;
}
.brand::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  height: 3px;
  width: 100%;
  background: linear-gradient(
    90deg,
    var(--accent-primary),
    var(--accent-secondary)
  );
  border-radius: 2px;
  box-shadow:
    0 0 8px var(--accent-primary),
    0 0 16px var(--accent-secondary);
  opacity: 0.9;
}
.light .brand {
  text-shadow:
    0 0 4px var(--accent-primary),
    0 0 10px var(--accent-secondary);
}
.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}
.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition:
    color 0.3s ease,
    text-shadow 0.4s ease,
    background 0.35s ease;
}
.nav-links a:after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--accent-primary),
    var(--accent-secondary)
  );
  box-shadow: 0 0 6px var(--accent-primary);
  transition: width 0.4s ease;
}
.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--accent-primary);
  text-shadow:
    0 0 6px var(--accent-primary),
    0 0 14px var(--accent-secondary);
}
.nav-links a:hover:after,
.nav-links a:focus-visible:after {
  width: 100%;
}
.light .nav-links a:hover,
.light .nav-links a:focus-visible {
  text-shadow:
    0 0 4px var(--accent-primary),
    0 0 10px var(--accent-secondary);
}
.theme-toggle {
  background: transparent;
  border: 2px solid var(--accent-primary);
  color: var(--accent-primary);
  padding: 8px 16px;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 1px;
  transition: 0.3s ease;
}
.theme-toggle:hover {
  background: var(--accent-primary);
  color: var(--bg-dark);
  box-shadow: var(--glow);
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 120px 0 80px;
  background: linear-gradient(
    135deg,
    var(--bg-dark) 0%,
    var(--bg-surface) 100%
  );
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  animation: grid-move 20s linear infinite;
}
@keyframes grid-move {
  to {
    transform: translate(50px, 50px);
  }
}
.hero-core {
  text-align: center;
  position: relative;
  z-index: 1;
}
.avatar-shell {
  width: 180px;
  height: 180px;
  margin: 0 auto 2rem;
  position: relative;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--accent-primary),
    var(--accent-secondary)
  );
  padding: 4px;
}
.avatar-shell img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg-dark);
}
.tagline {
  display: inline-block;
  color: var(--accent-primary);
  font-family: "Share Tech Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 1rem;
  opacity: 0.9;
}
.hero h1 {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 800;
  margin-bottom: 1.5rem;
  letter-spacing: -2px;
}
.hero-sub {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 14px 32px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  transition: 0.3s ease;
  font-size: 1rem;
  letter-spacing: 0.5px;
  border: 2px solid transparent;
}
.btn.primary {
  background: var(--accent-primary);
  color: var(--bg-dark);
}
.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
}
.btn.outline {
  border: 2px solid var(--accent-primary);
  color: var(--accent-primary);
  background: transparent;
}
.btn.outline:hover {
  background: var(--accent-primary);
  color: var(--bg-dark);
}

section {
  padding: 80px 0;
  position: relative;
}
.section-head {
  margin-bottom: 3rem;
}
.section-eyebrow {
  display: inline-block;
  color: var(--accent-primary);
  font-family: "Share Tech Mono", monospace;
  font-size: 0.9rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  opacity: 0.9;
}
.section-head p {
  max-width: 760px;
  color: var(--text-secondary);
  font-size: 1rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: 0.3s ease;
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-primary);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}
.project-media {
  height: 200px;
  background: var(--bg-surface);
  overflow: hidden;
  position: relative;
}
.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.project-card:hover .project-media img {
  transform: scale(1.05);
}
.project-body {
  padding: 1.5rem 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.project-label {
  display: inline-block;
  color: var(--accent-primary);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}
.project-title {
  font-size: 1.35rem;
  margin: 0 0 0.75rem;
}
.project-title a {
  color: var(--text-primary);
  text-decoration: none;
}
.project-title a:hover {
  color: var(--accent-primary);
}
.project-desc {
  color: var(--text-secondary);
  line-height: 1.55;
  font-size: 0.95rem;
  margin: 0 0 1.15rem;
  flex: 1;
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}
.tag {
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent-primary);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  border: 1px solid rgba(0, 212, 255, 0.2);
  text-transform: uppercase;
}
.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.project-status {
  color: var(--accent-tertiary);
  font-weight: 700;
}
.project-status.soon {
  color: var(--accent-secondary);
}

/* AI-Powered Badge */
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(
    135deg,
    rgba(0, 212, 255, 0.15),
    rgba(255, 0, 110, 0.15)
  );
  border: 1px solid;
  border-image: linear-gradient(
      135deg,
      var(--accent-primary),
      var(--accent-secondary)
    )
    1;
  position: relative;
  line-height: 1;
}
.ai-badge::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: linear-gradient(
    135deg,
    var(--accent-primary),
    var(--accent-secondary)
  );
  opacity: 0;
  z-index: -1;
  transition: opacity 0.4s ease;
}
.ai-badge:hover::before {
  opacity: 0.2;
}
.ai-badge .ai-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: linear-gradient(
    135deg,
    var(--accent-primary),
    var(--accent-secondary)
  );
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 2L9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61z'/%3E%3C/svg%3E")
    center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 2L9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61z'/%3E%3C/svg%3E")
    center/contain no-repeat;
  animation: ai-pulse 2.5s ease-in-out infinite;
}
.ai-badge .ai-label {
  background: linear-gradient(
    90deg,
    var(--accent-primary),
    var(--accent-secondary)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@keyframes ai-pulse {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}
.project-meta .ai-badge {
  margin-left: auto;
}

.skill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
  max-width: 800px;
  margin: 0 auto;
  justify-content: center;
}
.skill-cloud li {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: 30px;
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  transition: 0.3s ease;
}
.skill-cloud li:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
}

#contact {
  background: var(--bg-surface);
  text-align: center;
}
.contact-cta {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.site-footer {
  background: var(--bg-dark);
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  margin-bottom: 2rem;
}
.social-list {
  display: flex;
  list-style: none;
  gap: 1rem;
}
.social-list a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 8px;
  transition: 0.3s ease;
  text-decoration: none;
  font-size: 1.1rem;
}
.social-list a:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
}
.copyright {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  letter-spacing: 1px;
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* Code Rain Background Animation */
.code-rain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0; /* ensure visible above body background */
  overflow: hidden;
}

.code-snippet {
  position: absolute;
  font-family: "Share Tech Mono", monospace;
  font-size: 12px;
  color: var(--glow-primary);
  opacity: 0;
  animation: rain linear infinite;
  white-space: nowrap;
  text-shadow: 0 0 5px currentColor;
}

@keyframes rain {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.15;
  }
  90% {
    opacity: 0.15;
  }
  100% {
    transform: translateY(100vh) rotate(2deg);
    opacity: 0;
  }
}

/* Glow pulse for hero section */
.hero::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at center,
    rgba(0, 212, 255, 0.05) 0%,
    transparent 50%
  );
  transform: translate(-50%, -50%);
  animation: glow-pulse 8s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes glow-pulse {
  0%,
  100% {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

/* Light theme adjustments */
:root.light .code-snippet {
  color: #ff006e;
  opacity: 0;
}

:root.light .code-snippet {
  animation: rain-light linear infinite;
}

@keyframes rain-light {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.08;
  }
  90% {
    opacity: 0.08;
  }
  100% {
    transform: translateY(100vh) rotate(2deg);
    opacity: 0;
  }
}

/* ── GitHub Live Metrics ──────────────────────────────────── */
.metrics-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}
.metrics-loading::after {
  content: "";
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.metrics-error {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.metrics-error a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
}
.metric-value {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-variant-numeric: tabular-nums;
}

/* Repo update badge on project cards */
.repo-update-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 4px 10px;
  font-family: "Share Tech Mono", monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  background: rgba(10, 10, 15, 0.85);
  border: 1px solid var(--border);
  border-radius: 4px;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
  pointer-events: none;
  z-index: 2;
}
.light .repo-update-badge {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.1);
}
.repo-update-badge.fresh {
  border-color: var(--accent-tertiary);
  color: var(--accent-tertiary);
}
.project-card:hover .repo-update-badge.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Performance optimization */
@media (prefers-reduced-motion: reduce) {
  .code-snippet,
  .hero::before {
    animation: none;
  }
  .metrics-loading::after {
    animation: none;
    border-top-color: var(--accent-primary);
  }
  .repo-update-badge {
    transition: none;
  }
}
