:root {
  color-scheme: light dark;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --paper: #f6f3ec;
  --ink: #1b1916;
  --muted: #514d46;
  --faint: #6f6a62;
  --line: #ddd6c8;
  --accent: #6e3c2b;
  --pill: #efeae1;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131311;
    --ink: #ece7de;
    --muted: #b7b1a6;
    --faint: #9c968c;
    --line: #2e2d29;
    --accent: #e2b48a;
    --pill: #1c1c19;
  }
}

@supports (color: light-dark(black, white)) {
  :root {
    --paper: light-dark(#f6f3ec, #131311);
    --ink: light-dark(#1b1916, #ece7de);
    --muted: light-dark(#514d46, #b7b1a6);
    --faint: light-dark(#6f6a62, #9c968c);
    --line: light-dark(#ddd6c8, #2e2d29);
    --accent: light-dark(#6e3c2b, #e2b48a);
    --pill: light-dark(#efeae1, #1c1c19);
  }
}

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

html {
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

.skip {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 2;
  padding: 0.45rem 0.7rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.skip:focus {
  top: 1rem;
}

.page {
  width: min(50rem, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: clamp(2.25rem, 7vw, 4.75rem) 0 3rem;
}

.masthead,
.section {
  display: grid;
  grid-template-columns: 8.75rem minmax(0, 1fr);
  column-gap: 1.75rem;
}

.masthead {
  align-items: center;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.avatar {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 682 / 1024;
  border-radius: 0.45rem;
  box-shadow: 0 0 0 1px var(--line);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

.subtitle {
  margin-top: 0.55rem;
  max-width: 38rem;
  font-size: 1.02rem;
  line-height: 1.45;
  text-wrap: balance;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1.15rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem;
}

.dot {
  color: var(--faint);
}

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-decoration-color: var(--line);
  text-underline-offset: 0.22em;
}

a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

main {
  display: flex;
  flex-direction: column;
  gap: 2.35rem;
  margin-top: 2.35rem;
}

main:focus {
  outline: none;
}

h2 {
  margin-top: 0.2rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.45;
  text-transform: uppercase;
  color: var(--accent);
}

.section > p {
  max-width: 40rem;
  text-wrap: pretty;
}

.entries {
  display: flex;
  flex-direction: column;
  gap: 1.65rem;
}

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem 1.5rem;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.org {
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.dates {
  flex: none;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.01em;
  color: var(--muted);
  white-space: nowrap;
}

.entry ul {
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
}

.entry li {
  position: relative;
  margin-top: 0.38rem;
  padding-left: 1rem;
}

.entry li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 0.45rem;
  height: 1px;
  background: var(--accent);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pills li {
  padding: 0.28rem 0.72rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--pill);
  font-size: 0.86rem;
  line-height: 1.4;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem 1.5rem;
  margin-top: 3rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

@media (max-width: 42rem) {
  .masthead,
  .section {
    grid-template-columns: 1fr;
    row-gap: 0.85rem;
  }

  .avatar {
    width: 8.25rem;
  }

  .entry-head {
    flex-direction: column;
    gap: 0.2rem;
  }

  .dates {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media print {
  :root {
    --paper: #fff;
    --ink: #111;
    --muted: #333;
    --faint: #333;
    --line: #ccc;
    --accent: #6e3c2b;
    --pill: #fff;
  }

  body {
    background: #fff;
    font-size: 11pt;
  }

  .skip {
    display: none;
  }

  .page {
    width: auto;
    padding: 0;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  .links a::after,
  footer a::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }
}
