/* The lesson tabs keep the three actual stages visible while the board is in use. */
.tutorial-heading h1,
.article-sheet h1 {
  color: var(--ink);
  font: 900 clamp(2.15rem, 4.5vw, 3.95rem)/1.04 var(--display);
  letter-spacing: -.047em;
  text-wrap: balance;
}
.tutorial-heading p { max-width: 72ch; line-height: 1.6; }
.tutorial-heading > a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--primary);
  font-weight: 700;
  text-underline-offset: .22em;
}
.page-tutorial .journey {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  border: 0;
  border-bottom: 2px solid var(--ink);
  padding: 0;
  margin-block: 0 22px;
}
.page-tutorial .journey button {
  justify-content: flex-start;
  gap: clamp(5px, 1vw, 13px);
  min-height: 64px;
  padding: 9px clamp(6px, 1vw, 16px);
  border: 1px dashed var(--line);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: var(--paper);
  color: var(--muted);
}
.page-tutorial .journey button + button::before { content: none; }
.page-tutorial .journey button.current {
  border: 2px solid var(--ink);
  border-bottom: 0;
  background: var(--accent);
  color: var(--ink);
}
.page-tutorial .journey button:enabled:not(.current) {
  background: var(--surface);
  border: 1px solid var(--ink);
  border-bottom: 0;
  color: var(--ink);
}
.page-tutorial .step-num {
  flex: none;
  min-width: 2.15em;
  min-height: 2.15em;
  border: 1px solid currentColor;
  border-radius: 4px;
  font: 750 13px/1 var(--mono, monospace);
}
.page-tutorial .current .step-num { color: var(--surface); background: var(--ink); }
.page-tutorial .journey strong { font-weight: 800; }
.page-tutorial .step-status:not(:empty) { margin-inline-start: auto; font-weight: 650; }
.page-tutorial .lesson {
  padding: clamp(13px, 2vw, 26px) 0 4px;
  border-top: 3px solid var(--ink);
}
.page-tutorial .lesson h2,
.article-sheet h2 {
  color: var(--ink);
  font: 850 clamp(1.4rem, 2.2vw, 2rem)/1.18 var(--display);
  letter-spacing: -.025em;
  text-wrap: pretty;
}
.page-tutorial #lesson-kicker,
.page-tutorial #lesson-progress {
  color: var(--ink);
  font: 700 .79rem/1.4 var(--mono, monospace);
}
.page-tutorial #lesson-progress {
  padding: .24em .58em;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface);
}
.page-tutorial .callout {
  border-left: 4px solid var(--accent);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
}
.page-tutorial .hint-block + .hint-block,
.page-tutorial .rules { border-color: var(--line); border-top-style: dashed; }
.page-tutorial .rules summary { font-weight: 800; }
.page-tutorial #debrief {
  border: 0;
  border-block: 1px dashed var(--line);
  border-radius: 0;
  padding-inline: 0;
  background: transparent;
}
.page-tutorial .reason-options button {
  border: 1px solid var(--ink);
  border-radius: 4px;
  color: var(--ink);
  background: var(--surface);
}
.page-tutorial .reason-options button[aria-pressed="true"] {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--C) 42%, var(--surface));
  box-shadow: inset 4px 0 var(--primary);
}
.page-tutorial .tutorial-finish,
.article-sheet .site-button {
  min-height: 46px;
  max-width: 100%;
  padding: 10px 16px;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background: var(--accent);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  font-weight: 800;
  text-decoration: none;
}

/* A single printed instruction sheet, with a perforated binding margin. */
.article-sheet {
  --binding: clamp(12px, 2.25vw, 27px);
  position: relative;
  width: min(calc(100% - 2 * var(--gutter)), 840px);
  min-height: 0;
  margin: clamp(22px, 4.5vw, 64px) auto;
  padding: clamp(23px, 4.4vw, 54px) clamp(17px, 4.6vw, 58px) clamp(27px, 5vw, 62px)
           calc(var(--binding) + clamp(12px, 3.5vw, 46px));
  border: 1px solid var(--ink);
  border-top-width: 3px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 3px 0 var(--paper), 0 4px 0 var(--ink);
}
.article-sheet::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--binding);
  border-right: 1px dashed var(--line);
  pointer-events: none;
}
.article-sheet::after {
  content: "";
  position: absolute;
  left: calc(var(--binding) / 2 - 3px);
  top: 24px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--line), 0 14px 0 var(--paper), 0 14px 0 1px var(--line);
  pointer-events: none;
}
.article-sheet h1 { max-width: 19ch; margin: 0 0 .45em; }
.article-sheet h2 { margin: 1.3em 0 .45em; }
.article-sheet p { max-width: 69ch; line-height: 1.7; }
.article-sheet h1 + p { color: var(--ink); font-size: clamp(1rem, 1.6vw, 1.15rem); }
.page-privacy .article-sheet h1 + p { color: var(--muted); font: 650 .87rem/1.6 var(--mono, monospace); }
.article-sheet > a:not(.site-button) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--primary);
  font-weight: 750;
  text-underline-offset: .2em;
}
.page-404 .article-sheet { max-width: 660px; }

