:root {
  color-scheme: light;
  --ink: #142a36;
  --text: #263e49;
  --muted: #405b66;
  --link: #046358;
  --line: #d5e2df;
  --paper: #fff;
  --tint: #f0f6f4;
  font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  background: var(--paper);
  color: var(--text);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-size: 1rem;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.frame {
  width: min(100% - clamp(2.5rem, 9vw, 8rem), 70rem);
  margin-inline: auto;
}

.hero {
  position: relative;
  overflow: hidden;
  color: #edf5f6;
  background: #102735;
  border-block-start: 0.32rem solid #52c6ab;
  padding-block: clamp(2.5rem, 7vw, 5rem);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0 0 0 62%;
  background: repeating-linear-gradient(135deg, transparent 0 29px, #72d5c431 29px 30px, transparent 30px 40px);
  mask-image: linear-gradient(90deg, transparent, #000);
  pointer-events: none;
}

.hero .frame { position: relative; z-index: 1; }

.brand {
  color: #8ae4cf;
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  margin: 0 0 0.6rem;
}

h1, h2, h3, h4 { line-height: 1.45; }

h1 {
  font-size: clamp(1.9rem, 5.65vw, 3.65rem);
  color: #fff;
  letter-spacing: 0.02em;
  margin: 0 0 1.35rem;
}

.intro { max-width: 44rem; }

p { margin: 0 0 0.9em; }

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

.intro p + p { margin-block-start: 0.25rem; }

.layout {
  display: grid;
  grid-template-columns: minmax(13rem, 1fr) minmax(0, 2.85fr);
  gap: clamp(2rem, 5.5vw, 5.25rem);
  align-items: start;
  padding-block: clamp(1.5rem, 4.5vw, 3.25rem) 2.5rem;
}

.contents {
  position: sticky;
  top: 1.5rem;
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--tint);
}

.contents h2 {
  font-size: 1rem;
  color: var(--ink);
  margin: 0 0 0.65rem;
}

.contents ol {
  margin: 0;
  padding-inline-start: 1.45rem;
  font-size: 0.9375rem;
}

.contents li { padding-inline-start: 0.09rem; }
.contents li::marker { color: var(--link); font-weight: 700; }

.contents a {
  display: block;
  padding-block: 0.3rem;
  line-height: 1.5;
  color: var(--text);
  text-decoration-color: transparent;
}

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

a {
  color: var(--link);
  text-underline-offset: 0.19em;
  text-decoration-thickness: from-font;
}

a:focus-visible { outline: 2px solid currentColor; outline-offset: 0.22rem; }

.skip-link {
  position: absolute;
  z-index: 2;
  inset: 0.6rem auto auto 0.6rem;
  padding: 0.4rem 0.8rem;
  background: var(--paper);
  transform: translateY(-180%);
}

.skip-link:focus { transform: none; }
main:focus { outline: none; }

.rule {
  padding-block: 1.85rem;
  border-block-end: 1px solid var(--line);
}

.rule:first-child { padding-block-start: 0; }

.rule h2 {
  display: flex;
  align-items: baseline;
  gap: 0.53em;
  margin: 0 0 0.85em;
  color: var(--ink);
  font-size: clamp(1.2rem, 3.5vw, 1.6rem);
  scroll-margin-top: 1.4rem;
}

.rule h2 span { color: var(--link); font-variant-numeric: tabular-nums; }

.rule h2:target {
  text-decoration: underline;
  text-decoration-color: #92d0be;
  text-underline-offset: 0.25em;
}

.rule ul { padding-inline-start: 1.4rem; margin: 0 0 0.9em; }
.rule ul:last-child { margin-block-end: 0; }
.rule li + li { margin-block-start: 0.45rem; }
.rule li::marker { color: var(--link); }

.comments .example {
  margin: 0.35rem 0 0.85rem;
  padding: 0.45rem 0.75rem;
  background: var(--tint);
  border-inline-start: 3px solid #95cbbc;
  color: var(--muted);
}

.official-link { margin-block: 0.45rem 1.15rem; }
.official-link:last-child { margin-block-end: 0; }

.group-label {
  color: var(--link);
  font-size: 1rem;
  margin: 1.55rem 0 0.85rem;
}

.subrules {
  padding-inline-start: clamp(0.85rem, 2vw, 1.2rem);
  border-inline-start: 2px solid var(--line);
}

.subrules h3, .subrules h4 {
  color: var(--ink);
  font-size: 1.0625rem;
  margin: 1.2rem 0 0.25rem;
}

.subrules h3:first-child, .subrules h4:first-child { margin-block-start: 0; }

.footer {
  padding-block: 1.1rem 0;
  text-align: end;
  font-size: 0.9375rem;
}

@media (max-width: 48rem) {
  .layout { display: block; }
  .contents { position: static; margin-block-end: 2rem; }
  .hero::after { opacity: 0.6; }
}

@media print {
  .frame { width: 100%; }
  .hero { color: var(--text); background: none; padding: 1rem 0; }
  .hero h1, .hero .brand { color: var(--ink); }
  .hero::after, .contents, .skip-link, .footer { display: none; }
  .layout { display: block; }
  .rule { padding-block: 1rem; }
  h2, h3, h4 { break-after: avoid; }
}
