:root {
  color-scheme: light;
  --ink: #1f2e2b;
  --paper: #f6f5ee;
  --line: #d9dfd8;
  --accent: #174f43;
  --muted: #596a63;
  --font: Georgia, "Times New Roman", serif;
  --focus: #99601b;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.75;
  overflow-wrap: break-word;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.24em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

.skip {
  position: fixed;
  inset: 0.75rem auto auto 1rem;
  z-index: 20;
  padding: 0.65rem 1rem;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-200%);
}

.skip:focus {
  transform: translateY(0);
}

.edition {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.125rem;
  padding: 0.625rem 4%;
  border-bottom: 1px solid var(--line);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
}

.edition > :first-child {
  text-transform: uppercase;
}

.edition > :last-child {
  white-space: nowrap;
}

body > header,
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.875rem;
  padding: 1.875rem 4%;
  border-bottom: 1px solid var(--line);
}

.brand {
  max-width: 24.375rem;
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.brand small {
  display: block;
  margin-top: 0.4375rem;
  color: var(--accent);
  font-family: system-ui, sans-serif;
  font-size: 0.6875rem;
  font-weight: 400;
  line-height: 2;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

body > header > nav,
.site-header > nav {
  display: flex;
  align-items: center;
  gap: 1.5625rem;
  font-size: 0.8125rem;
}

body > header > nav a,
.site-header > nav a {
  text-decoration: none;
}

body > header > nav a:hover,
.site-header > nav a:hover {
  text-decoration: underline;
}

.cta {
  flex-shrink: 0;
  padding-block: 0.4375rem;
  border-bottom: 1px solid currentColor;
  font-size: 0.8125rem;
  text-decoration: none;
  white-space: nowrap;
}

main {
  width: 100%;
  max-width: 90.625rem;
  margin-inline: auto;
  padding: 1.875rem 4% 5rem;
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 2.5rem;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.6875rem;
}

.crumbs li + li::before {
  margin-right: 0.5rem;
  content: "/";
  color: #819088;
}

.crumbs a {
  color: inherit;
}

.grid {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr) 14.0625rem;
  gap: 2.75rem;
  align-items: start;
}

.rail {
  padding-right: 1.25rem;
  border-right: 1px solid var(--line);
  font-size: 0.75rem;
}

.rail a {
  display: block;
  margin-block: 0.75rem;
  color: var(--ink);
  text-decoration: none;
}

.rail a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.rail strong,
.eyebrow {
  color: var(--accent);
  font-family: system-ui, sans-serif;
  font-size: 0.625rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

article,
.grid > * {
  min-width: 0;
}

h1,
h2,
h3 {
  font-family: var(--font);
  font-weight: 500;
  overflow-wrap: anywhere;
}

h1 {
  margin: 0.625rem 0 1.625rem;
  font-size: clamp(2.1875rem, 4.3vw, 4.0625rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
}

h2 {
  margin: 0 0 1.25rem;
  font-size: 1.875rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h3 {
  margin: 1.25rem 0 0.75rem;
  font-size: 1.375rem;
  line-height: 1.25;
}

p {
  margin: 0 0 1.1875rem;
}

article :where(ul, ol) {
  padding-left: 1.4rem;
}

article li + li {
  margin-top: 0.5rem;
}

article > section {
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.answer {
  padding-block: 1.5625rem;
  border-top: 3px solid var(--accent);
  font-size: 1.25rem;
  line-height: 1.55;
}

.answer p {
  margin-block: 0.625rem;
}

.note,
.updated {
  color: var(--muted);
  font-size: 0.75rem;
}

.updated {
  display: block;
  margin-block: 0.625rem 1.25rem;
}

.toc {
  margin-block: 1.75rem 2.5rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--line);
  font-size: 0.75rem;
}

.toc ol {
  columns: 2;
  column-gap: 1.5rem;
  margin-bottom: 0;
  padding-left: 1rem;
}

.toc li {
  margin: 0;
  padding-block: 0.1875rem;
  padding-right: 0.75rem;
  break-inside: avoid;
}

.record {
  align-self: start;
  padding-top: 1.25rem;
  border-top: 3px solid var(--ink);
  font-size: 0.75rem;
}

.record h2 {
  font-size: 2.1875rem;
}

.record dl {
  margin-block: 0 1.25rem;
}

.record dt {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.record dd {
  margin: 0.3125rem 0 0;
}

.record :where(a, dd) {
  overflow-wrap: anywhere;
}

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

.entry {
  display: block;
  min-width: 0;
  padding-block: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.entry h3 {
  margin-block: 0.5rem 0.75rem;
}

.entry p {
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
}

.entry small {
  color: var(--muted);
}

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

.paths {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.paths a,
.badge {
  border: 1px solid var(--line);
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
}

.paths a {
  text-decoration: none;
}

.paths a:hover {
  border-color: var(--accent);
  text-decoration: underline;
}

.badge {
  display: inline-block;
  line-height: 1.4;
}

.source-list,
.download-list,
.network-list {
  margin-block: 1rem;
  padding-left: 1.25rem;
}

.source-list li,
.download-list li,
.network-list li {
  margin-block: 0.625rem;
}

.source-list :where(a, code),
.citation {
  overflow-wrap: anywhere;
}

.network-list {
  columns: 2;
  column-gap: 2rem;
}

.network-list li {
  break-inside: avoid;
}

.page-search {
  margin-block: 1.5rem;
}

.page-search label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

.page-search input,
#directory-search {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

#directory-count,
#directory-empty {
  margin-block: 0.625rem 1rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

details {
  padding-block: 1rem;
  border-top: 1px solid var(--line);
}

summary {
  cursor: pointer;
  font-weight: 600;
}

details > :not(summary) {
  margin-top: 0.75rem;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin-block: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  line-height: 1.55;
}

caption {
  margin-bottom: 0.75rem;
  font-weight: 600;
  text-align: left;
}

th,
td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--accent);
  font-weight: 600;
}

.graph {
  max-width: 100%;
  overflow-x: auto;
  margin-top: 1.25rem;
}

.graph svg {
  display: block;
  width: 100%;
  min-width: 35rem;
  color: var(--accent);
}

.graph :where(rect, circle) {
  fill: var(--paper);
  stroke: var(--accent);
}

.graph text {
  fill: var(--ink);
  font: 0.8125rem system-ui, sans-serif;
}

.graph :where(path, line, polyline) {
  stroke: currentColor;
}

.graph-caption,
figcaption {
  margin-top: 0.625rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

.graph-caption {
  text-align: center;
}

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

figure {
  margin: 1.5rem 0;
}

blockquote {
  margin-inline: 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--line);
}

code {
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

body > footer,
.site-footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  padding: 2.375rem 4%;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
}

body > footer nav,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1.125rem;
}

body > footer p,
.site-footer p {
  grid-column: 1 / -1;
  max-width: 56.25rem;
  margin-bottom: 0;
  color: var(--muted);
}

/* Optional editorial skins share the same semantic document structure. */
body.lab {
  --paper: #f3f5fa;
  --ink: #18243b;
  --line: #d6ddea;
  --accent: #284c85;
  --muted: #54647c;
  --font: system-ui, sans-serif;
}

.lab > header {
  background: #13213c;
  color: #fff;
}

.lab > header :where(a, small) {
  color: #fff;
}

.lab .grid {
  max-width: 67.5rem;
  grid-template-columns: minmax(0, 1fr) 15rem;
  margin-inline: auto;
}

.lab .rail {
  display: none;
}

.lab .answer {
  padding: 1.5rem;
  border-top: 0;
  border-left: 4px solid var(--accent);
  background: #e7edfa;
}

.lab :where(.record, .entry, .toc) {
  padding: 1.5rem;
  background: #fff;
}

.lab .entry {
  margin-bottom: 1rem;
  border: 1px solid var(--line);
}

body.atlas {
  --paper: #faf7f0;
  --ink: #392e28;
  --line: #ddd5ca;
  --muted: #75675d;
}

.atlas .brand {
  max-width: 29.375rem;
  font-size: 1.875rem;
}

.atlas .grid {
  max-width: 71.875rem;
  grid-template-columns: 13.125rem minmax(0, 1fr);
  column-gap: 4.0625rem;
  row-gap: 2rem;
  margin-inline: auto;
}

.atlas .rail {
  grid-area: 1 / 1;
  border: 0;
}

.atlas .record {
  grid-area: 2 / 1;
}

.atlas article {
  grid-area: 1 / 2 / 3 / 3;
}

.atlas h1 {
  font-style: italic;
}

.atlas .answer {
  border-block: 1px solid var(--accent);
}

.atlas .edition {
  background: #eadfce;
}

body.journal {
  --paper: #f4f0e5;
  --line: #d4cfbf;
}

.journal > header {
  border-top: 6px solid var(--accent);
}

.journal .grid {
  grid-template-columns: 10.625rem minmax(0, 1fr) 13.75rem;
  gap: 2.25rem;
}

.journal .answer {
  padding: 1.25rem;
  border-top: 0;
  border-left: 3px solid var(--accent);
  background: #eae6da;
}

.journal .record {
  padding: 1.25rem;
  background: #e9e4d7;
}

.journal > footer {
  background: #242d29;
  color: #fff;
}

.journal > footer :where(a, p) {
  color: #fff;
}

@media (max-width: 68.75rem) {
  body > header,
  .site-header {
    flex-wrap: wrap;
  }

  .grid,
  .journal .grid {
    grid-template-columns: minmax(0, 1fr) 13.125rem;
    gap: 1.875rem;
  }

  .rail,
  .atlas .rail {
    display: none;
  }

  .atlas .grid {
    grid-template-columns: minmax(0, 1fr) 13.125rem;
    gap: 2rem;
  }

  .atlas article {
    grid-area: 1 / 1;
  }

  .atlas .record {
    grid-area: 1 / 2;
  }
}

@media (max-width: 45rem) {
  .edition {
    flex-wrap: wrap;
    justify-content: flex-end;
    padding: 0.5625rem 5%;
    font-size: 0.5625rem;
  }

  .edition > :first-child {
    display: none;
  }

  body > header,
  .site-header {
    gap: 1.25rem;
    padding: 1.5rem 5%;
  }

  .brand,
  .atlas .brand {
    max-width: 100%;
    font-size: 1.4375rem;
  }

  body > header > nav,
  .site-header > nav {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
    gap: 0.75rem 1.125rem;
  }

  .cta {
    margin-left: auto;
  }

  main {
    padding: 1.5rem 5% 3.125rem;
  }

  .crumbs ol {
    margin-bottom: 1.5625rem;
  }

  .grid,
  .lab .grid,
  .atlas .grid,
  .journal .grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  .grid > article {
    order: 1;
    width: 100%;
  }

  .record {
    order: 2;
    width: 100%;
  }

  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 1.6875rem;
  }

  .answer {
    font-size: 1.125rem;
  }

  .toc ol,
  .network-list {
    columns: 1;
  }

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

  .graph svg {
    min-width: 31.25rem;
  }

  body > footer,
  .site-footer {
    display: block;
    padding: 1.75rem 5%;
  }

  body > footer nav,
  .site-footer nav {
    justify-content: flex-start;
    margin-block: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
  }
}
