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

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2333;
  --bg-card-hover: #222d42;
  --border: #30363d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --green: #3fb950;
  --orange: #d29922;
  --purple: #bc8cff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica,
    Arial, sans-serif;
  --max-width: 960px;
  --transition: 0.2s ease;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

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

/* ─── Layout ───────────────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* ─── Header / Navigation ──────────────────────────────────── */
.site-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(22, 27, 34, 0.85);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.site-logo svg {
  fill: var(--text-primary);
}

.site-nav {
  display: flex;
  gap: 8px;
  list-style: none;
}

.site-nav a {
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

/* ─── Hero Section ─────────────────────────────────────────── */
.hero {
  padding: 100px 0 80px;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 32px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.hero-cta:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(88, 166, 255, 0.3);
}

/* ─── Section Headers ──────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-header .view-all {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.section-header .view-all:hover {
  color: var(--accent);
}

/* ─── Project Cards ────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 20px;
  margin-bottom: 60px;
}

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

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.project-card-icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--text-secondary);
}

.project-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
}

.project-card h3 a {
  color: var(--text-primary);
}

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

.project-card-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
  flex-grow: 1;
}

.project-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.project-card-meta .lang-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Language colors */
.lang-shell { background: #89e051; }
.lang-csharp { background: #178600; }
.lang-dockerfile { background: #384d54; }
.lang-html { background: #e34c26; }
.lang-css { background: #563d7c; }
.lang-javascript { background: #f1e05a; }

/* ─── Tags / Badges ────────────────────────────────────────── */
.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

/* ─── Project Detail Page ──────────────────────────────────── */
.project-detail {
  padding: 60px 0 80px;
  max-width: 800px;
  margin: 0 auto;
}

.project-detail-header {
  margin-bottom: 40px;
}

.project-detail-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.project-detail-header .description {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.project-detail-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.stat svg {
  width: 16px;
  height: 16px;
}

.project-detail-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  border: 1px solid var(--border);
  cursor: pointer;
}

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

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

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.project-content {
  line-height: 1.7;
}

.project-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.project-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 28px 0 12px;
}

.project-content p {
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.project-content ul,
.project-content ol {
  margin: 0 0 16px 24px;
  color: var(--text-secondary);
}

.project-content li {
  margin-bottom: 6px;
}

.project-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-primary);
}

.project-content pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  overflow-x: auto;
  margin-bottom: 20px;
}

.project-content pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

.project-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.project-content th,
.project-content td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
  font-size: 0.9rem;
}

.project-content th {
  background: var(--bg-secondary);
  font-weight: 600;
}

.project-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 20px 0;
  background: rgba(88, 166, 255, 0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}

/* ─── About Page ───────────────────────────────────────────── */
.about-page {
  padding: 60px 0 80px;
  max-width: 700px;
  margin: 0 auto;
}

.about-page h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.about-page p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 1.05rem;
  line-height: 1.7;
}

.about-links {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  flex-wrap: wrap;
}

/* ─── Projects Listing Page ────────────────────────────────── */
.projects-page {
  padding: 60px 0 80px;
}

.projects-page h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.projects-page .subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 40px;
}

/* ─── Footer ───────────────────────────────────────────────── */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--text-secondary);
}

.site-footer a:hover {
  color: var(--accent);
}

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

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
}

/* ─── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .header-inner {
    flex-direction: column;
    height: auto;
    padding: 12px 0;
    gap: 8px;
  }

  .site-header {
    position: relative;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .project-detail-header h1 {
    font-size: 1.7rem;
  }

  .project-detail-stats {
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 60px 0 50px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

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

  .project-card {
    padding: 20px;
  }
}
