:root {
  --bg: #f5ece6;
  --bg-alt: #eaddd3;
  --dark: #25304d;
  --ink: #241c19;
  --muted: #7d6c62;
  --on-dark: #f5ece6;
  --accent: #2f3d63;
  --accent-2: #b05a3c;
  --line: rgba(47, 61, 99, 0.38);
  --line-soft: rgba(125, 108, 98, 0.35);
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --pad: 48px;
  --gap: 32px;
}

* { box-sizing: border-box; }

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

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

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

a { color: var(--accent); }

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

.sec--dark a:focus-visible { outline-color: var(--on-dark); }

/* ---------- shell ---------- */

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 20px 0;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 28px;
  padding-bottom: 22px;
}

.brand {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: 0.03em;
  color: var(--ink);
  text-decoration: none;
}

.brand span {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.06em;
  color: var(--accent-2);
}

.nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.nav a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}

.nav a:hover { border-bottom-color: var(--accent); }

.nav a[aria-current="page"] {
  color: var(--accent-2);
  border-bottom-color: var(--accent-2);
}

.sheet {
  border: 1px solid var(--line);
  background: var(--bg);
  padding: 44px var(--pad) 56px;
}

/* ---------- grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px var(--gap);
  align-items: start;
}

.col-text { grid-column: 1 / span 7; }
.col-side { grid-column: 9 / span 4; }

/* ---------- typography ---------- */

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(31px, 4.4vw, 52px);
  line-height: 1.14;
  letter-spacing: -0.01em;
  margin: 0;
}

h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 25px;
  line-height: 1.3;
  margin: 0 0 14px;
}

h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.4;
  margin: 26px 0 8px;
}

p { margin: 0 0 18px; }

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

.lead {
  font-size: 19px;
  line-height: 1.75;
}

.marker {
  display: block;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--accent-2);
  margin-bottom: 6px;
}

.caption {
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0;
}

/* ---------- hero ---------- */

.hero-head { margin-bottom: 34px; }

.hero-head h1 { grid-column: 1 / span 8; }

.hero-head .card {
  grid-column: 9 / span 4;
  margin-top: 6px;
}

.hero-intro .col-text p + p { margin-top: 0; }

/* ---------- small tables / note cards ---------- */

.card {
  border: 1px solid var(--line);
  padding: 14px 16px 16px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

.card h2,
.card h3 {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--accent-2);
  margin: 0 0 8px;
}

.card dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0 12px;
}

.card dt {
  color: var(--ink);
  border-top: 1px solid var(--line-soft);
  padding: 5px 0;
}

.card dd {
  margin: 0;
  text-align: right;
  border-top: 1px solid var(--line-soft);
  padding: 5px 0;
}

.card dl > dt:first-of-type,
.card dl > dt:first-of-type + dd { border-top: 0; }

.card p { margin: 0 0 10px; }

.card a { color: var(--accent); }

.card + .card { margin-top: 20px; }

/* ---------- sections ---------- */

.sec { margin-top: 88px; }

.sec--tint {
  background: var(--bg-alt);
  margin-inline: calc(-1 * var(--pad));
  padding: 56px var(--pad);
}

.sec--dark {
  background: var(--dark);
  color: var(--on-dark);
  margin-inline: calc(-1 * var(--pad));
  padding: 60px var(--pad);
}

