:root {
  --nn-paper: #f8faf2;
  --nn-white: #fffef9;
  --nn-ink: #203631;
  --nn-muted: #465d56;
  --nn-primary: #005d54;
  --nn-deep: #153934;
  --nn-mint: #e3f2e7;
  --nn-line: #bfcfc1;
  --nn-yellow: #eaf0a4;
  --nn-focus: #7a4113;
}

body { background: var(--nn-paper); color: var(--nn-ink); }
a, a:visited { color: var(--nn-primary); }
a:hover { color: var(--nn-deep); }
:where(a, button, input, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--nn-focus);
  outline-offset: 3px;
}
::selection { background: var(--nn-yellow); color: var(--nn-deep); }
#main, .page__footer, .search-content.is--visible { animation: none; }
#main > .sidebar { opacity: 1; }

.nn-masthead {
  background: var(--nn-white);
  border-block-start: 4px solid var(--nn-deep);
  border-block-end: 1px solid var(--nn-line);
  position: relative;
  z-index: 21;
}
.nn-masthead__inner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 72rem;
  margin-inline: auto;
  padding: 0.6rem 1rem;
}
.nn-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-inline-end: auto;
  min-height: 44px;
  text-decoration: none;
}
.nn-brand img { width: 5.5rem; height: auto; }
.nn-brand span {
  border-inline-start: 1px solid var(--nn-line);
  padding-inline-start: 0.7rem;
  color: var(--nn-muted);
  font: 700 0.58rem/1.35 ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.nn-nav ul {
  display: flex;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nn-nav a, .nn-control {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.25rem 0.55rem;
  border-radius: 0.25rem;
  font: 650 0.75rem/1.35 system-ui, sans-serif;
  text-decoration: none;
}
.nn-nav a:hover, .nn-nav a[aria-current="page"], .nn-control:hover,
.nn-control[aria-expanded="true"], .nn-menu[open] > summary {
  color: var(--nn-deep);
  background: var(--nn-mint);
}
.nn-control {
  justify-content: center;
  min-width: 44px;
  border: 1px solid var(--nn-line);
  color: var(--nn-primary);
  background: transparent;
  cursor: pointer;
}
.nn-search-toggle[hidden], .nn-menu { display: none; }
.nn-menu > summary { list-style: none; }
.nn-menu > summary::-webkit-details-marker { display: none; }
.nn-menu > summary::after {
  content: "";
  width: 0.36rem;
  height: 0.36rem;
  margin: -0.2rem 0 0 0.45rem;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.nn-menu[open] > summary::after { transform: rotate(225deg); margin-top: 0.15rem; }
.nn-nav--compact {
  position: absolute;
  inset: 100% 0 auto;
  padding: 0.4rem 1rem 0.7rem;
  background: var(--nn-white);
  border-block-end: 1px solid var(--nn-line);
  box-shadow: 0 8px 16px #15393420;
}
.nn-nav--compact ul { display: grid; }
.nn-nav--compact a { font-size: 0.9rem; }

.layout--home .archive, .layout--posts .archive { padding-inline-end: 0; }
.layout--home .archive > .page__title:empty { display: none; }
.nn-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.4rem);
  align-items: center;
  padding: clamp(1.2rem, 3vw, 2.6rem);
  margin-block: 0 2.25rem;
  border: 1px solid var(--nn-line);
  border-radius: 0.55rem;
  background-color: var(--nn-mint);
  background-image: radial-gradient(#68887b43 0.7px, transparent 0.7px);
  background-size: 0.65rem 0.65rem;
}
.nn-intro__text { container-type: inline-size; }
.nn-intro h1 {
  margin: 0 0 0.65rem;
  color: var(--nn-deep);
  font: 780 clamp(1.85rem, 4.2vw, 3rem)/1.02 system-ui, sans-serif;
  font-size: clamp(1.85rem, 13cqi, 3rem);
  letter-spacing: -0.055em;
}
.nn-intro__text > p:not(.nn-eyebrow) { max-width: 46ch; font-size: 0.92rem; line-height: 1.55; }
.nn-eyebrow {
  color: var(--nn-primary);
  font: 700 0.66rem/1.5 ui-monospace, monospace;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}
.nn-button, .nn-button:visited {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 44px;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--nn-deep);
  border-radius: 0.25rem;
  background: var(--nn-yellow);
  color: var(--nn-deep);
  font: 700 0.75rem/1.35 system-ui, sans-serif;
  text-decoration: none;
}
.nn-button:hover { background: var(--nn-white); }
.nn-intro__figure { display: block; margin: 0; min-width: 0; }
.nn-intro__figure img {
  display: block;
  margin-block-end: 0;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--nn-line);
  border-radius: 0.35rem;
}
.nn-intro__figure figcaption {
  padding: 0.45rem 0 0;
  margin: 0;
  color: var(--nn-muted);
  font: 650 0.66rem/1.45 ui-monospace, monospace;
}
.nn-intro__figure figcaption a { text-underline-offset: 0.14em; }

