:root {
  --bg: #f7f4ec;
  --fg: #26231e;
  --muted: #6d665a;
  --rule: #ddd5c4;
  --link: #8a3b12;
  --panel: #efe9dc;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1a17;
    --fg: #e8e2d6;
    --muted: #a39b8c;
    --rule: #3a352d;
    --link: #e4a574;
    --panel: #25221e;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0 auto;
  max-width: 40rem;
  padding: 2.5rem 1.25rem 3rem;
  font: 17px/1.6 Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
}

a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

header.site { border-bottom: 1px solid var(--rule); padding-bottom: 1rem; margin-bottom: 2rem; }
header.site .name { margin: 0; font-size: 1.6rem; letter-spacing: .01em; }
header.site .name a { color: var(--fg); text-decoration: none; }
header.site .tag { margin: .25rem 0 .75rem; color: var(--muted); font-style: italic; }
nav a { margin-right: 1.1rem; font-size: .95rem; }

h1 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: normal; margin: 0 0 .75rem; }
h2 { font-size: 1.3rem; line-height: 1.3; margin: 0 0 .15rem; }

ol.index { list-style: none; padding: 0; margin: 0 0 2.5rem; }
ol.index li { display: flex; gap: 1rem; padding: .3rem 0; border-bottom: 1px dotted var(--rule); }
ol.index time { flex: 0 0 5.5rem; color: var(--muted); font-size: .9rem; padding-top: .1rem; font-variant-numeric: tabular-nums; }

article { margin: 0 0 2.75rem; scroll-margin-top: 1rem; }
article p { margin: .6rem 0; }
.date { color: var(--muted); font-size: .9rem; margin-top: 0 !important; }
.math { text-align: center; font-variant-numeric: tabular-nums; }

details { background: var(--panel); border-radius: 4px; padding: .6rem .9rem; margin: .8rem 0; }
summary { cursor: pointer; color: var(--muted); }
details[open] summary { margin-bottom: .3rem; }

table { border-collapse: collapse; margin: .9rem 0; font-variant-numeric: tabular-nums; }
caption { caption-side: bottom; text-align: left; color: var(--muted); font-size: .85rem; padding-top: .35rem; }
th, td { border: 1px solid var(--rule); padding: .25rem .7rem; text-align: center; }
th { font-weight: normal; color: var(--muted); }

#about { border-top: 1px solid var(--rule); padding-top: 1.5rem; }

footer.site { margin-top: 2.5rem; color: var(--muted); font-size: .85rem; }

@media (max-width: 30rem) {
  body { font-size: 16px; padding-top: 1.5rem; }
  ol.index li { flex-direction: column; gap: 0; }
  ol.index time { flex: none; }
}