.page-strategy .article-sheet { width: min(calc(100% - 2 * var(--gutter)), 920px); }
.guide-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: clamp(21px, 4vw, 36px) 0;
  padding: 0;
  border-block: 2px solid var(--ink);
}
.guide-rules section {
  position: relative;
  padding: 14px 12px 14px 35px;
}
.guide-rules section:nth-child(2n) { border-inline-start: 1px dashed var(--line); padding-inline-start: 47px; }
.guide-rules section:nth-child(n+3) { border-top: 1px dashed var(--line); }
.guide-rules h3 { margin: 0 0 .2em; font-size: 1.06rem; }
.guide-rules p { margin: 0; font-size: .92rem; line-height: 1.55; }
/* Four little tile diagrams match the row, column, region and touching rules. */
.guide-rules section::before {
  content: "";
  position: absolute;
  top: 21px;
  left: 1px;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--ink);
  box-shadow: 8px 0 var(--ink), 16px 0 var(--ink);
}
.guide-rules section:nth-child(2)::before { left: 23px; top: 16px; box-shadow: 0 8px var(--ink), 0 16px var(--ink); }
.guide-rules section:nth-child(3)::before { top: 18px; box-shadow: 0 8px var(--ink), 8px 8px var(--ink); }
.guide-rules section:nth-child(4)::before { left: 19px; top: 18px; box-shadow: 8px 8px var(--ink); }
.guide-example {
  display: grid;
  grid-template-columns: minmax(180px, .75fr) minmax(0, 1.1fr);
  column-gap: clamp(18px, 3vw, 38px);
  align-items: start;
  background: transparent;
  border: 0;
  border-bottom: 1px dashed var(--line);
  border-radius: 0;
  margin-block: 0 26px;
  padding: 0 0 clamp(20px, 3vw, 35px);
  scroll-margin-top: 16px;
}
.guide-example > h2 { grid-column: 1 / -1; margin: 0 0 .7em; }
.guide-example .worked-board {
  grid-column: 1;
  grid-row: 2 / span 3;
  width: 100%;
  max-width: 294px;
  margin: 0;
}
.worked-board caption { padding-top: .8em; font-size: .84rem; }
.worked-board th { color: var(--ink); font-weight: 750; }
.worked-board td { border-color: var(--line); color: var(--ink); font-weight: 750; }
.worked-board .edge-r { border-right-color: var(--ink); }
.worked-board .edge-b { border-bottom-color: var(--ink); }
.guide-start { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin: 4px 0 22px; }
.guide-start > a:not(.site-button), .guide-solution summary {
  min-height: 44px; color: var(--primary); font-weight: 750; text-underline-offset: .22em;
}
.guide-start > a:not(.site-button) { display: inline-flex; align-items: center; }
.guide-example .worked-board { grid-row: 2; }
.guide-explanation { grid-column: 2; grid-row: 2; }
.guide-explanation > p { margin: 0 0 6px; }
.guide-solution { border-block: 1px dashed var(--line); }
.guide-solution summary { cursor: pointer; align-content: center; padding-block: 8px; }
.guide-solution p { margin: 4px 0 10px; }
.guide-rules h3 { color: var(--ink); font-family: var(--display); }
.worked-board td { position: relative; }
.proof-cross,.proof-queen { display: none; }
.guide-example:has(.guide-solution[open]) .proof-letter,
.opening-cell[data-played="true"] .proof-letter {
  position: absolute; left: 4px; top: 3px; font: 700 10px/1 var(--mono);
}
.guide-example:has(.guide-solution[open]) .proof-cross,
.opening-cell[data-played="true"] .proof-cross {
  display: block; position: absolute; left: 50%; top: 50%; width: 15px; height: 15px;
  transform: translate(-50%,-50%);
}
.proof-cross::before,.proof-cross::after { content: ''; position: absolute; inset: 0 6px; background: var(--ink); transform: rotate(45deg); }
.proof-cross::after { transform: rotate(-45deg); }
.guide-example:has(.guide-solution[open]) .proof-queen,
.opening-cell[data-played="true"] .proof-queen {
  display: block; position: absolute; inset: 20%; width: 60%; height: 60%; fill: var(--ink); stroke: none;
}

