:root {
  color-scheme: dark;
  --bg: #0f0f0d;
  --text: #d8d4ca;
  --bright: #f2efe7;
  --muted: #6f6c64;
  --rule: #24231f;
  --accent: #c8d67a;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Geist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--bg);
  /* faint film grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

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

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 24px 96px;
}

/* header */
.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 20px;
  margin-bottom: 56px;
  border-bottom: 1px solid var(--rule);
}
.top .name {
  font-family: var(--serif);
  font-style: italic;
  font-size: 34px;
  line-height: 1;
  color: var(--bright);
  text-decoration: none;
}
.top nav { font-family: var(--mono); font-size: 13px; }
.top nav a { margin-left: 22px; color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--bright); }
.top nav a[aria-current="page"] { color: var(--accent); }

/* links */
a {
  color: var(--bright);
  text-decoration: underline;
  text-decoration-color: #4a4840;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.posts a { text-decoration: none; }

p { margin: 0 0 1em; }

/* margin-note rows */
.row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  margin-bottom: 44px;
}
.row > .k {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding-top: 4px;
}
.row > .v > :last-child { margin-bottom: 0; }

.lead {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.25;
  color: var(--bright);
  margin-bottom: 20px;
}

ul.dash { list-style: none; padding: 0; margin: 0 0 1em; }
ul.dash li { padding-left: 20px; position: relative; }
ul.dash li::before { content: "·"; position: absolute; left: 4px; color: var(--accent); }

/* post index */
.posts { list-style: none; padding: 0; margin: 0; counter-reset: post; }
.posts li {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.posts li:first-child { padding-top: 0; }
.posts .n, .posts time { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* article */
article { max-width: 620px; }
article h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 46px;
  line-height: 1.1;
  color: var(--bright);
  margin: 0 0 14px;
}
.meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 48px;
}
.meta a { color: var(--muted); }
article { font-size: 17px; line-height: 1.75; }
article ul { padding-left: 1.1em; margin: 0 0 1.2em; }
article li { margin-bottom: 8px; }
article li::marker { color: var(--accent); }
article li p { margin: 0; }
article em { color: var(--bright); }
article hr { border: 0; margin: 48px 0; text-align: center; }
article hr::after { content: "※"; color: var(--muted); }

.foot {
  margin-top: 96px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .wrap { padding: 36px 20px 72px; }
  .top { margin-bottom: 40px; }
  .top .name { font-size: 28px; }
  .top nav a { margin-left: 14px; }
  .row { grid-template-columns: 1fr; gap: 8px; margin-bottom: 36px; }
  .lead { font-size: 26px; }
  .posts li { grid-template-columns: 34px 1fr; }
  .posts time { grid-column: 2; }
  article h1 { font-size: 36px; }
}
