:root {
  color-scheme: light;
  --paper: #fff;
  --ink: #191c17;
  --soft: #4b5247;
  --surface: #f1f3ee;
  --shade: #edf1e8;
  --accent: #d8f55b;
  --focus: #496229;
  --margin: clamp(20px, 5vw, 78px);
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-underline-offset: .22em; text-decoration-thickness: .075em; }
a:hover { text-decoration-thickness: .14em; }
a:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 1px; }
strong { font-weight: 660; }
.shell { width: min(100%, 1450px); margin-inline: auto; padding-inline: var(--margin); }
.skip-link { position: fixed; z-index: 2; top: 10px; left: 10px; translate: 0 -160%; background: var(--accent); padding: 9px 12px; }
.skip-link:focus { translate: 0 0; }

.site-header { background: var(--surface); }
.header-inner { min-height: 74px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.wordmark { font-size: 26px; font-weight: 900; line-height: 1; letter-spacing: -.07em; text-decoration: none; white-space: nowrap; }
.wordmark span { color: #506b39; }
.site-header nav { display: flex; gap: clamp(13px, 3vw, 34px); justify-content: flex-end; align-items: center; font-size: 14px; font-weight: 660; }
.site-header nav a { white-space: nowrap; display: inline-flex; align-items: center; min-height: 44px; }
.studio-link { display: inline-flex; gap: 9px; align-items: center; background: var(--accent); padding: 7px 13px; text-decoration: none; }
.studio-link:hover { background: #e4fb87; }

.layout {
  display: grid;
  grid-template-columns: minmax(190px, 227px) minmax(0, 820px);
  column-gap: clamp(35px, 5.6vw, 94px);
  align-items: start;
  padding-top: clamp(46px, 7vw, 108px);
  padding-bottom: clamp(60px, 9vw, 132px);
}
.intro { grid-column: 2; grid-row: 1; max-width: 820px; margin-bottom: clamp(46px, 6.5vw, 89px); }
.breadcrumb { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--soft); font-size: 14px; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.intro h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(45px, 6.25vw, 92px); font-weight: 400; letter-spacing: -.056em; line-height: .99; text-wrap: balance; }
.lead { max-width: 54ch; margin: clamp(16px, 2.4vw, 26px) 0 0; color: #343b31; font-size: clamp(18px, 1.65vw, 23px); line-height: 1.45; }
.intro-links { display: flex; flex-wrap: wrap; gap: 9px 24px; margin-top: clamp(20px, 3.2vw, 34px); }
.intro-links a, .back-link { min-height: 42px; display: inline-flex; align-items: center; gap: 8px; font-weight: 640; font-size: 14px; }

.contents { grid-column: 1; grid-row: 1 / span 2; position: sticky; top: 24px; min-width: 0; max-height: calc(100dvh - 48px); overflow: auto; padding: 0 9px 7px 0; scrollbar-width: thin; }
.contents h2 { margin: 0 0 13px; color: var(--ink); font-size: 15px; font-weight: 700; }
.contents ol { padding: 0; margin: 0; list-style: none; }
.contents a { display: flex; align-items: center; min-height: 33px; padding: 4px 5px 4px 0; color: #3d4638; font-size: 14px; line-height: 1.28; text-decoration: none; }
.contents a:hover, .contents a:focus-visible { text-decoration: underline; }
.contents li + li { margin-top: 1px; }
.contents a:focus-visible { outline-offset: -1px; }
.contents .catalogue-link a { gap: 6px; font-weight: 660; color: #293c23; }

.handbook { grid-column: 2; grid-row: 2; min-width: 0; }
.handbook > section + section { margin-top: clamp(58px, 9vw, 120px); }
.handbook section[id], .handbook h3[id] { scroll-margin-top: 24px; }
.handbook h2 { font: 400 clamp(34px, 4.3vw, 56px)/1.02 Georgia, "Times New Roman", serif; margin: 0 0 22px; letter-spacing: -.045em; text-wrap: balance; }
.handbook h3 { font-size: clamp(19px, 2vw, 24px); line-height: 1.22; font-weight: 650; letter-spacing: -.033em; margin: 32px 0 10px; text-wrap: pretty; }
.handbook p { margin: 0 0 15px; max-width: 76ch; overflow-wrap: anywhere; }
.handbook ol, .handbook ul { margin: 16px 0 19px; padding-left: 1.45rem; }
.handbook li { padding-left: .28rem; }
.handbook li + li { margin-top: 8px; }
.handbook ol li::marker { color: #3c5034; font-weight: 650; }
.handbook code, .handbook kbd { font: 500 .86em/1.5 Consolas, "Courier New", monospace; overflow-wrap: anywhere; background: var(--surface); padding: .16em .26em; }
.handbook pre { margin: 16px 0 20px; padding: 15px 17px; background: var(--surface); overflow: auto; max-width: 100%; }
.handbook pre code { display: block; background: transparent; padding: 0; white-space: pre-wrap; }
.handbook blockquote { background: var(--surface); color: #263123; margin: 15px 0 20px; padding: 16px 19px; }
.shortcuts { width: 100%; margin-block: 19px 23px; border-collapse: collapse; font-size: 15px; line-height: 1.4; }
.shortcuts caption { text-align: left; font-weight: 660; margin-bottom: 9px; }
.shortcuts :is(th, td) { padding: 9px 11px; text-align: left; vertical-align: top; }
.shortcuts thead th { background: var(--shade); }
.shortcuts tbody tr:nth-child(odd) { background: var(--surface); }
.shortcuts tbody th { width: 39%; font-weight: 630; }
.shortcuts kbd { white-space: nowrap; }
.rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 22px 0; }
.rules > section { background: var(--surface); padding: 17px 18px; }
.rules h3 { margin: 0 0 7px; }
.rules p { margin: 0; }
.troubleshooting { margin: 0; }
.troubleshooting dt { font-weight: 670; line-height: 1.35; }
.troubleshooting dt:not(:first-child) { margin-top: 20px; }
.troubleshooting dd { margin: 5px 0 0; max-width: 74ch; }
.handbook .reference-note { margin-top: 30px; font-size: 14px; color: var(--soft); }
.footer { display: flex; min-height: 94px; justify-content: space-between; align-items: center; column-gap: 20px; }
.footer > a:last-child { font-size: 14px; font-weight: 650; padding-block: 12px; }

@media (max-width: 810px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-top: 43px; }
  .intro, .contents, .handbook { grid-column: 1; grid-row: auto; }
  .intro { margin-bottom: 27px; }
  .contents { position: static; max-height: none; overflow: visible; padding: 14px 13px; margin-bottom: 40px; background: var(--surface); }
  .contents h2 { margin-left: 6px; margin-bottom: 5px; }
  .contents ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 8px; }
  .contents a { min-height: 44px; padding-inline: 6px; }
  .footer { min-height: 72px; }
}

@media (max-width: 430px) {
  .header-inner { min-height: 63px; }
  .site-header .catalogue-nav { display: none; }
  .intro h1 { max-width: 12ch; }
  .intro-links { gap: 1px 16px; }
  .intro-links a { min-height: 41px; }
  .rules { grid-template-columns: 1fr; }
  .handbook pre { padding: 11px 12px; }
}
