/* The preview shares the site's header, typography and book-card styles. */
.mc-home-intro {container-type: inline-size}
.mc-home-intro .mc-home-kicker {font-size: clamp(.8125rem, 1.4vw, .9375rem); color: var(--ink)}
.mc-home-intro .mc-home-lede {color: var(--ink)}
.mc-home-intro :focus-visible {outline-color: var(--ink)}
#books, #puzzle-reveal {scroll-margin-top: 100px}
.reveal-section {border-block: 1px solid #cbd9cf; padding-block: clamp(24px,3vw,40px)}
.reveal-layout {display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); align-items: center; gap: clamp(28px,6vw,84px)}
.reveal-copy {container-type: inline-size}
.reveal-copy h2,.print-invite h2 {line-height: 1.04; letter-spacing: -.05em; margin: 0}
.reveal-copy h2 {font-size: 1.75rem; font-size: min(2.875rem, 8.35cqi)}
.reveal-copy > p:not(.mc-home-kicker),.print-invite p {font-size: 17px; line-height: 1.65; margin: 20px 0; color: #394940}
.reveal-copy > p:not(.mc-home-kicker) {max-width: 48ch; line-height: 1.85}
@media (min-width: 900px) {
  .reveal-copy {margin-block-end: 64px}
}
.sample-key {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.5rem), 1fr));
  gap: 12px;
  padding: 0;
  margin: 24px 0 28px;
  list-style: none;
}
.sample-key li {font-size: 14px}
.sample-key li span {background:var(--swatch); color:var(--ink); flex-shrink:0; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 4px; font: 700 14px/1 system-ui}
.sample-sheet {margin: 0; justify-self: center; container-type: inline-size}
.sample-frame {padding-block: 4px 9px; border-radius: 16px; box-shadow: 0 0 0 1px #899f93, 6px 7px 0 #c9d8cd}
.sample-toolbar {display:flex; align-items:flex-end; justify-content:space-between; width:calc(100% - 20px); gap:6px; margin-bottom:2px; flex-wrap:wrap}
.sample-state {
  display: block;
  color: #42574b;
  font: 500 11px/1.4 system-ui;
  text-align: start;
}
.sample-stages {display:inline-flex; border-radius:10px; padding:3px; background:#eeefe9; gap:2px}
.sample-sheet button {min-height:40px; padding: 6px 12px; border-radius:7px; border:0; background:transparent; font:600 14px/1.2 system-ui; color:#36473c; cursor:pointer}
.sample-stages button {min-height:26px; padding:3px 6px; white-space:nowrap}
.sample-sheet button:focus-visible {outline:3px solid #805500; outline-offset:2px}
.sample-sheet .sample-zoom {display:inline-flex;align-items:center;gap:4px;padding-inline:3px;font-size:12px}
.sample-zoom[aria-pressed="true"] .zoom-plus {display:none}
.sample-window {position:relative; aspect-ratio:39 / 50; overflow:hidden; background:#fffdf8}
.sample-window canvas,.sample-window img {display:block; width:100%; height:100%; object-fit:contain}
.sample-sheet [hidden] {display:none}
.print-invite {
  padding: 50px 0;
  border-bottom: 1px solid var(--dark-line);
  background: var(--black);
  color: var(--white);
}
.print-invite :focus-visible {outline-color: var(--yellow)}
.print-layout {display:flex;align-items:center;justify-content:center;gap:clamp(25px,6vw,78px)}
.print-thumb {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  flex-shrink: 0;
  width: clamp(220px, 26vw, 330px);
  margin: 0;
  padding-inline: 14px;
}
.print-thumb img {
  grid-row: 1;
  display: block;
  width: 100%;
  height: auto;
  padding: 5px;
  border: 1px solid #ccd8c7;
  background: var(--white);
  box-shadow: 0 7px 14px #0005;
}
.print-sheet-mono {
  grid-column: 3 / span 3;
  transform: rotate(9deg);
}
.print-sheet-color {
  grid-column: 1 / span 3;
  z-index: 1;
  transform: rotate(-4deg);
}
.print-invite h2 {font-size:clamp(30px,3.2vw,46px)}
.print-invite p {max-width:44ch;margin:14px 0 20px;color:#D6DAD1;font-size:clamp(15px, 2vw, 17px)}
@media(max-width:760px){
 .reveal-layout {grid-template-columns:1fr;gap:24px}
 .reveal-copy .mc-home-kicker {margin-bottom:10px}
 .sample-key {margin:15px 0}
 .reveal-copy > p:not(.mc-home-kicker) {margin:12px 0}
 .print-layout {gap:22px}
}
@media(max-width:460px){
 .sample-sheet button {font-size:13px;padding-inline:9px}
 .sample-stages button {min-height:30px}
 .print-layout {flex-direction:column;text-align:center}
}
@container (max-width: 355px) {
 .sample-sheet .sample-zoom {min-width:44px;min-height:44px;justify-content:center}
 .sample-zoom span {display:none}
}
@container (max-width: 290px) {
 .sample-toolbar {width:calc(100% - 12px)}
 .sample-sheet .sample-stages button {font-size:12px;padding-inline:4px}
}

/* Keep the homepage footer compact while leaving each link easy to select. */
.site-footer {padding-block: 24px 14px}
.site-footer .footer-grid {
  grid-template-columns: minmax(max-content, 1.65fr) repeat(3, minmax(0, 1fr));
  gap: 14px clamp(14px, 2.5vw, 32px);
}
.site-footer .footer-brand {grid-column: auto}
.footer-brand .brand {margin-bottom: 8px}
.footer-brand > .footer-small {margin-top: 4px}
.site-footer h2 {margin-bottom: 4px}
.site-footer .footer-link {min-height: 28px; padding-block: 5px}
.site-footer .footer-bottom {
  margin-top: 15px;
  padding-top: 10px;
  gap: 4px 16px;
  flex-flow: row wrap;
}
@media (max-width: 699px) {
  .site-footer {padding-block: 18px 12px}
  .site-footer .footer-grid {grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px}
  .site-footer .footer-brand {grid-column: 1 / -1}
  .footer-brand .brand {margin-bottom: 5px}
  .site-footer .footer-link {min-height: 32px; padding-block: 7px}
}

.sample-key button {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  padding: 4px;
  font: inherit;
  color: inherit;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
}
.sample-key button:focus-visible {outline:3px solid #805500; outline-offset:2px}
.sample-window.enlarged {overflow:auto; overscroll-behavior:contain}
.coloring-grid {display:grid; width:100%; aspect-ratio:39 / 50; grid-template-columns:repeat(39,1fr); grid-template-rows:repeat(50,1fr); container-type:inline-size}
.enlarged .coloring-grid {width:max(250%, 1248px)}
.sample-sheet .puzzle-cell {
  min-width:0; min-height:0; padding:0; margin:0; border:0; border-radius:0;
  box-shadow:inset 0 0 0 .4px #a3aba3; background:#fffdf8; color:#49544d;
  font:500 1.65cqw/1 system-ui; cursor:crosshair;
}
.sample-sheet .puzzle-cell.painted {background:var(--cell-color); color:transparent; box-shadow:inset 0 0 0 .4px #000}
.sample-sheet .puzzle-cell:focus-visible {outline:2px solid #614300; outline-offset:-2px; z-index:1}
.sample-stages {max-width:100%;flex-wrap:wrap}

#monochrome-reveal {scroll-margin-top:100px}
.mono-reveal {
  border-block-start:0;
  border-block-end-color:#d5d8d3;
}
.mono-reveal .reveal-copy > .mono-instructions {
  font-size: 16px;
  text-wrap: balance;
}
.mono-reveal .sample-frame {box-shadow:0 0 0 1px #a5aba4, 6px 7px 0 #dbddd8}
.mono-reveal .sample-key {grid-template-columns:repeat(2,minmax(0,1fr))}
.mono-reveal .mono-key-mark {
  width:32px;
  height:32px;
  background:white url("assets/pegasus-mark-key.webp") center var(--key-position) / 100% 600% no-repeat;
}
.mono-reveal .sample-window, .mono-reveal .mono-grid {aspect-ratio:46 / 60}
.mono-reveal .mono-grid {grid-template-columns:repeat(46,minmax(0,1fr)); grid-template-rows:repeat(60,minmax(0,1fr))}
.mono-reveal .puzzle-cell {
  color:#5a615b;
  background:#fff;
  font-size:1.56cqw;
  position:relative;
}
.mono-reveal .puzzle-cell.painted {color:transparent; box-shadow:inset 0 0 0 .4px #a3aba3}
.mono-reveal .puzzle-cell.painted::after {
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
}
.mono-reveal .puzzle-cell {--slash:linear-gradient(135deg,transparent 44%,#171918 45% 55%,transparent 56%);--backslash:linear-gradient(45deg,transparent 44%,#171918 45% 55%,transparent 56%)}
.mono-reveal .puzzle-cell[data-mark="1"].painted::after {background:radial-gradient(circle closest-side,#171918 20%,transparent 23%)}
.mono-reveal .puzzle-cell[data-mark="2"].painted::after {background:var(--slash)}
.mono-reveal .puzzle-cell[data-mark="3"].painted::after {background:var(--backslash)}
.mono-reveal .puzzle-cell[data-mark="4"].painted::after {background:var(--slash),var(--backslash)}
.mono-reveal .puzzle-cell[data-mark="5"].painted::after {
  background:var(--slash),var(--backslash),
    linear-gradient(90deg,transparent 44%,#171918 45% 55%,transparent 56%),
    linear-gradient(transparent 44%,#171918 45% 55%,transparent 56%);
}
.mono-reveal .puzzle-cell[data-mark="6"].painted::after {background:#171918}
.mono-reveal .enlarged .mono-solution {width:max(250%, 1408px); max-width:none; height:auto}

.mc-home-book-grid {
  inline-size: 100%;
  zoom: .8;
}

.mc-home-book-grid .book-cover-card-copy {
  container-type: inline-size;
}

#books .book-card-method {
  color: #2F588C;
  font-size: min(2.0625rem, 8.5cqi);
  line-height: 1.15;
  white-space: nowrap;
}

@supports (background-clip: text) {
  #books .book-card-method {
    width: fit-content;
    background-image: linear-gradient(90deg, #006B66, #2F588C);
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

@media (forced-colors: active) {
  #books .book-card-method {-webkit-text-fill-color: currentColor}
}

/* Shared artwork dimensions for the hero and interactive samples. */
.sample-sheet {
  width: min(100%, clamp(238px, 33vw, 361px));
}
.mc-hero-gallery .mc-home-art-frame, .sample-frame {
  display: grid;
  place-items: center;
  border: 0;
  background: #fffdf8;
}
.mc-hero-gallery .mc-home-art-frame {
  aspect-ratio: 361 / 463;
  padding: 0;
}
.mc-hero-gallery .mc-home-art-frame::after {content: none}
.mc-gallery-viewport, .sample-window, .sample-state {
  width: calc(100% * 316 / 361);
}
/* Finished puzzle carousel in the homepage hero. */
.mc-home-hero-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: var(--home-hero-gap);
}
.mc-hero-gallery-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: clamp(12px, 2vw, 24px);
  width: 100%;
  max-width: 650px;
  justify-self: end;
}
.mc-home-art.mc-hero-gallery {width: 100%; max-width: none}
.mc-hero-gallery .mc-hero-gallery-label {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
}
@media (max-width: 760px) {
  .mc-home-hero-grid {grid-template-columns: minmax(0, 1fr)}
  .mc-hero-gallery-pair {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    max-width: 300px;
    justify-self: center;
  }
}
.mc-gallery-viewport {
  position: relative;
  overflow: hidden;
  aspect-ratio: 316 / 425;
  border-radius: 8px;
  touch-action: pan-y pinch-zoom;
}
.mc-gallery-track {
  display: flex;
  height: 100%;
  list-style: none;
  padding: 0;
  margin: 0;
}
.mc-gallery-slide {
  flex: 0 0 100%;
  min-width: 0;
  background: #000;
}
.mc-gallery-slide[data-kind="Monochrome"] {background: #fff}
.mc-hero-gallery .mc-gallery-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
}
.mc-gallery-arrows {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 4px;
  pointer-events: none;
}
.mc-gallery-arrows[hidden] {display: none}
.mc-gallery-arrow {
  display: grid;
  place-items: center;
  min-block-size: 44px;
  min-inline-size: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: rgb(17 18 22 / 62%);
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
}
@media (hover: hover) and (pointer: fine) {
  .mc-gallery-arrow {opacity: 0}
  .mc-gallery-arrow:hover, .mc-gallery-arrow:focus-visible {opacity: 1}
}
.mc-gallery-arrow:focus-visible {outline: 2px solid #fff200; outline-offset: 1px}

/* Keep the finished color or mark visible while interacting with a filled cell. */
@media (hover: hover) {
  .puzzle-cell.painted:hover:not(:focus-visible) {
    outline: 1px solid var(--button-hover);
    outline-offset: -1px;
  }
}

.puzzle-cell.painted:active:not(:focus-visible) {
  outline: 1px solid var(--button-active);
  outline-offset: -1px;
}
