.blog-list-view {
  background: var(--c-panel);
  color: var(--c-text);
  font-family: var(--font-body);
}

.notes-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: 4rem 5rem;
  background: var(--c-bg-deep);
  color: var(--c-panel);
}

.notes-hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: radial-gradient(ellipse at 0% 115%, var(--c-arc-3) 0% 29%, var(--c-arc-2) 29.2% 43%, var(--c-arc-1) 43.2% 58%, var(--c-bg) 58.2% 77%, var(--c-bg-deep) 100%);
}

.notes-hero-inner {
  text-align: center;
}

.notes-kicker {
  margin: 0 0 1.25rem;
  color: var(--c-sky);
  font-size: var(--fs-label);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
}

.notes-hero h1 {
  color: var(--c-panel);
  max-width: 100%;
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  font-weight: var(--weight-display);
  line-height: 1.25;
}

.notes-hero h1 span {
  color: var(--c-sky);
}

.notes-intro {
  max-width: 42rem;
  margin: 1.25rem auto 0;
  font-size: var(--fs-lede);
  line-height: 1.8;
  text-wrap: pretty;
}

.notes-topics {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
}

.notes-topics span {
  padding: 0.5rem 1rem;
  border: 1px solid var(--c-sky);
  border-radius: var(--r-pill);
  color: var(--c-panel);
  font-size: var(--fs-small);
}

.notes-library {
  position: relative;
  margin-top: -2rem;
  padding-block: 3.5rem var(--space-section);
  border-radius: var(--r-section) var(--r-section) 0 0;
  background: var(--c-panel);
}

.notes-library-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.notes-library-head .eyebrow {
  margin: 0 0 0.5rem;
}

.notes-library-head h2 {
  margin: 0;
  color: var(--c-text);
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  line-height: 1.4;
}

.notes-count {
  margin: 0;
  color: var(--c-muted);
  font-size: var(--fs-small);
}

.notes-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-bottom: 2rem;
}

.notes-filters button {
  min-height: 2.75rem;
  padding: 0.625rem 1.125rem;
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  background: var(--c-panel);
  color: var(--c-muted);
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: var(--weight-medium);
  line-height: 1.5;
  cursor: pointer;
  transition: background var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast);
}

.notes-filters button:hover {
  border-color: var(--c-accent);
  color: var(--c-accent-dark);
}

.notes-filters button[aria-pressed="true"] {
  border-color: var(--c-accent-dark);
  background: var(--c-accent-dark);
  color: var(--c-panel);
}

.notes-filters button:focus-visible,
.post-card a:focus-visible,
#post-nav a:focus-visible,
.blog-breadcrumb a:focus-visible,
nav.breadcrumb a:focus-visible,
nav.breadcrumbs a:focus-visible {
  outline: 3px solid var(--c-accent);
  outline-offset: 4px;
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.post-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: 1.75rem;
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  background: var(--c-panel);
  color: var(--c-text);
  box-shadow: var(--shadow-card);
}

.post-meta,
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem 1rem;
  color: var(--c-muted);
  font-size: var(--fs-small);
  line-height: 1.6;
}

.post-meta .tag,
.article-meta .tag {
  max-width: 100%;
  padding: 0.25rem 0.625rem;
  border-radius: var(--r-pill);
  background: var(--c-accent-soft);
  color: var(--c-accent-dark);
  font-size: var(--fs-small);
  font-weight: var(--weight-medium);
  white-space: normal;
}

