:root {
  --paper: #f8f4ec;
  --paper-deep: #f3eadb;
  --ink: #101010;
  --muted: #57534d;
  --blue: #06458e;
  --blue-dark: #073b78;
  --yellow: #ffc81d;
  --green: #88bb29;
  --orange: #ff7b17;
  --line: rgba(16, 16, 16, .66);
  --hand: "Patrick Hand", "Comic Sans MS", cursive;
  --body: "Nunito Sans", Arial, sans-serif;
  --shadow: 0 18px 55px rgba(68, 48, 26, .08);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 86px;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 22%, rgba(255, 255, 255, .8), transparent 24rem),
    radial-gradient(circle at 85% 10%, rgba(255, 255, 255, .75), transparent 28rem),
    var(--paper);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: .22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.09'/%3E%3C/svg%3E");
}

button,
a { transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease; }

a { color: inherit; }

.page-shell { max-width: 1376px; }

.skip-link {
  position: fixed;
  z-index: 2000;
  top: .5rem;
  left: .5rem;
  padding: .75rem 1rem;
  color: #fff;
  background: var(--blue);
  border-radius: .5rem;
}

.site-header {
  background: rgba(248, 244, 236, .9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  border-color: rgba(16, 16, 16, .12);
  box-shadow: 0 8px 28px rgba(45, 32, 20, .06);
}

.navbar { min-height: 82px; }

.brand-mark {
  display: inline-flex;
  align-items: baseline;
  color: var(--ink);
  font-family: var(--hand);
  font-size: clamp(1.7rem, 2.5vw, 2.15rem);
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1;
  text-decoration: none;
  transform: rotate(-1deg);
}

.brand-mark:hover { color: var(--ink); transform: rotate(0); }
.brand-blue { color: var(--blue); }
.brand-mark small { margin-left: 2px; font-size: .63em; }

.navbar-nav { gap: clamp(.35rem, 1.15vw, 1.2rem); }

.navbar .nav-link {
  position: relative;
  padding: .65rem .5rem !important;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 800;
  white-space: nowrap;
}

.navbar .nav-link::after {
  position: absolute;
  right: .3rem;
  bottom: .22rem;
  left: .3rem;
  height: 1px;
  content: "";
  background: var(--ink);
  transform: scaleX(0) rotate(-1deg);
  transform-origin: left;
  transition: transform .2s ease;
}

.navbar .nav-link:hover::after,
.navbar .nav-link.active::after { transform: scaleX(1) rotate(-1deg); }

.navbar-toggler {
  padding: .25rem .55rem;
  border: 1px solid var(--ink);
  border-radius: 7px 10px 6px 9px;
  font-size: 1.7rem;
  box-shadow: none !important;
}

.btn {
  border-width: 1px;
  border-radius: 6px 8px 5px 7px;
  font-weight: 800;
}

.btn-lg { padding: .73rem 1.6rem; font-size: .92rem; }
.btn-sm { padding-top: .48rem; padding-bottom: .48rem; }

.btn-primary-sketch {
  color: #fff;
  background: linear-gradient(135deg, #0754a4, var(--blue-dark));
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07), 0 6px 16px rgba(6, 69, 142, .14);
}

.btn-primary-sketch:hover,
.btn-primary-sketch:focus {
  color: #fff;
  background: #08356d;
  border-color: #08356d;
  transform: translateY(-2px) rotate(-.3deg);
  box-shadow: 0 9px 22px rgba(6, 69, 142, .22);
}

.btn-outline-ink {
  color: var(--ink);
  background: rgba(255, 255, 255, .24);
  border-color: var(--ink);
}

.btn-outline-ink:hover,
.btn-outline-ink:focus {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
  transform: translateY(-2px) rotate(.25deg);
}

.cart-button {
  position: relative;
  display: grid;
  width: 43px;
  height: 43px;
  padding: 0;
  place-items: center;
  color: var(--ink);
  background: transparent;
  border: 0;
  font-size: 1.45rem;
}

.cart-button:hover { transform: rotate(-5deg) scale(1.08); }

.cart-count {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  place-items: center;
  background: var(--yellow);
  border: 1px solid #d9a900;
  border-radius: 50%;
  font-size: .65rem;
  font-weight: 900;
}

.hero-section { padding: 2.2rem 0 1.3rem; }

.hero-copy { padding-left: clamp(.75rem, 2vw, 2rem); }

.eyebrow {
  margin-bottom: .7rem;
  font-family: var(--hand);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.eyebrow span {
  position: relative;
  display: inline-block;
  z-index: 0;
  padding: .05rem .65rem;
  transform: rotate(-1deg);
}

.eyebrow span::before {
  position: absolute;
  z-index: -1;
  inset: 2px -2px 0;
  content: "";
  background: var(--yellow);
  border: 1px solid rgba(16, 16, 16, .45);
  clip-path: polygon(1% 13%, 99% 0, 97% 91%, 0 100%);
}

.hero-copy h1 {
  max-width: 610px;
  margin-bottom: 1rem;
  font-family: var(--hand);
  font-size: clamp(2.55rem, 4.4vw, 4rem);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: .01em;
}

.hero-lead {
  max-width: 570px;
  margin-bottom: 1.6rem;
  font-size: clamp(.98rem, 1.2vw, 1.1rem);
  line-height: 1.55;
}

.hero-art-wrap {
  position: relative;
  min-height: 460px;
  display: flex;
  align-items: center;
}

.hero-art {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
  filter: saturate(.96) contrast(1.02);
  transform: scale(1.08);
}

.hero-note {
  position: absolute;
  right: .4rem;
  bottom: 1.8rem;
  display: flex;
  flex-direction: column;
  font-family: var(--hand);
  font-size: clamp(1.1rem, 1.8vw, 1.55rem);
  font-weight: 700;
  line-height: 1.25;
  transform: rotate(-1deg);
}

.hero-note::after {
  width: 100%;
  height: 8px;
  margin-top: .2rem;
  content: "";
  border-top: 3px solid var(--blue);
  border-radius: 50%;
  transform: rotate(-3deg);
}

mark {
  padding: 0 .2em;
  color: inherit;
  background: linear-gradient(transparent 42%, var(--yellow) 42%, var(--yellow) 91%, transparent 91%);
}

.feature-grid { max-width: 630px; margin-top: .8rem; }

.feature-item { text-align: center; }
.feature-icon { display: block; margin-bottom: .4rem; font-size: 2.25rem; line-height: 1; }
.feature-item h2 { margin-bottom: .2rem; font-size: .78rem; font-weight: 900; }
.feature-item p { max-width: 145px; margin: 0 auto; font-size: .68rem; line-height: 1.5; }

.catalog-section { padding: 1.25rem 0 .5rem; }

.sketch-panel {
  position: relative;
  background: rgba(255, 255, 255, .1);
  border: 1px solid var(--line);
  border-radius: 8px 12px 7px 10px;
  box-shadow: var(--shadow);
}

.sketch-panel::before {
  position: absolute;
  inset: 3px -2px -2px 3px;
  z-index: -1;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(16, 16, 16, .14);
  border-radius: 10px 7px 12px 8px;
}

.latest-book,
.series-panel { padding: 1rem 1.25rem; }

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .8rem;
}

.panel-heading h2,
.community-invite h2,
.audio-card h2,
.modal-title,
.offcanvas-title {
  margin: 0;
  font-family: var(--hand);
  font-weight: 700;
}

.panel-heading h2 { font-size: 1.45rem; }

.new-badge {
  padding: .05rem .5rem;
  background: var(--yellow);
  border: 1px solid rgba(16, 16, 16, .4);
  font-family: var(--hand);
  font-weight: 700;
  transform: rotate(-4deg);
}

.book-cover {
  width: 100%;
  height: auto;
  border: 1px solid rgba(16, 16, 16, .45);
  box-shadow: 6px 7px 0 rgba(16, 16, 16, .08);
  transform: rotate(-.7deg);
}

.book-info h3,
.series-card h3 {
  margin: 0;
  font-family: var(--hand);
  font-weight: 700;
}

.book-info h3 { font-size: clamp(1.5rem, 2.1vw, 2rem); letter-spacing: .02em; }
.book-subtitle { font-size: .95rem; font-weight: 800; }
.book-summary { color: #25221f; font-size: .78rem; }
.price { display: block; font-size: 1.05rem; }

.link-arrow {
  padding: .35rem .2rem;
  background: transparent;
  border: 0;
  font-size: .7rem;
  font-weight: 900;
  white-space: nowrap;
}

.link-arrow:hover { color: var(--blue); transform: translateX(3px); }

.series-scroll {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: .4rem;
}

.series-card {
  display: flex;
  min-width: 0;
  height: 205px;
  padding: .65rem .55rem 0;
  flex-direction: column;
  overflow: hidden;
  background: rgba(255, 255, 255, .24);
  border: 1px solid rgba(16, 16, 16, .55);
  border-radius: 6px 9px 5px 7px;
}

.series-title { display: flex; align-items: center; gap: .45rem; }
.series-card h3 { font-size: 1rem; white-space: nowrap; }
.series-card p { min-height: 38px; margin: .3rem .1rem 0 2.25rem; font-size: .62rem; line-height: 1.35; text-align: center; }
.series-card img { width: 100%; height: auto; margin-top: auto; mix-blend-mode: multiply; object-fit: cover; object-position: center bottom; }
.series-arrow { font-size: 1rem; }

.series-number {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  color: #fff;
  border: 1px solid var(--ink);
  border-radius: 48% 52% 46% 54%;
  font-family: var(--hand);
  font-size: 1.25rem;
  font-weight: 700;
  box-shadow: inset -2px -2px 0 rgba(0, 0, 0, .08);
}

.series-number.blue { background: var(--blue); }
.series-number.yellow { color: var(--ink); background: var(--yellow); }
.series-number.green { color: var(--ink); background: var(--green); }
.series-number.orange { color: var(--ink); background: var(--orange); }

.community-section { padding: .9rem 0 .4rem; }

.community-strip {
  display: grid;
  grid-template-columns: 1.05fr 1.25fr;
  align-items: center;
  gap: 1.4rem;
  padding: .65rem 1.5rem;
  background: linear-gradient(96deg, rgba(255, 255, 255, .18), rgba(255, 238, 203, .48));
}

.community-invite { display: flex; align-items: center; gap: 1rem; }
.community-invite img { width: 110px; height: 90px; flex: 0 0 auto; object-fit: cover; object-position: top; mix-blend-mode: multiply; }
.community-invite h2 { font-size: 1.2rem; }
.community-invite p { margin: .1rem 0 .5rem; font-size: .7rem; }

.community-stats { display: grid; grid-template-columns: repeat(3, 1fr); }

.stat-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .75rem;
  min-height: 75px;
  padding: .4rem 1rem;
  border-left: 1px solid rgba(16, 16, 16, .18);
}

.stat-item:first-child { border-left: 0; }
.stat-item > i { font-size: 2.1rem; }
.stat-item strong { display: block; font-family: var(--hand); font-size: 1.7rem; line-height: 1; }
.stat-item span { display: block; font-size: .65rem; font-weight: 900; }
.stat-item small { display: block; max-width: 120px; margin-top: .25rem; font-size: .58rem; line-height: 1.35; }

.quote-section { padding: .75rem 0 2rem; }
.quote-section blockquote { margin: 0; font-family: var(--hand); font-size: clamp(1rem, 1.7vw, 1.35rem); font-weight: 700; text-align: center; }

.audio-section { padding: 1.5rem 0 4rem; }

.audio-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  background: rgba(231, 238, 247, .42);
}

