:root {
  color-scheme: light;
  --paper: #f6f4ef;
  --ink: #292e32;
  --muted: #5a5c5b;
  --rule: #d9d4c9;
  --amber: #f2a541;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --japanese: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
}

body {
  margin: 0;
  font-family: Charter, "Bitstream Charter", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 18px;
  line-height: 1.8;
  -webkit-text-size-adjust: 100%;
}

:lang(ja) body {
  font-family: var(--japanese);
  font-size: 17px;
  line-height: 1.95;
  line-break: strict;
}

flecto-site-header {
  display: block;
}

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

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

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

a:focus-visible, .table-scroll:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 5px;
}

.hero {
  color: #fcfaf5;
  background-color: #0d1720;
  background-image: linear-gradient(90deg, rgba(7, 15, 22, 0.96) 0%, rgba(7, 15, 22, 0.91) 30%, rgba(7, 15, 22, 0.76) 48%, rgba(7, 15, 22, 0.16) 78%), url("assets/bg_hero.png");
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid #26313a;
}

.hero-inner {
  max-width: 1180px;
  margin-inline: auto;
  padding: 28px 40px 70px;
}

.language-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-bottom: 44px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
}

.language-switch a {
  text-decoration-color: rgba(252, 250, 245, 0.4);
  text-decoration-thickness: 1px;
}

.language-switch a[aria-current] {
  text-decoration-color: var(--amber);
  text-decoration-thickness: 2px;
}

.hero-copy {
  max-width: 650px;
}

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

h1 {
  margin: 0 0 28px;
  max-width: 640px;
  font-size: clamp(30px, 3.1vw, 42px);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.introduction {
  margin: 0;
  max-width: 620px;
  color: #f0eee8;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.8;
  text-wrap: pretty;
}

:lang(ja) h1, :lang(ja) h2, :lang(ja) .introduction, :lang(ja) .language-switch {
  font-family: var(--japanese);
}

:lang(ja) h1 {
  font-size: clamp(27px, 2.7vw, 37px);
  line-height: 1.5;
  letter-spacing: -0.025em;
}

:lang(ja) .introduction {
  font-size: 16px;
  line-height: 1.95;
}

.article-body {
  max-width: 1140px;
  margin-inline: auto;
  padding: 0 20px 92px;
}

.bibliography, section > h2, section > p, section > ul, section > ol, .table-scroll {
  max-width: 740px;
  margin-inline: auto;
}

.bibliography {
  padding: 34px 0;
  margin-bottom: 48px;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.85;
}

.bibliography p {
  margin: 0;
}

:lang(ja) .bibliography {
  font-family: var(--japanese);
  line-height: 1.95;
}

section {
  margin-block: 0 64px;
}

h2 {
  position: relative;
  padding-bottom: 18px;
  margin-block: 0 24px;
  font-size: clamp(24px, 2.2vw, 30px);
  line-height: 1.3;
  letter-spacing: -0.018em;
  scroll-margin-top: 88px;
}

h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 32px;
  height: 2px;
  background: var(--amber);
}

:lang(ja) h2 {
  font-size: clamp(23px, 2.1vw, 28px);
  line-height: 1.55;
}

p {
  margin-block: 0 24px;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

strong {
  font-weight: 700;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.86em;
  padding: 0.1em 0.22em;
  background: #ece8de;
  overflow-wrap: anywhere;
}

ul, ol {
  padding-inline-start: 26px;
  margin-block: 26px 30px;
}

li {
  padding-inline-start: 5px;
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}

figure {
  margin: 34px auto 38px;
  max-width: 1100px;
}

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

.figure-access {
  max-width: 740px;
  margin: 12px auto 14px;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.6;
}

.figure-caption {
  max-width: 740px;
  margin-inline: auto;
  color: #4d504f;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.8;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.figure-caption.detailed {
  font-family: inherit;
  font-size: 18px;
  line-height: 1.8;
  color: var(--ink);
}

:lang(ja) .figure-caption, :lang(ja) .figure-access {
  font-family: var(--japanese);
}

:lang(ja) .figure-caption {
  line-height: 1.95;
}

:lang(ja) .figure-caption.detailed {
  font-size: 17px;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  margin-block: 28px;
  border-block: 1px solid #8f918b;
  scrollbar-color: #8b867d #e9e5dc;
}

table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
}

th, td {
  padding: 12px 14px;
  text-align: right;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}

thead th {
  background: #ede9df;
  font-weight: 650;
  text-align: left;
}

tbody th {
  font-weight: 400;
  text-align: left;
}

td {
  white-space: nowrap;
}

th:first-child {
  min-width: 180px;
  padding-inline-start: 10px;
}

tbody tr:last-child > * {
  border-bottom: 0;
}

:lang(ja) table {
  font-family: var(--japanese);
  line-height: 1.8;
}

.table-note {
  margin-top: -12px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.8;
}

:lang(ja) .table-note {
  font-family: var(--japanese);
}

.interpretation {
  padding: 22px 26px;
  margin-block: 32px;
  background: #efe8da;
}

.interpretation em {
  font-style: normal;
  font-weight: 700;
}

.implications {
  max-width: 796px;
  margin: 8px auto 0;
  padding: 30px 28px 14px;
  background: #efe8da;
}

.case-list {
  list-style: none;
  padding: 0;
  margin-block: 28px 32px;
}

.case-list li {
  padding: 20px 0;
  margin: 0;
  border-top: 1px solid var(--rule);
}

.case-list li:last-child {
  border-bottom: 1px solid var(--rule);
}

@media (max-width: 800px) {
  .hero-inner {
    padding: 24px 28px 48px;
  }

  .hero {
    background-image: linear-gradient(90deg, rgba(7, 15, 22, 0.95), rgba(7, 15, 22, 0.82)), url("assets/bg_hero.png");
  }

  .article-body {
    padding-inline: 24px;
  }

  section {
    margin-bottom: 52px;
  }
}

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

  :lang(ja) body {
    font-size: 16px;
    line-height: 1.95;
  }

  .hero {
    background-size: auto 720px;
    background-position: center top;
    background-repeat: no-repeat;
  }

  .hero-inner {
    padding: 22px 20px 40px;
  }

  .language-switch {
    margin-bottom: 32px;
  }

  h1 {
    font-size: 30px;
    line-height: 1.25;
    letter-spacing: -0.02em;
  }

  .introduction {
    font-size: 16px;
  }

  .article-body {
    padding: 0 20px 56px;
  }

  .bibliography {
    padding-block: 28px;
    margin-bottom: 36px;
  }

  h2 {
    font-size: 24px;
  }

  figure {
    margin-block: 28px 32px;
  }

  figure img {
    padding-block: 8px;
  }

  .figure-caption {
    font-size: 14px;
  }

  .figure-caption.detailed {
    font-size: 17px;
  }

  :lang(ja) .figure-caption.detailed {
    font-size: 16px;
  }

  .interpretation {
    padding: 20px;
  }

  .implications {
    padding: 24px 20px 8px;
  }
}

@media (max-width: 560px) {
  .table-scroll::before { display: block; margin-bottom: 10px; font: 13px/1.7 Arial, sans-serif; color: #4b514e; }
  html[lang="en"] .table-scroll::before { content: "Scroll horizontally to compare all columns."; }
  html[lang="ja"] .table-scroll::before { content: "横にスクロールすると全ての列を比較できます。"; }
}
