:root {
  --paper: #f5f1e8;
  --paper-raised: #fbf9f4;
  --ink: #171714;
  --muted: #68655f;
  --rule: #c8c2b6;
  --rule-strong: #2e2c29;
  --accent: #1859d1;
  --accent-soft: #e3eaf8;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --reading-size: 19px;
  --header-height: 66px;
  color-scheme: light;
}

html[data-theme="evening"] {
  --paper: #1b1b19;
  --paper-raised: #232320;
  --ink: #f4f0e7;
  --muted: #aaa69d;
  --rule: #45423c;
  --rule-strong: #d8d1c3;
  --accent: #8bb2ff;
  --accent-soft: #26334d;
  color-scheme: dark;
}

html[data-type="large"] {
  --reading-size: 21px;
}

html[data-type="larger"] {
  --reading-size: 23px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 120;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: white;
  background: var(--accent);
  transform: translateY(-150%);
}

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

.reading-progress {
  position: fixed;
  z-index: 110;
  inset: 0 0 auto;
  height: 3px;
  background: transparent;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 120ms linear;
}

.site-header {
  position: sticky;
  z-index: 80;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header-height);
  padding: 0 24px;
  border-bottom: 1px solid var(--rule-strong);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(16px);
}

.menu-button {
  display: grid;
  gap: 4px;
  width: 42px;
  height: 42px;
  padding: 12px 10px;
  border: 0;
  background: transparent;
}

.menu-button span {
  display: block;
  height: 1.5px;
  background: var(--ink);
}

.masthead {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 6px 12px;
  border: 0;
  background: transparent;
}

.masthead-product {
  font-weight: 800;
  letter-spacing: -0.04em;
}

.masthead-title {
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
}

.header-tools {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
}

.text-button {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.type-large {
  font-size: 18px;
}

.eyebrow,
.article-kicker,
.rail-label,
.issue-line {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.issue-line {
  display: flex;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto;
  padding: 15px 24px;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
}

.home-view {
  padding-bottom: 90px;
}

.home-hero {
  max-width: 980px;
  margin: 0 auto;
  padding: 88px 32px 74px;
  text-align: center;
}

.home-hero h1 {
  max-width: 900px;
  margin: 20px auto 24px;
  font-family: var(--serif);
  font-size: clamp(48px, 8vw, 104px);
  font-weight: 400;
  line-height: 0.93;
  letter-spacing: -0.065em;
}

.home-deck {
  max-width: 720px;
  margin: 0 auto 32px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(20px, 2.5vw, 28px);
  line-height: 1.35;
}

.primary-link {
  padding: 13px 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--paper);
  background: var(--ink);
  font-weight: 750;
}

.featured-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  max-width: 1180px;
  margin: 0 auto;
  border-top: 2px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
}

.feature-card {
  min-height: 290px;
  padding: 24px;
  border-right: 1px solid var(--rule);
  background: transparent;
}

.feature-card:last-child {
  border-right: 0;
}

.feature-card:first-child {
  min-height: 390px;
}

.feature-card button,
.content-row button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.feature-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 20px;
  border: 1px solid var(--rule);
  object-fit: cover;
}

.card-kicker {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.feature-card h2 {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 46px);
  font-weight: 400;
  line-height: 1.03;
  letter-spacing: -0.035em;
}

.feature-card:not(:first-child) h2 {
  font-size: clamp(24px, 2.4vw, 34px);
}

.feature-card p:last-child {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.45;
}

.contents-section {
  max-width: 1180px;
  margin: 80px auto 0;
  padding: 0 24px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 3px double var(--rule-strong);
}

.section-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
}

.content-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1.6fr) minmax(240px, 1fr) auto;
  gap: 24px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}

.content-number {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 30px;
}

.content-row h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 400;
  line-height: 1.12;
}

.content-row p {
  margin: 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.45;
}

.content-meta {
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.navigation-drawer {
  position: fixed;
  z-index: 100;
  inset: 0 auto 0 0;
  width: min(430px, 92vw);
  padding: 22px;
  overflow-y: auto;
  border-right: 1px solid var(--rule-strong);
  background: var(--paper-raised);
  transform: translateX(-102%);
  transition: transform 240ms ease;
}

body.drawer-open {
  overflow: hidden;
}

body.drawer-open .navigation-drawer {
  transform: translateX(0);
}

.drawer-backdrop {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: none;
  border: 0;
  background: rgb(0 0 0 / 0.42);
}

body.drawer-open .drawer-backdrop {
  display: block;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule-strong);
}

.drawer-header button {
  padding: 8px;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.search-field {
  display: block;
  margin: 18px 0 24px;
}

.search-field input {
  width: 100%;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--rule-strong);
  outline: none;
  background: transparent;
  font-family: var(--serif);
  font-size: 20px;
}

