/* Cool off-white paper, ink, the old site's teal. No framework. */
/* Self-hosted, latin subset, variable weight. SIL OFL: see fonts/jetbrains-mono-OFL.txt */
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --paper: #f4f7f4;
  --ink: #1e2b29;
  --muted: #6b7b77;
  --rule: #d6e0dc;
  --accent: #00756f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

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

html {
  border-top: 5px solid var(--accent); /* nod to the old teal header */
  background-color: var(--paper);
  /* faint paper grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.06'/%3E%3C/svg%3E");
}

body {
  max-width: calc(800px + 2.5rem); /* 800px of content plus side padding */
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
  color: var(--ink);
  font: 1.1875rem/1.65 var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration: underline 1px var(--accent);
  text-underline-offset: .18em;
}
a:hover { color: var(--accent); }

h1, h2, h3 { font-weight: normal; line-height: 1.2; }
h1 { font-size: 2.4rem; font-style: italic; letter-spacing: -.01em; margin: .2em 0 .6em; }
h2 { font-size: 1.5rem; margin: 2em 0 .5em; }
h3 { font-size: 1.2rem; }

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

hr { border: 0; margin: 3rem 0; text-align: center; }
hr::after { content: "❦"; color: var(--accent); font-size: 1.3rem; }

/* --- header & footer --- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem 1.5rem;
  padding-bottom: 1rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--rule);
}
.brand { font-size: 1.3rem; font-style: italic; text-decoration: none; }
.brand::before {
  content: "";
  display: inline-block;
  width: .55em;
  height: .55em;
  margin-right: .45em;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: .08em;
}
.site-header nav { display: flex; gap: 1.25rem; }
.site-header nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover, .site-header nav .active { color: var(--ink); }

.site-header nav, .label, .more, time, .inline, .site-footer {
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  margin-top: 4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  text-transform: none;
}
.site-footer p { margin: 0; }

/* --- home & about --- */
.label { margin: 2.5rem 0 1.2rem; color: var(--accent); letter-spacing: .16em; }
.intro { display: flow-root; }
.intro p { font-size: 1.3rem; line-height: 1.55; }

.polaroid {
  float: right;
  width: min(40%, 13rem);
  margin: .4rem 0 1rem 1.75rem;
  padding: .5rem .5rem 1.8rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 45, 40, .15), 0 10px 24px -10px rgba(15, 45, 40, .35);
  transform: rotate(2.5deg);
}

/* home: intro text centred on the photo's height */
.hero { display: flex; flex-direction: row-reverse; align-items: center; }
.hero .polaroid { float: none; flex: none; margin: 0 0 0 1.75rem; }
.hero > div > :first-child { margin-top: 0; }
.hero > div > :last-child { margin-bottom: 0; }

.inline { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: 0; padding: 0; list-style: none; }
.inline .active { color: var(--accent); text-decoration: none; }

/* --- post lists: title ........ date --- */
.entry { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .6rem; margin-bottom: 1.4rem; }
.entry h3 { margin: 0; font-size: 1.15rem; }
.entry h3 a { text-decoration: none; }
.entry h3 a:hover { text-decoration: underline 1px var(--accent); }
.leader { flex: 1 0 1.5rem; border-bottom: 1px dotted var(--muted); transform: translateY(-.3em); }
.entry time { color: var(--muted); white-space: nowrap; }
.entry p { flex-basis: 100%; margin: .15rem 0 0; color: var(--muted); font-size: 1rem; font-style: italic; }

/* --- single post --- */
.post-header time { color: var(--muted); }
.post-header h1 { margin-top: .35rem; }
.e-content > p:first-child::first-letter {
  float: left;
  margin: .06em .1em 0 0;
  color: var(--accent);
  font-size: 3.6em;
  line-height: .85;
}
.e-content img { display: block; margin: 1.5rem auto; border: 1px solid var(--rule); }

blockquote { margin: 1.5rem 0; padding-left: 1.2rem; border-left: 2px solid var(--accent); color: #3d4b48; font-style: italic; }

code { padding: .1em .3em; border-radius: 3px; background: #e3ece8; font: .82em var(--mono); }
pre {
  overflow-x: auto;
  padding: 1rem 1.2rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: #fbfcfb;
  line-height: 1.5;
}
pre code { padding: 0; background: none; }

table { border-collapse: collapse; }
th, td { padding: .3rem .6rem; border-bottom: 1px solid var(--rule); text-align: left; }

@media (max-width: 34rem) {
  body { padding-top: 1.5rem; font-size: 1.0625rem; }
  h1 { font-size: 2rem; }
  .intro p { font-size: 1.15rem; }
}

/* social icons: Font Awesome 6, classes set per link in hugo.toml */
.inline i { margin-right: .4em; color: var(--accent); }
