/* ─────────────────────────────────────────────────────────────
   hayshutton.tech — writing surface
   Effectively monochrome. Black on warm white. One muted ochre accent.
   Plus Jakarta Sans for everything; JetBrains Mono for code.
   ─────────────────────────────────────────────────────────────  */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("./fonts/plus-jakarta-sans.woff2") format("woff2-variations"),
       url("./fonts/plus-jakarta-sans.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("./fonts/jetbrains-mono.woff2") format("woff2-variations"),
       url("./fonts/jetbrains-mono.woff2") format("woff2");
}

:root {
  --bg:        #fafaf7;
  --bg-2:      #f3f1ea;
  --bg-3:      #e9e6dc;

  --fg:        #14130f;
  --fg-2:      #3a3833;
  --fg-3:      #6f6c63;
  --fg-4:      #9a968a;

  --rule:      #d6d2c5;
  --rule-soft: #e4e0d3;

  --accent:    #8a6a3b;
  --accent-ink:#5d4724;

  --selection-bg: #e7dcc2;
  --selection-fg: #14130f;

  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont,
               "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas,
               monospace;

  --leading-prose:   1.65;
  --leading-tight:   1.45;
  --leading-display: 1.15;

  --tracking-tight:  -0.012em;
  --tracking-wide:   0.04em;

  --measure-prose: 65ch;
  --measure-wide:  72ch;
  --measure-narrow: 52ch;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  --radius-1: 2px;
  --radius-2: 4px;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 19px;
  line-height: var(--leading-prose);
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--selection-bg); color: var(--selection-fg); }

/* ── Typography ─────────────────────────────────────────── */

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  color: var(--fg);
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(28px, 1.4rem + 1.6vw, 38px);
  font-weight: 600;
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-tight);
}

h2 {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: var(--tracking-tight);
}

h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

p, li {
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: var(--leading-prose);
  color: var(--fg);
  max-width: var(--measure-prose);
  text-wrap: pretty;
  hyphens: auto;
}

p { margin: 0 0 1em 0; }

small, .meta, time, figcaption {
  font-size: 13px;
  color: var(--fg-3);
}

/* ── Links ──────────────────────────────────────────────── */

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-ink);
  text-decoration-color: var(--accent);
}

a:visited { color: inherit; }
a:visited:hover { color: var(--accent-ink); }

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a.accent { color: var(--accent); text-decoration-color: var(--accent); }
a.accent:hover { color: var(--accent-ink); }

/* ── Code ───────────────────────────────────────────────── */

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
  font-feature-settings: "calt" 0;
}

code {
  background: var(--bg-2);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-1);
}

pre {
  background: var(--bg-2);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-2);
  overflow-x: auto;
  line-height: var(--leading-tight);
  margin: 1.5em 0;
  font-size: 0.9em;
}

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

kbd {
  background: var(--bg-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius-1);
  padding: 0.05em 0.4em;
  font-size: 0.82em;
}

/* ── Block elements ─────────────────────────────────────── */

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: var(--space-7) 0;
}

blockquote {
  margin: 1.5em 0;
  padding-left: var(--space-5);
  border-left: 1px solid var(--rule);
  color: var(--fg-2);
}

ul, ol {
  max-width: var(--measure-prose);
  padding-left: 1.4em;
}

li { margin: 0.25em 0; }

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

figure { margin: var(--space-7) 0; }
figcaption { margin-top: var(--space-2); }

/* ── Page frame ─────────────────────────────────────────── */

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 32px 0 18px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 48px;
}

.site-header .wordmark {
  font-weight: 600;
  font-size: 17px;
  letter-spacing: var(--tracking-tight);
  color: var(--fg);
  text-decoration: none;
}

.site-header nav {
  display: flex;
  gap: 24px;
  font-size: 15px;
}

.site-header nav a {
  color: var(--fg);
  text-decoration: none;
}

.site-header nav a:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  color: var(--accent-ink);
}

.site-header nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.18em;
}

.site-footer {
  border-top: 1px solid var(--rule);
  padding-top: 18px;
  margin-top: 96px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--fg-3);
}

.site-footer a { color: var(--fg-3); }

/* ── Home / post list ───────────────────────────────────── */

.essays-h1 {
  margin: 0 0 8px;
}

.essays-intro {
  color: var(--fg-3);
  font-size: 15px;
  margin: 0 0 32px;
  max-width: 65ch;
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 65ch;
}

.post-list > li {
  border-top: 1px solid var(--rule);
  padding: 24px 0;
  display: flex;
  gap: 28px;
  align-items: baseline;
  max-width: none;
  margin: 0;
}

.post-list time {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-3);
  flex-shrink: 0;
  min-width: 90px;
  letter-spacing: 0;
}

.post-list .post-title {
  font-size: 21px;
  font-weight: 500;
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.2em;
  line-height: 1.3;
  display: inline-block;
}

.post-list .post-title:hover {
  text-decoration-color: var(--accent);
  color: var(--accent-ink);
}

.post-list .post-blurb {
  font-size: 16px;
  color: var(--fg-2);
  margin: 8px 0 0;
  line-height: 1.55;
  max-width: 55ch;
}

/* ── Essay page ─────────────────────────────────────────── */

.essay {
  max-width: 65ch;
}

.essay-title {
  margin: 0 0 14px;
}

.essay-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-3);
  margin: 0 0 56px;
}

.essay h2 {
  margin: 48px 0 14px;
}

.essay h3 {
  margin: 32px 0 10px;
}

.footnotes {
  font-size: 15px;
  color: var(--fg-2);
  line-height: 1.6;
  padding-left: 20px;
}

.footnotes li { font-size: 15px; }

.back-link {
  margin-top: 64px;
  font-size: 15px;
}

.back-link a {
  color: var(--fg);
  text-decoration: none;
}

.back-link a:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
  color: var(--accent-ink);
}

/* ── About ──────────────────────────────────────────────── */

.about { max-width: 65ch; }
.about h1 { margin: 0 0 32px; }

/* ── 404 ────────────────────────────────────────────────── */

.notfound {
  max-width: var(--measure-narrow);
  padding-top: 48px;
}

.notfound h1 { margin: 0 0 16px; font-size: 28px; }

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 560px) {
  .post-list > li {
    flex-direction: column;
    gap: 6px;
    padding: 20px 0;
  }
  .post-list time { min-width: 0; }
  .site-header { padding: 24px 0 16px; margin-bottom: 36px; }
  .site-header nav { gap: 16px; }
  .essay-meta { margin-bottom: 40px; }
  .essay h2 { margin: 36px 0 12px; }
}