.drawer-group {
  margin: 26px 0;
}

.drawer-group-title {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.drawer-link {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  width: 100%;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 55%, transparent);
  background: transparent;
  text-align: left;
}

.drawer-link[aria-current="page"] {
  color: var(--accent);
}

.drawer-index {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 13px;
}

.drawer-title {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.25;
}

.jump-group {
  margin: 28px 0 12px;
  padding-top: 18px;
  border-top: 2px solid var(--rule-strong);
}

.jump-link {
  display: block;
  width: 100%;
  padding: 7px 0 7px 12px;
  border: 0;
  border-left: 1px solid var(--rule);
  background: transparent;
  color: var(--muted);
  font-family: var(--serif);
  text-align: left;
}

.jump-link.level-3 {
  padding-left: 28px;
  font-size: 14px;
}

.article-view {
  padding-bottom: 80px;
}

.article-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 760px);
  gap: 72px;
  justify-content: center;
  max-width: 1160px;
  margin: 0 auto;
  padding: 60px 32px 0;
}

.article-rail {
  position: sticky;
  top: calc(var(--header-height) + 30px);
  align-self: start;
  max-height: calc(100vh - var(--header-height) - 60px);
  overflow: auto;
}

.rail-label {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule-strong);
}

.article-rail a {
  display: block;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.25;
  text-decoration: none;
}

.article-rail a.level-3 {
  padding-left: 14px;
  font-size: 12px;
}

.article-rail a.active {
  color: var(--accent);
}

.article-header {
  padding-bottom: 38px;
  border-bottom: 1px solid var(--rule-strong);
}

