:root {
  color-scheme: light dark;
  --paper: #faf8f1;
  --ink: #1d2b27;
  --heading: #102e28;
  --accent: #205944;
  --rule: #bacfc3;
  --strong-rule: #618878;
  --mint: #e7f0e9;
  --table-accent: #d5e8dc;
  --forest: #0d2e27;
  --hero-ink: #f8f7ef;
  --hero-mint: #c6e3d5;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --gutter: clamp(1.125rem, 4.5vw, 4.5rem);
}

:root:lang(ja) {
  --serif: "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "Noto Serif CJK JP", serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", YuGothic, Meiryo, "Noto Sans CJK JP", sans-serif;
}



body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

.paper-main {
  line-break: strict;
  font-family: var(--sans);
  font-size: clamp(1.0625rem, 0.98rem + 0.18vw, 1.1875rem);
  line-height: 1.75;
}

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

.paper-main a {
  color: var(--accent);
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.2em;
}

.paper-main a:hover {
  text-decoration-thickness: 0.13em;
}

.paper-main a:focus-visible,
.table-scroll:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.article-hero {
  background: var(--forest);
  color: var(--hero-ink);
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 58fr) minmax(0, 42fr);
  max-inline-size: 96rem;
  margin-inline: auto;
}

.hero-copy {
  padding-block: clamp(2.75rem, 5.4vw, 5.25rem);
  padding-inline: var(--gutter) clamp(2rem, 4vw, 4.5rem);
}

.paper-main h1,
.paper-main h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.paper-main h1 {
  max-inline-size: 21ch;
  font-size: clamp(2.125rem, 4.25vw, 4rem);
  line-height: 1.07;
  letter-spacing: -0.032em;
}

.paper-main h1:lang(ja) {
  max-inline-size: 14em;
  line-height: 1.23;
  letter-spacing: 0;
}

.hero-photo {
  background: var(--forest) url("assets/bg_hero.png") right center / cover no-repeat;
  border-inline-start: 1px solid #42685a;
}

.byline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 1.15rem;
  margin: 1.65rem 0 0;
  color: var(--hero-mint);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.byline time {
  white-space: nowrap;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 1.4rem;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
  font-weight: 600;
}

.hero-links a {
  color: var(--hero-ink);
  overflow-wrap: anywhere;
}

.hero-links li + li {
  padding-inline-start: 1.4rem;
  border-inline-start: 1px solid #72998a;
}

.reading-layout {
  display: grid;
  max-inline-size: 53rem;
  margin-inline: auto;
  padding: clamp(1.5rem, 4.8vw, 4.5rem) var(--gutter) clamp(3.5rem, 9vw, 8rem);
}

.contents {
  margin-block-end: clamp(1.75rem, 4.5vw, 3rem);
  padding-block: 0.6rem;
  border-block: 1px solid var(--rule);
  color: var(--accent);
  font-size: 0.90625rem;
  line-height: 1.4;
}

.contents ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contents a {
  display: block;
  padding-block: 0.4rem;
  text-decoration-color: var(--strong-rule);
  text-wrap: pretty;
}

.contents a:hover,
.contents a:focus-visible {
  text-decoration-color: currentColor;
}

.article-copy {
  min-inline-size: 0;
}

.article-copy p {
  max-inline-size: 70ch;
  margin: 0;
  overflow-wrap: break-word;
}

.article-copy p:lang(ja) {
  max-inline-size: 43ic;
}

.article-copy p + p {
  margin-block-start: 1.15em;
}

.article-copy .lede {
  max-inline-size: 63ch;
  color: var(--heading);
  font-size: clamp(1.1875rem, 1.04rem + 0.62vw, 1.625rem);
  line-height: 1.55;
}

.article-copy .lede:lang(ja) {
  max-inline-size: 39ic;
  line-height: 1.7;
}

.article-section {
  margin-block-start: clamp(2.5rem, 5.3vw, 4.75rem);
  padding-block-start: clamp(1.2rem, 2.4vw, 2.1rem);
  border-block-start: 1px solid var(--rule);
}