.guide-example[data-interactive] { grid-template-columns: minmax(250px,.75fr) minmax(0,1.1fr); }
.guide-example[data-interactive] .worked-board,
.guide-example[data-interactive] .guide-explanation { grid-row: 3; }
.guide-example[data-interactive] .guide-explanation > [data-i18n="strategyProbe"] { display: none; }
.guide-example .opening-status {
  grid-column: 1 / -1; grid-row: 2; margin: 0 0 9px; font-size: 15px; line-height: 1.4; color: var(--ink);
}
.opening-count { font: 700 12px/1 var(--mono); color: var(--primary); white-space: nowrap; }
.guide-example[data-interactive] .region-tile { height: clamp(46px,6vw,52px); padding: 0; }
.worked-board .opening-cell {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; display: grid; place-items: center;
  color: inherit; font: inherit; border: 0; border-radius: 0; background: transparent; touch-action: manipulation;
}
.opening-cell:focus-visible { outline: 3px solid var(--focus); outline-offset: -4px; }
.worked-board .opening-cell:disabled { color: inherit; opacity: 1; -webkit-text-fill-color: currentColor; }
.opening-cell:disabled, .opening-cell[aria-disabled="true"] { cursor: default; }
.guide-example .opening-retry { min-height: 44px; }
@media (max-width: 620px) {
  .guide-start { margin-bottom: 14px; }
  .guide-start .site-button { padding-inline: 11px; }
}
.article-sheet #feedback-form {
  margin: 1.4rem 0;
  padding: 16px 0 20px;
  border: 0;
  border-block: 1px dashed var(--line);
  border-radius: 0;
  background: transparent;
  gap: 7px;
}
.article-sheet #feedback-form label { color: var(--ink); font-weight: 750; }
.article-sheet #feedback-form :is(textarea,input) {
  padding: 10px 12px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  color: var(--ink);
  background: var(--surface);
}
.article-sheet #feedback-form textarea { min-height: 8.5rem; }
.article-sheet #feedback-form :is(textarea,input):focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.article-sheet #submit-feedback:disabled { background: var(--paper); color: var(--muted); box-shadow: none; }
.article-sheet #feedback-receipt:not(:empty) { color: var(--ink); font-weight: 650; }

@media (hover: hover) {
  .page-tutorial .journey button:enabled:not(.current):hover,
  .page-tutorial .reason-options button:hover { background: var(--paper); border-color: var(--primary); }
  .article-sheet .site-button:hover:not(:disabled), .page-tutorial .tutorial-finish:hover {
    background: var(--ink); color: var(--surface);
  }
}
@media (min-width: 850px) {
  .tutorial-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    column-gap: clamp(12px, 2vw, 25px);
  }
  .tutorial-heading h1 { grid-column: 1 / -1; }
  .tutorial-heading > a + a { margin-inline-start: 0; }
}
@media (max-width: 720px) {
  .tutorial-heading { margin-bottom: 8px; }
  .tutorial-heading h1 { font-size: clamp(1.9rem, 7vw, 2.6rem); }
  .tutorial-heading p { font-size: .9rem; line-height: 1.47; }
  .page-tutorial .journey button { min-height: 47px; }
  .page-tutorial .step-num { min-width: 1.65em; min-height: 1.65em; }
  .page-tutorial .journey strong { font-size: .82rem; }
  .page-tutorial .journey { margin-bottom: 14px; }
}
@media (max-width: 620px) {
  .guide-example { display: block; }
  .guide-example .worked-board { margin: 0 0 16px; }
}
@media (max-width: 515px) {
  .article-sheet, .page-strategy .article-sheet { width: calc(100% - 16px); }
  .guide-rules { grid-template-columns: 1fr; }
  .guide-rules section:nth-child(n) { border-inline-start: 0; padding: 11px 3px 11px 34px; }
  .guide-rules section + section { border-top: 1px dashed var(--line); }
  .guide-rules section:nth-child(2)::before { left: 9px; top: 12px; }
  .guide-rules section:nth-child(4)::before { left: 4px; top: 14px; }
}
@media (max-width: 355px) {
  .page-tutorial .journey button {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 5px 6px;
  }
  .page-tutorial .journey strong { line-height: 1.15; }
}

.field-note { scroll-margin-top: 16px; }
.column-proof { max-width: 640px; margin: 1.1rem 0 1.5rem; }
.column-views { border: 1px solid var(--line); border-radius: 5px; overflow: hidden; background: var(--paper); }
.column-views > div { overflow: hidden; }
.column-views img { display: block; width: 100%; height: auto; }
.column-views > div:last-child { display: none; }
.column-proof figcaption { max-width: 58ch; margin-top: .6rem; color: var(--muted); font-size: .89rem; line-height: 1.55; }
@media (max-width: 540px) {
  .column-views { max-width: 295px; }
  .column-views > div { position: relative; aspect-ratio: 1 / 1.07; }
  .column-views > div:last-child { display: block; border-top: 1px dashed var(--line); }
  .column-views img { position: absolute; width: 250%; max-width: none; top: -9%; left: -10%; }
  .column-views > div:last-child img { left: -136.25%; }
}
.technique-index { margin: 1.3rem 0; border-block: 1px solid var(--line); }
.technique-index summary { padding: 12px 0; min-height: 44px; color: var(--primary); cursor: pointer; font-weight: 750; }
.technique-index ul { margin: 0 0 .6rem; padding-inline-start: 1.4rem; }
.technique-index a { display: inline-block; padding-block: 9px; color: var(--primary); text-underline-offset: 3px; }
.field-note h3 { margin: 1.1rem 0 .4rem; }
