/* Build Journal — "print journal, set in ink" */

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-roman.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink-0: #0d0d0f;
  --hairline: #26262c;
  --paper: #e9e4d8;
  --paper-dim: #9d978a;
  --faint: #6a655b;
  --accent: #b08d57;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { background: var(--ink-0); }

body {
  font-family: var(--serif);
  color: var(--paper);
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(176, 141, 87, 0.045), transparent 70%),
    var(--ink-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(176, 141, 87, 0.28); color: var(--paper); }

a { color: inherit; }

main {
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(4rem, 12vh, 8rem) 1.5rem 6rem;
}

/* ---------- meta chrome: letter-spaced sans caps, the only non-serif voice ---------- */

.post-preview time,
.post-date,
.back-nav a {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

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

.site-header { margin-bottom: clamp(4rem, 10vh, 6.5rem); }

.site-header h1 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 460;
  font-size: clamp(2.9rem, 8vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  font-variation-settings: "opsz" 72;
}

.site-header p {
  margin-top: 1.1rem;
  font-size: 1.0625rem;
  font-style: italic;
  color: var(--paper-dim);
  font-weight: 380;
}

.post-list { counter-reset: entry; }

.post-preview {
  counter-increment: entry;
  display: grid;
  grid-template-columns: 3.4rem 1fr;
  padding: 2.1rem 0 2.3rem;
  border-top: 1px solid var(--hairline);
}

.post-preview::before {
  content: counter(entry, decimal-leading-zero);
  grid-row: 1 / span 3;
  font-style: italic;
  font-weight: 420;
  font-size: 0.95rem;
  color: var(--accent);
  padding-top: 0.45rem;
  font-variant-numeric: tabular-nums;
}

.post-preview time { display: block; margin-bottom: 0.55rem; }

.post-preview h2 {
  font-weight: 480;
  font-size: clamp(1.45rem, 3.4vw, 1.8rem);
  line-height: 1.18;
  letter-spacing: -0.008em;
  font-variation-settings: "opsz" 44;
}

.post-preview h2 a {
  text-decoration: none;
  transition: color 140ms ease;
}

.post-preview h2 a:hover,
.post-preview h2 a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  text-decoration-color: rgba(176, 141, 87, 0.55);
}

.post-preview p {
  margin-top: 0.6rem;
  font-style: italic;
  font-weight: 380;
  font-size: 1.02rem;
  color: var(--paper-dim);
  max-width: 34rem;
}

/* ---------- post page ---------- */

.back-nav { margin-bottom: clamp(3rem, 8vh, 4.5rem); }

.back-nav a {
  text-decoration: none;
  transition: color 140ms ease;
}
.back-nav a::before { content: "\2190\00a0\00a0"; }
.back-nav a:hover, .back-nav a:focus-visible { color: var(--accent); }

.post-header { margin-bottom: 3.2rem; }

.post-header h1 {
  font-weight: 480;
  font-size: clamp(2.1rem, 6vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.012em;
  font-variation-settings: "opsz" 60;
  max-width: 17ch;
}

.post-date { margin-top: 1.3rem; }
.post-date, .post-date em { color: var(--accent); font-style: normal; }

.post-body {
  font-size: 1.145rem;
  font-weight: 400;
  line-height: 1.78;
  color: var(--paper);
  max-width: 62ch;
}

.post-body p + p { margin-top: 1.45em; }

.post-body p:first-of-type {
  font-size: 1.24rem;
  line-height: 1.68;
}

.post-body em {
  font-style: italic;
  font-weight: 430;
}

/* ---------- small screens ---------- */

@media (max-width: 480px) {
  main { padding-top: 4.5rem; }
  .post-preview { grid-template-columns: 2.6rem 1fr; }
  .post-body { font-size: 1.08rem; }
  .post-body p:first-of-type { font-size: 1.14rem; }
}
