@font-face {
  font-family: 'Barlow Condensed';
  src: url('fonts/barlow-condensed-800.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: 'Instrument Sans';
  src: url('fonts/instrument-sans.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #19293b;
  --muted: #46515a;
  --paper: #fcf8ed;
  --white: #fffdf7;
  --line: #ddd6c6;
  --red: #ed6a53;
  --yellow: #ffce54;
  --blue: #287791;
  --heading: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-family: 'Instrument Sans', system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }

body, h1, h2, h3, h4, p, figure { margin: 0; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 5px;
}

.shell {
  width: min(100% - 5.5rem, 72rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  z-index: 2;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--white);
  transform: translateY(-200%);
}

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

.site-header { border-bottom: 1px solid var(--line); }

.header-inner, .footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font: 800 1.75rem/1 var(--heading);
  letter-spacing: 0.025em;
  text-transform: uppercase;
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: end;
  gap: 0.17rem;
  height: 1.5rem;
  transform: rotate(-12deg);
}

.brand-mark i {
  width: 0.32rem;
  height: 0.94rem;
  background: var(--red);
  border-radius: 45% 40% 20% 25%;
}

.brand-mark i:nth-child(2) {
  height: 1.41rem;
  background: #eab237;
}

.brand-mark i:nth-child(3) {
  height: 1.16rem;
  background: #2e92ab;
}

nav a, .back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  font-weight: 700;
  text-decoration: none;
}

nav a:hover, .back-to-top:hover { text-decoration: underline; }

.hero {
  display: grid;
  grid-template-columns: 1fr 1.02fr;
  align-items: center;
  gap: clamp(2.5rem, 5.7vw, 5.1rem);
  padding-block: 4.9rem 5.3rem;
}

.series-mark { width: clamp(10.5rem, 18vw, 14.5rem); }

.hero h1 {
  position: relative;
  margin-block: 1rem 1.6rem;
  font: 800 clamp(4.2rem, 8.4vw, 7.5rem)/0.84 var(--heading);
  letter-spacing: -0.025em;
}

.crayon-underline {
  position: relative;
  display: inline-block;
  isolation: isolate;
}

.crayon-underline::after {
  position: absolute;
  z-index: -1;
  right: -0.045em;
  bottom: -0.015em;
  left: -0.035em;
  height: 0.18em;
  background: var(--red) url('crayon-red.webp') center / cover;
  clip-path: polygon(0 28%, 20% 13%, 58% 9%, 98% 0, 100% 70%, 67% 82%, 22% 96%, 1% 100%);
  transform: rotate(-2deg);
  content: '';
}

.hero-copy p {
  max-width: 23rem;
  color: var(--muted);
  font-size: clamp(1.04rem, 1.55vw, 1.2rem);
  line-height: 1.48;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.95rem;
  padding: 0.55rem 0.95rem;
  border: 1.5px solid var(--ink);
  border-radius: 0.35rem;
  font-size: 0.96rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button span { font: 700 1.15rem/1 system-ui, sans-serif; }

.button-yellow {
  min-height: 3.25rem;
  margin-top: 1.65rem;
  padding-inline: 1.05rem;
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--ink);
}

.button:hover { transform: translateY(-2px); }
.button-yellow:hover { box-shadow: 3px 5px 0 var(--ink); }
.button:active { transform: translateY(1px); }

.hero-art {
  position: relative;
  isolation: isolate;
  padding: 0.6rem 0.7rem 0.7rem 0.35rem;
}

.hero-art::before {
  position: absolute;
  z-index: -1;
  inset: 3% -1% 0 4%;
  background: var(--yellow) url('crayon-yellow.webp') center / cover;
  clip-path: polygon(0 2%, 96% 0, 100% 4%, 100% 94%, 96% 99%, 4% 100%, 0 96%);
  transform: rotate(4deg);
  content: '';
}

.hero-paper {
  position: relative;
  padding: clamp(0.55rem, 1.15vw, 0.9rem);
  border: 1px solid var(--ink);
  background: var(--white);
  box-shadow: 4px 6px 0 #19293b;
  transform: rotate(-3deg);
}

.hero-paper img { width: 100%; }

.catalog {
  padding-block: 2.75rem 4.4rem;
  border-block: 1px solid var(--line);
  background: #f6efdf;
  scroll-margin-top: 0;
}

