:root {
  --bg: #111111;
  --surface: #171717;
  --text: #f3f3f0;
  --muted: #bdbdb7;
  --border: #2a2a2a;
  --link: #ffffff;
  --link-hover: #d7d7d2;
  --shadow: rgba(0, 0, 0, 0.22);
}

:root[data-theme="light"] {
  --bg: #f4f1ea;
  --surface: #f8f6f0;
  --text: #1d1d1b;
  --muted: #575753;
  --border: #d7d2c9;
  --link: #111111;
  --link-hover: #43433f;
  --shadow: rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Courier New", Courier, monospace;
  line-height: 1.82;
  text-rendering: optimizeLegibility;
}

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

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

a:hover {
  color: var(--link-hover);
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 1000;
  background: var(--surface);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
}

.wrap {
  width: min(100% - 2rem, 42rem);
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  background: var(--bg);
}

.nav-wrap {
  width: min(100% - 2rem, 54rem);
}

.site-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.site-title {
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link,
.theme-toggle {
  font: inherit;
  font-size: 0.95rem;
}

.nav-link {
  text-decoration: none;
}

.nav-link.is-active {
  text-decoration: underline;
}

.theme-toggle {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0.1rem;
  cursor: pointer;
  line-height: 1;
  font-size: 1.05rem;
}

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

.theme-toggle-icon {
  display: inline-block;
  width: 1.2rem;
  text-align: center;
}

.site-main {
  min-height: calc(100vh - 10rem);
}

.intro {
  padding: 5.25rem 0 3.4rem;
}

.intro h1,
.article-header h1,
.list-header h1 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  line-height: 1.25;
  margin: 0 0 1rem;
  font-weight: 700;
}

.tagline {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--muted);
  max-width: 34rem;
  margin: 0;
}

.home-block,
.list-page {
  padding: 0 0 2rem;
}

.home-block + .home-block {
  padding-top: 1rem;
}

.home-block-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.home-block h2,
.note-card h2 {
  margin: 0;
  font-size: 1.1rem;
}

.entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

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

.entry-list li span,
.article-meta,
.list-intro,
.note-card header p,
.site-footer,
figcaption {
  color: var(--muted);
}

.entry-list li span {
  white-space: nowrap;
  font-size: 0.92rem;
}

.prose {
  padding-top: 3rem;
  padding-bottom: 4rem;
}

.article-header,
.list-header {
  margin-bottom: 2rem;
}

.article-meta {
  font-size: 0.94rem;
  margin-top: 0;
}

.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote,
.note-body p,
.list-intro p {
  margin: 0 0 1.4rem;
}

.article-content h2,
.article-content h3,
.article-content h4 {
  line-height: 1.35;
  margin: 2.2rem 0 0.9rem;
}

.article-content blockquote,
.note-body blockquote {
  border-left: 2px solid var(--border);
  padding-left: 1rem;
  margin-left: 0;
}

.article-figure {
  margin: 1.6rem 0 2rem;
}

.article-figure img {
  width: 100%;
  border: 1px solid var(--border);
}

figcaption {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  font-style: italic;
}

.notes-stream {
  display: grid;
  gap: 1.4rem;
}

.note-card {
  padding: 1rem 0 0;
  border-top: 1px solid var(--border);
}

.note-card:last-child {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
}

.footer-wrap {
  width: min(100% - 2rem, 54rem);
  padding: 1.25rem 0 2.5rem;
}

.footer-wrap p {
  margin: 0;
}

.footer-sep {
  margin: 0 0.35rem;
}

@media (max-width: 42rem) {
  html {
    font-size: 17px;
  }

  .site-nav,
  .home-block-heading,
  .entry-list li {
    display: block;
  }

  .nav-links {
    margin-top: 0.8rem;
    justify-content: flex-start;
  }

  .entry-list li span {
    display: block;
    margin-top: 0.2rem;
  }

  .intro {
    padding: 3.5rem 0 2.4rem;
  }
}


.article-thumb {
  float: right;
  width: min(42%, 13rem);
  margin: 0.2rem 0 1rem 1.25rem;
}

.article-thumb img {
  width: 100%;
  border: 1px solid var(--border);
}

.article-thumb figcaption {
  margin-top: 0.45rem;
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.45;
}

.article-content::after {
  content: "";
  display: block;
  clear: both;
}

@media (max-width: 720px) {
  .article-thumb {
    float: none;
    width: 100%;
    max-width: 18rem;
    margin: 1rem 0 1.2rem;
  }
}

.intro + .home-block {
  margin-top: 2rem;
}
