:root {
  --paper: #f3f4f0;
  --ink: #1e2832;
  --muted: #56616b;
  --line: #d3d8d2;
  --wash: #e8ece7;
  --seal: #b4332a;
  --accent: #28555c;
  --serif: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  --sans: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.95;
  line-break: strict;
  word-break: auto-phrase;
}

a { color: var(--accent); text-underline-offset: 0.2em; }

a:focus-visible,
.table-wrap:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---- header ---- */
.site-head { border-bottom: 1px solid var(--line); }

.site-head .wrap { padding-top: 0.9rem; padding-bottom: 0.9rem; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
}

.brand svg { width: 1.9rem; height: 1.9rem; color: var(--seal); flex: none; }

/* ---- top page ---- */
.hero {
  display: grid;
  gap: 1.5rem;
  padding: 3.5rem 0 3rem;
  grid-template-areas: "seal" "text";
}

.hero-seal {
  grid-area: seal;
  width: 6rem;
  height: 6rem;
  color: var(--seal);
  transform: rotate(-5deg);
  mix-blend-mode: multiply;
}

.hero-text { grid-area: text; }

.lead {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(1.9rem, 5.2vw, 2.8rem);
  line-height: 1.5;
  letter-spacing: 0.02em;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}

.lead-sub { margin: 0; max-width: 34rem; text-wrap: pretty; }

.nb { display: inline-block; }

@media (min-width: 48rem) {
  .hero {
    grid-template-columns: 1fr 9rem;
    grid-template-areas: "text seal";
    align-items: start;
    padding: 5rem 0 4rem;
  }
  .hero-seal { width: 9rem; height: 9rem; }
}

.block { padding: 2.5rem 0; border-top: 1px solid var(--line); }

.block h2 {
  font-family: var(--serif);
  font-weight: 800;
  font-size: 1.3rem;
  line-height: 1.6;
  margin: 0 0 1.25rem;
}

.entry {
  display: block;
  color: inherit;
  text-decoration: none;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.entry h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.6;
  margin: 0 0 0.4rem;
  color: var(--accent);
}

.entry p { margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.8; }

.entry + .entry { border-top: 0; }

.entry:hover h3 { text-decoration: underline; text-underline-offset: 0.2em; }

.entry:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.note { color: var(--muted); font-size: 0.95rem; margin: 1.25rem 0 0; }

/* ---- article ---- */
.article { padding: 2.75rem 0 4rem; max-width: 38rem; }

.article h1 {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(1.65rem, 4.6vw, 2.2rem);
  line-height: 1.55;
  margin: 0 0 0.6rem;
  text-wrap: balance;
}

.meta { color: var(--muted); font-size: 0.9rem; margin: 0 0 2.5rem; }

.article h2 {
  font-family: var(--serif);
  font-weight: 800;
  font-size: 1.45rem;
  line-height: 1.6;
  margin: 3.2rem 0 1rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}

.article h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.6;
  margin: 2.2rem 0 0.6rem;
}

.article p { margin: 0 0 1.2em; }

.article ul { padding-left: 1.3em; margin: 0 0 1.4em; }

.article ol { padding-left: 1.5em; margin: 0 0 1.4em; }

.article li { margin-bottom: 0.5em; }

.article strong { font-weight: 700; }

.photo { margin: 1.75rem 0; }

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

.photo figcaption { color: var(--muted); font-size: 0.85rem; margin-top: 0.5rem; line-height: 1.7; }

.table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--line);
  background: #fff;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  font-size: 0.95rem;
  line-height: 1.75;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
}

thead th { background: var(--wash); font-family: var(--serif); }

tbody th { font-family: var(--serif); white-space: nowrap; }

tbody tr:last-child th,
tbody tr:last-child td { border-bottom: 0; }

.diagrams-figure { margin: 1.75rem 0 2rem; }

.article .diagrams {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.25rem, 1fr));
  gap: 1.5rem 1rem;
}

.article .diagrams li { margin: 0; text-align: center; }

.diagrams svg { display: block; width: 100%; max-width: 7.5rem; height: auto; margin: 0 auto 0.5rem; }

.diagram-label { display: block; font-family: var(--serif); font-weight: 700; font-size: 0.95rem; line-height: 1.5; }

.diagram-desc { display: block; color: var(--muted); font-size: 0.82rem; line-height: 1.6; }

.diagrams-figure figcaption { color: var(--muted); font-size: 0.82rem; margin-top: 1rem; line-height: 1.7; }

/* ---- footer ---- */
.site-foot {
  border-top: 1px solid var(--line);
  padding: 1.75rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.8;
}

.site-foot p { margin: 0 0 0.4rem; }
