/* ------------------------------------------------------------------
   Christopher A. Wood — minimal, text-first theme
   Two type voices: a serif for reading, a mono for the "machine" layer.
   Light = warm paper; dark = cool near-black. Accent = muted pine green.
   ------------------------------------------------------------------ */

:root {
  /* light (warm paper) */
  --paper:      #f6f6f1;
  --surface:    #ffffff;
  --ink:        #1b1d19;
  --muted:      #585d54;
  --faint:      #8b9087;
  --line:       #e2e2d8;
  --accent:     #2f6f4e;
  --accent-str: #245a3f;

  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, "Noto Serif", Georgia, serif;
  --mono:  ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;

  --measure: 40rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #111311;
    --surface:    #171a17;
    --ink:        #e8e9e2;
    --muted:      #9ba096;
    --faint:      #6b706a;
    --line:       #282c27;
    --accent:     #74c79f;
    --accent-str: #8fd4b2;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-str); text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ---- layout ---- */
.wrap { width: min(var(--measure), 100% - 2.75rem); margin-inline: auto; }
.read { max-width: var(--measure); }

main { padding-block: 2.9rem 1rem; }
section + section { margin-top: 3.4rem; }

/* ---- masthead ---- */
.masthead {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 1.6rem 0 1.1rem;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  font-family: var(--mono);
  font-size: .92rem; font-weight: 600; letter-spacing: .04em;
  color: var(--ink);
}
.wordmark:hover { color: var(--ink); text-decoration: none; }
.masthead nav { display: flex; align-items: baseline; gap: 1.35rem; font-family: var(--mono); font-size: .8rem; letter-spacing: .02em; }
.masthead nav a { color: var(--muted); }
.masthead nav a:hover { color: var(--ink); text-decoration: none; }
.masthead nav a[aria-current] { color: var(--ink); }
.masthead nav a[aria-current]::before { content: "· "; color: var(--accent); }

/* ---- eyebrow + section titles ---- */
.eyebrow {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 1.15rem;
}
.section-title {
  font-family: var(--mono); font-weight: 600;
  font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.3rem; padding-bottom: .55rem;
  border-bottom: 1px solid var(--line);
}

/* ---- home intro ---- */
.intro { max-width: var(--measure); }
.intro::after { content: ""; display: table; clear: both; }  /* contain the float */
.intro p { margin: 0 0 1.05rem; }
.intro p:last-child { margin-bottom: 0; }

/* headshot floats right so the bio wraps around it; stacks on narrow screens */
figure.portrait { width: 9.5rem; margin: 0 0 1rem; }
@media (min-width: 480px) {
  figure.portrait { float: right; margin: .35rem 0 .4rem 1.5rem; }
}
figure.portrait img {
  width: 100%; display: block;
  border-radius: 4px; border: 1px solid var(--line);
  filter: saturate(.92);
}

/* ---- pointers ---- */
ul.pointers { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .55rem 1.4rem; font-family: var(--mono); font-size: .85rem; }
ul.pointers a { color: var(--ink); }
ul.pointers a:hover { color: var(--accent); }
ul.pointers svg { vertical-align: -2px; opacity: .7; }

/* ---- posts list (used by tag pages / future blog) ---- */
ol.posts { list-style: none; margin: 0; padding: 0; }
ol.posts li { padding: 1.1rem 0; border-top: 1px solid var(--line); }
ol.posts li:first-child { border-top: 0; padding-top: 0; }
.post-row { display: grid; grid-template-columns: 1fr; gap: .15rem; }
@media (min-width: 560px) { .post-row { grid-template-columns: 7.5rem 1fr; gap: 1.2rem; align-items: baseline; } }
.post-date { font-family: var(--mono); font-size: .76rem; color: var(--faint); letter-spacing: .02em; font-variant-numeric: tabular-nums; padding-top: .25rem; }
.post-title { font-size: 1.22rem; font-weight: 600; margin: 0; line-height: 1.3; }
.post-title a { color: var(--ink); }
.post-title a:hover { color: var(--accent); text-decoration: none; }
.post-desc { color: var(--muted); font-size: 1rem; margin: .2rem 0 0; }
.post-tags { margin-top: .4rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.tag, .post-tag {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .03em; color: var(--faint);
  border: 1px solid var(--line); border-radius: 3px; padding: .08rem .4rem;
}
.post-tag:hover { color: var(--accent); text-decoration: none; }
.morelink { font-family: var(--mono); font-size: .8rem; margin-top: 1.3rem; }

/* ---- draft markers (only ever render on the local preview server) ---- */
.draft-badge { font-family: var(--mono); font-size: .6rem; text-transform: uppercase; letter-spacing: .08em; color: var(--paper); background: var(--accent); border-radius: 3px; padding: .1rem .4rem; vertical-align: .12em; }
.draft-banner { font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; color: var(--accent-str); border: 1px dashed var(--accent); border-radius: 4px; padding: .5rem .8rem; margin: 0 0 1.4rem; }

/* ---- single article (post / 404 / tags prose) ---- */
article.post h1 { font-size: 2rem; line-height: 1.2; text-wrap: balance; margin: 0 0 .5rem; }
article.post .lead { color: var(--muted); font-size: 1.15rem; margin: 0 0 1rem; }
.post-meta { font-family: var(--mono); font-size: .76rem; color: var(--faint); letter-spacing: .02em; margin: 0 0 1.6rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.post-meta time { font-variant-numeric: tabular-nums; }
.post-cover { border-radius: 5px; border: 1px solid var(--line); margin-bottom: 1.6rem; }
.read h1, .read h2, .read h3 { text-wrap: balance; line-height: 1.25; }
.read h1 { font-size: 2rem; margin: 0 0 1rem; }
main p { margin: 0 0 1.05rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
blockquote { margin: 1.4rem 0; padding-left: 1.1rem; border-left: 2px solid var(--line); color: var(--muted); }
code { font-family: var(--mono); font-size: .9em; background: var(--surface); border: 1px solid var(--line); border-radius: 3px; padding: .05em .35em; }
pre { font-family: var(--mono); font-size: .85rem; line-height: 1.55; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 1rem 1.1rem; overflow-x: auto; }
pre code { background: none; border: 0; padding: 0; font-size: inherit; }

.postnav { display: flex; justify-content: space-between; gap: 1rem; font-family: var(--mono); font-size: .8rem; }
.postnav .next { text-align: right; margin-left: auto; }

/* ---- gallery ---- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.grid picture, .grid a { display: block; line-height: 0; }
.grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; border-radius: 4px; border: 1px solid var(--line); cursor: zoom-in; }

/* ---- gallery lightbox ---- */
.lightbox { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: rgba(10, 11, 10, .92); }
.lightbox[hidden] { display: none; }
.lightbox-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; box-shadow: 0 12px 48px rgba(0, 0, 0, .5); }
.lightbox-close { position: absolute; top: .8rem; right: 1rem; width: 2.3rem; height: 2.3rem; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 1.5rem; line-height: 1; color: #fff; background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; cursor: pointer; }
.lightbox-close:hover { background: rgba(0, 0, 0, .6); }
@media (prefers-reduced-motion: no-preference) {
  .lightbox { animation: lb-fade .15s ease-out; }
  @keyframes lb-fade { from { opacity: 0 } to { opacity: 1 } }
}

/* ---- footer ---- */
footer { margin-top: 4rem; padding: 1.6rem 0 2.6rem; border-top: 1px solid var(--line); }
.sig { font-family: var(--mono); font-size: .76rem; color: var(--muted); text-align: center; }
.sig .dim { color: var(--faint); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
