:root {
  color-scheme: light;
  --paper: #faf8f3;
  --plum: #342433;
  --cover: #241321;
  --muted: #6d6066;
  --amber: #ac875d;
  --rule: #d6c2a7;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--plum);
  scroll-padding-top: 3rem;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.8;
}

flecto-site-header {
  display: block;
}

main,
article,
.paper-body,
section {
  min-width: 0;
}

a {
  color: inherit;
  text-decoration-color: var(--amber);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  overflow-wrap: anywhere;
}

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

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 5px;
}

.cover {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--cover);
  color: var(--paper);
  border-bottom: 1px solid var(--amber);
}

.cover-image {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 48%;
}

.cover::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, rgba(30, 15, 28, 0.88), rgba(30, 15, 28, 0.62) 47%, rgba(30, 15, 28, 0.04) 86%);
}

.cover-inner {
  width: min(100% - 112px, 1280px);
  min-height: 570px;
  margin-inline: auto;
  padding-block: 32px 78px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 76px;
}

.article-nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.6;
  letter-spacing: 0.045em;
}

.article-nav a {
  text-decoration-color: #c7a576;
}

h1,
h2 {
  font-family: var(--serif);
  font-weight: 400;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

h1 {
  max-width: 790px;
  margin: 0;
  font-size: clamp(42px, 4.5vw, 66px);
  line-height: 1.14;
  letter-spacing: -0.035em;
}

.paper-body {
  max-width: 1100px;
  margin-inline: auto;
  padding: 66px 0 112px;
}

.introduction,
h2,
section > p,
figcaption {
  width: min(760px, 100%);
  margin-inline: auto;
}

.introduction {
  padding-bottom: 43px;
  border-bottom: 1px solid var(--rule);
  font-size: 23px;
  line-height: 1.7;
}

p {
  margin-block: 0 1.25em;
  text-wrap: pretty;
  orphans: 3;
  widows: 3;
}

.introduction p {
  margin-bottom: 0;
}

section {
  margin-top: 62px;
  scroll-margin-top: 3rem;
}

h2 {
  margin-block: 0 25px;
  font-size: 34px;
  line-height: 1.3;
  letter-spacing: -0.022em;
}

section > p:last-child {
  margin-bottom: 0;
}

figure {
  margin: 44px 0;
  padding-top: 21px;
  border-top: 1px solid var(--rule);
}

.figure-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  background: #fff;
  scrollbar-color: var(--amber) #eee6da;
  scrollbar-width: thin;
}

.figure-scroll img {
  display: block;
  width: 100%;
  min-width: 963px;
  height: auto;
  max-width: none;
}

figcaption {
  margin-top: 19px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.75;
}

html[lang="ja"] body {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: 17px;
  line-height: 1.9;
  line-break: strict;
  overflow-wrap: anywhere;
}

html[lang="ja"] h1,
html[lang="ja"] h2 {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  line-height: 1.45;
}

html[lang="ja"] h1 {
  max-width: 780px;
  font-size: clamp(35px, 3.8vw, 55px);
  letter-spacing: -0.025em;
}

html[lang="ja"] h2 {
  font-size: 29px;
  letter-spacing: -0.015em;
}

html[lang="ja"] .introduction {
  font-size: 20px;
  line-height: 1.9;
}

html[lang="ja"] figcaption {
  font-family: inherit;
  line-height: 1.9;
}

@media (max-width: 1196px) {
  .paper-body {
    margin-inline: 48px;
  }
}

@media (max-width: 800px) {
  .cover-inner {
    width: calc(100% - 64px);
    min-height: 520px;
    padding-bottom: 64px;
  }

  .cover::after {
    background: linear-gradient(90deg, rgba(30, 15, 28, 0.9), rgba(30, 15, 28, 0.68) 65%, rgba(30, 15, 28, 0.3));
  }

  h1 {
    max-width: 650px;
    font-size: 51px;
  }

  .paper-body {
    margin-inline: 32px;
    padding-top: 48px;
    padding-bottom: 80px;
  }

  .introduction {
    font-size: 21px;
    padding-bottom: 35px;
  }

  section {
    margin-top: 49px;
  }

  h2 {
    font-size: 30px;
  }

  html[lang="ja"] h1 {
    font-size: 43px;
  }

  html[lang="ja"] h2 {
    font-size: 27px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 18px;
    line-height: 1.8;
  }

  .cover-inner {
    width: calc(100% - 40px);
    min-height: 515px;
    padding-block: 24px 48px;
    gap: 58px;
  }

  .cover-image {
    object-position: 58% center;
  }

  .article-nav {
    font-size: 12px;
    gap: 16px;
  }

  h1 {
    font-size: 39px;
    line-height: 1.18;
    letter-spacing: -0.03em;
  }

  .paper-body {
    margin-inline: 23px;
    padding-block: 37px 64px;
  }

  .introduction {
    font-size: 20px;
    line-height: 1.75;
    padding-bottom: 30px;
  }

  section {
    margin-top: 42px;
  }

  h2 {
    margin-bottom: 21px;
    font-size: 28px;
  }

  figure {
    margin-block: 32px;
    padding-top: 16px;
  }

  figcaption {
    margin-top: 14px;
    font-size: 13px;
  }

  html[lang="ja"] h1 {
    font-size: 32px;
    line-height: 1.5;
  }

  html[lang="ja"] h2 {
    font-size: 25px;
    line-height: 1.5;
  }

  html[lang="ja"] .introduction {
    font-size: 18px;
  }
}

.keep-equation { white-space: nowrap; }
.scroll-hint { font-size: 13px; line-height: 1.6; color: #595653; margin: .6rem auto; max-width: 760px; }
.table-note { font-size: 14px; line-height: 1.8; color: #595653; margin: 1rem 0 1.8rem; }
@media (min-width: 1200px) { .scroll-hint { display: none; } }
