:root {
  color-scheme: light;
  --paper: #f8f2e6;
  --ink: #1d1a5e;
  --text: #303141;
  --muted: #68675f;
  --rule: #d1cbbb;
  --vermilion: #e2552d;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", Georgia, serif;
  --sans: system-ui, "Hiragino Sans", "Noto Sans JP", sans-serif;
}

html {
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background-image: linear-gradient(rgb(29 26 94 / 0.025) 1px, transparent 1px), linear-gradient(90deg, rgb(29 26 94 / 0.025) 1px, transparent 1px);
  background-size: 24px 24px;
}

.edition-bar,
main,
.skip-link {
  box-sizing: border-box;
}

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

flecto-site-header {
  min-height: 4rem;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.75rem;
  left: 1rem;
  max-width: calc(100% - 2rem);
  padding: 0.65rem 1rem;
  transform: translateY(calc(-100% - 1rem));
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
}

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

.edition-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.75rem;
  max-width: 80rem;
  margin-inline: auto;
  padding: 0.5rem 1.25rem;
  border-bottom: 1px solid var(--ink);
  color: var(--ink);
  font-size: 0.75rem;
  line-height: 1.4;
  letter-spacing: 0.055em;
}

.paper-id {
  font-variant-numeric: tabular-nums;
}

.languages {
  display: flex;
  gap: 0.25rem;
}

.languages a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  color: inherit;
  text-decoration: none;
}

.languages a[aria-current] {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.5rem;
}

main a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

main a:hover,
.languages a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.skip-link:focus-visible,
.languages a:focus-visible,
main a:focus-visible,
.table-scroll:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.hero {
  display: flex;
  flex-direction: column;
  max-width: 90rem;
  margin-inline: auto;
  border-bottom: 1px solid var(--ink);
}

.hero-art {
  height: 15.625rem;
  background-color: var(--paper);
  background-image: url(assets/bg_hero.png);
  background-repeat: no-repeat;
  background-size: auto 100%;
  background-position: 129% center;
}

.hero-content {
  min-width: 0;
  padding: 1.75rem 1.25rem 2.5rem;
}

.kicker {
  max-width: 42em;
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.6875rem;
  line-height: 1.8;
  letter-spacing: 0.035em;
}

h1,
h2 {
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 600;
  text-wrap: balance;
}

h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.22;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.original {
  margin: 1.5rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.7;
}

.article-body {
  width: calc(100% - 2.5rem);
  max-width: 68ch;
  margin: 0 auto;
  padding-block: 2.5rem 5rem;
  font-size: 1rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.article-body p {
  margin: 0 0 1.35em;
  text-wrap: pretty;
}

.article-body strong {
  color: var(--ink);
  font-weight: 650;
}

.introduction {
  padding-bottom: 0.75rem;
}

.introduction > p:first-child {
  color: var(--ink);
  font-size: 1.0625em;
}

.article-section {
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 2rem;
}

.article-section h2 {
  margin: 0 0 1.4rem;
  font-size: 1.5rem;
  line-height: 1.35;
  letter-spacing: -0.025em;
}

.section-no {
  display: block;
  margin-bottom: 0.65rem;
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
}

.article-body ul,
.article-body ol {
  margin: 1.25rem 0 1.75rem;
  padding-inline-start: 1.4em;
}

.article-body li {
  padding-inline-start: 0.2em;
  text-wrap: pretty;
}

.article-body li + li {
  margin-top: 0.9em;
}

.article-body li::marker {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.article-body p.stage-title {
  margin: 2rem 0 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--ink);
  background: #eae6dc;
  color: var(--ink);
  font-size: 0.9375em;
}

.stage-title strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.5;
}

.article-body .stage-title + ul {
  margin: 0 0 1.5rem;
  padding: 1.1rem 1rem 1.25rem;
  border: 1px solid var(--ink);
  border-top: 0;
  background: rgb(255 253 247 / 0.6);
  list-style: none;
}

.stage-title + ul > li {
  padding: 0;
}

