:root {
  color-scheme: light;
  --paper: #f7f5ee;
  --surface: #fffcf5;
  --ink: #253e35;
  --body: #35443d;
  --muted: #65716a;
  --line: #cbd2c7;
  --sage: #e7ecdf;
  --accent: #a55a40;
  --serif: "Yu Mincho", "Hiragino Mincho ProN", "Hiragino Mincho Pro", "Noto Serif CJK JP", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 2rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.95;
  overflow-wrap: break-word;
  line-break: strict;
}

::selection {
  background: #d7e1cb;
  color: #172c23;
}

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

a:hover {
  color: #7d3e29;
  text-decoration-thickness: 2px;
}

a:focus-visible {
  outline: 3px solid #80402d;
  outline-offset: 5px;
  border-radius: 1px;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.wrap {
  width: calc(100% - 80px);
  max-width: 1120px;
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  inset-block-start: 8px;
  inset-inline-end: max(24px, calc((100vw - 1120px) / 2));
  z-index: 2;
  padding: 2px 8px;
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
}

.skip-link:focus-visible {
  color: var(--ink);
  background: var(--surface);
}

.site-header {
  border-top: 5px solid var(--ink);
}

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 20px;
  padding-block: 42px 27px;
}

.brand {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 35px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.025em;
  text-decoration: none;
}

.brand-sub {
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0.14em;
}

.site-note {
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.035em;
}

.primary-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 0;
  padding-block: 13px;
  border-block: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.8;
}

.primary-nav a {
  display: block;
  padding: 4px 17px;
  text-decoration: none;
  border-inline-start: 1px solid var(--line);
}

.primary-nav a:first-child {
  padding-inline-start: 0;
  border-inline-start: 0;
}

.primary-nav a[aria-current="page"] {
  color: #7d3e29;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4em;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(0, 720px) minmax(170px, 216px);
  justify-content: space-between;
  align-items: start;
  gap: 64px;
  padding-block: 42px 104px;
}

.page-shell:not(:has(.page-index)) {
  display: block;
}

.article {
  min-width: 0;
  width: 100%;
  max-width: 720px;
}

.page-shell:not(:has(.page-index)) .article {
  margin-inline: auto;
}

.breadcrumb {
  margin-block: 0 35px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
}

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

.eyebrow,
.section-label {
  margin-block: 0 12px;
  color: #7d3e29;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

h1,
h2,
h3 {
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 600;
  overflow-wrap: anywhere;
}

h1 {
  margin-block: 0 24px;
  font-size: clamp(29px, 3.1vw, 40px);
  line-height: 1.55;
  letter-spacing: 0.035em;
  text-wrap: pretty;
}

.home-intro h1 {
  max-width: 16em;
  font-size: clamp(32px, 3.8vw, 48px);
  line-height: 1.6;
}

.lead {
  margin-block: 0 35px;
  color: #4c5e52;
  font-size: 18px;
  line-height: 2;
}

.hero-image,
.home-lead-image {
  margin: 34px 0 48px;
}

.hero-image img,
.home-lead-image img {
  width: 100%;
  border: 1px solid #dedfd3;
  background: #e9e7dd;
}

figcaption {
  margin-block-start: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.85;
}

.article-body section {
  margin-block: 48px;
  scroll-margin-top: 28px;
}

.article-body section:last-child {
  margin-block-end: 0;
}

h2 {
  margin-block: 48px 20px;
  padding-block-start: 20px;
  border-top: 1px solid var(--line);
  font-size: 25px;
  line-height: 1.7;
  letter-spacing: 0.025em;
}

h3 {
  margin-block: 30px 12px;
  font-size: 20px;
  line-height: 1.75;
}

p {
  margin-block: 0 22px;
}

ul,
ol {
  padding-inline-start: 1.55em;
  margin-block: 20px 28px;
}

li {
  padding-inline-start: 0.25em;
  margin-block: 8px;
}

li::marker {
  color: #77876d;
}

strong {
  color: var(--ink);
  font-weight: 700;
}

dl {
  margin-block: 24px 32px;
}

dt {
  margin-block-start: 20px;
  color: var(--ink);
  font-weight: 700;
}

dd {
  margin: 6px 0 20px;
}

blockquote {
  margin: 28px 0;
  padding: 22px 28px;
  border-inline-start: 3px solid #89967b;
  background: var(--sage);
}

blockquote p:last-child {
  margin-block-end: 0;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  margin-block: 25px 30px;
  padding: 22px 25px;
  border: 1px solid #c7d0c0;
  background: #e9eee2;
  color: #233d30;
  font-size: 14px;
  line-height: 1.9;
  tab-size: 2;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
  overflow-wrap: anywhere;
}

pre code {
  font-size: inherit;
  overflow-wrap: normal;
}

table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-block: 25px 30px;
  border-collapse: collapse;
  overflow-x: auto;
  font-size: 15px;
  line-height: 1.8;
}

caption {
  padding-block-end: 12px;
  color: var(--muted);
  text-align: start;
  font-size: 13px;
}

th,
td {
  padding: 13px 17px;
  border-bottom: 1px solid var(--line);
  text-align: start;
  vertical-align: top;
}

th {
  background: var(--sage);
  color: var(--ink);
  font-weight: 600;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  margin-block: 22px 38px;
  border-top: 1px solid var(--line);
}

