/* =========================================================
   gpfeifer.de – main.css
   ========================================================= */

/* --- Variables ------------------------------------------ */
:root {
  --bg:           #f7f6f2;
  --surface:      #ffffff;
  --text-primary: #1a1916;
  --text-muted:   #6b6962;
  --text-faint:   #9b9891;
  --border:       #e4e2da;
  --tag-bg:       #eeecea;
  --tag-text:     #4a4742;
  --nav-bg:       rgba(247,246,242,0.9);
}

[data-theme="dark"] {
  --bg:           #141210;
  --surface:      #1e1c19;
  --text-primary: #f0ede8;
  --text-muted:   #8a8780;
  --text-faint:   #5a5852;
  --border:       #2a2826;
  --tag-bg:       #252320;
  --tag-text:     #a0998f;
  --nav-bg:       rgba(20,18,16,0.9);
}

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

html { color-scheme: light dark; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background .3s, color .3s;
  display: flex;
  flex-direction: column;
}

main { flex: 1; max-width: 900px; margin: 0 auto; width: 100%; padding: 0 2rem; }

/* --- Navigation ----------------------------------------- */
nav {
  position: sticky; top: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: .5px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem; height: 52px; z-index: 100;
}

.nav-logo {
  font-family: 'DM Mono', monospace;
  font-size: 14px; font-weight: 500;
  color: var(--text-primary);
  text-decoration: none; letter-spacing: -.02em;
}

.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a {
  font-size: 13px; color: var(--text-muted);
  text-decoration: none; transition: color .15s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text-primary); }

.theme-toggle {
  width: 32px; height: 18px; border-radius: 9px;
  border: .5px solid var(--border);
  background: var(--surface);
  position: relative; cursor: pointer; transition: background .2s;
  flex-shrink: 0;
}
.theme-toggle::after {
  content: '';
  position: absolute;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--text-muted);
  top: 2px; left: 2px;
  transition: transform .2s, background .2s;
}
[data-theme="dark"] .theme-toggle::after {
  transform: translateX(14px);
  background: var(--text-primary);
}

/* --- Hero ----------------------------------------------- */
.hero {
  padding: 4rem 0 3rem;
  border-bottom: .5px solid var(--border);
}
.hero-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-faint);
  margin-bottom: 1rem;
}
.hero-name {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(40px, 8vw, 72px);
  font-weight: 400; line-height: 1.0;
  letter-spacing: -.03em; color: var(--text-primary);
  margin-bottom: 1rem;
}
.hero-name em { font-style: italic; color: var(--text-muted); }
.hero-sub {
  font-size: 16px; color: var(--text-muted);
  max-width: 480px; line-height: 1.6;
  font-weight: 300; margin-bottom: 2rem;
}
.hero-cta { display: inline-flex; gap: .75rem; }

/* --- Buttons -------------------------------------------- */
.btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 500;
  padding: 8px 16px; border-radius: 4px;
  cursor: pointer; text-decoration: none;
  border: .5px solid var(--border);
  background: var(--surface); color: var(--text-primary);
  display: inline-block; transition: opacity .15s;
}
.btn:hover { opacity: .7; }
.btn-primary {
  background: var(--text-primary);
  color: var(--bg);
  border-color: var(--text-primary);
}

/* --- Sections ------------------------------------------- */
.section { padding: 3rem 0; border-bottom: .5px solid var(--border); }
.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-faint);
  margin-bottom: 2rem;
}

/* --- About --------------------------------------------- */
.about-grid {
  display: grid; grid-template-columns: 160px 1fr;
  gap: 3rem; align-items: start;
}
.about-stat { padding: 1rem 0; border-top: .5px solid var(--border); }
.about-stat-num {
  font-family: 'DM Serif Display', serif;
  font-size: 32px; font-weight: 400;
  color: var(--text-primary); line-height: 1;
}
.about-stat-label { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
.about-text {
  font-size: 16px; line-height: 1.75;
  color: var(--text-muted); font-weight: 300;
  margin-bottom: 1rem;
}
.about-text:last-of-type { margin-bottom: 0; }
.about-text strong { color: var(--text-primary); font-weight: 500; }

/* --- Tags ----------------------------------------------- */
.stack-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.5rem; }
.tag {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  background: var(--tag-bg); color: var(--tag-text);
  padding: 4px 10px; border-radius: 3px;
}

