:root {
  --notes-index-title: clamp(1.875rem, 1.2rem + 2.3vw, 3rem);
  --notes-heading: clamp(1.375rem, 1.12rem + 0.85vw, 1.75rem);
  --notes-card-title: clamp(1.125rem, 1.04rem + 0.3vw, 1.25rem);
  --notes-article-title: clamp(1.5rem, 1.1rem + 1.4vw, 2rem);
  --notes-article-lead: clamp(0.9375rem, 0.85rem + 0.45vw, 1.125rem);
  --notes-article-h2: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  --notes-article-h3: clamp(1.0625rem, 1rem + 0.25vw, 1.25rem);
  --notes-meta: 0.8125rem;
  --notes-related-width: 820px;
  --notes-related-card-min: 300px;
  --notes-body-gap: 0.875rem;
  --notes-chapter-gap: 1.75rem;
}

.notes-hero {
  background: linear-gradient(180deg, var(--sky-top), var(--sky-low));
}

.notes-hero__body {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
  padding-block: clamp(2rem, 4vw, 3.5rem) 1.25rem;
}

.notes-hero h1,
.has-dl-fab .article-hero h1,
.article-hero h1,
.read-wrap > article > header > h1 {
  color: var(--accent-dark);
  font-family: var(--font-display);
  font-weight: var(--weight-regular);
}

.notes-hero h1 {
  margin: 0;
  font-size: var(--notes-index-title);
  line-height: 1.24;
}

.notes-hero p {
  margin-block: 0.875rem 0;
  color: var(--text-muted);
  font-size: var(--size-lead);
  line-height: 1.65;
}

.notes-hero__chart {
  display: block;
  width: min(100%, 20rem);
  height: auto;
  justify-self: end;
}

.notes-hero__route,
.notes-hero__node {
  stroke: var(--notes-route, var(--accent));
  stroke-width: 3;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.notes-hero__route--blue {
  --notes-route: var(--accent);
}

.notes-hero__route--coral {
  --notes-route: var(--tag-coral);
}

.notes-hero__route--mint {
  --notes-route: var(--tag-mint);
}

.notes-hero__node {
  fill: var(--cloud);
}

.notes-hero__wave {
  display: block;
  width: 100%;
  height: clamp(2rem, 7vw, 6rem);
}

.notes-hero__sea {
  fill: var(--sea-1);
}

.notes-hero__shore {
  fill: var(--bg);
}

.notes-list {
  padding-block: clamp(1.75rem, 4vw, 3.5rem) clamp(2.75rem, 6vw, 5rem);
}

.notes-list h2,
#related-posts > h2 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--notes-heading);
  font-weight: var(--weight-regular);
  line-height: 1.35;
}

.notes-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-block-start: 1rem;
}

.notes-filters[hidden] {
  display: none;
}

.notes-filters button {
  min-block-size: var(--tap);
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg-panel);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

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

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

.notes-filters button:focus-visible,
.blog-index .post-card a:focus-visible,
#related-posts a:focus-visible,
#post-nav a:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 3px;
}

.notes-status {
  margin-block: 0.75rem 1rem;
  color: var(--text-muted);
  font-size: var(--size-small);
}

.notes-status:empty {
  margin: 0;
}

.notes-grid,
#related-posts .related-grid,
#post-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--notes-related-card-min)), 1fr));
  gap: 1rem;
  align-items: stretch;
}

.notes-grid .post-card,
#related-posts .post-card,
#post-nav .post-nav-link {
  min-width: 0;
  padding: var(--card-pad);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--bg-panel);
  box-shadow: none;
}

.notes-grid .post-card,
#related-posts .post-card {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 0.75rem;
  align-content: start;
}

.post-card__meta,
.article-meta,
.article-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  color: var(--text-muted);
  font-size: var(--notes-meta);
  line-height: 1.5;
}

.post-card__meta time,
.article-meta time,
.article-hero__meta time {
  font-variant-numeric: tabular-nums;
}

.post-card__meta .tag,
.article-meta .tag,
.article-hero__meta .tag {
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  background: var(--accent-wash);
  color: var(--accent-dark);
  font-size: inherit;
  font-weight: var(--weight-medium);
}