.stage-title + ul > li + li {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.stage-title + ul em {
  color: var(--ink);
  font-style: normal;
  font-weight: 650;
}

.paper-figure {
  margin: 2rem 0;
}

.paper-figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  padding: 0.4rem;
  border: 1px solid var(--rule);
  background: #fff;
}

.paper-figure figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.7;
  text-wrap: pretty;
}

.table-scroll {
  max-width: 100%;
  margin-block: 1.75rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-color: #827e91 #ebe5d8;
  scrollbar-width: thin;
  border-block: 2px solid var(--ink);
  background: rgb(255 253 247 / 0.5);
}

.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text);
  font-size: 0.8125rem;
  line-height: 1.6;
  overflow-wrap: normal;
}

.table-scroll th,
.table-scroll td {
  padding: 0.8rem 0.9rem;
  text-align: left;
  vertical-align: top;
}

.table-scroll th {
  border-bottom: 1px solid var(--ink);
  background: #eae6dc;
  color: var(--ink);
  font-weight: 650;
}

.table-scroll td {
  border-bottom: 1px solid var(--rule);
}

.table-scroll tbody tr:last-child td {
  border-bottom: 0;
}

.table-scroll th:first-child,
.table-scroll td:first-child {
  min-width: 9rem;
}

.table-scroll .num {
  text-align: right;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}

.source-ref {
  color: var(--muted);
  font-size: 0.78em;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.7;
}

.article-body .source-line {
  margin-top: -0.6rem;
  line-height: 1.6;
}

