/* The Commonplace — a commonplace-book aesthetic */

:root {
  --ink: #1c1b18;
  --ink-soft: #2e2c27;
  --paper: #faf5e8;
  --paper-deep: #f3ecd8;
  --muted: #6b6860;
  --muted-soft: #8a857a;
  --rule: #d6cfbc;
  --rule-soft: #e6dfc9;
  --accent: #8c2b1a;
  --accent-soft: rgba(140, 43, 26, 0.25);
  --measure: 34rem;
  --outer: 44rem;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

/* Subtle paper texture — very light SVG noise on the body.
   Kept quiet: if it's noticed as texture, it's too loud. */
body {
  background-color: var(--paper);
  background-image:
    radial-gradient(1100px 600px at 20% -10%, rgba(180, 140, 60, 0.05), transparent 60%),
    radial-gradient(900px 500px at 120% 120%, rgba(140, 90, 40, 0.04), transparent 60%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.28  0 0 0 0 0.18  0 0 0 0.04 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Iowan Old Style", "Charter", Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
  transition: border-color 0.2s ease;
}
a:hover { border-bottom-color: var(--accent); }

/* Header — a title-page header */
.site-header {
  max-width: var(--outer);
  margin: 0 auto;
  padding: 3rem 1.5rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  flex-wrap: wrap;
  position: relative;
}
.site-header::after {
  content: "";
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 0.6rem;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--rule) 12%, var(--rule) 88%, transparent);
}
.wordmark {
  font-family: "Iowan Old Style", "Charter", Georgia, serif;
  font-size: 1.55rem;
  font-weight: 600;
  font-variant: small-caps;
  letter-spacing: 0.04em;
  color: var(--ink);
  border-bottom: 0;
}
.wordmark em {
  font-style: italic;
  font-weight: 400;
  font-variant: normal;
  letter-spacing: 0;
  color: var(--muted);
  margin-right: 0.25em;
}
.site-header nav {
  font-family: "Iowan Old Style", "Charter", Georgia, serif;
  font-size: 0.95rem;
  font-style: italic;
}
.site-header nav a {
  color: var(--muted);
  margin-left: 1.25rem;
  border-bottom: 0;
}
.site-header nav a[aria-current="page"] { color: var(--ink); }
.site-header nav a:hover { color: var(--accent); }

/* Main */
main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.25rem 1.5rem 3rem;
}

/* Hero */
.hero { margin: 1rem 0 2.5rem; }
.hero h1 {
  font-size: 2.25rem;
  line-height: 1.15;
  margin: 0 0 0.6rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.hero .lede {
  color: var(--muted);
  font-style: italic;
  margin: 0;
  font-size: 1.05rem;
}
.hero .empty { margin-top: 2rem; color: var(--muted); font-style: italic; }

/* Ornamental rule — a quiet asterism between entries */
.ornament {
  display: block;
  text-align: center;
  color: var(--muted-soft);
  letter-spacing: 1.2em;
  padding-left: 1.2em; /* visually centre the letter-spaced glyphs */
  margin: 1.5rem 0;
  font-size: 0.85rem;
  user-select: none;
}

/* Entry list — index of pieces */
.entries { list-style: none; padding: 0; margin: 0; }
.entry {
  border-top: 1px solid var(--rule);
  padding: 1.4rem 0 1.25rem;
  position: relative;
}
.entry:last-child { border-bottom: 1px solid var(--rule); }
.entry-link {
  display: block;
  color: var(--ink);
  border-bottom: 0;
}
.entry-link time {
  font-family: "Iowan Old Style", "Charter", Georgia, serif;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
}
.entry-link h2 {
  font-size: 1.45rem;
  margin: 0.3rem 0 0.4rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.005em;
}
.entry-link:hover h2 { color: var(--accent); }
.entry-link .excerpt { margin: 0.35rem 0; color: var(--ink-soft); }
.entry-link .format {
  font-family: "Iowan Old Style", "Charter", Georgia, serif;
  font-style: italic;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.45rem 0 0;
  letter-spacing: 0;
  text-transform: none;
}

/* Post */
.post { padding-top: 0.5rem; }
.post-header { margin-bottom: 2.25rem; }
.post .kicker {
  font-family: "Iowan Old Style", "Charter", Georgia, serif;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 0.6rem;
  letter-spacing: 0;
  text-transform: none;
}
.post h1 {
  font-size: 2.05rem;
  line-height: 1.2;
  margin: 0 0 0.85rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.post .lede {
  font-size: 1.1rem;
  color: var(--ink-soft);
  font-style: italic;
  margin: 0;
  line-height: 1.5;
}

/* The body — with a drop cap on the opening paragraph */
.post-body > p:first-of-type::first-letter {
  font-family: "Iowan Old Style", "Charter", Georgia, serif;
  font-weight: 600;
  float: left;
  font-size: 3.4rem;
  line-height: 0.95;
  padding: 0.35rem 0.55rem 0 0;
  margin-top: 0.15rem;
  color: var(--accent);
}
.post-body h2 { font-size: 1.35rem; margin: 2rem 0 0.5rem; font-weight: 600; }
.post-body h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; font-weight: 600; }
.post-body p { margin: 0 0 1.1rem; }
.post-body blockquote {
  border-left: 2px solid var(--accent-soft);
  margin: 1.25rem 0;
  padding: 0.1rem 0 0.1rem 1.1rem;
  color: var(--ink-soft);
  font-style: italic;
}
.post-body ul, .post-body ol { padding-left: 1.5rem; }
.post-body li { margin: 0.25rem 0; }
.post-body code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: rgba(28, 27, 24, 0.05);
  padding: 0.1em 0.3em;
  border-radius: 3px;
}
.post-body pre {
  background: rgba(28, 27, 24, 0.04);
  padding: 1rem;
  border-radius: 3px;
  overflow-x: auto;
  font-size: 0.85rem;
  border: 1px solid var(--rule-soft);
}
.post-body pre code { background: none; padding: 0; }
.post-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.75rem auto;
}
.post-body hr {
  border: 0;
  height: 1.5rem;
  margin: 2rem 0;
  background-image: radial-gradient(circle, var(--muted-soft) 1px, transparent 1.5px);
  background-size: 1.2em 100%;
  background-position: center;
  background-repeat: repeat-x;
  opacity: 0.55;
}
.post-body iframe, .post-body video, .post-body canvas {
  max-width: 100%;
  display: block;
  margin: 1.5rem auto;
}
.post-body em { color: var(--ink); }