.post-card__meta .tag--coral,
.article-meta .tag--coral,
.article-hero__meta .tag--coral {
  background: var(--tag-coral-soft);
  color: var(--text);
}

.post-card__meta .tag--mint,
.article-meta .tag--mint,
.article-hero__meta .tag--mint {
  background: var(--tag-mint-soft);
  color: var(--text);
}

.notes-grid .post-card__title,
#related-posts .post-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--notes-card-title);
  font-weight: var(--weight-regular);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.post-card__title a:not([class*="btn"]):not([class*="button"]) {
  color: var(--text);
  text-decoration: none;
}

.post-card__title a:not([class*="btn"]):not([class*="button"]):hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.notes-grid .post-card__summary,
#related-posts .post-card__summary {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--size-small);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.post-card__read {
  justify-self: start;
  align-self: end;
  color: var(--accent-dark);
  font-size: var(--size-small);
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

:is(.blog-breadcrumb, nav.breadcrumb, nav.breadcrumbs, .read-wrap > nav:has(> [aria-current="page"])) {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  margin-block: 0 1.25rem;
  overflow: hidden;
  color: var(--text-muted);
  font-size: var(--notes-meta);
  line-height: 1.5;
  white-space: nowrap;
}

:is(.blog-breadcrumb, nav.breadcrumb, nav.breadcrumbs, .read-wrap > nav:has(> [aria-current="page"])) a {
  flex: 0 0 auto;
  color: var(--text-muted);
  text-decoration: none;
}

:is(.blog-breadcrumb, nav.breadcrumb, nav.breadcrumbs, .read-wrap > nav:has(> [aria-current="page"])) a:hover {
  color: var(--accent-dark);
}

:is(.blog-breadcrumb, nav.breadcrumb, nav.breadcrumbs, .read-wrap > nav:has(> [aria-current="page"])) a:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: -2px;
}

:is(.blog-breadcrumb, nav.breadcrumb, nav.breadcrumbs, .read-wrap > nav:has(> [aria-current="page"])) [aria-hidden="true"] {
  flex: 0 0 auto;
  opacity: 0.55;
}

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

:is(.article-page, .has-dl-fab) main:is(.section, .section-space),
:is(.article-page, .has-dl-fab) .section:has(> :is(.blog-breadcrumb, nav.breadcrumb, nav.breadcrumbs, .read-wrap > nav:has(> [aria-current="page"]))) {
  padding-block-start: 0;
}

.read-wrap:has(> article > header > h1) {
  padding-block-start: 2rem;
}

:is(.article-hero, .read-wrap > article > header) {
  padding-block: 0 0.75rem;
}

.article-hero :is(.article-meta, .article-hero__meta),
.read-wrap > article > header > :first-child:has(> time) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin-block: 0 0.875rem;
}

