/* =====================================================
   CSS Variables & Reset
   ===================================================== */
:root {
  /* Colors */
  --bg: hsl(60, 9%, 98%);
  --bg-alt: hsl(220, 13%, 95%);
  --fg: hsl(220, 15%, 15%);
  --fg-muted: hsl(220, 10%, 45%);
  --primary: hsl(142, 70%, 40%);
  --primary-glow: hsl(142, 70%, 50%);
  --border: hsl(220, 13%, 88%);
  --code-bg: hsl(220, 15%, 96%);
  --card: hsl(0, 0%, 100%);
  --destructive: hsl(0, 84%, 60%);
  
  /* Typography */
  --font-mono: 'JetBrains Mono', monospace;
  --font-sans: 'Inter', system-ui, sans-serif;
  
  /* Spacing */
  --container-max: 1000px;
  --section-padding: 5rem;
  
  /* Effects */
  --shadow: 0 2px 8px -2px hsl(220 15% 15% / 0.08);
  --shadow-hover: 0 8px 24px -4px hsl(220 15% 15% / 0.12);
  --transition: all 0.3s ease;
  --radius: 0.5rem;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  
  /* Subtle grid background */
  background-image: 
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: -1px -1px;
}

a {
  color: inherit;
  text-decoration: none;
}

/* =====================================================
   Container
   ===================================================== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* =====================================================
   Navigation
   ===================================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: var(--transition);
}

.nav.scrolled {
  background: hsl(60 9% 98% / 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.nav-logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.125rem;
  transition: var(--transition);
}

.nav-logo:hover {
  color: var(--primary);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--fg-muted);
  position: relative;
  padding: 0.25rem 0;
  transition: var(--transition);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 1.25rem;
  height: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--fg);
  transition: var(--transition);
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }
  
  .nav-links {
    position: absolute;
    top: 4rem;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: var(--transition);
  }
  
  .nav-links.active {
    max-height: 400px;
    padding: 0.5rem 0;
  }
  
  .nav-link {
    padding: 0.75rem 1.5rem;
  }
  
  .nav-link::after {
    display: none;
  }
  
  .nav-link.active {
    background: hsl(142 70% 40% / 0.05);
  }
}

/* =====================================================
   Hero Section
   ===================================================== */
.hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 4rem;
  text-align: center;
}

.hero-content {
  max-width: 100%;
}

.hero-greeting {
  font-family: var(--font-mono);
  color: var(--primary);
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--fg-muted);
  margin-bottom: 2rem;
}

.cursor {
  display: inline-block;
  width: 4px;
  height: 1em;
  background: var(--primary);
  margin-left: 0.25rem;
  vertical-align: middle;
  animation: blink 1s step-end infinite;
}

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

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2.5rem;
}

.scroll-indicator {
  margin-top: 3rem;
  color: var(--fg-muted);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* =====================================================
   Buttons
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  border-radius: var(--radius);
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 0 20px hsl(142 70% 50% / 0.3), 0 0 40px hsl(142 70% 50% / 0.1);
}

.btn-primary:hover {
  background: hsl(142, 70%, 35%);
}

