@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Big Shoulders Text";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/big-shoulders-text-latin-700-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Fragment Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/fragment-mono-latin-400-normal.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --ground: #d5e3da;
  --sheet: #f3f7f4;
  --ink: #14241c;
  --muted: #3c5348;
  --mark: #9d1c1c;
  --link: #143d32;
  --visited: #5c3a32;
  --line: #b7c9be;
  --code: #e6efe9;
  --font-reading: "Atkinson Hyperlegible", "Segoe UI", sans-serif;
  --font-station: "Big Shoulders Text", "Arial Narrow", sans-serif;
  --font-mono: "Fragment Mono", ui-monospace, monospace;
  --measure: 68ch;
  --band: min(48rem, 100%);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #101815;
  --sheet: #18211c;
  --ink: #e8f2ec;
  --muted: #b5c9bd;
  --mark: #ff7a6e;
  --link: #d5eee4;
  --visited: #f0d2cc;
  --line: #2c3b34;
  --code: #0e1612;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #101815;
    --sheet: #18211c;
    --ink: #e8f2ec;
    --muted: #b5c9bd;
    --mark: #ff7a6e;
    --link: #d5eee4;
    --visited: #f0d2cc;
    --line: #2c3b34;
    --code: #0e1612;
  }
}

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

html {
  scrollbar-color: var(--muted) var(--ground);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-reading);
  font-size: 1.0625rem;
  line-height: 1.6;
  caret-color: var(--ink);
}

::selection {
  background: #f3c1b8;
  color: #2a1210;
}

:root[data-theme="dark"] ::selection {
  background: #6b2a24;
  color: #fff5f3;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) ::selection {
    background: #6b2a24;
    color: #fff5f3;
  }
}

:focus-visible {
  outline: 2px solid var(--mark);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 2;
  background: var(--sheet);
  color: var(--ink);
  padding: 0.5rem 0.8rem;
}

.skip:focus {
  top: 1rem;
}

main {
  flex: 1;
}

.band,
.sheet {
  width: var(--band);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.sheet {
  background: var(--sheet);
  padding-block: 2rem 3rem;
}

.mast {
  padding-top: 1.25rem;
}

.band-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.wordmark {
  color: var(--ink);
  font-family: var(--font-station);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 3.5rem);
  line-height: 0.9;
  letter-spacing: 0.01em;
  text-decoration: none;
  text-wrap: balance;
}

.wordmark:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.12em;
}

.tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
}

.tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  color: var(--ink);
}

.tool:hover {
  color: var(--mark);
}

.theme-toggle {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  min-height: 2.75rem;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--mark);
  color: var(--mark);
}

.level {
  margin: 0.85rem 0 1rem;
}

.level span {
  display: block;
  height: 1px;
  background: var(--mark);
}

.level span + span {
  margin-top: 4px;
}

.level-draw span {
  transform-origin: left center;
  animation: level-draw 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.level-draw span + span {
  animation-delay: 0.08s;
}

@keyframes level-draw {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.65rem 0;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
}

.nav a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.nav a[aria-current="page"] {
  color: var(--mark);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.25em;
}

h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.2;
  text-wrap: balance;
  margin: 0;
}

h1 {
  font-size: clamp(1.8rem, 3vw, 2.35rem);
}

h2 {
  font-size: 1.45rem;
  margin-top: 2.25rem;
}

h3 {
  font-size: 1.2rem;
  margin-top: 1.75rem;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-top: 2.5rem;
}

.section-head h1,
.section-head h2 {
  margin-top: 0;
}

.section-head a {
  color: var(--link);
}

.start {
  margin-top: 2.5rem;
}

.recent .section-head {
  margin-top: 0;
}

.start-group h2 {
  margin-bottom: 0;
}

.start-group:first-child h2 {
  margin-top: 0;
}

.entries,
.terms {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
}

.entry {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 0.35rem 1rem;
  align-items: baseline;
  color: var(--ink);
  text-decoration: none;
  padding: 0.4rem 0;
}

.entry time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-station);
  font-weight: 700;
  letter-spacing: 0.01em;
  font-size: 1.15rem;
  white-space: nowrap;
}

.entry-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--line);
}

.entry:hover .entry-title,
.entry:focus-visible .entry-title {
  text-decoration-color: var(--mark);
}

