/* alexhatfield.com
   The LX Field Solutions language as it was first shipped, with the colour taken
   out: grid paper, ink hairlines, mono labels, a dashed rule under each heading.
   One accent is left, and it is the ink itself. Sans reads, mono counts. */

:root {
  --paper: #EFEEE9;
  --card: #F8F7F4;
  --ink: #1C1C1A;
  --grid: #E2DFD7;
  --muted: #6E6A61;
  --rule: #CFCAC0;
  --soft: #4A4640;

  --sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --header-h: 52px;
  --gap-section: 2.6rem;
  --shadow: 3px 3px 0 rgba(28, 28, 26, .10);
  --measure: 40rem;
}

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

/* the grid is the one decoration on the page, and it is kept faint enough to read
   as paper rather than as a chart */
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: -1px -1px;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 600; letter-spacing: -0.02em; line-height: 1.15;
  margin: 0 0 .6em; text-wrap: balance;
}
h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 1em; }
main p, main li { max-width: var(--measure); }

/* links are ink, underlined, and go quiet rather than coloured on hover */
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: .18em; text-decoration-color: var(--muted); }
a:hover { text-decoration-color: var(--ink); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.mono { font-family: var(--mono); }
.muted { color: var(--muted); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 100; background: var(--ink); color: var(--paper); padding: .6rem 1rem; }

.wrap { max-width: 46rem; margin: 0 auto; padding: 0 1.2rem; }
.lede { font-size: 1.08rem; max-width: var(--measure); color: var(--soft); }
.section { margin-top: var(--gap-section); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------- label ---------- */
/* the signature: a mono, spaced, lower-case label over a dashed hairline */
.label {
  font-family: var(--mono); font-weight: 400;
  font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px dashed var(--rule); padding-bottom: .5rem; margin: 0 0 1rem;
  letter-spacing: .14em;
}
.label .count { float: right; letter-spacing: 0; }
.label .when { color: var(--muted); }

/* ---------- site-header ---------- */
/* the header scrolls away with the page; it is a masthead, not a toolbar */
.site-header {
  border-bottom: 1px solid var(--ink); background: var(--paper);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 1rem;
  min-height: var(--header-h); flex-wrap: nowrap;
}
.wordmark {
  color: var(--ink); text-decoration: none; font-weight: 600;
  letter-spacing: -.02em; white-space: nowrap;
  min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.wordmark:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.site-nav { margin-left: auto; flex: none; }
.site-nav ul {
  display: flex; gap: 1.1rem; list-style: none; margin: 0; padding: 0;
  font-size: .88rem; align-items: center; flex-wrap: nowrap;
}
.site-nav a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.site-nav a:hover { color: var(--ink); }
/* the current page is marked by a hairline beneath it, not a colour */
.site-nav a[aria-current="page"] {
  color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .35em;
}
@media (max-width: 560px) {
  .site-header .wrap { gap: .6rem; padding: 0 1rem; }
  .wordmark { font-size: .9rem; }
  .site-nav ul { gap: .8rem; font-size: .8rem; }
}

/* ---------- hero ---------- */
.hero { padding: 2.4rem 0 .4rem; }
.hero .lede:last-child { margin-bottom: 0; }
.hero .label { border-bottom: 0; padding-bottom: 0; margin-bottom: .5rem; }
.hero-with-photo { display: flex; gap: 1.6rem; align-items: flex-start; }
.hero-text { flex: 1 1 auto; min-width: 0; }
.hero-photo {
  flex: 0 0 auto; width: 11rem; height: auto; display: block;
  border: 1px solid var(--ink); box-shadow: var(--shadow); background: var(--card);
}
@media (max-width: 560px) {
  .hero-with-photo { flex-direction: column; }
  .hero-photo { width: 9rem; order: -1; }
}

/* ---------- panel ---------- */
/* used sparingly here: one box per page at most */
.panel {
  background: var(--card); border: 1px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 1.2rem 1.3rem; margin: 0;
}
.panel > :last-child { margin-bottom: 0; }

/* ---------- spec-table ---------- */
table.spec-table { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--card); }
table.spec-table th, table.spec-table td { border: 1px solid var(--rule); padding: .45rem .6rem; text-align: left; vertical-align: top; }
table.spec-table th { background: var(--paper); font-weight: 400; white-space: nowrap; font-family: var(--mono); font-size: .78rem; color: var(--muted); width: 7.5rem; }

/* ---------- lists ---------- */
.plain-list { margin: 0; padding-left: 1.1rem; }
.plain-list li { margin-bottom: .4rem; }
.index-list { list-style: none; margin: 0; padding: 0; }
.index-list li { margin-bottom: .45rem; }
.more { margin-top: .8rem; font-size: .9rem; }

/* ---------- rows: a date rail on the left, the entry on the right ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: 6.2rem minmax(0, 1fr); gap: .2rem 1rem;
  padding: .7rem 0; border-bottom: 1px dashed var(--rule); max-width: none;
}
.row:last-child { border-bottom: 0; }
.row .when { font-family: var(--mono); font-size: .8rem; color: var(--muted); padding-top: .2em; }
.row .what { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.row .title { font-weight: 600; }
.row .summary { font-size: .92rem; color: var(--soft); max-width: var(--measure); }
.row .abstract p { margin: 0; }
.row .links { font-family: var(--mono); font-size: .78rem; display: flex; gap: .9rem; }
.tag {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); border: 1px dashed var(--rule); padding: .05em .4em; vertical-align: middle;
}
@media (max-width: 560px) {
  .row { grid-template-columns: 1fr; gap: .1rem; }
}

/* ---------- prose: rendered markdown ---------- */
.prose { margin-top: 1.6rem; }
.prose > * { max-width: var(--measure); }
.prose h2 { margin-top: 2rem; }
.prose h3 { margin-top: 1.5rem; }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li { margin-bottom: .3rem; }
.prose blockquote { margin: 1.2rem 0; padding-left: .9rem; border-left: 2px solid var(--rule); color: var(--soft); }
.prose hr { border: 0; border-top: 1px dashed var(--rule); margin: 2rem 0; }
.prose img { max-width: 100%; height: auto; border: 1px solid var(--ink); box-shadow: var(--shadow); }
.prose table { border-collapse: collapse; font-size: .9rem; }
.prose th, .prose td { border: 1px solid var(--rule); padding: .4rem .6rem; text-align: left; vertical-align: top; }
.prose th { background: var(--card); font-family: var(--mono); font-weight: 400; font-size: .8rem; }
code, pre { font-family: var(--mono); }
:not(pre) > code { font-size: .88em; background: var(--card); border: 1px solid var(--rule); padding: .05em .3em; }
pre {
  background: var(--card); border: 1px solid var(--ink); box-shadow: var(--shadow);
  padding: .9rem 1rem; overflow-x: auto; font-size: .84rem; line-height: 1.55; margin: 1.4rem 0;
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.post-footer { margin-top: 2.4rem; border-top: 1px dashed var(--rule); padding-top: 1rem; font-size: .9rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--sans); font-size: .92rem; font-weight: 600; line-height: 1.3;
  background: var(--ink); color: var(--paper); text-decoration: none;
  padding: .6rem 1rem; border: 1px solid var(--ink); cursor: pointer;
  box-shadow: 3px 3px 0 rgba(28, 28, 26, .18);
}
.btn:hover { background: var(--card); color: var(--ink); }
.btn:active { box-shadow: 1px 1px 0 rgba(28, 28, 26, .18); transform: translate(2px, 2px); }
.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin: 0 0 1.2rem; }
.btn-row .meta-note { font-family: var(--mono); font-size: .78rem; color: var(--muted); }

/* ---------- channels ---------- */
.channels { margin: 0; border-top: 1px dashed var(--rule); }
.channels > div {
  display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 1rem; align-items: baseline;
  padding: .6rem 0; border-bottom: 1px dashed var(--rule);
}
.channels dt { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.channels dd { margin: 0; font-family: var(--mono); font-size: .9rem; word-break: break-word; }

/* ---------- empty-slot ---------- */
.empty-slot { border: 1px dashed var(--muted); padding: 1rem 1.2rem; color: var(--muted); }
.empty-slot strong { color: var(--ink); }
.empty-slot p:last-child { margin-bottom: 0; }

/* ---------- site-footer ---------- */
.site-footer { border-top: 1px solid var(--ink); margin-top: 3.5rem; padding: 1.4rem 0 2.5rem; font-size: .82rem; color: var(--muted); }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }
.footer-line { margin: 0 0 .3rem; display: flex; flex-wrap: wrap; gap: .3rem .6rem; }
.footer-note { font-family: var(--mono); font-size: .74rem; margin: 0; }
.sep { color: var(--rule); }

@media (prefers-reduced-motion: reduce) {
  .btn:active { transform: none; }
}
