:root {
  --ink: #121821;
  --paper: #f5f1e8;
  --paper-2: #fffaf0;
  --line: rgba(18, 24, 33, 0.14);
  --line-strong: rgba(18, 24, 33, 0.28);
  --green: #168967;
  --blue: #2d73c9;
  --gold: #c9972e;
  --muted: #5f6873;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", "Inter", "Noto Sans", Arial, sans-serif;
  line-height: 1.68;
  letter-spacing: 0;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 3px solid rgba(45, 115, 201, 0.34);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--white);
  transform: translateY(-160%);
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 241, 232, 0.96);
  backdrop-filter: blur(10px);
}

.nav,
.page-width,
.footer-inner {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

.nav {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 700;
}

.brand img {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.navlinks {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.navlinks a[aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-transform: uppercase;
}

.section-label::before {
  content: "";
  width: 36px;
  height: 2px;
  background: var(--gold);
}

.page-header,
.article-header {
  border-bottom: 1px solid var(--line);
}

.page-header .page-width,
.article-header .page-width {
  padding: 80px 0 64px;
}

h1,
h2,
h3 {
  letter-spacing: 0;
}

h1 {
  max-width: 900px;
  margin: 0;
  font-size: 64px;
  line-height: 1.08;
}

.dek {
  max-width: 800px;
  margin: 24px 0 0;
  color: #2b3742;
  font-size: 21px;
  line-height: 1.55;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.research-index {
  padding: 56px 0 88px;
}

.index-intro {
  max-width: 760px;
  margin-bottom: 52px;
  font-size: 18px;
}

.note-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
  list-style: none;
}

.note-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 28px;
  padding: 30px 0 34px;
  border-bottom: 1px solid var(--line);
}

.note-number {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.note-item h2 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.22;
}

.note-item p {
  max-width: 760px;
  margin: 0 0 14px;
  color: #2b3742;
  font-size: 17px;
}

.note-link {
  font-weight: 700;
}

.research-subscribe {
  border-top: 1px solid var(--line-strong);
  background: var(--ink);
  color: var(--white);
}

.subscribe-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
  gap: 72px;
  align-items: center;
  padding: 64px 0 70px;
}

.research-subscribe .section-label {
  color: rgba(255, 255, 255, 0.68);
}

.research-subscribe h2 {
  margin: 0 0 14px;
  font-size: 34px;
  line-height: 1.2;
}

.research-subscribe p {
  max-width: 650px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 17px;
}

.subscribe-form label {
  display: block;
  margin-bottom: 9px;
  font-size: 14px;
  font-weight: 700;
}

.subscribe-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.subscribe-fields input,
.subscribe-fields button {
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  font: inherit;
}

.subscribe-fields input {
  min-width: 0;
  padding: 10px 13px;
  background: var(--white);
  color: var(--ink);
}

.subscribe-fields button {
  padding: 10px 20px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 750;
  cursor: pointer;
}

.subscribe-fields button:hover {
  background: #d8aa45;
}

.subscribe-fields input:focus-visible,
.subscribe-fields button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.42);
  outline-offset: 3px;
}

.research-subscribe .privacy-note {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
  line-height: 1.5;
}

.article-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 210px minmax(0, 760px);
  justify-content: space-between;
  gap: 64px;
  padding: 56px 0 96px;
}

.contents {
  align-self: start;
  position: sticky;
  top: 92px;
  padding-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.contents strong {
  display: block;
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 14px;
}

.contents ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.contents li {
  margin: 0 0 9px;
}

.contents a {
  color: var(--muted);
}

.article-body {
  min-width: 0;
}

.article-body > p,
.article-body > ul,
.article-body > ol {
  font-size: 18px;
}

.article-body p {
  margin: 0 0 19px;
}

.article-body h2 {
  margin: 64px 0 20px;
  padding-top: 8px;
  font-size: 34px;
  line-height: 1.2;
}

.article-body h2:first-child {
  margin-top: 0;
}

.article-body h3 {
  margin: 38px 0 14px;
  font-size: 24px;
  line-height: 1.3;
}

.article-body ul,
.article-body ol {
  margin: 0 0 24px;
  padding-left: 24px;
}

.article-body li {
  margin: 8px 0;
}

.path {
  margin: 30px 0;
  padding: 24px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--ink);
  color: #f8f5ed;
  font-family: "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
  font-size: 15px;
  line-height: 1.7;
  white-space: pre;
}

.working-note {
  margin: 28px 0;
  padding: 4px 0 4px 22px;
  border-left: 4px solid var(--green);
}

.working-note strong {
  display: block;
  margin-bottom: 6px;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  margin: 30px 0 34px;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: rgba(255, 250, 240, 0.48);
  font-size: 14px;
  line-height: 1.5;
}

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

th {
  background: rgba(18, 24, 33, 0.06);
  font-weight: 700;
}

.references {
  font-size: 16px;
}

.closing-line {
  margin-top: 48px;
  padding-top: 30px;
  border-top: 1px solid var(--line-strong);
  font-size: 24px;
  font-weight: 750;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  color: var(--muted);
  font-size: 14px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

@media (max-width: 860px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 14px 0;
  }

  .navlinks {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px 16px;
    overflow-x: visible;
    padding-bottom: 4px;
    white-space: normal;
  }

  .page-header .page-width,
  .article-header .page-width {
    padding: 58px 0 48px;
  }

  h1 {
    font-size: 46px;
  }

  .article-shell {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .contents {
    position: static;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
  }

  .contents ol {
    columns: 2;
    column-gap: 28px;
  }

  .subscribe-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 600px) {
  h1 {
    font-size: 40px;
  }

  .dek {
    font-size: 18px;
  }

  .note-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .note-item h2 {
    font-size: 26px;
  }

  .article-body h2 {
    margin-top: 52px;
    font-size: 30px;
  }

  .article-body h3 {
    font-size: 22px;
  }

  .article-body > p,
  .article-body > ul,
  .article-body > ol {
    font-size: 17px;
  }

  .contents ol {
    columns: 1;
  }

  .path {
    margin-right: -8px;
    margin-left: -8px;
    padding: 18px;
    font-size: 13px;
  }

  .table-wrap {
    width: 100%;
  }

  .subscribe-fields {
    grid-template-columns: 1fr;
  }

  .subscribe-fields button {
    width: 100%;
  }
}
