/* ==========================================================================
   1. CUSTOM PROPERTIES
   ========================================================================== */
:root {
  --bg:          #0f0f0f;
  --surface:     #1a1a1a;
  --surface-alt: #222222;
  --border:      #2a2a2a;
  --border-hover:#64ffda33;
  --text:        #e2e8f0;
  --text-muted:  #94a3b8;
  --text-faint:  #475569;
  --accent:      #64ffda;
  --accent-dim:  #64ffda1a;
  --font-sans:   'Inter', system-ui, sans-serif;
  --font-mono:   'JetBrains Mono', monospace;
  --max-width:   900px;
  --nav-height:  64px;
  --glow-accent: 0 0 0 1px var(--border-hover), 0 0 16px #64ffda18;
}

/* ==========================================================================
   2. RESET
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   3. BASE
   ========================================================================== */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.7;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.15s ease;
}

a:hover {
  opacity: 0.8;
}

img {
  max-width: 100%;
  display: block;
}

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

main {
  padding-top: calc(var(--nav-height) + 2rem);
  padding-bottom: 4rem;
}

section {
  margin-bottom: 4rem;
}

/* ==========================================================================
   5. NAVIGATION
   ========================================================================== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(15, 15, 15, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: -0.01em;
}

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

.nav-link {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s ease;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.nav-link:hover {
  color: var(--text);
  opacity: 1;
}

.nav-link--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  font-size: 1.1rem;
  line-height: 1;
}

/* ==========================================================================
   6. HERO
   ========================================================================== */
.hero {
  padding: 3rem 0 2rem;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero-name {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.hero-tagline {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-weight: 400;
}

.hero-bio {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 620px;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   7. BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #0f0f0f;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: transparent;
  color: var(--accent);
  opacity: 1;
}

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-secondary:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: var(--glow-accent);
  opacity: 1;
}

/* ==========================================================================
   8. SECTION HEADINGS
   ========================================================================== */
.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 1.1rem;
  background: var(--accent);
  border-radius: 2px;
}

/* ==========================================================================
   9. SKILLS GRID
   ========================================================================== */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.skill-tag {
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  border: 1px solid var(--border-hover);
  white-space: nowrap;
}

/* ==========================================================================
   10. PROJECT CARDS
   ========================================================================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: var(--glow-accent);
}

.project-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.project-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1rem;
}

.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.tag {
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
}

.project-card-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: auto;
}

.project-card-link:hover {
  opacity: 0.75;
}

/* ==========================================================================
   11. PROJECT DETAIL PAGE
   ========================================================================== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 2.5rem;
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--accent);
  opacity: 1;
}

.page-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.page-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.prose {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.8;
}

.prose h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.prose p {
  margin-bottom: 1rem;
}

.prose ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose a {
  color: var(--accent);
}

.code-block {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
  overflow-x: auto;
}

.code-block pre {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-muted);
  white-space: pre;
}

.code-block .comment { color: var(--text-faint); }
.code-block .keyword { color: var(--accent); }
.code-block .string  { color: #a3be8c; }

.link-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.link-list li a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}

/* ==========================================================================
   12. 404 PAGE
   ========================================================================== */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.error-code {
  font-family: var(--font-mono);
  font-size: clamp(4rem, 15vw, 8rem);
  font-weight: 700;
  color: var(--border);
  line-height: 1;
  margin-bottom: 1rem;
}

.error-message {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.error-sub {
  font-size: 0.9rem;
  color: var(--text-faint);
  margin-bottom: 2rem;
}

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

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-faint);
  font-family: var(--font-mono);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-faint);
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--accent);
  opacity: 1;
}

/* ==========================================================================
   14. RESPONSIVE
   ========================================================================== */
@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links li {
    border-bottom: 1px solid var(--border);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-link {
    display: block;
    padding: 0.85rem 1.5rem;
    border-bottom: none;
  }

  .nav-toggle {
    display: block;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .hero-name {
    font-size: 2.25rem;
  }

  .hero-cta {
    flex-direction: column;
  }

  .hero-cta .btn {
    justify-content: center;
  }
}
