/* Type scale: major third (1.25) on an 18px base */
:root {
  color-scheme: light dark;

  --step--2: 0.72rem;
  --step--1: 0.8rem;
  --step-0: 1.125rem;
  --step-1: 1.4rem;
  --step-2: 1.75rem;
  --step-3: 2.2rem;

  --serif: "Charter", "Bitstream Charter", "Sitka Text", Cambria, "Iowan Old Style",
    Georgia, serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
    system-ui, sans-serif;

  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

  --measure: 34rem;
  --space: 1.5rem;

  --bg: #eef1f4;
  --text: #1a2028;
  --muted: #637080;
  --rule: #d8dee5;
  --accent: #1a2028;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b2027;
    --text: #d6dce4;
    --muted: #8793a2;
    --rule: #2d343e;
    --accent: #eef1f4;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1b2027;
  --text: #d6dce4;
  --muted: #8793a2;
  --rule: #2d343e;
  --accent: #eef1f4;
}

:root[data-theme="light"] {
  color-scheme: light;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--serif);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  hyphens: manual;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--muted);
  transition: text-decoration-color 120ms;
}

a:hover {
  text-decoration-color: currentColor;
}

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

::selection {
  background: var(--text);
  color: var(--bg);
}

h1,
h2,
h3,
h4 {
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.012em;
  text-wrap: balance;
  margin: 2.2em 0 0.6em;
}

h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
h4 { font-size: var(--step-0); }

p,
ul,
ol {
  margin-bottom: 1.1em;
  text-wrap: pretty;
}

ul,
ol {
  padding-left: 1.25em;
}

li + li {
  margin-top: 0.3em;
}

blockquote {
  margin: 1.6em 0;
  padding-left: 1.1em;
  border-left: 1px solid var(--muted);
  color: var(--muted);
  font-style: italic;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5em 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 3px;
}

code,
pre {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85em;
}

pre {
  overflow-x: auto;
  padding: 1em;
  margin-bottom: 1.1em;
  border: 1px solid var(--rule);
  border-radius: 3px;
}

/* Layout */
.container {
  width: min(100% - 2 * var(--space), var(--measure));
  margin: 0 auto;
}

.site-header {
  padding: 2.5rem 0 0;
}

.header-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  font-family: var(--sans);
  font-size: var(--step--1);
}

.site-brand {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.site-tagline {
  margin: 0;
  font-size: var(--step--2);
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--muted);
}

.site-title {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-size: var(--step-1);
  line-height: 28px;
  font-weight: 500;
  font-variation-settings: "opsz" 72;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.site-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.site-nav {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  color: var(--muted);
}

.site-nav a {
  text-decoration: none;
}

.site-nav a:hover,
.theme-toggle:hover {
  color: var(--text);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  padding: 0.25rem;
  margin: -0.25rem;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

/* Show the icon for the theme you would switch to */
.icon-sun {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-moon {
    display: none;
  }

  :root:not([data-theme="light"]) .icon-sun {
    display: block;
  }
}

:root[data-theme="dark"] .icon-moon {
  display: none;
}

:root[data-theme="dark"] .icon-sun {
  display: block;
}

main {
  padding: 4rem 0 5rem;
}

.page-title {
  margin: 0 0 1.5rem;
}

/* Feed */
.feed-section-title {
  font-family: var(--sans);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.feed-item {
  padding: 1.1rem 0;
  border-top: 1px solid var(--rule);
}

.feed-title {
  font-size: var(--step-1);
  line-height: 1.3;
  font-weight: 600;
  margin: 0;
}

.feed-title a {
  text-decoration: none;
}

.feed-title a:hover {
  text-decoration: underline;
  text-decoration-color: var(--muted);
}

.feed--previous {
  margin-top: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.feed--previous .feed-section-title {
  margin-bottom: 1rem;
}

.feed--previous .feed-item {
  padding: 0.3rem 0;
  border-top: 0;
}

.feed--previous .feed-title {
  font-size: var(--step-0);
  line-height: 1.5;
  font-weight: 400;
}

.feed-item--full {
  padding-top: 0;
  padding-bottom: 2.5rem;
  border-top: 0;
}

.feed-item--full .feed-title {
  font-size: var(--step-3);
  line-height: 1.2;
  margin-bottom: 1.25rem;
}

.feed-body > :last-child {
  margin-bottom: 0;
}

/* Posts and pages */
.post-header {
  margin-bottom: 2.5rem;
}

.post-meta {
  display: flex;
  gap: 0.75em;
  font-family: var(--sans);
  font-size: var(--step--2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.post-title {
  font-size: var(--step-3);
  margin: 0 0 0.5em;
}

.post-summary {
  color: var(--muted);
  font-style: italic;
}

.post-external {
  font-family: var(--sans);
  font-size: var(--step--1);
  color: var(--muted);
}

.post-hero {
  margin: 2rem 0 0;
}

.post-hero-credit {
  margin-top: 0.5rem;
  font-family: var(--sans);
  font-size: var(--step--2);
  color: var(--muted);
}

.post-body > :first-child,
.page-body > :first-child {
  margin-top: 0;
}

.post-date {
  margin: 2rem 0 0;
  font-family: var(--sans);
  font-size: var(--step--2);
  letter-spacing: 0.04em;
  color: var(--muted);
}

.post-date::before {
  content: "";
  display: block;
  width: 1.75rem;
  margin-bottom: 0.75rem;
  border-top: 1px solid var(--muted);
}

.site-footer {
  padding: 0 0 3rem;
  font-family: var(--sans);
  font-size: var(--step--1);
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

.empty-state {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 480px) {
  :root {
    --step-0: 1.0625rem;
    --step-2: 1.5rem;
    --step-3: 1.85rem;
    --space: 1.25rem;
  }
}