/* --- Projects ------------------------------------------- */
.projects-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1px; background: var(--border);
  border: .5px solid var(--border);
}
.project-card {
  background: var(--surface); padding: 1.5rem;
  transition: background .15s;
}
.project-card:hover { background: var(--tag-bg); }
.project-title {
  font-family: 'DM Serif Display', serif;
  font-size: 18px; font-weight: 400;
  color: var(--text-primary); margin-bottom: 6px;
}
.project-desc {
  font-size: 13px; color: var(--text-muted);
  line-height: 1.5; font-weight: 300; margin-bottom: 1rem;
}
.project-tech { display: flex; gap: 6px; flex-wrap: wrap; }

/* --- Blog list ------------------------------------------ */
.blog-list { display: flex; flex-direction: column; }
.blog-item {
  display: flex; align-items: baseline;
  justify-content: space-between;
  padding: 1rem 0; border-top: .5px solid var(--border);
  text-decoration: none; transition: opacity .15s; gap: 1rem;
}
.blog-item:hover { opacity: .6; }
.blog-item-title { font-size: 15px; font-weight: 400; color: var(--text-primary); }
.blog-item-date {
  font-family: 'DM Mono', monospace;
  font-size: 11px; color: var(--text-faint); white-space: nowrap;
}
.blog-empty { font-size: 14px; color: var(--text-faint); }

/* --- Blog post ------------------------------------------ */
.post-article { padding: 3rem 0; }
.back-link {
  font-size: 13px; color: var(--text-faint);
  text-decoration: none; display: inline-block; margin-bottom: 1.5rem;
}
.back-link:hover { color: var(--text-primary); }
.post-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(28px, 5vw, 48px); font-weight: 400;
  line-height: 1.1; letter-spacing: -.02em;
  color: var(--text-primary); margin-bottom: 1rem;
}
.post-meta {
  display: flex; gap: .75rem; align-items: center;
  flex-wrap: wrap; margin-bottom: 2.5rem;
  padding-bottom: 1.5rem; border-bottom: .5px solid var(--border);
}
.post-meta time {
  font-family: 'DM Mono', monospace;
  font-size: 12px; color: var(--text-faint);
}

/* --- Prose (rendered markdown) -------------------------- */
.prose { max-width: 680px; }
.prose h1, .prose h2, .prose h3, .prose h4 {
  font-family: 'DM Serif Display', serif;
  font-weight: 400; color: var(--text-primary);
  margin-top: 2rem; margin-bottom: .75rem;
}
.prose h1 { font-size: 32px; }
.prose h2 { font-size: 24px; }
.prose h3 { font-size: 20px; }
.prose p { font-size: 16px; line-height: 1.75; color: var(--text-muted); margin-bottom: 1.25rem; font-weight: 300; }
.prose a { color: var(--text-primary); text-underline-offset: 3px; }
.prose strong { color: var(--text-primary); font-weight: 500; }
.prose code {
  font-family: 'DM Mono', monospace;
  font-size: 13px; background: var(--tag-bg);
  padding: 2px 6px; border-radius: 3px; color: var(--text-primary);
}
.prose pre {
  background: var(--surface); border: .5px solid var(--border);
  border-radius: 6px; padding: 1.25rem;
  overflow-x: auto; margin: 1.5rem 0;
}
.prose pre code { background: none; padding: 0; font-size: 13px; }
.prose blockquote {
  border-left: 2px solid var(--border);
  padding-left: 1rem; margin: 1.5rem 0;
  color: var(--text-faint);
}
.prose ul, .prose ol {
  padding-left: 1.5rem; margin-bottom: 1.25rem; color: var(--text-muted);
}
.prose li { font-size: 16px; line-height: 1.75; font-weight: 300; margin-bottom: .25rem; }
.prose hr { border: none; border-top: .5px solid var(--border); margin: 2rem 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 14px; }
.prose th, .prose td { padding: .5rem .75rem; border: .5px solid var(--border); text-align: left; }
.prose th { font-weight: 500; color: var(--text-primary); }
.prose td { color: var(--text-muted); }

/* --- Footer --------------------------------------------- */
footer {
  max-width: 900px; margin: 0 auto; width: 100%;
  padding: 2rem; display: flex;
  justify-content: space-between; align-items: center;
}
.footer-text {
  font-family: 'DM Mono', monospace;
  font-size: 11px; color: var(--text-faint);
}

/* --- Responsive ----------------------------------------- */
@media (max-width: 600px) {
  nav { padding: 0 1rem; }
  main { padding: 0 1rem; }
  footer { padding: 1.5rem 1rem; flex-direction: column; gap: .5rem; }
  .about-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .about-stats { display: flex; gap: 2rem; }
  .projects-grid { grid-template-columns: 1fr; }
}