.audio-icon {
  display: grid;
  width: 78px;
  height: 78px;
  flex: 0 0 78px;
  place-items: center;
  color: var(--blue);
  border: 1px solid var(--ink);
  border-radius: 50% 45% 52% 47%;
  font-size: 2.5rem;
  transform: rotate(-3deg);
}

.section-kicker { margin: 0; color: var(--blue); font-size: .72rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.audio-card h2 { font-size: 1.7rem; }
.audio-card p:not(.section-kicker) { margin: .2rem 0 .6rem; font-size: .8rem; }

.audio-player { display: flex; max-width: 560px; align-items: center; gap: .65rem; }
.audio-play { display: grid; width: 32px; height: 32px; padding: 0; place-items: center; color: #fff; background: var(--blue); border: 0; border-radius: 50%; }
.audio-track { height: 5px; flex-grow: 1; overflow: hidden; background: rgba(16, 16, 16, .16); border-radius: 10px; }
.audio-track span { display: block; width: 0; height: 100%; background: var(--blue); transition: width .4s linear; }
.audio-player time { min-width: 38px; font-size: .67rem; font-variant-numeric: tabular-nums; }

.site-footer { padding: 1.5rem 0; background: rgba(16, 16, 16, .94); color: #fff; }
.site-footer .brand-mark { color: #fff; }
.site-footer p { font-family: var(--hand); font-size: 1.1rem; }
.social-links { display: flex; justify-content: flex-end; gap: .8rem; }
.social-links a { display: inline-grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(255, 255, 255, .55); border-radius: 50%; }
.social-links a:hover { color: var(--yellow); border-color: var(--yellow); transform: translateY(-2px); }

.modal-content { background: var(--paper); }
.modal-title, .offcanvas-title { font-size: 1.55rem; }
.form-control { background: rgba(255, 255, 255, .42); border-color: rgba(16, 16, 16, .5); border-radius: 6px 8px 5px 7px; }
.form-control:focus { background: #fff; border-color: var(--blue); box-shadow: 0 0 0 .2rem rgba(6, 69, 142, .12); }
.offcanvas { background: var(--paper); }

.empty-cart { padding: 3rem 1rem; color: var(--muted); text-align: center; }
.empty-cart i { display: block; font-size: 3rem; }
.cart-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-bottom: 1px dashed rgba(16, 16, 16, .25); }
.cart-item-title { font-family: var(--hand); font-size: 1.1rem; font-weight: 700; }
.cart-remove { padding: .25rem; color: #8b1f1f; background: transparent; border: 0; }
.cart-summary { padding-top: 1rem; border-top: 1px solid var(--ink); }
.book-list { padding-left: 1.4rem; font-family: var(--hand); font-size: 1.2rem; line-height: 1.7; }

.toast { background: #fffdf8; border: 1px solid var(--ink); border-radius: 7px 10px 6px 8px; }

.back-to-top {
  position: fixed;
  z-index: 1020;
  right: 1.2rem;
  bottom: 1.2rem;
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  color: #fff;
  background: var(--blue);
  border: 1px solid var(--ink);
  border-radius: 50% 45% 53% 47%;
  opacity: 0;
  pointer-events: none;
  transform: translateY(15px);
}

.back-to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }

.reveal { opacity: 0; transform: translateY(16px); }
.reveal.visible { opacity: 1; transform: translateY(0); transition: opacity .55s ease, transform .55s ease; }

@media (max-width: 1199.98px) {
  .hero-art-wrap { min-height: 390px; }
  .hero-note { right: 0; bottom: .4rem; }
  .series-scroll { display: flex; overflow-x: auto; padding-bottom: .45rem; scroll-snap-type: x mandatory; }
  .series-card { min-width: 180px; scroll-snap-align: start; }
  .series-arrow { flex: 0 0 auto; }
  .community-strip { grid-template-columns: 1fr; }
}

@media (max-width: 991.98px) {
  .navbar { min-height: 70px; }
  .navbar-collapse { padding: 1rem 0 .5rem; border-top: 1px dashed rgba(16, 16, 16, .2); }
  .navbar-nav { align-items: stretch !important; }
  .navbar .nav-link { padding: .55rem .2rem !important; }
  .navbar .nav-link::after { right: auto; width: 52px; }
  .nav-actions { padding-top: .8rem; }
  .hero-section { padding-top: 1rem; }
  .hero-copy { text-align: center; }
  .hero-copy h1, .hero-lead { margin-right: auto; margin-left: auto; }
  .hero-actions { justify-content: center; }
  .hero-art-wrap { min-height: 0; max-width: 780px; margin: 0 auto; }
  .hero-art { transform: none; }
  .hero-note { right: 2rem; bottom: 1rem; }
  .feature-grid { max-width: none; }
}

@media (max-width: 767.98px) {
  .hero-copy h1 br { display: none; }
  .hero-note { display: none; }
  .hero-actions .btn { width: 100%; }
  .feature-grid { margin-top: 0; }
  .latest-book, .series-panel { padding: .85rem; }
  .community-strip { padding: 1rem; }
  .community-invite { align-items: flex-start; }
  .community-invite img { width: 78px; height: 78px; }
  .community-stats { grid-template-columns: 1fr; }
  .stat-item { border-top: 1px solid rgba(16, 16, 16, .18); border-left: 0; }
  .stat-item:first-child { border-top: 0; }
  .audio-card { align-items: flex-start; flex-wrap: wrap; }
  .audio-card > .btn { width: 100%; }
  .social-links { justify-content: flex-start; }
}

@media (max-width: 479.98px) {
  body { font-size: 14px; }
  .brand-mark { font-size: 1.7rem; }
  .hero-copy h1 { font-size: 2.5rem; }
  .hero-art { width: 116%; margin-left: -8%; }
  .feature-grid { --bs-gutter-x: .75rem; }
  .feature-item p { font-size: .64rem; }
  .book-info h3 { font-size: 1.35rem; }
  .book-summary { display: none; }
  .series-card { min-width: 168px; }
  .quote-section blockquote { line-height: 1.7; }
  .audio-icon { width: 58px; height: 58px; flex-basis: 58px; font-size: 1.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
.transaction-footer {
  padding: 1.25rem 0;
  border-top: 1px solid var(--checkout-muted-border, var(--payment-muted-border, #d7d2c8));
}

.transaction-footer-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1210px;
}

.transaction-footer p {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
}

.transaction-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.transaction-footer a {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
}

.transaction-footer a:hover {
  color: var(--blue);
}

@media (max-width: 767.98px) {
  .transaction-footer-shell {
    align-items: flex-start;
    flex-direction: column;
  }

  .transaction-footer nav {
    gap: .8rem 1.2rem;
  }
}