.post-tags {
  margin-top: 2.75rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  font-family: "Iowan Old Style", "Charter", Georgia, serif;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--muted);
}
.tag {
  color: var(--muted);
  margin-right: 0.6rem;
}
.tag::before { content: "—\00a0"; opacity: 0.5; }
.tag:first-of-type::before { content: "tagged:\00a0"; font-style: italic; opacity: 0.7; }

.backlink {
  margin-top: 3rem;
  font-family: "Iowan Old Style", "Charter", Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
}
.backlink a { color: var(--muted); border-bottom: 0; }
.backlink a:hover { color: var(--accent); }
.backlink a::before { content: "← "; }

/* About / page */
.page h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 1rem;
  font-weight: 600;
}
.page h2 { font-size: 1.25rem; margin: 2rem 0 0.5rem; font-weight: 600; }
.page h3 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; font-weight: 600; }
.page p { margin: 0 0 1.1rem; }
.page ul, .page ol { padding-left: 1.5rem; }

/* Footer — a colophon */
.site-footer {
  max-width: var(--outer);
  margin: 2.5rem auto 3rem;
  padding: 1.5rem;
  text-align: center;
  font-family: "Iowan Old Style", "Charter", Georgia, serif;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--muted);
  position: relative;
}
.site-footer::before {
  content: "❦";
  display: block;
  color: var(--muted-soft);
  font-size: 1rem;
  margin-bottom: 0.75rem;
  font-style: normal;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--muted); border-bottom-color: transparent; }
.site-footer a:hover { color: var(--accent); border-bottom-color: var(--accent-soft); }

/* Audio — a quiet narration strip under the lede */
.audio-strip {
  margin: 1.5rem 0 2rem;
  padding: 0.9rem 1rem;
  background: var(--paper-deep);
  border: 1px solid var(--rule-soft);
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: "Iowan Old Style", "Charter", Georgia, serif;
  font-style: italic;
  font-size: 0.92rem;
  color: var(--muted);
}
.audio-strip::before {
  content: "♪";
  font-style: normal;
  color: var(--accent);
  font-size: 1.05rem;
  line-height: 1;
}
.audio-strip audio {
  flex: 1;
  min-width: 0;
  height: 34px;
}
.audio-strip .audio-label { white-space: nowrap; }

@media (max-width: 560px) {
  body { font-size: 17px; line-height: 1.6; }
  .hero h1 { font-size: 1.85rem; }
  .post h1 { font-size: 1.7rem; }
  .post-body > p:first-of-type::first-letter { font-size: 2.9rem; }
  .site-header { padding: 2rem 1.25rem 1rem; }
  main { padding: 1.75rem 1.25rem 2.5rem; }
  .audio-strip { flex-wrap: wrap; }
  .audio-strip audio { width: 100%; flex-basis: 100%; }
}
