/* stephenshaffer.io — "Field notes"
   Palette: paper #F2EFE3 · ink #1B2620 · green #3B5D45 · clay #9C4A24

   Every text colour below clears WCAG AA (4.5:1) against --paper, and the
   greys stay ordered ink > body > soft > muted > faint > fainter so the
   hierarchy still reads. Do not lighten them back: the quiet tone comes
   from size, weight and letter-spacing, not from low contrast.

   Ported from the Claude Design project (direction 1a). Two deliberate
   deviations from the design source, both forced by deployment config:
   1. asset URLs are root-absolute, because vercel.json sets cleanUrls
      and pages are served from more than one directory depth;
   2. the utility classes at the foot of this file exist so no shipped
      markup needs an inline style= attribute — the CSP in vercel.json
      sets style-src 'self' with no 'unsafe-inline'. */

:root {
  --paper: #F2EFE3;
  --card: #FBF8F0;
  --ink: #1B2620;
  --body: #3D4842;
  --soft: #4E584F;
  --muted: #59605B;
  --faint: #60675F;
  --fainter: #656D66;
  --green: #3B5D45;
  --clay: #9C4A24;

  /* Link states as tokens so a surface can restate them. The dark plates the
     Almanac theme introduces need a different set entirely: green on #1E2A1C
     is 2.02:1 and --ink is 1.04:1, so a link focused there was invisible. */
  --link:         #3B5D45;  /* = --green */
  --link-hover:   #1B2620;  /* = --ink */
  --link-accent:  #3B5D45;  /* hover on nav, contact and footer */
  --focus:        #3B5D45;  /* focus ring */
  --rule: #DFD8C4;
  --hairline: #E6E0CE;
  --measure: 1000px;
  --pad: 0px;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --display: 'Archivo', var(--sans);
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Graph-paper substrate, kept very faint */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(59,93,69,.055) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, rgba(59,93,69,.055) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(0deg, rgba(74,107,80,.03) 0 1px, transparent 1px 8px),
    repeating-linear-gradient(90deg, rgba(74,107,80,.03) 0 1px, transparent 1px 8px);
}

body > * { position: relative; z-index: 1; }

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

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

::selection { background: rgba(59,93,69,.16); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 32px; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 12px; padding: 10px 14px; z-index: 60;
}
.skip:focus { left: 12px; top: 12px; }

/* ---------------------------------------------------------------- header */

.site-head { padding: 26px 0; }
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.wordmark {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  color: var(--ink); font-weight: 500; text-decoration: none;
}
.site-nav { display: flex; gap: 26px; flex-wrap: wrap; }
.site-nav a {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  color: var(--muted); text-decoration: none;
  transition: color .18s ease;
}
.site-nav a:hover { color: var(--link-accent); }
.site-nav a.is-current { color: var(--ink); }

/* ------------------------------------------------------------------ hero */

.hero { position: relative; padding: 46px 0 84px; overflow: hidden; }
.hero .wrap { position: relative; }

.hero-fern {
  position: absolute; top: 0; right: 34px;
  height: 330px; width: auto; opacity: .52;
  pointer-events: none; user-select: none;
}

.eyebrow {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--clay); margin: 0;
}
.eyebrow img { width: 16px; height: 16px; flex: 0 0 auto; }

.hero h1 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(38px, 6.4vw, 62px); line-height: 1.02; letter-spacing: -.032em;
  margin: 20px 0 0; max-width: 13ch;
}

.lead {
  font-size: clamp(18px, 2.2vw, 21px); font-weight: 300; line-height: 1.62;
  color: var(--body); max-width: 46ch; margin: 26px 0 0; text-wrap: pretty;
}

.quiet-link {
  display: inline-block; font-family: var(--mono); font-size: 12px; letter-spacing: .06em;
  color: var(--green); text-decoration: none;
  border-bottom: 1px solid rgba(59,93,69,.3); padding-bottom: 3px;
  transition: border-color .18s ease;
}
.quiet-link:hover { border-bottom-color: var(--green); color: var(--green); }
.hero .quiet-link { margin-top: 30px; }

/* --------------------------------------------------------------- divider */

.divider { display: flex; align-items: center; gap: 20px; }
.divider::before, .divider::after {
  content: ""; height: 1px; flex: 1; background: var(--rule);
}
.divider img { width: 168px; height: 48px; opacity: .62; flex: 0 0 auto; }

/* ---------------------------------------------------------------- browse */

.browse { padding: 52px 0 0; }
.browse-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 14px;
}