.post-card h3 {
  max-width: 100%;
  margin: 1rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: var(--weight-bold);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.post-card h3 a {
  color: var(--c-text);
  text-decoration: none;
}

.post-card h3 a:hover {
  color: var(--c-accent-dark);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.post-card .post-summary {
  margin: 0 0 1.5rem;
  color: var(--c-muted);
  font-size: var(--fs-body);
  line-height: 1.8;
}

.post-card .post-read {
  align-self: flex-start;
  margin-top: auto;
  color: var(--c-accent-dark);
  font-size: var(--fs-label);
  font-weight: var(--weight-semibold);
  text-decoration: none;
}

.post-card .post-read:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.notes-empty {
  grid-column: 1 / -1;
  padding: 1.5rem;
  border-radius: var(--r-card);
  background: var(--c-panel-2);
  color: var(--c-muted);
  line-height: 1.8;
}

.notes-empty a {
  color: var(--c-accent-dark);
}

main.reading {
  padding-top: 32px;
}

.blog-breadcrumb,
nav.breadcrumb,
nav.breadcrumbs {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  margin-top: 1.5rem;
  margin-bottom: 1.25rem;
  padding-block: 0;
  overflow: hidden;
  color: var(--c-muted);
  font-family: var(--font-body);
  font-size: var(--fs-small);
  line-height: 1.7;
  white-space: nowrap;
}

.blog-breadcrumb a,
nav.breadcrumb a,
nav.breadcrumbs a {
  flex: 0 0 auto;
  color: var(--c-muted);
  text-decoration: none;
}

.blog-breadcrumb a:hover,
nav.breadcrumb a:hover,
nav.breadcrumbs a:hover {
  color: var(--c-accent-dark);
}

.blog-breadcrumb [aria-hidden="true"],
nav.breadcrumb [aria-hidden="true"],
nav.breadcrumbs [aria-hidden="true"] {
  flex: 0 0 auto;
  opacity: 0.35;
}

.blog-breadcrumb [aria-current="page"],
nav.breadcrumb [aria-current="page"],
nav.breadcrumbs [aria-current="page"] {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 30ch;
  overflow: hidden;
  color: var(--c-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-view .section:has(.blog-breadcrumb, nav.breadcrumb, nav.breadcrumbs),
.blog-article-view .section:has(.blog-breadcrumb, nav.breadcrumb, nav.breadcrumbs),
.section:has(> .blog-breadcrumb, > nav.breadcrumb, > nav.breadcrumbs) {
  padding-top: 0;
  padding-bottom: 0;
}

.blog-breadcrumb.section,
nav.breadcrumb.section,
nav.breadcrumbs.section {
  padding-block: 0;
}

.article-hero,
.article-header {
  padding-block: 0.5rem 1.5rem;
  color: var(--c-text);
}

.article-hero .article-meta,
.article-header .article-meta {
  margin: 0 0 0.9375rem;
}

main.reading h1,
.article-hero h1,
.article-header h1,
.article-view h1,
.blog-article-view h1 {
  max-width: 100%;
  margin-block: 0.9375rem;
  color: var(--c-text);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem);
  font-weight: var(--weight-display);
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.article-hero .article-lead,
.article-header .article-lead,
.article-hero .lead,
.article-header .lead,
.article-hero > p:not(.article-meta):not(.eyebrow),
.article-header > p:not(.article-meta):not(.eyebrow) {
  margin-top: 1rem;
  margin-bottom: 0;
  color: var(--c-muted);
  font-size: clamp(0.9375rem, 0.85rem + 0.45vw, 1.125rem);
  line-height: 1.7;
}

.article-body,
.prose {
  min-width: 0;
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.article-body.section,
.prose.section {
  padding-block: 0;
}

.prose section,
.article-body section,
.prose section.section,
.article-body section.section {
  margin-block: 1.75rem 0;
  padding-block: 0;
}

.prose section:first-child,
.article-body section:first-child {
  margin-top: 0;
}

.prose h2,
.article-body h2 {
  max-width: 100%;
  margin: 2rem 0 0.875rem;
  color: var(--c-text);
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: var(--weight-bold);
  line-height: 1.5;
  scroll-margin-top: calc(var(--mast-h) + 1rem);
}

.prose > h2:first-child,
.article-body > h2:first-child,
.prose > section:first-child > h2:first-child,
.article-body > section:first-child > h2:first-child,
.prose > h2:first-of-type,
.article-body > h2:first-of-type {
  margin-top: 0;
}

.prose h3,
.article-body h3 {
  margin: 1.5rem 0 0.75rem;
  color: var(--c-text);
  font-family: var(--font-display);
  font-size: calc(var(--fs-body) * 1.25);
  font-weight: var(--weight-bold);
  line-height: 1.5;
}

.prose p,
.article-body p {
  margin-block: 0 1rem;
}

.prose ul,
.prose ol,
.article-body ul,
.article-body ol {
  margin-block: 0.875rem 1.25rem;
  padding-inline-start: 1.5rem;
}

.prose li + li,
.article-body li + li {
  margin-top: 0.5rem;
}

.prose a:not([class*="btn"]):not([class*="button"]),
.article-body a:not([class*="btn"]):not([class*="button"]) {
  color: var(--c-accent-dark);
  text-underline-offset: 0.2em;
}

.prose blockquote,
.article-body blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-inline-start: 4px solid var(--c-accent);
  border-radius: var(--r-field);
  background: var(--c-surface);
  color: var(--c-text);
}

.prose blockquote > :last-child,
.article-body blockquote > :last-child {
  margin-bottom: 0;
}

.prose code,
.article-body code {
  padding: 0.125rem 0.375rem;
  border-radius: var(--r-field);
  background: var(--c-surface);
  color: var(--c-text);
  font-family: var(--font-mono);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.prose pre,
.article-body pre {
  max-width: 100%;
  margin: 1.25rem 0;
  padding: 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  background: var(--c-surface);
  color: var(--c-text);
  line-height: 1.7;
  tab-size: 2;
}

.prose pre code,
.article-body pre code {
  padding: 0;
  border-radius: 0;
  background: var(--c-clear);
  color: inherit;
  white-space: pre;
  overflow-wrap: normal;
}

.prose .table-scroll,
.article-body .table-scroll {
  max-width: 100%;
  margin-block: 1.25rem;
  overflow-x: auto;
}

.prose table,
.article-body table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-block: 1.25rem;
  overflow-x: auto;
  border-collapse: collapse;
  color: var(--c-text);
  font-size: var(--fs-label);
}

.prose .table-scroll table,
.article-body .table-scroll table {
  margin-block: 0;
}

.prose th,
.prose td,
.article-body th,
.article-body td {
  min-width: 7em;
  padding: 0.875rem 1rem;
  border: 1px solid var(--c-border);
  text-align: start;
  vertical-align: top;
}

.prose th,
.article-body th {
  background: var(--c-surface);
  font-weight: var(--weight-semibold);
}

.article-download {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-block: 2rem;
  padding: 1.75rem;
  border: 1px solid var(--c-border);
  border-radius: var(--r-panel);
  background: var(--c-panel-2);
  color: var(--c-text);
}

.article-download > div {
  flex: 1 1 18rem;
  min-width: 0;
}

.article-download h2,
.prose .article-download h2 {
  margin: 0 0 0.625rem;
  font-size: var(--fs-h3);
  line-height: 1.4;
}

.article-download p,
.prose .article-download p {
  margin: 0;
  color: var(--c-muted);
  font-size: var(--fs-body);
  line-height: 1.75;
}

.article-download .article-download-actions {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

#related-posts {
  margin-block: 2rem;
  padding-block: 0;
}

#related-posts > h2 {
  margin: 0 0 1.25rem;
  color: var(--c-text);
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  line-height: 1.4;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.25rem;
}

#related-posts .post-card {
  padding: 1.5rem;
}

#related-posts .post-card h3 {
  margin-block: 1rem 0.75rem;
  font-size: calc(var(--fs-body) * 1.25);
  line-height: 1.5;
}

#related-posts .post-card .post-summary {
  font-size: var(--fs-label);
}