.article-hero h1,
.has-dl-fab .article-hero h1,
.read-wrap > article > header > h1 {
  max-width: 100%;
  margin-block: 0 0.75rem;
  font-size: var(--notes-article-title);
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.article-hero :is(.article-lead, .article-hero__lead, .article-summary, .lead),
.article-hero > p:last-child:not(.article-meta):not(.article-hero__meta),
.read-wrap > article > header > h1 + p {
  max-width: 100%;
  margin-block: 0;
  color: var(--text-muted);
  font-size: var(--notes-article-lead);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

:is(.article-body, .article-content, .has-dl-fab .prose, .article-page .prose) {
  min-width: 0;
  color: var(--text);
  font-size: var(--size-body);
  line-height: 1.75;
  overflow-wrap: anywhere;
}

:is(.article-body, .article-content, .has-dl-fab .prose, .article-page .prose) :is(h2, h3) {
  margin-block: var(--notes-chapter-gap) 0.65rem;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: var(--weight-regular);
  line-height: 1.4;
}

:is(.article-body, .article-content, .has-dl-fab .prose, .article-page .prose) h2 {
  font-size: var(--notes-article-h2);
}

:is(.article-body, .article-content, .has-dl-fab .prose, .article-page .prose) h3 {
  margin-block-start: 1.25rem;
  font-size: var(--notes-article-h3);
}

:is(.article-body, .article-content, .has-dl-fab .prose, .article-page .prose) > h2:first-of-type,
:is(.article-body, .article-content, .has-dl-fab .prose, .article-page .prose) :is(section, .download-note) > :is(h2, h3):first-child {
  margin-block-start: 0;
}

:is(.article-body, .article-content, .has-dl-fab .prose, .article-page .prose) > section:not(#related-posts) {
  margin-block: 0;
  padding-block: 0;
}

:is(.article-body, .article-content, .has-dl-fab .prose, .article-page .prose) > section:not(#related-posts) + section:not(#related-posts) {
  margin-block-start: var(--notes-chapter-gap);
}

:is(.article-body, .article-content, .has-dl-fab .prose, .article-page .prose) :is(p, ul, ol, pre, blockquote):not(:where(.article-hero *, .read-wrap > article > header *)) {
  margin-block: 0 var(--notes-body-gap);
}

:is(.article-body, .article-content, .has-dl-fab .prose, .article-page .prose) :is(p, ul, ol, pre, blockquote):last-child {
  margin-block-end: 0;
}

:is(.article-body, .article-content, .has-dl-fab .prose, .article-page .prose) :is(ul, ol) {
  padding-inline-start: 1.5em;
}

:is(.article-body, .article-content, .has-dl-fab .prose, .article-page .prose) li + li {
  margin-block-start: 0.35em;
}

.blog-index noscript a:not([class*="btn"]):not([class*="button"]),
:is(.article-body, .article-content, .prose) a:not([class*="btn"]):not([class*="button"]):not(.dl-fab):not(:where(.post-card *, #post-nav *, .blog-breadcrumb *, nav.breadcrumb *, nav.breadcrumbs *)) {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

:is(.article-body, .article-content, .has-dl-fab .prose, .article-page .prose) :not(pre) > code {
  padding: 0.1em 0.3em;
  border-radius: var(--radius-focus);
  background: var(--bg-panel-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

:is(.article-body, .article-content, .has-dl-fab .prose, .article-page .prose) pre {
  max-width: 100%;
  padding: 1rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-focus);
  background: var(--bg-panel-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--size-small);
  line-height: 1.65;
  white-space: pre;
}

:is(.article-body, .article-content, .has-dl-fab .prose, .article-page .prose) pre code {
  padding: 0;
  background: var(--clear);
  color: inherit;
  font: inherit;
}

:is(.article-body, .article-content, .has-dl-fab .prose, .article-page .prose) blockquote {
  margin-inline: 0;
  padding: 0.75rem 1rem;
  border-inline-start: 2px solid var(--accent);
  background: var(--accent-wash);
  color: var(--text);
}

.card.download-note {
  margin-block: var(--notes-chapter-gap) 0;
  padding: var(--card-pad);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--bg-panel);
  box-shadow: none;
}

.card.download-note h2 {
  margin-block: 0 0.5rem;
  font-family: var(--font-display);
  font-size: var(--notes-article-h2);
  font-weight: var(--weight-regular);
  line-height: 1.4;
}

.card.download-note p {
  margin-block: 0 0.875rem;
  color: var(--text-muted);
}

.card.download-note .cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

#related-posts,
#post-nav {
  max-width: var(--notes-related-width);
  margin-block-start: var(--notes-chapter-gap);
}

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

#related-posts > h2 {
  margin-block: 0 0.875rem;
  font-size: var(--notes-article-h2);
}

#post-nav .post-nav-link {
  display: grid;
  align-content: start;
  gap: 0.4rem;
  color: var(--accent-dark);
  text-decoration: none;
}

#post-nav .post-nav-link:hover {
  border-color: var(--accent);
}

#post-nav .post-nav-link:hover .post-nav-link__title {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.post-nav-link__label {
  color: var(--text-muted);
  font-size: var(--notes-meta);
}

.post-nav-link__title {
  line-height: 1.5;
  overflow-wrap: anywhere;
}

@media (max-width: 40rem) {
  :root {
    --notes-index-title: 1.875rem;
    --notes-article-title: 1.5rem;
  }

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

  .notes-hero__chart {
    width: min(55%, 12rem);
  }
}