:root {
  --chapter-height: 54px;
}
[hidden] { display: none !important; }
html { scroll-padding-top: calc(var(--chapter-height) + 14px); }

.hero, .hero.alternate {
  --plate-left: 44%;
  background: radial-gradient(ellipse at 11% 40%, #244638, #102f25 49%, #0f291f 90%);
  height: clamp(538px, 66svh, 760px);
}
.cover-print {
  position: absolute;
  inset: 18px clamp(24px, 2.5vw, 54px) 24px var(--plate-left);
  isolation: isolate;
  overflow: hidden;
  background: #5d4b39;
  box-shadow: 0 13px 26px #07170f50, 0 0 0 1px #f0d6a959;
}
.cover-print::after {
  content: '';
  position: absolute;
  inset: 8px;
  box-shadow: inset 0 0 0 1px #fff8dc33;
  pointer-events: none;
  z-index: 1;
}
.cover-print .backdrop, .hero.alternate .cover-print .backdrop {
  z-index: -2;
  inset: -8px 0;
  background-size: cover;
  background-position: 66% 13%;
  translate: 0 var(--cover-shift, 0px);
}
.hero.alternate .cover-print .backdrop { background-position: 50% 30%; }
.cover-print .shade, .hero.alternate .cover-print .shade {
  z-index: -1;
  background: linear-gradient(0deg, #2219084a, transparent 24%);
}
.hero-content {
  z-index: 2;
  top: 43%;
  width: var(--plate-left);
  max-width: none;
  padding-right: clamp(24px, 2.2vw, 46px);
}
.hero h1 {
  margin: clamp(18px, 2vh, 27px) 0;
  font-size: clamp(74px, 6.6vw, 132px);
}
.hero-content p {
  max-width: 35ch;
  font-size: clamp(14px, .98vw, 18px);
  color: #e7e7d8;
  margin-bottom: 23px;
}
.cover-cta { gap: 23px; }
.cover-cta .icon { transition: transform 180ms ease; }
.cover-cta:hover .icon { transform: translateX(4px); }
.shoplook {
  position: absolute;
  bottom: 20px;
  right: 20px;
  z-index: 2;
  min-height: 42px;
  padding: 4px 13px 4px 6px;
  border: 1px solid #f7e5c18c;
  border-radius: 99px;
  background: #18271ccd;
  backdrop-filter: blur(9px);
}
.shoplook .look-dot { background: #e4cea8; border-color: transparent; color: var(--ink); }
.shoplook:hover .look-dot { background: white; }
.hero-bottom {
  left: 0;
  bottom: 26px;
  width: var(--plate-left);
  padding-right: clamp(23px, 2.7vw, 55px);
  gap: 10px;
}
.cover-tabs { display: flex; align-items: center; gap: 9px; }
.cover-tabs button {
  display: block;
  width: 34px;
  height: 44px;
  padding: 2px;
  border: 1px solid transparent;
  transition: border-color .2s, transform .2s;
}
.cover-tabs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-tabs button[aria-pressed=true] { border-color: #e4ca9a; }
.cover-tabs button:hover { transform: translateY(-2px); }
.pager button { width: 32px; height: 32px; }
.pager { gap: 8px; }
.page-line { width: 22px; }

.chapter-map {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: var(--chapter-height);
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 18px;
  border-bottom: 1px solid #d2cbbb;
  background: #f8f6eff5;
  backdrop-filter: blur(12px);
}
.chapter-name { display: inline-flex; align-items: center; gap: 10px; font: italic 19px/1 Georgia, serif; }
.binding {
  display: inline-block;
  width: 16px;
  height: 19px;
  border: 1px solid #9b835b;
  border-left: 4px double #9b835b;
  border-radius: 0 2px 2px 0;
}
.chapter-links { display: flex; align-items: center; gap: clamp(17px, 2.8vw, 45px); }
.chapter-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: var(--chapter-height);
  font-size: 12px;
  color: #556357;
}
.chapter-links a::after {
  position: absolute;
  content: '';
  height: 1px;
  left: 0; right: 0; bottom: 10px;
  background: #79623b;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s;
}
.chapter-links a[aria-current], .chapter-links a:hover { color: var(--pine); }
.chapter-links a[aria-current]::after, .chapter-links a:hover::after { transform: scaleX(1); }
.guide-trigger { justify-self: end; min-height: 40px; color: #4f594d; font-size: 12px; }
.guide-trigger span { color: #8b734d; }
.read-progress {
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: #99723b;
  transform-origin: left;
  transform: scaleX(var(--read, 0));
}
.first-visit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 24px var(--gutter);
  border-bottom: 1px solid #d7d1c1;
  background: #edeadf;
}
.first-visit .eyebrow { font-size: 9px; }
.first-visit .dash { width: 20px; }
.first-visit h2 { margin: 6px 0 0; font: 400 clamp(23px,1.85vw,35px)/1.08 var(--serif); letter-spacing: -.04em; }
.visit-controls, .visit-options { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.visit-options button {
  min-height: 39px;
  padding: 8px 13px;
  border: 1px solid #abb2a0;
  border-radius: 2px;
  background: #f7f5ed;
  font-size: 13px;
  transition: background .2s, border-color .2s;
}
.visit-options button:hover { background: #fffdf6; border-color: #576a54; }
.visit-options button span { color: #7c704c; margin-left: 8px; }
#guide-close, #guide-back { padding: 7px; color: #536050; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
#guide-title:focus:not(:focus-visible), [tabindex="-1"]:focus:not(:focus-visible) { outline: none; }

@media (prefers-reduced-motion: no-preference) {
  @keyframes print-in { from { opacity: .15; clip-path: inset(0 3% 0 0); } to { opacity: 1; clip-path: inset(0); } }
  @keyframes type-in { from { opacity: .4; translate: 0 10px; } to { opacity: 1; translate: 0; } }
  .hero .cover-print { animation: print-in .65s cubic-bezier(.16,1,.3,1) both; }
  .hero-content > h1 { animation: type-in .57s cubic-bezier(.16,1,.3,1) both; }
  .arrived { animation: type-in .5s cubic-bezier(.16,1,.3,1) both; }
}
@media (min-width: 1700px) {
  .hero-content { max-width: none; }
}
@media (min-width: 681px) and (max-width: 1050px) {
  .hero, .hero.alternate { --plate-left: 46%; }
  .hero h1 { font-size: clamp(64px,7.2vw,80px); }
  .cover-tabs { gap: 4px; }
  .cover-tabs button { width: 27px; height: 36px; }
  .pager { gap: 5px; }
  .hero-bottom { padding-right: 15px; }
  .first-visit { gap: 15px; }
}
@media (max-width: 680px) {
  :root { --chapter-height: 47px; }
  .hero, .hero.alternate { --plate-left: 100%; height: clamp(466px, 68svh, 635px); }
  .cover-print { inset: 0; box-shadow: none; }
  .cover-print::after { display: none; }
  .cover-print .backdrop { background-position: 66% 45%; }
  .hero.alternate .cover-print .backdrop { background-position: 50% 27%; }
  .cover-print .shade, .hero.alternate .cover-print .shade {
    background: linear-gradient(0deg,#11261cdb 0%,#16291e95 32%,#21312518 73%), linear-gradient(90deg,#20281a38,transparent 80%);
  }
  .hero-content { top: auto; bottom: 85px; max-width: 96%; padding-right: 16px; }
  .hero h1 { font-size: clamp(65px, 15vw, 89px); margin: 14px 0; }
  .hero-content p { max-width: 32ch; font-size: 14px; line-height: 1.45; margin-bottom: 17px; }
  .hero-bottom { bottom: 19px; width: fit-content; padding-right: 0; }
  .hero-bottom .cover-tabs { display: none; }
  .cover-print .shoplook { bottom: 18px; right: var(--gutter); min-height: 33px; font-size: 11px; }
  .chapter-map { grid-template-columns: 1fr auto; padding-inline: var(--gutter); gap: 8px; }
  .chapter-name { display: none; }
  .chapter-links { gap: clamp(10px, 3.7vw, 25px); }
  .chapter-links a, .guide-trigger { font-size: 11px; }
  .chapter-links a::after { bottom: 8px; }
  .first-visit { display: block; padding-block: 18px; }
  .visit-controls { margin-top: 13px; gap: 5px; }
  .visit-options { gap: 5px; }
  .visit-options button { min-height: 35px; padding: 7px 10px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .cover-print .backdrop { translate: none; }
}