.btn-outline {
  border-color: var(--border);
  background: transparent;
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* =====================================================
   Sections
   ===================================================== */
.section {
  padding: var(--section-padding) 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-title {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-subtitle {
  color: var(--fg-muted);
  margin-top: -1rem;
  margin-bottom: 2rem;
}

/* =====================================================
   Code Block
   ===================================================== */
.code-block {
  background: var(--code-bg);
  border-radius: var(--radius);
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  text-align: left;
  overflow-x: auto;
}

.code-block pre {
  margin: 0;
}

.code-block code {
  color: var(--fg);
  white-space: pre;
}

.comment {
  color: var(--fg-muted);
}

/* =====================================================
   Accent & Glow
   ===================================================== */
.accent {
  color: var(--primary);
}

.glow-text {
  text-shadow: 0 0 10px hsl(142 70% 50% / 0.5), 0 0 20px hsl(142 70% 50% / 0.3);
}

/* =====================================================
   Tags
   ===================================================== */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background: hsl(142 70% 40% / 0.1);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius);
}

/* =====================================================
   About Section
   ===================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.about-text p {
  color: var(--fg-muted);
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* =====================================================
   Skills Section
   ===================================================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.skill-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

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

.skill-category {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.skill-item {
  margin-bottom: 1rem;
}

.skill-item:last-child {
  margin-bottom: 0;
}

.skill-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.skill-name {
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.skill-level {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-muted);
}

.skill-bar {
  height: 0.5rem;
  background: var(--bg-alt);
  border-radius: 9999px;
  overflow: hidden;
}

.skill-progress {
  height: 100%;
  background: var(--primary);
  border-radius: 9999px;
  transition: width 1s ease-out;
}

@media (max-width: 768px) {
  .skills-grid {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   Projects Section
   ===================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: block;
}

.project-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  border-color: hsl(142 70% 40% / 0.5);
}

.project-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.project-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.project-content {
  flex: 1;
}

.project-title {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.project-card:hover .project-title {
  color: var(--primary);
}

.project-title svg {
  opacity: 0;
  transform: translateX(-8px);
  transition: var(--transition);
}

.project-card:hover .project-title svg {
  opacity: 1;
  transform: translateX(0);
}

.project-description {
  color: var(--fg-muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   Blog Section
   ===================================================== */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.blog-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

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

.blog-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--code-bg);
  border-bottom: 1px solid var(--border);
}

.blog-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
}

.blog-dot.red { background: var(--destructive); }
.blog-dot.yellow { background: hsl(45, 93%, 47%); }
.blog-dot.green { background: var(--primary); }

.blog-filename {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin-left: 0.5rem;
}

.blog-content {
  padding: 1.5rem;
}

.blog-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--fg-muted);
  margin-bottom: 0.75rem;
}

.blog-meta span:nth-child(2) {
  color: var(--border);
}

.blog-title {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.blog-title:hover {
  color: var(--primary);
}

.blog-excerpt {
  color: var(--fg-muted);
  margin-bottom: 1rem;
}

/* =====================================================
   Gear Section
   ===================================================== */
.gear-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.gear-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

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

.gear-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.gear-icon {
  font-size: 1.5rem;
}

.gear-info {
  flex: 1;
}

.gear-category {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.gear-name {
  font-family: var(--font-mono);
  font-weight: 600;
  margin-top: 0.25rem;
}

.gear-description {
  font-size: 0.875rem;
  color: var(--fg-muted);
  margin-top: 0.25rem;
}

@media (max-width: 768px) {
  .gear-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .gear-grid {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   Contact Section
   ===================================================== */
.contact-content {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.contact-text {
  color: var(--fg-muted);
  margin: 2rem 0;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg-muted);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.social-link:hover {
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

/* =====================================================
   Footer
   ===================================================== */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.footer-brand {
  font-family: var(--font-mono);
}

/* =====================================================
   Animations
   ===================================================== */
.slide-up {
  opacity: 0;
  transform: translateY(20px);
  animation: slideUp 0.6s ease-out forwards;
}

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

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading state */
.loading {
  font-family: var(--font-mono);
  color: var(--fg-muted);
  text-align: center;
  padding: 2rem;
}

.error {
  color: var(--destructive);
}

/* Make entire blog card clickable */
.blog-card {
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.blog-link {
  position: absolute;
  inset: 0;
  z-index: 10;
}

.blog-card:hover {
  border-color: var(--primary);
}

/* Optional: Fancy "Read more" at bottom */
.read-more {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 500;
  opacity: 0;
  transform: translateY(10px);
  transition: var(--transition);
}

.blog-card:hover .read-more {
  opacity: 1;
  transform: translateY(0);
}

/* Dim excerpt on hover to focus on "Read more" */
.blog-card:hover .blog-excerpt {
  opacity: 0.7;
}

.back-link {
      display: inline-block;
      margin-top: 3rem;
      color: var(--primary);
      font-weight: 500;
      font-family: var(--font-mono);
    }
    .back-link:hover {
      text-decoration: underline;
    }
