/* Shared appearance controls and the two catalogue palettes. */
:root {color-scheme:light;--panel:#efe9dc;--book-rule:#c8b99d}
:root[data-theme="charcoal"] {
  color-scheme:dark;--paper:#181818;--ink:#ecdfc5;--muted:#bdb5a7;--wine:#ebd8b4;
  --berry:#f1dfbf;--line:#46433d;--gold:#dfcba6;--panel:#222220;--book-rule:#766c5a;
}
[data-theme="charcoal"] .hero {background:#181818;color:#ecdfc5}
[data-theme="charcoal"] .hero-copy {background:radial-gradient(ellipse at 0 0,#2b2927,transparent 66%),#181818}
[data-theme="charcoal"] .hero-title em {color:#e2cba3}
[data-theme="charcoal"] .hero-copy p {color:#d9d3c8}
[data-theme="charcoal"] .ribbon {background:#e7dac0;color:#292621;border-color:#b4a78d}
[data-theme="charcoal"] .accent {color:#d7c29f}
[data-theme="charcoal"] .count,[data-theme="charcoal"] .filter-bar button[aria-pressed="true"] {color:#1b1a18}
[data-theme="charcoal"] .button.light {background:#ecdfc5;color:#24221d}
[data-theme="charcoal"] .card-media,[data-theme="charcoal"] .main-photo {background:#272623}
[data-theme="charcoal"] .custom-promo {background:#272725;color:var(--ink)}
[data-theme="charcoal"] .main-photo span {color:#292622}
[data-theme="charcoal"] .icon-btn:hover,[data-theme="charcoal"] .add-mini:hover,[data-theme="charcoal"] .checkout textarea {background:#302f2c}
[data-theme="charcoal"] .add-mini {border-color:#655e53}
[data-theme="charcoal"] .hero-controls button {border-color:#958c7c}
footer {background:var(--panel)}
.sort option {color:var(--ink);background:var(--paper)}
.theme-picker {display:inline-flex;align-items:center;border:1px solid var(--line);border-radius:2rem;padding:3px;background:var(--panel)}
.theme-picker button {display:flex;align-items:center;justify-content:center;gap:.36rem;border-radius:1.5rem;min-height:1.85rem;padding:.32rem .62rem;font-size:.76rem;color:var(--muted)}
.theme-picker button[aria-pressed=true] {background:var(--paper);color:var(--ink);box-shadow:0 0 0 1px var(--book-rule)}
.theme-picker i {width:.73rem;height:.73rem;background:#222;border:1px solid #978c78;border-radius:100%}
.theme-picker button:last-child i {background:#f2e5ca}
.book-cover {display:grid;grid-template-columns:.85fr 1.15fr;align-items:stretch;border-bottom:1px solid var(--line)}
.book-intro {padding:clamp(2rem,6vw,7rem) var(--pad);align-self:center}
.book-cover h1 {margin:.6rem 0 2rem;font-size:clamp(4.2rem,8vw,9.4rem);line-height:.88;letter-spacing:-.075em}
.book-cover h1 em {color:var(--wine)}
.book-cover-art {background:#181818;display:grid;align-items:center;overflow:hidden}
.book-index {display:flex;flex-wrap:wrap;gap:.45rem}
.book-index a {border:1px solid var(--book-rule);border-radius:99px;padding:.5rem .85rem;font-size:.84rem}
.book-index a:hover {color:var(--paper);background:var(--ink)}
.spread {display:grid;grid-template-columns:1.15fr 1fr;gap:clamp(1.5rem,5.5vw,6rem);padding:clamp(2.5rem,5vw,6rem) var(--pad);align-items:center;border-bottom:1px solid var(--line)}
.spread:nth-of-type(odd) figure {order:1}
.spread figure {position:relative;overflow:hidden;border-radius:4px}
.spread figure img {aspect-ratio:1.3;object-fit:cover}
.spread figcaption {position:absolute;left:1rem;bottom:1rem;padding:.45rem .8rem;background:#181818d9;color:#f4e8d2;border-radius:3px;font-size:.84rem}
.spread h2 {margin:.5rem 0 .9rem}
.spread-copy>p:not(.kicker) {color:var(--muted);line-height:1.55;max-width:45ch}
.spread-links {margin:1.25rem 0 0;border-top:1px solid var(--line)}
.spread-links a {display:flex;justify-content:space-between;gap:1rem;align-items:center;border-bottom:1px solid var(--line);padding:.75rem 0}
.spread-links a span:first-child {font:1.22rem Georgia,serif}
.spread-links a span:last-child {font-size:.88rem}
.spread-links a:hover {color:var(--wine)}
@media(max-width:950px) and (min-width:681px) {
  .mast-inner {gap:.8rem;padding-inline:1.3rem}.mast nav,.nav-tools {gap:.75rem}
  .theme-picker button {padding-inline:.48rem}
}
@media(max-width:680px) {
  html {scroll-padding-top:6.5rem}
  .mast-inner {display:grid;grid-template-columns:1fr auto;gap:0;padding-block:.42rem .22rem}
  .mast .wordmark {justify-self:start;font-size:2.15rem}
  .mast nav {grid-column:1/-1;grid-row:2;justify-content:center;gap:clamp(1rem,9vw,3.2rem)}
  .mast nav a {padding:.4rem .2rem;font-size:.84rem}
  .nav-tools {grid-column:2;grid-row:1;gap:.55rem}
  .theme-picker button {min-height:1.7rem;padding:.25rem .46rem}
  .nav-tools .icon-btn {width:2rem}.bag-word {display:none}
  .book-cover,.spread {grid-template-columns:1fr}
  .book-intro {padding-block:2rem}.book-cover h1 {font-size:clamp(3.8rem,13vw,5.2rem);margin-bottom:1.25rem}
  .book-cover-art img {max-height:16rem;object-fit:contain}
  .spread:nth-of-type(odd) figure {order:0}
}
@media(max-width:355px) {.theme-picker button {font-size:.7rem}.nav-tools {gap:.25rem}}

/* Preserve native URLs, browser history and focus as the artwork moves between pages. */
@view-transition {navigation:auto}
@media(prefers-reduced-motion:no-preference) {
  .mast {view-transition-name:masthead}
  .card-media img,.main-photo img {view-transition-name:var(--product-transition,none)}
  ::view-transition-group(*) {animation-duration:.42s;animation-timing-function:cubic-bezier(.22,.7,.22,1)}
  ::view-transition-old(root) {animation:leave-page .2s ease-in both}
  ::view-transition-new(root) {animation:arrive-page .34s .045s ease-out both}
  .page-entry main {animation:arrive-page .32s ease-out both}
  .mast,footer,dialog,.hero-copy,.theme-picker,.theme-picker button,body {transition:background-color .24s,color .24s,border-color .24s}
  .hero-copy:after {animation:glint 5s ease-in-out infinite alternate;pointer-events:none}
  .hero-eyebrow span {transform-origin:left;animation:draw-rule .7s ease-out both}
  .hero-slide:not([hidden]) .hero-title em {animation:title-unfold .7s cubic-bezier(.16,.78,.25,1) both}
  .hero-slide:not([hidden]) .photo-tag {animation:rise .55s .1s ease-out both}
  .cards .card.enter {animation:card-arrive .55s cubic-bezier(.16,.78,.25,1) both}
  .card.enter:nth-child(3n+2) {animation-delay:.045s}.card.enter:nth-child(3n) {animation-delay:.09s}
  .spread.arrived .spread-copy,.builder-head.arrived h1,.shop-heading.arrived h2,.custom-promo.arrived h2 {animation:rise .62s ease-out both}
  .spread.arrived figure img,.book-cover-art img {animation:image-enter 1s ease-out both}
  .spread-links a span:first-child {transition:transform .2s}.spread-links a:hover span:first-child {transform:translateX(.35rem)}
  .bag-footer,.checkout,.quick-copy h2 {animation:rise .25s ease-out}
  .theme-picker i {transition:transform .22s}.theme-picker button[aria-pressed=true] i {transform:scale(1.13)}
  .drawer[open]::backdrop,.quick-dialog[open]::backdrop {animation:veil .24s ease-out}
}
@keyframes leave-page {to {opacity:0;transform:translateY(-7px)}}
@keyframes arrive-page {from {opacity:0;transform:translateY(11px)}to {opacity:1;transform:none}}
@keyframes draw-rule {from {transform:scaleX(0)}to {transform:scaleX(1)}}
@keyframes title-unfold {from {clip-path:inset(0 0 95% 0);transform:translateY(.15em)}to {clip-path:inset(-25% -12% -30% -8%);transform:none}}
@keyframes card-arrive {from {opacity:.25;transform:translateY(18px) scale(.985)}to {opacity:1;transform:none}}
@keyframes glint {from {opacity:.45;transform:rotate(-8deg) scale(.92)}to {opacity:1;transform:rotate(8deg) scale(1.04)}}
@keyframes veil {from {opacity:0}to {opacity:1}}
@media(prefers-reduced-motion:reduce) {
  @view-transition {navigation:none}
  ::view-transition-group(*),::view-transition-old(*),::view-transition-new(*) {animation:none!important}
}

.main-photo img.gallery-previous {position:absolute;inset:0;width:100%;height:100%;pointer-events:none;view-transition-name:none}.main-photo span {z-index:1}
