/* ==========================================================================
   Joe Pfohl — joepfohl.com
   ========================================================================== */

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

/* --- Custom Properties --- */
:root {
  --bg: #faf9f7;
  --text: #1c1917;
  --muted: #57534e;
  --accent: #b45309;
  --border: #e7e5e4;
  --surface: #f5f5f4;

  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Source Serif 4', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', monospace;

  --content-width: 680px;
  --resume-width: 720px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1917;
    --text: #e7e5e4;
    --muted: #a8a29e;
    --accent: #f59e0b;
    --border: #44403c;
    --surface: #292524;
  }
}

/* --- Base --- */
html {
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.3;
}

h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.4rem; font-weight: 600; margin-top: 2rem; }
h3 { font-size: 1.15rem; font-weight: 600; }

p { margin-top: 0.75rem; }
p:first-child { margin-top: 0; }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { text-decoration-thickness: 2px; }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface);
  padding: 0.15em 0.35em;
  border-radius: 4px;
}

pre code {
  background: none;
  padding: 0;
}

blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  color: var(--muted);
  margin: 1.5rem 0;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

img { max-width: 100%; height: auto; }

/* --- Nav --- */
.site-nav {
  border-bottom: 1px solid var(--border);
}

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

.nav-home {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.nav-home:hover { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.nav-links a:hover { color: var(--accent); }

.icon {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}

/* --- Main Content --- */
.site-main {
  max-width: var(--content-width);
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  flex: 1;
}

.resume-main {
  max-width: var(--resume-width);
}

/* --- Homepage --- */
.hero {
  margin-bottom: 3rem;
}

.hero h1 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.8;
}

.home-section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.post-preview {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.6rem 0;
}

.post-preview a {
  font-weight: 500;
}

.post-preview time {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

.empty-state {
  color: var(--muted);
  font-style: italic;
}

/* --- Blog Listing --- */
.blog-listing h1 {
  margin-bottom: 1.5rem;
}

.post-card {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.post-card:last-of-type {
  border-bottom: none;
}

.post-card-header h2 {
  font-size: 1.25rem;
  margin-top: 0;
}

.post-card-header h2 a {
  color: var(--text);
  text-decoration: none;
}
.post-card-header h2 a:hover {
  color: var(--accent);
}

.post-card-header time {
  font-size: 0.85rem;
  color: var(--muted);
}

.post-card p {
  color: var(--muted);
  font-size: 0.95rem;
}

.post-card-tags {
  margin-top: 0.5rem;
}

.tag {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  margin-right: 0.5rem;
}
.tag:hover { text-decoration: underline; }

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.pagination-info {
  color: var(--muted);
}

/* --- Post --- */
.post-header {
  margin-bottom: 2rem;
}

.post-header h1 {
  margin-bottom: 0.25rem;
}

.post-header time {
  font-size: 0.9rem;
  color: var(--muted);
}

.post-tags {
  margin-top: 0.5rem;
}

.post-content h2 { margin-top: 2.5rem; margin-bottom: 0.75rem; }
.post-content h3 { margin-top: 2rem; margin-bottom: 0.5rem; }

.post-content ul,
.post-content ol {
  margin-top: 0.75rem;
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: 0.35rem;
}

.post-content pre {
  margin: 1.5rem 0;
  border-radius: 8px;
}

/* --- Resume --- */
.resume h1 {
  font-size: 1.75rem;
}

.resume .subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.resume h2 {
  font-size: 1.1rem;
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.resume h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
}

.resume p {
  font-size: 0.95rem;
}

.job { margin-bottom: 1.75rem; }

.job-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.1rem;
}

.job-date {
  color: var(--muted);
  font-size: 0.85rem;
  opacity: 0.8;
}

.resume ul {
  margin-top: 0.5rem;
  padding-left: 1.25rem;
}

.resume li {
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.skills-grid {
  display: grid;
  gap: 0.5rem;
}

.skills-grid dt {
  font-weight: 600;
  font-size: 0.9rem;
}

.skills-grid dd {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.edu { margin-bottom: 0.75rem; }
.edu-degree { font-weight: 600; font-size: 0.95rem; }
.edu-meta { color: var(--muted); font-size: 0.85rem; }

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.footer-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}
.footer-links a:hover { color: var(--accent); text-decoration: underline; }

.footer-sep {
  margin: 0 0.5rem;
  opacity: 0.5;
}

/* --- 404 --- */
.not-found {
  text-align: center;
  padding: 4rem 0;
}

.not-found h1 {
  font-size: 4rem;
  color: var(--muted);
  opacity: 0.5;
}

.not-found p {
  color: var(--muted);
  margin-top: 1rem;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  html { font-size: 16px; }

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

  .nav-inner { padding: 0.75rem 1rem; }

  .site-main { padding: 1.5rem 1rem; }

  .post-preview {
    flex-direction: column;
    gap: 0.1rem;
  }
}

/* --- Print (Resume) --- */
@media print {
  .site-nav,
  .site-footer { display: none; }

  body { background: white; color: black; font-size: 11pt; }

  .site-main { padding: 0; max-width: none; }

  .resume h2 { color: #333; border-color: #ccc; }
  .resume .subtitle,
  .job-meta,
  .edu-meta { color: #555; }
  .job-date { color: #777; }
  .resume li { color: #222; }
  .skills-grid dd { color: #444; }

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

  .job { break-inside: avoid; }
}