.paper-main h2 {
  margin-block-end: 0.72em;
  scroll-margin-block-start: 5.5rem;
  color: var(--heading);
  font-size: clamp(1.625rem, 1.12rem + 1.2vw, 2.45rem);
  line-height: 1.16;
  letter-spacing: -0.018em;
}

.paper-main h2:lang(ja) {
  line-height: 1.35;
  letter-spacing: 0;
}

.citation {
  font-size: 0.875em;
  text-wrap: pretty;
}

.defense-text {
  padding-inline-start: clamp(0.9rem, 2vw, 1.6rem);
  border-inline-start: 3px solid var(--strong-rule);
}

.table-scroll {
  max-inline-size: 100%;
  margin-block: 1.6rem;
  overflow-x: auto;
  scrollbar-color: var(--strong-rule) var(--mint);
}

.table-scroll table {
  inline-size: 100%;
  min-inline-size: 17.5rem;
  table-layout: fixed;
  border-collapse: collapse;
  border-block: 2px solid var(--strong-rule);
  background: var(--mint);
  color: var(--heading);
  font-size: clamp(0.875rem, 0.825rem + 0.23vw, 1.025rem);
  line-height: 1.45;
}

.condition-column {
  inline-size: 34%;
}

.table-scroll th,
.table-scroll td {
  padding: clamp(0.6rem, 1.6vw, 1rem) clamp(0.3rem, 1.4vw, 1rem);
  border-block-end: 1px solid var(--rule);
  text-align: end;
}

.table-scroll th + th,
.table-scroll th + td,
.table-scroll td + td {
  border-inline-start: 1px solid var(--rule);
}

.table-scroll th {
  overflow-wrap: break-word;
}

.table-scroll thead th {
  vertical-align: bottom;
  border-block-end-color: var(--strong-rule);
}

.table-scroll th:first-child {
  text-align: start;
}

.table-scroll tbody th {
  font-weight: 500;
}

.table-scroll td {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-scroll .spillway-result {
  background: var(--table-accent);
}

.spillway-result th,
.spillway-result td {
  font-weight: 700;
}

@media (width > 1050px) {
  .reading-layout {
    grid-template-columns: clamp(11rem, 16vw, 14rem) minmax(0, 52rem);
    justify-content: center;
    align-items: start;
    column-gap: clamp(2.25rem, 4.6vw, 4.5rem);
    max-inline-size: 81rem;
  }

  .contents {
    margin-block-end: 0;
    padding: 0.75rem 0.95rem 0.75rem 1.1rem;
    border-block: 0;
    border-inline-start: 2px solid var(--strong-rule);
    background: var(--mint);
  }

  .contents ul {
    flex-direction: column;
  }

  .contents li + li {
    border-block-start: 1px solid var(--rule);
  }

  .contents a {
    padding-block: 0.65rem;
    text-decoration: none;
  }

  .contents a:hover,
  .contents a:focus-visible {
    text-decoration: underline;
  }
}

@media (width > 1050px) and (min-height: 42rem) {
  .contents {
    position: sticky;
    inset-block-start: 5.5rem;
  }
}

@media (max-width: 700px) {
  .hero-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-copy {
    padding: 2.5rem var(--gutter) 2rem;
  }

  .paper-main h1 {
    font-size: clamp(2.125rem, 6.1vw, 2.9rem);
  }

  .hero-photo {
    block-size: clamp(6.5rem, 23vw, 10rem);
    border-inline-start: 0;
    border-block-start: 1px solid #42685a;
    background-size: auto max(100%, 11rem);
  }

  .byline {
    margin-block-start: 1.25rem;
  }
}

.source-label { white-space: nowrap; }
article table caption { caption-side: top; text-align: start; padding-block: 0.25rem 0.7rem; font-size: 0.9em; }

html.dark {
    color-scheme: dark;
    --paper: #17221e;
    --ink: #e2e9e3;
    --heading: #f1f4eb;
    --accent: #a9d9c1;
    --rule: #425d50;
    --strong-rule: #719480;
    --mint: #21362e;
    --table-accent: #2c493d;
    --forest: #0a241f;
}
