:root {
  --ink: #070708;
  --ink-raised: #121214;
  --line: rgba(255, 255, 255, 0.1);
  --teal: #0fb194;
  --teal-deep: #0c8d76;
  --paper: #f6f5f2;
  --card: #ffffff;
  --text: #1c1917;
  --muted: #6f6a64;
  --muted-dark: #a8a29e;
  --white: #f7f7f5;
  --font: "Inter", ui-sans-serif, system-ui, sans-serif;
  --shell: 1180px;
  --header: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.screen-reader-text,
.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
}

.skip-link:focus {
  left: 8px;
  z-index: 100;
  background: var(--white);
  color: var(--ink);
  padding: 8px 12px;
}

.shell {
  width: min(var(--shell), calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(7, 7, 8, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.header-bar {
  min-height: var(--header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: grid;
  grid-template-columns: 32px auto;
  column-gap: 10px;
  align-items: center;
  flex: 0 0 auto;
}

.brand img {
  width: 32px;
  height: 32px;
  grid-row: span 2;
}

.brand-lockup {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-dark);
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0 16px 0 0;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  color: var(--muted-dark);
  font-size: 14px;
  font-weight: 500;
}

.nav-list a:hover,
.nav-list .current-menu-item > a,
.nav-list .current_page_item > a {
  color: var(--white);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  background: transparent;
}

.nav-cta:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--white);
  padding: 0;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--white);
  position: relative;
  margin: 0 auto;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before { top: -5px; }
.nav-toggle-bars::after { top: 5px; }

.mast,
.article-hero,
.feature {
  position: relative;
  isolation: isolate;
  background: var(--ink);
}

.mast::before,
.article-hero::before,
.feature::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../img/bck.png");
  background-repeat: repeat-x;
  background-position: top left;
  opacity: 0.45;
  pointer-events: none;
}

.mast > .shell,
.article-hero > .shell,
.feature > .shell {
  position: relative;
  z-index: 1;
}

.mast {
  padding: 72px 0 28px;
}

.mast-compact {
  padding: 56px 0 36px;
}

.kicker,
.article-date,
.section-label,
.toc-label,
.related-label,
.rail-label,
.footer-label {
  margin: 0 0 14px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mast-title,
.article-title {
  margin: 0;
  max-width: 16em;
  font-size: clamp(2.5rem, 5vw, 4.25rem);
  font-weight: 500;
  letter-spacing: -0.038em;
  line-height: 1.02;
}

.mast-dek,
.article-dek {
  max-width: 40rem;
  margin: 18px 0 0;
  color: var(--muted-dark);
  font-size: 1.05rem;
  line-height: 1.55;
}

.mast-actions {
  margin-top: 28px;
}

.feature {
  padding: 12px 0 64px;
}

.feature-link {
  display: block;
}

.feature-media,
.article-figure {
  margin: 28px 0 0;
  overflow: hidden;
  background: #000;
}

.feature-media img,
.article-figure img,
.related-media img,
.post-row-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature-media img,
.article-figure img {
  aspect-ratio: 16 / 8.2;
}

.feature-copy {
  max-width: 46rem;
  padding-top: 22px;
}

.feature-copy time,
.post-row time,
.related-card time {
  display: block;
  margin-bottom: 8px;
  color: var(--muted-dark);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.feature-copy h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.feature-copy p,
.feature-by {
  color: var(--muted-dark);
}

.feature-copy p {
  margin: 12px 0 0;
  font-size: 1.02rem;
  line-height: 1.55;
}

.feature-by {
  display: inline-block;
  margin-top: 16px;
  font-size: 14px;
}

.article-hero {
  padding: 56px 0 0;
}

.article-hero .shell {
  padding-bottom: 56px;
}

.article-title {
  max-width: 14em;
}

.byline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 0;
  color: var(--white);
  font-size: 14px;
  max-width: 46rem;
}

.byline-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #04241e;
  font-size: 13px;
  font-weight: 700;
}

.article-body {
  background: var(--paper);
  color: var(--text);
}

.article-grid {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 270px;
  gap: 48px 36px;
  padding: 56px 0 88px;
  align-items: start;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 720px);
  padding: 56px 0 88px;
}

.toc {
  position: sticky;
  top: calc(var(--header) + 24px);
  max-height: calc(100vh - var(--header) - 48px);
  overflow: auto;
}

.toc.is-empty {
  display: none;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid rgba(28, 25, 23, 0.12);
}

.toc a {
  display: block;
  padding: 7px 0 7px 14px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.35;
}

.toc li.is-sub a {
  padding-left: 26px;
  font-size: 13px;
}

.toc a:hover,
.toc a.is-active {
  color: var(--text);
  border-left-color: var(--teal);
}

.entry-content {
  font-size: 1.0625rem;
  line-height: 1.75;
  min-width: 0;
}

.entry-content > *:first-child {
  margin-top: 0;
}

.entry-content p,
.entry-content ul,
.entry-content ol,
.entry-content figure,
.entry-content blockquote,
.entry-content table {
  margin: 0 0 1.15em;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  letter-spacing: -0.03em;
  line-height: 1.2;
  scroll-margin-top: calc(var(--header) + 20px);
}