.breadcrumb {
  margin-bottom: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.article-kicker {
  color: var(--muted);
}

.article-header h1 {
  margin: 12px 0 22px;
  font-family: var(--serif);
  font-size: clamp(44px, 7vw, 78px);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.article-deck {
  margin: 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.38;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.article-image {
  margin: 34px 0 0;
}

.article-image img {
  display: block;
  width: 100%;
  max-height: 680px;
  border: 1px solid var(--rule);
  object-fit: cover;
}

.article-image figcaption {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.article-image figcaption a {
  margin-left: 0.45em;
  color: inherit;
}

.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.8em auto;
}

.article-body {
  padding-top: 28px;
  font-family: var(--serif);
  font-size: var(--reading-size);
  line-height: 1.65;
}

.article-body > p:first-child {
  font-size: calc(var(--reading-size) + 3px);
}

.article-body h2 {
  margin: 2.7em 0 0.75em;
  padding-top: 0.3em;
  border-top: 1px solid var(--rule-strong);
  font-size: 1.8em;
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.035em;
  scroll-margin-top: calc(var(--header-height) + 22px);
}

.article-body h3 {
  margin: 2.1em 0 0.6em;
  font-family: var(--sans);
  font-size: 1.02em;
  font-weight: 800;
  line-height: 1.25;
  scroll-margin-top: calc(var(--header-height) + 22px);
}

.article-body p {
  margin: 0 0 1.2em;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.35em;
  padding-left: 1.35em;
}

.article-body li {
  margin: 0.42em 0;
  padding-left: 0.3em;
}

.article-body blockquote {
  margin: 1.8em 0;
  padding: 0.2em 0 0.2em 1em;
  border-left: 3px solid var(--accent);
  color: var(--ink);
  font-size: 1.22em;
  font-style: italic;
  line-height: 1.45;
}

.article-body blockquote p {
  margin: 0;
}

.article-body code {
  padding: 0.13em 0.3em;
  border-radius: 3px;
  background: var(--accent-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78em;
}

.article-body pre {
  max-width: 100%;
  padding: 18px;
  overflow-x: auto;
  border: 1px solid var(--rule);
  background: var(--paper-raised);
}

.article-body pre code {
  padding: 0;
  background: transparent;
}

.article-body table {
  display: block;
  width: 100%;
  margin: 1.8em 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.72em;
  line-height: 1.4;
}

.article-body th,
.article-body td {
  min-width: 150px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.article-body th {
  border-top: 1px solid var(--rule-strong);
  border-bottom-color: var(--rule-strong);
}

.article-body hr {
  margin: 3em 0;
  border: 0;
  border-top: 3px double var(--rule-strong);
}

.article-body strong {
  font-weight: 700;
}

.article-source {
  margin-top: 64px;
  padding: 18px 0;
  border-top: 3px double var(--rule-strong);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.article-source p:last-child {
  overflow-wrap: anywhere;
}

.next-previous {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 980px;
  margin: 80px auto 0;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
}

.next-previous button {
  min-height: 130px;
  padding: 24px;
  border: 0;
  background: transparent;
  font-family: var(--serif);
  font-size: 22px;
  text-align: left;
}

.next-previous button:last-child {
  border-left: 1px solid var(--rule);
  text-align: right;
}

.next-previous button:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.45;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border-top: 1px solid var(--rule-strong);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.site-footer button {
  padding: 0;
  border: 0;
  background: transparent;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.loading-screen {
  position: fixed;
  z-index: 140;
  inset: 0;
  display: grid;
  place-content: center;
  background: var(--paper);
  text-align: center;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.loading-screen.loaded {
  visibility: hidden;
  opacity: 0;
}

.loading-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 34px;
  font-style: italic;
}

.loading-screen p {
  color: var(--muted);
  font-family: var(--serif);
}

@media (max-width: 900px) {
  .featured-grid {
    grid-template-columns: 1fr 1fr;
    margin: 0 20px;
  }

  .feature-card:first-child {
    grid-column: 1 / -1;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .article-shell {
    display: block;
    max-width: 780px;
    padding-top: 46px;
  }

  .article-rail {
    display: none;
  }

  .content-row {
    grid-template-columns: 54px minmax(0, 1fr) auto;
  }

  .content-row p {
    display: none;
  }
}

@media (max-width: 640px) {
  :root {
    --reading-size: 18px;
    --header-height: 58px;
  }

  html[data-type="large"] {
    --reading-size: 20px;
  }

  html[data-type="larger"] {
    --reading-size: 22px;
  }

  .site-header {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    height: var(--header-height);
    padding: 0 8px;
  }

  .masthead {
    justify-content: center;
    gap: 6px;
    overflow: hidden;
  }

  .masthead-product {
    font-size: 14px;
  }

  .masthead-title {
    font-size: 18px;
  }

  .header-tools {
    justify-content: flex-end;
  }

  #type-button {
    display: none;
  }

  .tool-label {
    display: none;
  }

  .text-button {
    justify-content: center;
    width: 42px;
    padding: 8px;
    font-size: 18px;
  }

  .issue-line {
    padding: 12px 16px;
    font-size: 9px;
  }

  .home-hero {
    padding: 62px 20px 54px;
    text-align: left;
  }

  .home-hero h1 {
    margin-left: 0;
    font-size: clamp(48px, 16vw, 72px);
    line-height: 0.96;
  }

  .home-deck {
    margin-left: 0;
    font-size: 20px;
  }

  .featured-grid {
    display: block;
    margin: 0 16px;
  }

  .feature-card,
  .feature-card:first-child {
    min-height: 0;
    padding: 22px 0;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .feature-card:last-child {
    border-bottom: 0;
  }

  .feature-card h2,
  .feature-card:not(:first-child) h2 {
    font-size: 31px;
  }

  .contents-section {
    margin-top: 58px;
    padding: 0 16px;
  }

  .section-heading {
    display: block;
  }

  .section-heading h2 {
    margin-top: 8px;
  }

  .content-row {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    padding: 18px 0;
  }

  .content-number {
    font-size: 20px;
  }

  .content-row h3 {
    font-size: 21px;
  }

  .content-meta {
    grid-column: 2;
    margin-top: -2px;
  }

  .article-shell {
    padding: 34px 18px 0;
  }

  .breadcrumb {
    margin-bottom: 34px;
  }

  .article-header {
    padding-bottom: 28px;
  }

  .article-header h1 {
    font-size: clamp(43px, 13vw, 62px);
    line-height: 0.99;
  }

  .article-deck {
    font-size: 20px;
  }

  .article-meta {
    gap: 12px;
    font-size: 9px;
  }

  .article-body h2 {
    font-size: 1.55em;
  }

  .article-body blockquote {
    margin-left: 0;
    margin-right: 0;
    font-size: 1.1em;
  }

  .next-previous {
    display: block;
    margin-top: 56px;
  }

  .next-previous button {
    width: 100%;
    min-height: 96px;
    padding: 18px;
    font-size: 19px;
  }

  .next-previous button:last-child {
    border-top: 1px solid var(--rule);
    border-left: 0;
    text-align: left;
  }

  .site-footer {
    flex-wrap: wrap;
    padding: 20px 16px;
  }
}

@media print {
  .site-header,
  .reading-progress,
  .navigation-drawer,
  .drawer-backdrop,
  .article-rail,
  .next-previous,
  .site-footer {
    display: none !important;
  }

  .article-shell {
    display: block;
    max-width: none;
    padding: 0;
  }

  .article-body {
    font-size: 12pt;
  }
}