.routes { display: flex; flex-wrap: wrap; gap: 6px; }
.route {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--sans); font-size: 14.5px; font-weight: 400; color: var(--body);
  padding: 9px 14px; border: 1px solid transparent; border-radius: 2px;
  background: transparent; cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.route::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  border: 1.4px solid var(--green); background: transparent;
  transition: background .18s ease;
}
.route:hover { background: rgba(59,93,69,.055); }
.route[aria-pressed="true"] {
  background: rgba(59,93,69,.09); border-color: rgba(59,93,69,.28);
  color: #2F4B37; font-weight: 500;
}
.route[aria-pressed="true"]::before { background: var(--green); }
.route .count { font-family: var(--mono); font-size: 10.5px; color: var(--fainter); }

.topics {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 18px; margin: 22px 0 0;
}
.topics-mark { width: 15px; height: 15px; flex: 0 0 auto; align-self: center; margin-right: -10px; }
.topics-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--fainter);
}
.topic {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em;
  background: transparent; border: 0; border-bottom: 1px solid transparent;
  color: var(--muted); padding: 2px 0; cursor: pointer;
  transition: color .18s ease, border-color .18s ease;
}
.topic:hover { color: var(--green); }
.topic[aria-pressed="true"] { color: var(--green); border-bottom-color: var(--green); }

.clear {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  background: transparent; border: 0; color: var(--clay);
  padding: 2px 0; cursor: pointer; margin-left: auto;
}
.clear[hidden] { display: none; }

/* ----------------------------------------------------------------- index */

.index { padding: 8px 0 0; }

.group { margin: 56px 0 0; }
.group[hidden] { display: none; }

.group-head { display: flex; align-items: baseline; gap: 18px; }
/* group marks sit beside a 26px display face; baseline alignment would hang them low */
.group-mark { width: 22px; height: 22px; flex: 0 0 auto; align-self: center; }
.group-head::after { content: ""; height: 1px; flex: 1; background: var(--rule); }
.group-head h2 {
  font-family: var(--display); font-weight: 700; font-size: 26px;
  letter-spacing: -.022em; margin: 0;
}
.group-note { font-size: 14.5px; font-weight: 300; color: var(--muted); margin: 0; }

.row {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) 150px;
  gap: 32px; padding: 24px 16px; margin: 0 -16px;
  text-decoration: none; color: inherit;
  border-top: 1px solid var(--hairline);
  transition: background .18s ease;
}
.row:hover { background: rgba(59,93,69,.04); color: inherit; }
.row[hidden] { display: none; }

.row-when {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  color: var(--faint); padding-top: 6px;
}
.row-title {
  display: block; font-family: var(--display); font-weight: 600; font-size: 19.5px;
  line-height: 1.33; letter-spacing: -.012em; color: var(--ink); max-width: 44ch;
}
.row-desc {
  display: block; font-size: 15px; font-weight: 300; line-height: 1.62;
  color: var(--soft); margin-top: 8px; max-width: 60ch; text-wrap: pretty;
}
.row-meta {
  display: block; font-family: var(--mono); font-size: 11px;
  color: var(--faint); margin-top: 10px;
}
.row-cta {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .05em;
  color: var(--green); text-align: right; padding-top: 7px;
}

.empty {
  font-size: 15px; font-weight: 300; color: var(--muted);
  padding: 40px 0; text-align: center;
}
.empty[hidden] { display: none; }

/* --------------------------------------------------------------- article */

.page-head { padding: 34px 0 0; }
.page-head h1 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(34px, 5vw, 48px); line-height: 1.06; letter-spacing: -.03em;
  margin: 20px 0 0;
}
.page-head .lead { max-width: 60ch; font-size: clamp(17px, 2.1vw, 20px); color: #333F38; }

.prose { font-size: 17px; font-weight: 300; line-height: 1.74; color: var(--body); max-width: 64ch; }
.prose p { margin: 22px 0 0; text-wrap: pretty; }
.prose h2 {
  font-family: var(--display); font-weight: 700; font-size: 24px;
  letter-spacing: -.02em; line-height: 1.22; margin: 44px 0 0; color: var(--ink);
}

/* Roles / entries */

.section { margin: 64px 0 0; }
.section > h2 {
  font-family: var(--display); font-weight: 700; font-size: 26px;
  letter-spacing: -.022em; margin: 0;
}
.section-note { font-size: 14.5px; font-weight: 300; color: var(--muted); margin: 8px 0 0; max-width: 60ch; }
.entry { padding: 26px 0 4px; border-top: 1px solid var(--hairline); margin-top: 22px; }
.entry-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 24px; flex-wrap: wrap;
}
.entry-head h3 {
  font-family: var(--display); font-weight: 600; font-size: 20px;
  line-height: 1.28; letter-spacing: -.014em; margin: 0; max-width: 50ch;
}
.entry-when {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  color: var(--faint); white-space: nowrap;
}
.entry-org {
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em;
  color: var(--green); margin: 8px 0 0;
}
.entry > p {
  font-size: 15.5px; font-weight: 300; line-height: 1.7;
  color: var(--soft); margin: 14px 0 0; max-width: 66ch; text-wrap: pretty;
}
.entry ul {
  margin: 14px 0 0; padding: 0; list-style: none;
  font-size: 15.5px; font-weight: 300; line-height: 1.68; color: var(--soft);
}
.entry li {
  position: relative; padding-left: 24px; margin-bottom: 10px;
  max-width: 66ch; text-wrap: pretty;
}
.entry li::before {
  content: ""; position: absolute; left: 0; top: 9px;
  width: 9px; height: 9px; opacity: .72;
  background: var(--green);
  -webkit-mask: url("/img/leaf.svg") no-repeat center / contain;
  mask: url("/img/leaf.svg") no-repeat center / contain;
}
.entry .quiet-link { margin-top: 14px; }