code {
  padding: 0.12em 0.3em;
  border: 1px solid #d9d2c5;
  background: #eee8dc;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.86em;
  overflow-wrap: anywhere;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.anchor {
  display: block;
  height: 0;
  visibility: hidden;
  scroll-margin-top: 2rem;
}

.article-body p.reading-note {
  margin-block: 2rem;
  padding: 1.1rem 1.1rem 1.1rem 1.25rem;
  border: 1px solid #d8c3b3;
  border-left: 3px solid var(--vermilion);
  background: #f3e8d9;
  font-size: 0.9375em;
}

.reading-note em {
  display: block;
  margin-bottom: 0.5rem;
  color: #9e371d;
  font-style: normal;
  font-weight: 650;
}

.article-body .assessment {
  margin-top: 3.5rem;
  padding: 1.5rem 1rem 0.25rem 1.25rem;
  border: 1px solid #d8c3b3;
  border-left: 3px solid var(--vermilion);
  background: #f3e8d9;
}

.assessment .section-no {
  color: #9e371d;
}

.assessment > p:first-of-type {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #d8c3b3;
  font-size: 0.9375em;
}

:lang(ja) .article-body {
  max-width: 40em;
  line-height: 1.9;
  line-break: strict;
  word-break: normal;
}

:lang(ja) h1 {
  font-size: 1.875rem;
  line-height: 1.45;
  letter-spacing: -0.035em;
  line-break: strict;
}

:lang(ja) h2 {
  font-size: 1.375rem;
  line-height: 1.45;
  line-break: strict;
}

:lang(ja) .stage-title strong {
  line-height: 1.45;
}

@media (min-width: 600px) {
  .edition-bar {
    padding-inline: 2.5rem;
  }

  .hero-content {
    order: -1;
    width: 100%;
    padding: 2.75rem 2.5rem 1.5rem;
  }

  .hero-art {
    height: auto;
    aspect-ratio: 1852 / 849;
    background-size: contain;
    background-position: center bottom;
  }

  h1 {
    max-width: 27ch;
    font-size: 2.5rem;
  }

  .kicker {
    font-size: 0.75rem;
  }

  .article-body {
    width: calc(100% - 6rem);
    padding-block: 3.5rem 6rem;
    font-size: 1.0625rem;
  }

  .article-section {
    margin-top: 3.5rem;
    padding-top: 2rem;
  }

  .article-section h2 {
    font-size: 1.875rem;
    margin-bottom: 1.75rem;
  }

  .section-no {
    margin-bottom: 0.8rem;
  }

  .article-body p.stage-title {
    padding: 1rem 1.5rem;
  }

  .article-body .stage-title + ul {
    padding: 1.25rem 1.5rem 1.5rem;
  }

  .paper-figure {
    margin-block: 2.5rem;
  }

  .paper-figure img {
    padding: 0.75rem;
  }

  .paper-figure figcaption {
    font-size: 0.8125rem;
  }

  .article-body .assessment {
    padding: 2rem 2rem 0.5rem;
  }

  .article-body p.reading-note {
    padding: 1.25rem 1.5rem;
  }

  :lang(ja) h1 {
    max-width: 23em;
    font-size: 2.25rem;
    line-height: 1.4;
  }

  :lang(ja) h2 {
    font-size: 1.75rem;
  }
}

@media (min-width: 1100px) {
  .hero {
    display: grid;
    align-items: center;
    min-height: 34rem;
  }

  .hero-art {
    grid-area: 1 / 1;
    width: 100%;
    align-self: stretch;
    background-position: center;
  }

  .hero-content {
    grid-area: 1 / 1;
    z-index: 1;
    width: 53%;
    padding: 3rem 0 3rem 3.5rem;
  }

  h1 {
    max-width: none;
    font-size: clamp(2.5rem, 3.2vw, 2.875rem);
  }

  .original {
    margin-top: 2rem;
  }

  .article-body {
    padding-top: 4rem;
  }

  .paper-figure,
  .table-scroll {
    width: calc(100% + 8rem);
    max-width: none;
    margin-inline: -4rem;
  }

  .paper-figure figcaption {
    max-width: 68ch;
    margin-inline: auto;
  }

  :lang(ja) h1 {
    font-size: clamp(2.125rem, 2.8vw, 2.625rem);
    line-height: 1.4;
  }
}

.nb {
  white-space: nowrap;
}

.hero,
.hero-art {
  background-color: #fcf5e8;
}

.reading-note em {
  display: inline;
  margin: 0 0.35em 0 0;
}

.table-scroll th:first-child,
.table-scroll td:first-child {
  min-width: 0;
  position: sticky;
  left: 0;
  z-index: 1;
  background: #f6f1e6;
  box-shadow: 1px 0 0 var(--rule);
}

.table-scroll th:first-child {
  background: #eae6dc;
}

.table-scroll td:nth-child(2) {
  white-space: nowrap;
}

.table-scroll th.num {
  white-space: normal;
}

@media (max-width: 599px) {
  .hero-art {
    background-size: cover;
    background-position: 100% center;
  }

  .table-scroll table {
    font-size: 0.75rem;
  }

  .table-scroll th,
  .table-scroll td {
    padding: 0.55rem 0.5rem;
  }

  .paper-figure {
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .paper-figure img {
    width: 640px;
    max-width: none;
  }
}

@media (min-width: 600px) and (max-width: 1099px) {
  .hero-art {
    height: 18rem;
    aspect-ratio: auto;
    background-size: cover;
    background-position: 100% center;
  }

  .table-scroll th,
  .table-scroll td {
    padding: 0.6rem 0.6rem;
  }
}

:lang(ja) .table-scroll th,
:lang(ja) .table-scroll td:first-child {
  word-break: keep-all;
}

@media (max-width: 599px) {
  .paper-figure {
    scrollbar-width: thin;
    scrollbar-color: #827e91 #ebe5d8;
    padding-bottom: 0.5rem;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 1.5rem), rgb(0 0 0 / 0.25));
    mask-image: linear-gradient(to right, #000 calc(100% - 1.5rem), rgb(0 0 0 / 0.25));
  }

  .paper-figure img {
    width: 560px;
  }
}

@media (max-width: 599px) {
  :lang(ja) .table-scroll td:first-child {
    word-break: normal;
  }
}

@media (min-width: 600px) and (max-width: 1099px) {
  .table-scroll th,
  .table-scroll td {
    padding: 0.6rem 0.45rem;
  }
}