.flag {
  grid-column: 2;
  color: var(--mark);
  font-family: var(--font-station);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 0.75rem 1rem;
  margin-top: 1.75rem;
}

.pager > :last-child {
  justify-self: end;
}

.pager p {
  margin: 0;
  color: var(--muted);
}

.years {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin: 1.25rem 0 0.5rem;
}

.years a {
  font-family: var(--font-station);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
}

.years a:hover {
  color: var(--mark);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.year h2 {
  font-family: var(--font-station);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  margin-bottom: 0;
}

.terms li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}

.terms a {
  color: var(--ink);
}

.count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.essay-dated {
  display: block;
}

.margin-date {
  display: block;
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-family: var(--font-station);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
}

.prose {
  max-width: var(--measure);
  margin-top: 1.25rem;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre,
.prose table,
.prose dl {
  margin: 1rem 0;
}

.prose h2,
.prose h3 {
  margin-bottom: 0.4rem;
}

.prose a {
  color: var(--link);
  text-underline-offset: 0.18em;
}

.prose a:visited {
  color: var(--visited);
}

.prose a:hover {
  color: var(--mark);
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: 0.25rem;
}

.prose blockquote {
  margin-left: 0;
  padding-left: 1rem;
  border-left: 1px solid var(--line);
  color: var(--ink);
}

.prose img,
.prose video,
.prose iframe,
.prose div {
  max-width: 100%;
}

.prose img,
.prose video {
  height: auto;
}

.prose hr {
  border: 0;
  height: 5px;
  margin: 2rem 0;
  background:
    linear-gradient(var(--mark), var(--mark)) top / 100% 1px no-repeat,
    linear-gradient(var(--mark), var(--mark)) bottom / 100% 1px no-repeat;
}

.prose table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
  border-collapse: collapse;
}

.prose th,
.prose td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  padding: 0.45rem 0.7rem;
}

.prose pre {
  overflow-x: auto;
  padding: 0.9rem 1rem;
  background: var(--code);
  font-size: 0.875rem;
  line-height: 1.45;
}

.prose code,
.prose kbd,
.prose samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.prose :not(pre) > code {
  background: var(--code);
  padding: 0.1em 0.35em;
}

.prose figcaption {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.35rem;
}

.share {
  max-width: var(--measure);
  margin-top: 2.5rem;
}

.share h2 {
  margin-top: 0;
  margin-bottom: 0.6rem;
}

.share ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.adjacent {
  max-width: var(--measure);
  display: grid;
  gap: 1rem;
  margin-top: 2.5rem;
}

.adjacent a {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  color: var(--ink);
  text-decoration: none;
  padding: 0.25rem 0;
}

.adjacent a span:last-child {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.adjacent a:hover span:last-child {
  text-decoration-color: var(--mark);
}

.adjacent-label {
  color: var(--muted);
  font-family: var(--font-station);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.colophon {
  padding-bottom: 2.5rem;
}

.colophon .level {
  margin-top: 0;
}

.colophon p {
  margin: 0.4rem 0;
  max-width: var(--measure);
}

.colophon a {
  color: var(--link);
}

.colophon-name {
  font-family: var(--font-station);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink);
}

@media (min-width: 800px) {
  .band,
  .sheet {
    padding-inline: 2rem;
  }

  .sheet {
    padding-block: 2.5rem 4rem;
  }

  .essay-dated {
    display: grid;
    grid-template-columns: 6.75rem minmax(0, var(--measure));
    column-gap: 1.25rem;
    align-items: start;
  }

  .essay-dated .margin-date {
    grid-column: 1;
    grid-row: 1;
    margin: 0.35rem 0 0;
    font-size: 1.2rem;
  }

  .essay-dated > header,
  .essay-dated > .prose,
  .essay-dated > .share,
  .essay-dated > .adjacent {
    grid-column: 2;
  }

  .essay-dated > header {
    grid-row: 1;
  }

  .adjacent {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .entry,
  .start .entry {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  .flag {
    grid-column: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .level-draw span {
    animation: none;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .tools,
  .skip,
  .theme-toggle,
  .share,
  .pager,
  .adjacent {
    display: none;
  }

  .sheet,
  .band {
    width: auto;
    background: #fff;
  }

  a {
    text-decoration: underline;
  }
}