/* Compact fact rows — credentials, education, tooling */
.facts { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 10px 32px; margin: 22px 0 0; }
.facts dt {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--fainter); padding-top: 4px;
}
.facts dd { margin: 0; font-size: 15.5px; font-weight: 300; color: var(--soft); }

.note {
  margin: 40px 0 0; padding: 18px 0 0; border-top: 1px solid var(--hairline);
  font-size: 14.5px; font-weight: 300; line-height: 1.7;
  color: #77695D; max-width: 60ch;
}

/* ------------------------------------------------------------------ essay */

.essay { padding: 40px 0 0; }
.essay .wrap { max-width: 900px; }
.essay h1 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(30px, 4.4vw, 42px); line-height: 1.12; letter-spacing: -.028em;
  margin: 20px 0 0; max-width: 26ch;
}
.essay-lead {
  font-size: clamp(18px, 2.3vw, 21px); font-weight: 300; line-height: 1.66;
  color: #333F38; margin: 30px 0 0; max-width: 58ch; text-wrap: pretty;
}
.essay-body {
  font-size: 18.5px; font-weight: 300; line-height: 1.78;
  color: #2F3A34; max-width: 66ch; margin: 40px 0 0;
}
.essay-body p { margin: 0 0 26px; text-wrap: pretty; }
.essay-body h2 {
  font-family: var(--display); font-weight: 700; font-size: 27px;
  letter-spacing: -.022em; line-height: 1.2; margin: 48px 0 18px; color: var(--ink);
}
.essay-body h3 {
  font-family: var(--display); font-weight: 600; font-size: 21px;
  letter-spacing: -.016em; line-height: 1.26; margin: 36px 0 14px; color: var(--ink);
}
.essay-body a {
  color: var(--green); text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: rgba(59,93,69,.32);
}
.essay-body blockquote {
  margin: 36px 0; padding: 0 0 0 24px; border-left: 2px solid rgba(59,93,69,.35);
  font-family: var(--display); font-weight: 500; font-size: 23px;
  line-height: 1.4; letter-spacing: -.018em; color: var(--ink);
}
.essay-body ul { margin: 0 0 26px; padding: 0; list-style: none; }
.essay-body ul li { position: relative; padding-left: 26px; margin-bottom: 12px; }
.essay-body ul li::before {
  content: ""; position: absolute; left: 0; top: 12px;
  width: 9px; height: 9px; opacity: .72; background: var(--green);
  -webkit-mask: url("/img/leaf.svg") no-repeat center / contain;
  mask: url("/img/leaf.svg") no-repeat center / contain;
}
.essay-body ol { margin: 0; padding: 0; list-style: none; counter-reset: ref; }
.essay-body ol li {
  position: relative; padding-left: 28px; margin-bottom: 12px; counter-increment: ref;
}
.essay-body ol li::before {
  content: counter(ref); position: absolute; left: 0; top: 3px;
  font-family: var(--mono); font-size: 12.5px; color: var(--fainter);
}
.essay-body hr {
  border: 0; height: 1px; background: var(--hairline);
  margin: 40px 0; max-width: 66ch;
}
.essay-body hr + hr { display: none; }
.essay-body table {
  width: 100%; border-collapse: collapse; margin: 0 0 28px;
  font-size: 15.5px; font-weight: 300;
}
.essay-body th, .essay-body td {
  text-align: left; padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--hairline); vertical-align: top;
}
.essay-body th {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--fainter); font-weight: 400;
}

