/* style.css: mobile first, monochrome, one column that widens politely. */

:root {
  --ink: #1b1b1a;
  --paper: #fbfbf9;
  --quiet: #6a6a66;
  --rule: #dcdcd7;
  --wash: #f0f0ec;
  --measure: 33rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e7e7e3;
    --paper: #151515;
    --quiet: #9b9b96;
    --rule: #34342f;
    --wash: #1f1f1d;
  }
}

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

html {
  font-family: Equity, "Iowan Old Style", Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  font-size: 112.5%;
  line-height: 1.45;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  hanging-punctuation: first allow-end;
}

body {
  margin: 0 auto;
  padding: 1.25rem 1.1rem 3rem;
  max-width: calc(var(--measure) + 2.2rem);
}

::selection { background: var(--ink); color: var(--paper); }

/* Text */

p, ul, ol, blockquote, figure, pre, table { margin: 0 0 1em; }
p, li { text-wrap: pretty; hyphens: auto; }
h1, h2, h3, h4 {
  font-weight: bold;
  line-height: 1.2;
  margin: 1.8em 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: 1.6rem; margin-top: 0.4em; }
h2 { font-size: 1.2rem; }
h3, h4 { font-size: 1rem; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--quiet);
  transition: text-decoration-thickness 120ms ease, text-decoration-color 120ms ease;
}
a:hover { text-decoration-thickness: 0.12em; text-decoration-color: currentColor; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 1px; }

blockquote {
  margin-left: 0;
  padding-left: 1em;
  border-left: 1px solid var(--rule);
  color: var(--quiet);
}
blockquote p { margin-bottom: 0.4em; }

hr {
  border: 0;
  margin: 2em 0;
  text-align: center;
  color: var(--quiet);
}
hr::after { content: "\2042"; }

small, .meta, time { color: var(--quiet); }
time, .posts, .meta { font-variant-numeric: tabular-nums lining-nums; }

code, pre, kbd {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82em;
}
pre {
  overflow-x: auto;
  padding: 0.8em 1em;
  background: var(--wash);
  line-height: 1.4;
  hyphens: none;
}

img, video { max-width: 100%; height: auto; }
figure { margin-left: 0; margin-right: 0; }
figure img { display: block; margin: 0 auto; }
figcaption { font-size: 0.85em; color: var(--quiet); margin-top: 0.4em; }

@media (prefers-color-scheme: dark) {
  img:not([src$=".svg"]) { filter: brightness(0.9); }
}

table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 0.3em 0.6em 0.3em 0; border-bottom: 1px solid var(--rule); }

/* Site chrome */

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: 0.3em 0.6em; }

header.site {
  hanging-punctuation: none;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.3rem 1rem;
  margin-bottom: 2.2rem;
}

.mark {
  font-weight: bold;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.mark .paren {
  display: inline-block;
  color: var(--quiet);
  font-weight: normal;
  transition: transform 240ms cubic-bezier(0.3, 1.6, 0.5, 1);
}
.mark:hover .paren:first-child, .mark:focus-visible .paren:first-child { transform: translateX(-0.18em) rotate(-8deg); }
.mark:hover .paren:last-child, .mark:focus-visible .paren:last-child { transform: translateX(0.18em) rotate(8deg); }

nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 0.9rem; }
nav a, .mark { font-variant-caps: all-small-caps; letter-spacing: 0.06em; }
.mark { font-variant-caps: normal; letter-spacing: 0.01em; }
nav a { text-decoration-color: transparent; }
nav a:hover, nav a[aria-current] { text-decoration-color: currentColor; }

footer.site {
  hanging-punctuation: none;
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85em;
  color: var(--quiet);
}
footer.site p { margin: 0 0 0.3em; }

.fish {
  display: inline-block;
  filter: grayscale(1);
  transition: transform 400ms cubic-bezier(0.3, 1.8, 0.5, 1);
}
.colophon:hover .fish { transform: scale(1.5) rotate(-12deg); }

/* Content shapes */

article > header { margin-bottom: 1.5rem; }
article > header h1 { margin-bottom: 0.2em; }
.meta { margin: 0; font-size: 0.9em; }
article > footer { margin-top: 2.5rem; }

.feature { margin-bottom: 1.5em; }
.feature img { max-height: 55vh; width: auto; }

.posts { list-style: none; padding: 0; }
.posts li { margin-bottom: 0.7em; }
.posts time { display: block; font-size: 0.8em; }

.file a::before { content: "\2193\00a0"; }
.embed a::before { content: "\25b6\00a0"; }
.bookmark a::after { content: "\00a0\2197"; }

:target { scroll-margin-top: 1rem; }
h2:target::before { content: "\00a7\00a0"; color: var(--quiet); }

/* Wider screens: larger type, dates in a column. */

@media (min-width: 40em) {
  html { font-size: 125%; }
  body { padding-top: 2.5rem; }
  .posts li { display: grid; grid-template-columns: 6.2em 1fr; gap: 1em; margin-bottom: 0.35em; }
  .posts time { display: inline; font-size: 0.85em; padding-top: 0.12em; }
}

@media (min-width: 64em) {
  html { font-size: 131.25%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  header.site nav, footer.site, .skip { display: none; }
  html { font-size: 11pt; background: none; color: black; }
  a { text-decoration: none; }
}

/* Equity A Tab by Matthew Butterick (MB Type), licensed webfonts served
   from this origin only. The files live in fonts/ and stay out of git.
   Tab = tabular figures by default. The Caps font maps lowercase to small
   caps, so it replaces the synthesized small caps used by the fallback. */
@font-face { font-family: Equity; src: url("/fonts/equity_a_tab_regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Equity; src: url("/fonts/equity_a_tab_italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: Equity; src: url("/fonts/equity_a_tab_bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: Equity; src: url("/fonts/equity_a_tab_bold_italic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Equity Caps"; src: url("/fonts/equity_a_tab_caps_regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Equity Caps"; src: url("/fonts/equity_a_tab_caps_bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

html { font-synthesis: none; }
nav a { font-family: "Equity Caps", Equity, serif; font-variant-caps: normal; letter-spacing: 0.04em; }