.service-link {
  display: block;
  position: relative;
  padding: 23px 28px 24px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.service-link::after {
  content: "↗";
  position: absolute;
  top: 22px;
  right: 3px;
  color: var(--accent);
  font-size: 18px;
}

.service-title {
  display: block;
  margin-block-end: 7px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.6;
}

.service-description {
  display: block;
  color: #65716a;
  font-size: 13px;
  line-height: 1.9;
}

.service-link:hover .service-title {
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

.history-list {
  display: grid;
  grid-template-columns: minmax(100px, 150px) minmax(0, 1fr);
  column-gap: 24px;
  margin-block: 26px 35px;
}

.history-list dt,
.history-list dd {
  margin: 0;
  padding-block: 18px;
  border-top: 1px solid var(--line);
}

.history-list dt {
  color: #65716a;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.8;
}

.history-list dd {
  font-size: 15px;
  line-height: 1.95;
}

.fact-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 25px;
  margin-block: 30px 38px;
  padding: 26px 28px;
  background: var(--sage);
  border-top: 2px solid #8f9c82;
}

.fact strong {
  display: block;
  font-family: Georgia, "Times New Roman", var(--serif);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.35;
}

.fact span {
  display: block;
  margin-block-start: 9px;
  color: #56624f;
  font-size: 12px;
  line-height: 1.85;
}

.note {
  margin-block: 28px;
  padding: 20px 24px;
  border-inline-start: 2px solid var(--accent);
  background: #efeee4;
  color: #53614f;
  font-size: 15px;
  line-height: 1.95;
}

.note p:last-child {
  margin-block-end: 0;
}

.related {
  margin-block-start: 56px;
}

.related h2 {
  font-size: 21px;
}

.related ul {
  margin-block: 0;
  padding: 0;
  list-style: none;
}

.related li {
  margin: 0;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.page-index {
  position: sticky;
  top: 32px;
  min-width: 0;
  margin-block-start: 55px;
  padding-block-start: 15px;
  border-top: 2px solid var(--accent);
  font-size: 13px;
  line-height: 1.8;
}

.page-index h2 {
  margin: 0 0 17px;
  padding: 0;
  border: 0;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.1em;
}

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

.toc-list li {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.toc-list a {
  display: block;
  padding: 11px 0;
  color: #52624f;
  text-decoration: none;
}

.toc-list a:hover {
  color: #7d3e29;
  text-decoration: underline;
}

.site-footer {
  padding-block: 48px 35px;
  border-top: 1px solid #bfc9b7;
  background: #e7ecdf;
}

.footer-title {
  margin-block: 0 25px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 0.025em;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 42px;
  align-items: start;
  margin-block-end: 27px;
  font-size: 13px;
}

.footer-links ul {
  flex: 1 1 180px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links li {
  margin: 6px 0;
  padding: 0;
}

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-note {
  margin: 0;
  padding-block-start: 21px;
  border-top: 1px solid #c5cfbc;
  color: #5d6c56;
  font-size: 12px;
  line-height: 1.9;
}

.error-page {
  padding-block: 36px 60px;
}

@media (max-width: 1000px) {
  .wrap {
    width: calc(100% - 56px);
  }

  .site-note {
    flex-basis: 100%;
    margin-block-start: 5px;
  }

  .page-shell {
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 40px;
  }

  .primary-nav a {
    padding-inline: 12px;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .wrap {
    width: calc(100% - 40px);
  }

  .masthead {
    gap: 9px 15px;
    padding-block: 40px 22px;
  }

  .brand {
    font-size: 31px;
  }

  .brand-sub {
    font-size: 11px;
  }

  .site-note {
    font-size: 11px;
  }

  .primary-nav {
    gap: 5px 0;
    font-size: 12px;
  }

  .primary-nav a {
    padding: 3px 12px;
  }

  .page-shell {
    display: flex;
    flex-direction: column;
    gap: 35px;
    padding-block: 28px 65px;
  }

  .article {
    max-width: none;
  }

  .breadcrumb {
    margin-block-end: 28px;
    font-size: 11px;
  }

  h1 {
    font-size: 29px;
    line-height: 1.6;
  }

  .home-intro h1 {
    font-size: 34px;
  }

  .lead {
    font-size: 17px;
    line-height: 1.95;
  }

  h2 {
    margin-block-start: 38px;
    font-size: 23px;
  }

  h3 {
    font-size: 19px;
  }

  .hero-image,
  .home-lead-image {
    margin-block: 28px 37px;
  }

  .article-body section {
    margin-block: 38px;
  }

  .page-index {
    position: static;
    width: 100%;
    margin-block-start: 4px;
  }

  .toc-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
  }

  .history-list {
    grid-template-columns: minmax(88px, 120px) minmax(0, 1fr);
    gap: 0 18px;
  }

  .history-list dd {
    font-size: 14px;
  }

  .note,
  blockquote,
  pre {
    padding: 18px 20px;
  }

  .site-footer {
    padding-block: 36px 28px;
  }
}

@media (max-width: 440px) {
  .wrap {
    width: calc(100% - 36px);
  }

  .brand-sub {
    flex-basis: 100%;
  }

  .site-note {
    margin-block-start: 0;
  }

  .service-grid {
    grid-template-columns: 1fr;
  }

  .service-link {
    padding-block: 19px;
  }

  .service-title {
    font-size: 20px;
  }

  .history-list {
    display: block;
  }

  .history-list dt {
    padding-block: 16px 4px;
  }

  .history-list dd {
    padding-block: 0 17px;
    border: 0;
  }

  .fact-strip {
    padding: 22px;
  }

  .toc-list {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .wrap {
    width: 100%;
    max-width: none;
  }

  .page-shell {
    display: block;
    padding-block: 20px;
  }

  .article {
    max-width: none;
  }

  .page-index {
    position: static;
    margin-block-start: 30px;
  }

  a {
    color: #000;
  }

  h2,
  h3 {
    break-after: avoid;
  }

  figure,
  pre,
  blockquote {
    break-inside: avoid;
  }
}