figure { margin: 12px 0 40px; }
figure img { display: block; width: 100%; border-radius: 2px; }
figcaption {
  font-family: var(--mono); font-size: 11.5px; color: var(--faint);
  margin-top: 12px; line-height: 1.6;
}

.post-nav { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin: 48px 0 0; }
.post-nav a {
  display: block; padding: 22px 24px; background: var(--card);
  border: 1px solid var(--hairline); border-radius: 2px;
  text-decoration: none; color: inherit; transition: border-color .18s ease;
}
.post-nav a:hover { border-color: #C6BEA6; color: inherit; }
.post-nav .dir {
  display: block; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--fainter);
}
.post-nav .to {
  display: block; font-family: var(--display); font-weight: 600;
  font-size: 17px; line-height: 1.34; margin-top: 8px;
}
.post-nav .prev { text-align: left; }
.post-nav .next { text-align: right; }
.post-nav a[aria-disabled="true"] { opacity: .4; pointer-events: none; }

/* ---------------------------------------------------------------- contact */

.contact { padding: 64px 0 0; }
.contact h2 {
  font-family: var(--display); font-weight: 700; font-size: 26px;
  letter-spacing: -.022em; margin: 0 0 8px;
}
.contact > .wrap > p {
  font-size: 16px; font-weight: 300; color: var(--soft);
  margin: 0 0 32px; max-width: 46ch;
}
.contact-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px;
  border-top: 1px solid var(--rule); padding-top: 26px;
}
.contact-col { display: flex; flex-direction: column; gap: 9px; }
.contact-col h3, .contact-col .h {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--fainter); margin: 0; font-weight: 400;
}
.contact-col a { font-size: 15px; color: var(--ink); text-decoration: none; }
.contact-col a:hover { color: var(--link-accent); }

/* ----------------------------------------------------------------- footer */

.site-foot { padding: 64px 0 72px; font-family: var(--mono); font-size: 11px; color: var(--fainter); }
.site-foot a { color: var(--fainter); text-decoration: none; }
.site-foot a:hover { color: var(--link-accent); }

/* ------------------------------------------------------------------- 404 */

.notfound { padding: 96px 0 120px; text-align: center; }
.notfound h1 {
  font-family: var(--display); font-weight: 800; font-size: 64px;
  letter-spacing: -.032em; margin: 0;
}
.notfound p { font-size: 18px; font-weight: 300; color: var(--soft); margin: 16px 0 30px; }

/* --------------------------------------------------------------- spacing
   Replaces the inline style= attributes used in the design source. The CSP
   in vercel.json sets style-src 'self' with no 'unsafe-inline', so inline
   style attributes are blocked in production. */

.mt-lg { margin-top: 44px; }
.mt-xl { margin-top: 64px; }
.mt-2xl { margin-top: 72px; }

/* First entry in a section gets the heavier rule */
.entry--first { border-top-color: var(--rule); }

/* A row of quiet-links under an entry */
.link-row { display: flex; gap: 24px; flex-wrap: wrap; }

/* Contact grid without its own rule, when it follows a divider */
.contact-grid--bare { border-top: 0; padding-top: 0; }

/* Placeholder blocks for facts Stephen still has to supply */
.todo {
  margin: 22px 0 0; padding: 18px 20px;
  background: var(--card); border: 1px dashed #C9C0A6; border-radius: 2px;
  font-size: 14.5px; font-weight: 300; line-height: 1.7;
  color: #77695D; max-width: 66ch;
}
.todo b {
  display: block; font-family: var(--mono); font-size: 11px;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--clay); font-weight: 500; margin-bottom: 6px;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 820px) {
  .wrap { padding: 0 22px; }
  .hero { padding: 32px 0 56px; }
  .hero-fern { height: 240px; right: 0; top: 40px; opacity: .34; }
  .hero h1 { max-width: none; }
  .row { grid-template-columns: 1fr; gap: 6px; padding: 20px 12px; margin: 0 -12px; }
  .row-when { padding-top: 0; }
  .row-cta { text-align: left; padding-top: 6px; }
  .contact-grid { grid-template-columns: 1fr; gap: 26px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
  .group-head { flex-wrap: wrap; }
  .divider img { width: 120px; height: 34px; }
  .facts { grid-template-columns: 1fr; gap: 4px 0; }
  .facts dd { margin-bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}

@media print {
  body::before, .site-nav, .browse, .divider, .post-nav { display: none; }
  body { background: #fff; }
  .row, .entry { break-inside: avoid; }
}
