/* Pages — a small journal about the quiet parts of the web */

:root {
  color-scheme: light dark;
  --bg: #f6f3ec;
  --surface: #fbf8f1;
  --ink: #191712;
  --muted: #6d675b;
  --line: #ded6c7;
  --accent: #a33d21;
  --accent-soft: rgba(163, 61, 33, 0.08);
  --max: 74rem;
  --measure: 41rem;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, ui-serif, serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14130f;
    --surface: #1c1a15;
    --ink: #ece7db;
    --muted: #a49d8e;
    --line: #343026;
    --accent: #e08a68;
    --accent-soft: rgba(224, 138, 104, 0.1);
  }
}

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

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

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

::selection {
  background: var(--accent);
  color: #fff;
}

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

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

a:hover {
  text-decoration-thickness: 2px;
}

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

.wrap {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 0.75rem 1rem;
  z-index: 20;
  font-family: var(--sans);
  font-size: 0.85rem;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
}

/* Masthead */

.masthead {
  border-bottom: 1px solid var(--line);
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.5rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  line-height: 1;
}

.brand img {
  width: 26px;
  height: 26px;
  display: block;
}

.brand .dot {
  color: var(--accent);
}

.brand:hover {
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.7rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nav a:hover {
  color: var(--accent);
}

/* Shared type */

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.lede {
  max-width: 34rem;
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: clamp(1.1rem, 1.5vw, 1.3rem);
  line-height: 1.6;
}

.more {
  display: inline-block;
  margin-top: 0.9rem;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  text-decoration: none;
}

.more:hover {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* Home */

.hero {
  padding: 5.5rem 0 4.5rem;
}

.hero h1 {
  max-width: 20ch;
  margin: 0.7rem 0 0;
  font-size: clamp(2.6rem, 7vw, 5rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.02;
}

.section {
  padding: 3.5rem 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.section-link {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.section-link:hover {
  color: var(--accent);
}

.post-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-item {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 2.5rem;
  padding: 2.1rem 0;
  border-bottom: 1px solid var(--line);
}

.post-date {
  padding-top: 0.45rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.post-title {
  margin: 0;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.post-title a {
  color: var(--ink);
  text-decoration: none;
}

.post-title a:hover {
  color: var(--accent);
}

.post-dek {
  max-width: 42rem;
  margin: 0.6rem 0 0;
  color: var(--muted);
}

.about-strip {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 3rem;
  padding: clamp(1.6rem, 4vw, 3rem);
  background: var(--surface);
  border: 1px solid var(--line);
}

.about-strip h2 {
  max-width: 15ch;
  margin: 0.45rem 0 0;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.about-strip p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.about-strip p:last-child {
  margin-bottom: 0;
}

/* Archive and interior pages */

.page {
  padding: 4.5rem 0 1rem;
}

.page-head {
  max-width: var(--measure);
}

.page-head h1 {
  margin: 0.6rem 0 0;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.06;
}

.year {
  margin: 2.5rem 0 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Article */

.article {
  padding: 4.5rem 0 4rem;
}

.article-head {
  max-width: var(--measure);
  margin-bottom: 2.8rem;
}

.article-head h1 {
  margin: 0.7rem 0 0;
  font-size: clamp(2.1rem, 4.6vw, 3.3rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

.article-head .dek {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1.15rem;
}

.meta {
  margin: 1.4rem 0 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.prose {
  max-width: var(--measure);
}

.prose > p:first-of-type::first-letter {
  float: left;
  padding: 0.06em 0.1em 0 0;
  color: var(--accent);
  font-size: 3.3em;
  line-height: 0.82;
}

.prose p {
  margin: 0 0 1.4em;
}

.prose h2 {
  margin: 2.4em 0 0.7em;
  font-size: 1.55rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.prose h3 {
  margin: 2em 0 0.6em;
  font-size: 1.18rem;
  font-weight: 600;
  line-height: 1.3;
}

.prose ul,
.prose ol {
  margin: 0 0 1.4em;
  padding-left: 1.3em;
}

.prose li {
  margin: 0.35em 0;
}

.prose blockquote {
  margin: 2em 0;
  padding: 0.2em 0 0.2em 1.4em;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose code {
  padding: 0.12em 0.35em;
  background: var(--accent-soft);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.87em;
}

.prose pre {
  margin: 0 0 1.5em;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.prose pre code {
  padding: 0;
  background: none;
  font-size: 0.85em;
}

.prose hr {
  margin: 2.5em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.article-foot {
  max-width: var(--measure);
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

/* 404 */

.notfound {
  max-width: 40rem;
  padding: 7rem 0 8rem;
}

.notfound h1 {
  margin: 0.6rem 0 0;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.06;
}

/* Footer */

.site-foot {
  margin-top: 4rem;
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--line);
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  align-items: start;
}

.foot-brand {
  font-size: 1.3rem;
}

.foot-note {
  max-width: 28rem;
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.8rem 1.6rem;
}

.foot-nav a {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
}

.foot-nav a:hover {
  color: var(--accent);
}

.foot-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  margin-top: 2.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.7rem;
}

.foot-base p {
  margin: 0;
}

/* Small screens */

@media (max-width: 720px) {
  .masthead-inner {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .nav {
    gap: 1.1rem;
  }

  .hero {
    padding: 3.5rem 0 3rem;
  }

  .post-item {
    grid-template-columns: 1fr;
    gap: 0.55rem;
    padding: 1.8rem 0;
  }

  .post-date {
    padding-top: 0;
  }

  .about-strip {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .foot-grid {
    grid-template-columns: 1fr;
  }

  .foot-nav {
    justify-content: flex-start;
  }

  .article {
    padding: 3.5rem 0 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .masthead,
  .site-foot,
  .more,
  .section-link,
  .skip {
    display: none;
  }

  .article,
  .page {
    padding: 0;
  }

  .prose,
  .article-head,
  .article-foot {
    max-width: none;
  }

  a {
    color: #000;
  }
}
