/* ─────────────────────────────────────────────────────────────
   Base & Reset
───────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

::selection {
  background-color: #10b981;
  color: #000;
}

:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ─────────────────────────────────────────────────────────────
   Scrollbar
───────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #09090b;
}
::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3f3f46;
}

/* ─────────────────────────────────────────────────────────────
   Navbar
───────────────────────────────────────────────────────────── */
#navbar {
  background: transparent;
}

#navbar.scrolled {
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(39, 39, 42, 0.6);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* Hamburger active state */
#hamburger.open .hamburger-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
#hamburger.open .hamburger-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
#hamburger.open .hamburger-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
  width: 1.5rem;
}

/* Active nav link indicator */
.nav-link.active {
  color: #fff;
  position: relative;
}
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: #10b981;
  border-radius: 1px;
}

/* ─────────────────────────────────────────────────────────────
   Hero Background Grid
───────────────────────────────────────────────────────────── */
.hero-grid {
  background-image:
    linear-gradient(rgba(39, 39, 42, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(39, 39, 42, 0.3) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
}

/* ─────────────────────────────────────────────────────────────
   Text Gradient
───────────────────────────────────────────────────────────── */
.text-gradient {
  background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─────────────────────────────────────────────────────────────
   Scroll Indicator
───────────────────────────────────────────────────────────── */
.scroll-line {
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50% { opacity: 0.8; transform: scaleY(0.6); }
}

/* ─────────────────────────────────────────────────────────────
   Tags (About)
───────────────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  color: #a1a1aa;
  border: 1px solid #3f3f46;
  border-radius: 9999px;
  transition: color 0.2s, border-color 0.2s;
}
.tag:hover {
  color: #10b981;
  border-color: #10b981;
}

/* ─────────────────────────────────────────────────────────────
   Stat Cards (About)
───────────────────────────────────────────────────────────── */
.stat-card {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s, transform 0.2s;
}
.stat-card:hover {
  border-color: #3f3f46;
  transform: translateY(-2px);
}
.stat-number {
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 0.75rem;
  color: #71717a;
  font-family: 'JetBrains Mono', monospace;
}

/* ─────────────────────────────────────────────────────────────
   Project Cards
───────────────────────────────────────────────────────────── */
.project-card {
  position: relative;
}

.project-card-inner {
  height: 100%;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 12px;
  padding: 28px;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}

.project-card-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 60% at 50% 0%, rgba(16, 185, 129, 0.04), transparent);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.project-card:hover .project-card-inner {
  border-color: #3f3f46;
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(16, 185, 129, 0.05);
}

.project-card:hover .project-card-inner::before {
  opacity: 1;
}

.project-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tech Badges */
.tech-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  color: #a1a1aa;
  background: #27272a;
  border: 1px solid #3f3f46;
  border-radius: 6px;
  letter-spacing: 0.02em;
  transition: background 0.2s, color 0.2s;
}

.project-card:hover .tech-badge {
  background: #3f3f46;
}

/* Project Buttons */
.project-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s;
  line-height: 1;
}

.project-btn-primary {
  background: #10b981;
  color: #000;
}
.project-btn-primary:hover {
  background: #34d399;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.project-btn-ghost {
  background: transparent;
  color: #71717a;
  border: 1px solid #3f3f46;
}
.project-btn-ghost:hover {
  color: #fff;
  border-color: #71717a;
  transform: translateY(-1px);
}

/* ─────────────────────────────────────────────────────────────
   Skills Section
───────────────────────────────────────────────────────────── */
.skill-category {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.2s;
}
.skill-category:hover {
  border-color: #3f3f46;
}

.skill-category-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.skill-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skill-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: #d4d4d8;
  padding: 4px 0;
  transition: color 0.15s, padding-left 0.15s;
  cursor: default;
}

.skill-item::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #3f3f46;
  flex-shrink: 0;
  transition: background 0.15s;
}

.skill-item:hover {
  color: #fff;
  padding-left: 4px;
}

.skill-item:hover::before {
  background: #10b981;
}

/* ─────────────────────────────────────────────────────────────
   Blog Placeholder Cards
───────────────────────────────────────────────────────────── */
.blog-placeholder-card {
  display: block;
}

.blog-placeholder-inner {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.2s, transform 0.2s;
}

.blog-placeholder-card:hover .blog-placeholder-inner {
  border-color: #3f3f46;
  transform: translateY(-2px);
}

.blog-tag {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 6px;
  margin-bottom: 16px;
}

.blog-placeholder-box {
  height: 80px;
  background: #27272a;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.blog-placeholder-box::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(63, 63, 70, 0.4) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

/* ─────────────────────────────────────────────────────────────
   Contact Section
───────────────────────────────────────────────────────────── */
.contact-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  padding: 8px 0;
}

.contact-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #27272a;
  border-radius: 8px;
  color: #71717a;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}

.contact-info-row:hover .contact-icon {
  background: #3f3f46;
  color: #10b981;
}

/* Form Styles */
.form-label {
  display: block;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
  color: #71717a;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-input {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-size: 0.875rem;
  font-family: 'Inter', sans-serif;
  color: #e4e4e7;
  background: #18181b;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

.form-input::placeholder {
  color: #52525b;
}

.form-input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-input.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ─────────────────────────────────────────────────────────────
   Reveal Animations (JS-driven)
───────────────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ─────────────────────────────────────────────────────────────
   Reduced Motion
───────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ─────────────────────────────────────────────────────────────
   Responsive Tweaks
───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .stat-number {
    font-size: 1.4rem;
  }
}