#post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-block: 2rem;
  padding-block: 1.5rem 0;
  border-top: 1px solid var(--c-border);
}

#post-nav .post-nav-card {
  display: block;
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  background: var(--c-surface);
  color: var(--c-text);
  text-decoration: none;
}

#post-nav .post-nav-card:hover {
  border-color: var(--c-accent);
  background: var(--c-accent-soft);
  color: var(--c-text);
}

#post-nav .post-nav-next {
  grid-column: 2;
}

.post-nav-label {
  display: block;
  margin-bottom: 0.625rem;
  color: var(--c-accent-dark);
  font-size: var(--fs-small);
  font-weight: var(--weight-semibold);
}

.post-nav-title {
  display: block;
  font-size: var(--fs-body);
  font-weight: var(--weight-semibold);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

#related-posts[hidden],
#post-nav[hidden] {
  display: none;
}

@media (min-width: 821px) {
  .related-grid {
    grid-template-columns: repeat(2, minmax(300px, 1fr));
  }
}

@media (max-width: 640px) {
  .notes-hero {
    padding-block: 2.75rem 4rem;
  }

  .notes-hero h1 {
    font-size: 1.875rem;
  }

  .notes-intro {
    font-size: var(--fs-body);
  }

  .notes-library {
    padding-top: 2.5rem;
  }

  .notes-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .post-card {
    padding: 1.375rem;
  }

  .post-card h3 {
    font-size: calc(var(--fs-body) * 1.25);
  }

  .article-hero h1,
  .article-header h1,
  .article-view h1,
  .blog-article-view h1 {
    font-size: 1.5rem;
    line-height: 1.32;
  }

  .article-download {
    padding: 1.375rem;
  }

  #post-nav {
    grid-template-columns: minmax(0, 1fr);
  }

  #post-nav .post-nav-next {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .notes-filters button {
    transition: none;
  }
}