/* ---------- Tokens ---------- */
:root {
  --bg: #fdfdfb;
  --surface: #ffffff;
  --text: #1c1c1a;
  --muted: #6b6b66;
  --rule: #e4e2dc;
  --accent: #9a4b2c;
  --max-width: 60rem;
  --gap: clamp(1.5rem, 4vw, 3rem);
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17171a;
    --surface: #1f1f23;
    --text: #ececea;
    --muted: #a0a09a;
    --rule: #33333a;
    --accent: #e79b74;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

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

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

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 4rem) clamp(1rem, 5vw, 2rem);
}

/* ---------- Intro: photo + bio ---------- */
/* Mobile first: photo on top, bio underneath. */
.intro {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  align-items: start;
}

/* The artwork is a transparent SVG, so no background or rounding here --
   the page background shows straight through it. */
.intro-photo img {
  width: 100%;
  height: auto;
}

.intro-name {
  margin: 0;
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.intro-tagline {
  margin: 0.35rem 0 1.25rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.intro-bio p { margin: 0 0 1rem; }
.intro-bio p:last-child { margin-bottom: 0; }

/* Wide layout: photo left, bio right. */
@media (min-width: 46rem) {
  .intro {
    grid-template-columns: minmax(16rem, 2fr) 3fr;
  }
}

/* ---------- Post list ---------- */
.posts {
  margin-top: clamp(2.5rem, 7vw, 4.5rem);
  border-top: 1px solid var(--rule);
  padding-top: 1.75rem;
}

.posts-title {
  margin: 0 0 1.25rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.post-list { margin: 0; padding: 0; list-style: none; }

.post-list-item {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
}
.post-list-item:last-child { border-bottom: 0; }

.post-list-date {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.post-list-link {
  font-size: 1.15rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}
.post-list-link:hover { color: var(--accent); text-decoration: underline; }

.post-list-excerpt {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.posts-empty { color: var(--muted); margin: 0; }

/* Wide layout: date in a left-hand column beside the title. */
@media (min-width: 46rem) {
  .post-list-item {
    display: grid;
    grid-template-columns: 8.5rem 1fr;
    column-gap: 1.25rem;
    align-items: baseline;
  }
  .post-list-date { padding-top: 0.15rem; }
  .post-list-excerpt { grid-column: 2; }
}

/* ---------- Post page ---------- */
.post-title {
  margin: 0;
  font-size: clamp(1.7rem, 4.5vw, 2.3rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.post-meta { margin: 0.4rem 0 2rem; color: var(--muted); font-size: 0.9rem; }

.post-content h2 { margin-top: 2.25rem; }

.post-content pre {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
}

.post-content code { font-size: 0.92em; }

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

.back-link { margin-top: 3rem; font-size: 0.95rem; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: clamp(3rem, 8vw, 5rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
}
.site-footer p { margin: 0; }
