/* ===========================
   Custom Properties
   =========================== */

:root {
  --bg-primary: #242424;
  --bg-surface: #2e2e2e;
  --bg-surface-hover: #363636;
  --border: #444444;
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-muted: #6a6a6a;
  --accent: #4BD882;
  --accent-dim: rgba(46, 160, 67, 0.2);
  --status-neutral-bg: rgba(136, 153, 166, 0.2);

  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ===========================
   Reset & Base
   =========================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4rem;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  opacity: 0.8;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  opacity: 1;
}

ul {
  list-style: none;
}

/* ===========================
   Layout
   =========================== */

main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 4rem 0;
}

/* ===========================
   Navigation
   =========================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  border-bottom: 1px solid transparent;
}

.site-header.nav--scrolled {
  background: var(--bg-surface);
  border-bottom-color: var(--border);
}

.nav {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.875rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo-img {
  height: 28px;
  width: 28px;
  border-radius: 4px;
}

.nav-logo:hover {
  color: var(--accent);
  opacity: 1;
}

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

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.nav-link--active {
  color: var(--accent);
  opacity: 1;
}

/* ===========================
   Hero
   =========================== */

.hero {
  padding: 8rem 0 4rem;
  text-align: center;
}

.hero-name {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.hero-tagline {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  line-height: 1.8;
}

.hero-tagline::after {
  content: '_';
  font-family: var(--font-mono);
  color: var(--accent);
  animation: blink 1s step-end infinite;
}

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

/* ===========================
   Section Headings
   =========================== */

.section-heading {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
  margin-bottom: 2rem;
}

/* ===========================
   About
   =========================== */

.about-content {
  /* max-width: 42rem; */
}

.about-content p {
  margin-bottom: 1rem;
}

.about-content p:last-child {
  margin-bottom: 0;
}

/* ===========================
   Project Groups
   =========================== */

.project-group {
  margin-bottom: 3rem;
}

.project-group:last-child {
  margin-bottom: 0;
}

.group-heading {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

/* ===========================
   Project Cards
   =========================== */

.project-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1.25rem;
}

.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  transition: border-color 0.15s ease;
  display: flex;
  flex-direction: column;
}

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

.project-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.project-title {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.project-description {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.project-description strong {
  color: var(--text-primary);
  font-weight: 500;
}

/* Status badges */

.project-status {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.15em 0.5em;
  border-radius: 3px;
  text-transform: lowercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.project-status--active {
  color: var(--accent);
  background: var(--accent-dim);
}

.project-status--maintained,
.project-status--fork {
  color: var(--text-primary);
  background: var(--status-neutral-bg);
}

.project-year {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Tech tags */

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.project-tech li {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.15em 0.5em;
}

/* Card links */

.project-card-links {
  display: flex;
  gap: 1rem;
}

.project-card-links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* Compact variant */

.project-card--compact {
  padding: 1rem 1.25rem;
}

.project-card--compact .project-title {
  font-size: 0.95rem;
}

.project-card--compact .project-description {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===========================
   Links Section
   =========================== */

.link-list {
  display: flex;
  gap: 2rem;
}

.link-list a {
  font-family: var(--font-mono);
  font-size: 1rem;
}

/* ===========================
   Footer
   =========================== */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
}

.site-footer p {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===========================
   Responsive
   =========================== */

@media (max-width: 640px) {
  .hero {
    padding: 5rem 0 3rem;
  }

  section {
    padding: 3rem 0;
  }

  .project-cards {
    grid-template-columns: 1fr;
  }

  .nav-links {
    gap: 1rem;
  }

  .nav-links a {
    font-size: 0.8rem;
  }

  .link-list {
    flex-direction: column;
    gap: 1rem;
  }
}