.archive__subtitle { color: var(--nn-deep); border-color: var(--nn-line); }
.layout--home h2.archive__subtitle, .layout--home h1.archive__subtitle {
  margin-block-end: 1rem;
  padding-block-start: 0;
  font: 740 1.35rem/1.25 system-ui, sans-serif;
  letter-spacing: -0.03em;
}
.entries-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.entries-grid::after { display: none; }
.entries-grid > .grid__item {
  float: none;
  width: auto;
  margin: 0;
}
.entries-grid > .grid__item .archive__item {
  height: 100%;
  padding: 0.75rem;
  background: var(--nn-white);
  border: 1px solid var(--nn-line);
  border-radius: 0.42rem;
  overflow-wrap: anywhere;
}
.entries-grid .archive__item-teaser {
  max-height: none;
  margin: 0 0 0.7rem;
  background: var(--nn-mint);
  border-radius: 0.24rem;
}
.entries-grid .archive__item-teaser img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
}
.entries-grid .archive__item-title { margin: 0 0 0.3rem; font-size: clamp(0.98rem, 1.6vw, 1.2rem); }
.entries-grid .archive__item-title a { text-decoration: underline; text-underline-offset: 0.15em; }
.entries-grid .archive__item:focus-within { outline: 3px solid var(--nn-focus); outline-offset: 3px; }
.entries-grid .archive__item-excerpt { margin: 0.5rem 0 0; color: var(--nn-muted); }
.page__meta, .page__meta a, .archive .page__meta { color: var(--nn-muted); }

.page__content { overflow-wrap: anywhere; }
.page__content p img, .page__content figure img { max-width: 100%; height: auto; }
.page__content figure figcaption { color: var(--nn-muted); line-height: 1.5; }
.page__content h2, .page__content h3 { scroll-margin-block-start: 1rem; }
.page__content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  font-size: 0.85em;
}
.page__content table th, .page__content table td {
  min-width: 4.75em;
  overflow-wrap: normal;
}
.page__content pre { max-width: 100%; overflow-x: auto; tab-size: 4; }
.sidebar__right:has(> .toc):not(:has(> .toc .toc__menu a)) { display: none; }
.toc { background: var(--nn-white); border-color: var(--nn-line); color: var(--nn-ink); }
.toc .nav__title { background: var(--nn-deep); color: var(--nn-white); }
.toc .toc__menu a { color: var(--nn-primary); padding-block: 0.5em; }
.toc .toc__menu a:hover { background: var(--nn-mint); }
.toc .toc__menu a:focus-visible { outline-offset: -3px; }
.page__footer { background: var(--nn-mint); color: var(--nn-deep); }
.page__footer a { color: var(--nn-primary); }
.page__share .btn--bluesky { background: #1666bf; }
.page__share-title { font-weight: 700; }

.nn-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
  margin-block-start: 1rem;
  color: var(--nn-muted);
  font-size: 0.8rem;
}
.nn-pagination a { display: inline-flex; min-height: 44px; align-items: center; }

.widget-container {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 0.8rem;
  margin-block-start: 1.65rem;
  clear: both;
}
.widget-container .widget { flex: 1 1 12rem; min-width: 0; }
.widget-container img { max-width: 100%; height: auto; }

@media (min-width: 75em) {
  .entries-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 59.99em) {
  .nn-nav--wide { display: none; }
  .nn-menu { display: block; }
}
@media (max-width: 42em) {
  .layout--home #main > .sidebar { display: none; }
  .nn-intro { grid-template-columns: 1fr; }
  .nn-intro__figure img { aspect-ratio: 16 / 9; }
  .toc .toc__menu a { min-height: 44px; display: flex; align-items: center; }
}
@media (max-width: 32em) {
  .entries-grid { grid-template-columns: 1fr; }
  .nn-brand span { display: none; }
}

.nn-scroll-table { max-width: 100%; overflow-x: auto; margin-block-end: 1em; }
.page__content .nn-scroll-table table { display: table; margin: 0; }

.nn-full-image { display: inline-block; position: relative; max-width: 100%; }
.nn-full-image img { display: block; }
.nn-full-image::after {
  content: "Full size";
  position: absolute;
  inset: auto 0.35em 0.35em auto;
  padding: 0.22em 0.5em;
  border-radius: 0.25em;
  background: var(--nn-deep);
  color: var(--nn-white);
  font: 700 0.65rem/1.5 system-ui, sans-serif;
}