.sec--dark a { color: var(--on-dark); }
.sec--dark .caption { color: rgba(245, 236, 230, 0.72); }
.sec--dark .marker { color: #d9927a; }

.sec--dark .card {
  border-color: rgba(245, 236, 230, 0.4);
  color: rgba(245, 236, 230, 0.82);
}

.sec--dark .card h3 { color: #d9927a; }
.sec--dark .card dt { color: var(--on-dark); border-top-color: rgba(245, 236, 230, 0.28); }
.sec--dark .card dd { border-top-color: rgba(245, 236, 230, 0.28); }

/* ---------- separators ---------- */

.rule {
  position: relative;
  height: 1px;
  background: var(--line-soft);
  margin-top: 88px;
}

.rule::before,
.rule::after {
  content: "";
  position: absolute;
  top: -5px;
  width: 1px;
  height: 11px;
  background: var(--accent-2);
}

.rule::before { left: 0; }
.rule::after { right: 0; }

.rule-note {
  margin-top: 88px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0 var(--gap);
  align-items: center;
}

.rule-note .bar {
  grid-column: 1 / span 7;
  position: relative;
  height: 1px;
  background: var(--line-soft);
}

.rule-note .bar::before {
  content: "";
  position: absolute;
  left: 0;
  top: -5px;
  width: 1px;
  height: 11px;
  background: var(--accent-2);
}

.rule-note .card { grid-column: 9 / span 4; }

/* ---------- figures ---------- */

.figure-main {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px var(--gap);
  align-items: end;
  margin: 0 0 12px;
}

.figure-main img {
  grid-column: 1 / span 5;
  border: 1px solid var(--line);
  width: 100%;
}

.figure-main figcaption { grid-column: 7 / span 4; }

.figure-detail { margin: 0; }

.figure-detail img {
  border: 1px solid rgba(245, 236, 230, 0.45);
  width: 100%;
}

.figure-detail figcaption { margin-top: 10px; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 28px var(--gap);
  align-items: start;
}

.detail-grid .txt { grid-column: 1 / span 6; }
.detail-grid .fig { grid-column: 8 / span 5; }

/* ---------- lists ---------- */

ul.plain {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}

ul.plain li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 9px;
}

ul.plain li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85em;
  width: 12px;
  height: 1px;
  background: var(--accent);
}

.sec--dark ul.plain li::before { background: #d9927a; }

ol.steps {
  margin: 0 0 18px;
  padding-left: 22px;
}

ol.steps li {
  margin-bottom: 9px;
  padding-left: 6px;
}

ol.steps li::marker {
  color: var(--accent-2);
  font-family: var(--serif);
}

.index-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-soft);
}

.index-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
  padding: 9px 0;
}

.index-list a {
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.index-list a:hover { border-bottom-color: var(--accent); }

.index-list .note {
  font-size: 12px;
  color: var(--muted);
  flex: 0 1 auto;
  text-align: right;
}

/* ---------- footer ---------- */

.page-foot {
  max-width: 1180px;
  margin: 72px auto 0;
  padding: 0 20px 60px;
}

.foot-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
  padding-bottom: 14px;
}

.foot-top .name {
  font-family: var(--serif);
  font-size: 19px;
}

.foot-line {
  height: 1px;
  background: var(--line-soft);
  position: relative;
}

.foot-line::before,
.foot-line::after {
  content: "";
  position: absolute;
  top: -5px;
  width: 1px;
  height: 11px;
  background: var(--accent-2);
}

.foot-line::before { left: 0; }
.foot-line::after { right: 0; }

.foot-bottom {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px var(--gap);
  padding-top: 16px;
}

.foot-bottom .nav { grid-column: 1 / span 7; }
.foot-bottom .foot-note {
  grid-column: 9 / span 4;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  :root { --pad: 30px; --gap: 24px; }

  .col-text,
  .col-side,
  .hero-head h1,
  .hero-head .card,
  .rule-note .bar,
  .rule-note .card,
  .figure-main img,
  .figure-main figcaption,
  .detail-grid .txt,
  .detail-grid .fig,
  .foot-bottom .nav,
  .foot-bottom .foot-note {
    grid-column: 1 / -1;
  }

  .figure-main img { max-width: 460px; }

  .detail-grid .fig { max-width: 420px; }

  .rule-note { display: block; }

  .rule-note .bar { margin-bottom: 24px; }

  .sec { margin-top: 52px; }
  .rule, .rule-note { margin-top: 52px; }
  .sec--tint, .sec--dark { padding-block: 40px; }

  h1 { font-size: clamp(28px, 7vw, 38px); }
  h2 { font-size: 22px; }
}

@media (max-width: 560px) {
  :root { --pad: 18px; }

  body { font-size: 16px; }

  .page { padding: 24px 12px 0; }
  .page-foot { padding-inline: 12px; }
  .sheet { padding: 28px var(--pad) 36px; }
  .lead { font-size: 17px; }
  .index-list .note { text-align: left; }
}