.catalog h2 {
  margin-bottom: 1.45rem;
  font: 800 clamp(3.1rem, 5.5vw, 4.4rem)/0.95 var(--heading);
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.book {
  overflow: hidden;
  border: 1px solid #d8cfbb;
  border-radius: 0.8rem;
  background: var(--white);
  scroll-margin-top: 1rem;
}

.book-art {
  position: relative;
  display: grid;
  grid-template-columns: 59% 26%;
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  justify-content: center;
  gap: 5%;
  aspect-ratio: 1.75;
  padding: 1.2rem 1rem;
  isolation: isolate;
  background: var(--book-tone);
}

.book-art:not(:has(.preview-stack)) { grid-template-columns: minmax(0, 1fr); }

.book-tone-sand { --book-tone: #f3dfac; }
.book-tone-blue { --book-tone: #dcebed; }

.book-cover {
  z-index: 1;
  width: 100%;
  max-width: 16.4rem;
  justify-self: center;
  border: 1px solid rgb(25 41 59 / 22%);
  box-shadow: 2px 3px 0 rgb(25 41 59 / 12%), 7px 10px 14px rgb(25 41 59 / 17%);
  transform: rotate(-4deg);
}

.preview-stack {
  position: relative;
  align-self: stretch;
  padding: 0;
  margin: 0;
  list-style: none;
}

.preview-stack li {
  position: absolute;
  width: 86%;
  top: 4%;
  left: 0;
  transform: rotate(8deg);
}

.preview-stack li:nth-child(2) {
  top: 30%;
  left: 6%;
  transform: rotate(-6deg);
}

.preview-stack li:nth-child(3) {
  top: 56%;
  left: 0;
  transform: rotate(5deg);
}

.preview-stack li:hover, .preview-stack li:focus-within { z-index: 2; }

.preview-stack a {
  display: block;
  padding: 0.22rem;
  border: 1px solid rgb(25 41 59 / 26%);
  background: white;
  box-shadow: 2px 4px 7px rgb(25 41 59 / 14%);
}

.preview-stack img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}

.book-copy { padding: 1.35rem 1.55rem 1.55rem; }

.book-number {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.book-title {
  font: 800 clamp(2.15rem, 4vw, 3.05rem)/1 var(--heading);
  letter-spacing: -0.01em;
}

.book-detail {
  margin-top: 0.48rem;
  color: var(--muted);
  line-height: 1.45;
}

.button-paper { margin-top: 1.05rem; }
.button-paper:hover { background: var(--paper); }

.book-in-development {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.05rem;
  padding: 1.3rem 1.55rem 1.45rem;
}

.book-in-development .book-title { font-size: clamp(2rem, 3.6vw, 2.65rem); }

.book-status {
  padding: 0.5rem 0.75rem;
  border: 1px solid #d8cfbb;
  border-radius: 0.35rem;
  background: #f8efdc;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.footer-inner { min-height: 5.1rem; }
.footer-inner .brand { font-size: 1.45rem; }
.back-to-top { font-size: 0.91rem; }

body:has(.gallery[open]) { overflow: hidden; }

.gallery {
  width: min(100% - 1.5rem, 45rem);
  max-height: calc(100% - 1.5rem);
  padding: clamp(0.65rem, 2vw, 1.35rem);
  border: 1px solid var(--ink);
  border-radius: 0.75rem;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 18px 70px rgb(11 21 31 / 32%);
}

.gallery::backdrop { background: rgb(16 26 36 / 72%); }

.gallery-header, .gallery-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.gallery-header h2 {
  padding-left: 0.2rem;
  font: 800 clamp(1.65rem, 4.5vw, 2.35rem)/1 var(--heading);
}

.gallery button {
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--ink);
  border-radius: 0.3rem;
  background: var(--white);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.gallery button:hover { background: var(--yellow); }

.gallery .gallery-close { font: 400 1.65rem/1 system-ui, sans-serif; }

.gallery-stage {
  display: grid;
  place-items: center;
  height: min(61svh, 35rem, calc(100vw - 3rem));
  margin-block: 0.85rem;
  border: 1px solid var(--line);
  background: white;
}

.gallery-stage img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.gallery-count {
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 58rem) {
  .shell { width: calc(100% - 3.5rem); }
  .hero { padding-block: 3.75rem 4.25rem; }
  .book-art { aspect-ratio: 1.6; }
}

@media (max-width: 43rem) {
  .shell { width: calc(100% - 2.5rem); }
  .header-inner { min-height: 3.9rem; }
  .brand { font-size: 1.55rem; }

  .hero {
    grid-template-columns: 1fr;
    gap: 2.35rem;
    padding-block: 2.65rem 3.2rem;
  }

  .hero h1 { font-size: clamp(4rem, 13vw, 6.4rem); }
  .hero-art { width: min(100% - 0.7rem, 31rem); justify-self: center; }
  .catalog { padding-block: 2.2rem 3rem; }
  .books-grid { grid-template-columns: 1fr; gap: 1rem; }
  .book-art { aspect-ratio: 1.7; }
  .preview-stack { max-width: 8.5rem; }
}

@media (max-width: 27rem) {
  .shell { width: calc(100% - 2rem); }
  .hero h1 { font-size: clamp(3.7rem, 13.4vw, 4.5rem); }
  .book-copy, .book-in-development { padding-inline: 1.15rem; }
  .book-in-development { align-items: flex-start; flex-direction: column; }
  .book-art { aspect-ratio: 1.6; }
}

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
}

.collection + .collection { margin-top: 2.75rem; }

.collection-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.collection-title {
  font: 800 clamp(1.85rem, 3vw, 2.4rem)/1 var(--heading);
}

.series-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  font-size: 0.94rem;
  font-weight: 700;
  text-underline-offset: 0.2em;
}

.series-link:hover { color: var(--blue); }

.book-cover-link {
  display: grid;
  place-items: center;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-width: 16.4rem;
  min-height: 0;
  justify-self: center;
}

.book-cover-link .book-cover {
  width: auto;
  max-width: 100%;
  max-height: 100%;
}

.book-title a { text-decoration: none; }

.book-title a:hover {
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.12em;
}

.book-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem 0.65rem;
  margin-block: 1.15rem 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.book-breadcrumb a { min-height: 2rem; }

.series-hero {
  padding: clamp(2.25rem, 5.5vw, 4.35rem) 1rem;
  border: 1px solid #cbdfe3;
  border-radius: 0.85rem;
  background-color: #dcebed;
  background-image: linear-gradient(125deg, rgb(235 248 250 / 92%), rgb(219 239 243 / 86%)), url('crayon-blue.webp');
  background-size: auto, 18rem;
  text-align: center;
}

.series-kicker {
  margin-bottom: 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.series-hero h1 {
  font: 800 clamp(3.25rem, 8vw, 6rem)/0.95 var(--heading);
}

.series-wordmark {
  width: min(100%, 35rem);
  margin-inline: auto;
}

.series-intro {
  max-width: 48ch;
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: clamp(1.04rem, 1.55vw, 1.2rem);
  line-height: 1.5;
  text-wrap: pretty;
}

.series-section { margin-block: clamp(2.2rem, 5vw, 3.5rem); }

.series-section h2 {
  margin-bottom: 1rem;
  font: 800 clamp(2.6rem, 5vw, 3.7rem)/0.95 var(--heading);
}

.series-section .book-in-development { grid-column: auto; }

.book-hero {
  display: grid;
  grid-template-columns: 1.18fr 1fr;
  overflow: hidden;
  margin-bottom: 3.5rem;
  border: 1px solid #d8cfbb;
  border-radius: 0.85rem;
  background: var(--white);
}

.book-hero-copy {
  align-self: center;
  padding: clamp(1.5rem, 4.5vw, 4rem);
}

.book-hero h1 {
  margin-block: 0.45rem 0.6rem;
  font: 800 clamp(3.5rem, 7.5vw, 7rem)/0.88 var(--heading);
  letter-spacing: -0.024em;
  text-wrap: balance;
}

.book-subtitle {
  font-size: clamp(1.18rem, 2vw, 1.45rem);
  font-weight: 700;
  line-height: 1.25;
}

.book-intro {
  max-width: 43ch;
  margin-top: 0.95rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.55vw, 1.2rem);
  line-height: 1.5;
}

.book-facts {
  display: grid;
  gap: 0.24rem;
  margin: 0.95rem 0 0;
  padding-left: 1.15rem;
  font-size: 0.93rem;
  line-height: 1.42;
}

.book-series-credit {
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.93rem;
}

.book-series-credit a {
  font-weight: 700;
  text-underline-offset: 0.15em;
}

.book-actions {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.8rem 0.9rem;
}

.book-actions:not(:empty) { margin-top: 1.25rem; }

.book-actions .button-yellow { margin-top: 0; }

.button-amazon {
  min-height: 3.25rem;
  background: var(--white);
}

.button-amazon:hover { background: var(--paper); }

.sample-detail {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.book-hero-art {
  display: grid;
  place-items: center;
  padding: clamp(1.8rem, 5.5vw, 4.5rem);
  background: var(--book-tone);
}

.book-hero-art .book-cover {
  width: min(100%, 25rem);
  max-width: none;
}

.look-inside {
  padding-block: 2.75rem 3.5rem;
  border-block: 1px solid var(--line);
  background: #f6efdf;
}

.look-inside h2 {
  margin-bottom: 1.25rem;
  font: 800 clamp(2.75rem, 5.5vw, 4.4rem)/0.95 var(--heading);
}

.book-previews {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.75rem, 2vw, 1.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.book-previews a {
  display: block;
  overflow: hidden;
  border: 1px solid #d8cfbb;
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 2px 3px 0 #e7ddc9;
}

.book-previews a:hover {
  border-color: var(--blue);
  box-shadow: 2px 3px 0 var(--blue);
}

@media (max-width: 43rem) {
  .book-hero { grid-template-columns: 1fr; margin-bottom: 2.5rem; }
  .book-hero h1 { font-size: clamp(3.35rem, 12vw, 5rem); }
  .book-hero-art { padding: 2rem; }
  .book-hero-art .book-cover { width: min(100%, 19rem); }
  .look-inside { padding-block: 2.25rem 2.8rem; }
}

@media (max-width: 31rem) {
  .book-previews { grid-template-columns: 1fr; }
}