.entry-content h2 {
  margin: 1.8em 0 0.55em;
  font-size: 1.7rem;
}

.entry-content h3 {
  margin: 1.5em 0 0.4em;
  font-size: 1.25rem;
}

.entry-content a {
  color: var(--teal-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.entry-content ul,
.entry-content ol {
  padding-left: 1.2em;
}

.entry-content li + li {
  margin-top: 0.35em;
}

.entry-content img,
.entry-content figure {
  border-radius: 2px;
}

.entry-content figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.entry-content blockquote {
  margin-left: 0;
  padding-left: 16px;
  border-left: 2px solid var(--teal);
  color: #3f3a36;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  font-size: 0.92rem;
}

.entry-content th,
.entry-content td {
  border-bottom: 1px solid rgba(28, 25, 23, 0.12);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.related-label {
  color: var(--muted);
}

.related {
  position: sticky;
  top: calc(var(--header) + 24px);
}

.related-list {
  display: grid;
  gap: 16px;
}

.related-card {
  display: block;
  background: var(--ink);
  color: var(--white);
  border-radius: 4px;
  overflow: hidden;
}

.related-media {
  aspect-ratio: 16 / 9;
  background: #1a1a1c;
}

.related-card time,
.related-card h2,
.related-card p {
  margin-left: 14px;
  margin-right: 14px;
}

.related-card time {
  margin-top: 12px;
  color: var(--teal);
}

.related-card h2 {
  margin: 0 14px;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.related-card p {
  margin: 8px 14px 14px;
  color: var(--muted-dark);
  font-size: 0.86rem;
  line-height: 1.45;
}

.paper {
  background: var(--paper);
  color: var(--text);
}

.list-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 56px;
  padding: 56px 0 88px;
  align-items: start;
}

.section-label {
  color: var(--muted);
}

.post-row + .post-row {
  border-top: 1px solid rgba(28, 25, 23, 0.1);
}

.post-row-link {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 22px;
  padding: 22px 0;
}

.post-row-media {
  aspect-ratio: 16 / 10;
  background: #e7e4de;
  overflow: hidden;
}

.post-row time {
  color: var(--muted);
}

.post-row h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.post-row p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.post-row-link:hover h2 {
  color: var(--teal-deep);
}

.rail {
  position: sticky;
  top: calc(var(--header) + 24px);
}

.topic-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.topic-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(28, 25, 23, 0.1);
  font-size: 14px;
}

.topic-list a:hover {
  color: var(--teal-deep);
}

.topic-count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.navigation.pagination {
  margin-top: 28px;
}

.nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(28, 25, 23, 0.14);
  border-radius: 999px;
  font-size: 14px;
}

.page-numbers.current,
.page-numbers:hover {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.site-footer {
  background: var(--ink);
  color: var(--white);
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 0.7fr 1fr;
  gap: 36px;
  padding: 48px 0 32px;
}

.footer-blurb {
  max-width: 28rem;
  margin: 16px 0 0;
  color: var(--muted-dark);
  line-height: 1.55;
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li + li {
  margin-top: 8px;
}

.footer-col a:hover {
  color: var(--teal);
}

.footer-label {
  color: var(--muted-dark);
}

.search-form {
  display: flex;
  gap: 8px;
}

.search-form input {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--white);
}

.search-form input::placeholder {
  color: var(--muted-dark);
}

.search-form button {
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #04241e;
  font-weight: 600;
  cursor: pointer;
}

.footer-base {
  border-top: 1px solid var(--line);
  padding: 16px 0 28px;
  color: var(--muted-dark);
  font-size: 13px;
}

.footer-base p {
  margin: 0;
}

.empty-state {
  padding: 72px 0;
}

@media (max-width: 980px) {
  .article-grid,
  .list-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .toc,
  .rail,
  .related {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .toc ol {
    display: flex;
    gap: 0;
    overflow-x: auto;
    border-left: 0;
    border-bottom: 1px solid rgba(28, 25, 23, 0.12);
    padding-bottom: 8px;
  }

  .toc a,
  .toc li.is-sub a {
    white-space: nowrap;
    border-left: 0;
    border-bottom: 2px solid transparent;
    padding: 8px 12px;
    margin: 0;
  }

  .toc a.is-active {
    border-bottom-color: var(--teal);
  }

  .related {
    order: 3;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(var(--shell), calc(100% - 32px));
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .primary-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: var(--header);
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 16px 20px;
    background: var(--ink);
    border-bottom: 1px solid var(--line);
  }

  .primary-nav.is-open {
    display: flex;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
  }

  .nav-cta {
    justify-content: center;
  }

  .mast,
  .article-hero {
    padding-top: 36px;
  }

  .post-row-link {
    grid-template-columns: 1fr;
  }

  .post-row-media {
    max-height: 220px;
  }

  .feature-media img,
  .article-figure img {
    aspect-ratio: 16 / 10;
  }
}
