.history-main{
  --book-paper:#f7efdf;
  --book-ink:#30251f;
  --book-wine:#641e31;
  --book-serif:Newsreader,Georgia,serif;
  color:var(--book-ink);
}
.history-desk{
  background-color:#e6d8bf;
  background-image:radial-gradient(ellipse at 48% 21%,#f4ebd96b,transparent 67%),repeating-linear-gradient(0deg,#6f543509 0 1px,transparent 1px 3px),repeating-linear-gradient(90deg,#74573608 0 1px,transparent 1px 4px);
}
.history-inner{max-width:1330px;padding:0 var(--edge) 32px;margin:0 auto}
.history-inner>.crumb{padding:16px 0;margin:0}
.history-inner>h1{font:400 clamp(47px,6vw,85px)/1 var(--book-serif);letter-spacing:-.05em;margin:30px auto;max-width:880px}
.book-mode .history-inner>h1,.binding-sr{position:absolute!important;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;margin:0;padding:0}
.history-text{max-width:880px;margin:0 auto 30px}
.history-chapter{display:grid;grid-template-columns:.8fr 1.2fr;align-items:center;gap:clamp(22px,4vw,56px);padding:32px clamp(22px,4vw,48px);background:var(--book-paper);border-top:1px solid #bdb09a}
.history-chapter figure,.heritage-image{margin:0}
.history-chapter figure img{width:100%;max-height:285px;object-fit:contain}
.history-chapter figcaption,.heritage-image figcaption{font:italic 400 14px/1.3 var(--book-serif);color:#574a41;margin-top:9px}
.history-period{color:var(--book-wine);font:600 .82em/1.2 var(--sans);letter-spacing:.09em;margin:0 0 15px}
.history-copy h2{font:400 clamp(30px,3.9vw,58px)/.98 var(--book-serif);letter-spacing:-.045em;margin:0 0 20px}
.history-copy>p:not(.history-period){font:400 clamp(17px,1.43vw,21px)/1.4 var(--book-serif);margin:0 0 .75em;max-width:45ch}
.book-reader{padding-top:2px}
.book-stage{
  --book-h:clamp(400px,min(51vw,62svh),590px);
  position:relative;max-width:1120px;margin:0 auto;
  padding:12px 12px 23px;outline-offset:-2px;
  touch-action:pan-y pinch-zoom;cursor:grab;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent;
}
.book-stage.is-dragging{cursor:grabbing}
.bound-volume{width:min(100%,calc(var(--book-h)*1.9));height:var(--book-h);margin:auto;position:relative}
.case-half{position:absolute;width:50%;top:-3px;bottom:-4px;pointer-events:none;background:#651e30;box-shadow:0 4px 0 #502233,0 9px 11px -4px #512b2280,0 17px 27px -14px #45291c9c}
.case-left{left:-3px;border-radius:5px 0 0 5px}
.case-right{right:-3px;border-radius:0 5px 5px 0}
.book-leaves{position:absolute;inset:0;perspective:1900px;perspective-origin:50% 44%}
.book-leaf{position:absolute;inset:0 0 0 50%;transform-origin:0 50%;transform-style:preserve-3d;-webkit-transform-style:preserve-3d}
.leaf-face{
  position:absolute;inset:0;box-sizing:border-box;overflow:hidden;
  backface-visibility:hidden;-webkit-backface-visibility:hidden;
  background:var(--book-paper);border:1px solid #a58a6a;
}
.leaf-front{transform:rotateY(0deg);border-radius:0 3px 3px 0}
.leaf-back{transform:rotateY(180deg);border-radius:3px 0 0 3px}
.paper-face{background-color:var(--book-paper);background-image:linear-gradient(108deg,#fcf7e966,transparent 55%,#a7865d09)}
.paper-face::after{content:"";position:absolute;inset:0;pointer-events:none;z-index:2;background:linear-gradient(90deg,#694e3170, #6b4b2d32 1.5%,#6b4b2d09 6%,transparent 12%);opacity:.72}
.leaf-back.paper-face::after{transform:scaleX(-1)}
.leaf-front.paper-face{box-shadow:inset -3px 0 #dfcfb4,inset -4px 0 #bba487,inset -7px 0 #eddfc7}
.leaf-back.paper-face{box-shadow:inset 3px 0 #dfcfb4,inset 4px 0 #bba487,inset 7px 0 #eddfc7}
.leaf-face::before{content:"";position:absolute;inset:0;pointer-events:none;z-index:3;background:linear-gradient(90deg,#543a2570,#39241118 75%);opacity:var(--fold,0)}
.cover-face{background:#580f23 url("assets/heritage-cover.webp") center/100% 100% no-repeat;border-color:#5b2030;color:#ffdf9a}
.jacket-type{position:absolute;top:18%;left:10%;right:10%;text-align:center}
.jacket-type p{font:600 clamp(10px,.85vw,14px)/1.2 var(--sans);letter-spacing:.23em;text-transform:uppercase;color:#f4d89c;margin:0 0 clamp(15px,2.3vh,25px)}
.jacket-type strong{display:block;font:400 clamp(48px,5vw,80px)/.92 var(--book-serif);letter-spacing:-.055em;color:#ffe6af;text-shadow:0 1px 1px #30121b;overflow-wrap:normal}
.jacket-type em{font-weight:400}
.jacket-type small{display:block;font:italic 400 clamp(15px,1.2vw,20px)/1.2 var(--book-serif);margin-top:17px;color:#ffe4ac}
.back-jacket .jacket-type{top:27%}.back-jacket .jacket-type strong{font-size:clamp(31px,3.3vw,51px)}
.heritage-image{position:absolute;inset:8% 8.5% 8%;display:flex;flex-direction:column}
.heritage-image img{flex:1 1 0;min-height:0;width:100%;height:0;object-fit:cover;object-position:center}
.heritage-image.is-portrait img{object-fit:contain;background:#eee4d2}
.heritage-image figcaption{flex:none;margin:10px 0 0}
.leaf-text{height:100%;padding:10% 10% 11%;box-sizing:border-box;display:flex;flex-direction:column;justify-content:center}
.leaf-text .history-copy{position:relative}
.leaf-text .history-copy::after{content:"";display:block;border-top:1px solid #aa957b;margin-top:clamp(13px,2.5vh,26px);width:100%}
.leaf-text h2{font-size:clamp(34px,3.65vw,56px);margin-bottom:18px}
.leaf-text .history-copy>p:not(.history-period){font-size:clamp(16px,1.42vw,21px);line-height:1.31}
.folio{position:absolute;bottom:3.7%;font:400 12px/1 var(--book-serif);color:#6b594b}
.leaf-front .folio{right:9%}.leaf-back .folio{left:9%}
.book-controls{display:grid;grid-template-columns:minmax(105px,1fr) minmax(120px,auto) minmax(105px,1fr);width:min(100%,560px);margin:3px auto 0;align-items:center}
.book-controls button,.history-mode,.history-sources summary{font:500 14px/1.35 var(--sans);color:var(--book-ink);cursor:pointer}
.book-controls button{min-height:44px;padding:8px 12px;background:transparent;border:0;display:inline-flex;gap:10px;align-items:center;justify-content:center}
.book-controls button:hover:enabled,.history-mode:hover,.history-sources summary:hover{color:var(--book-wine);text-decoration:underline;text-underline-offset:4px}
.book-controls button:disabled{color:#736858;opacity:.77;cursor:default}
.book-position{text-align:center;border-inline:1px solid #ac997d;padding:3px 15px;font:italic 400 18px/1.15 var(--book-serif)}
.book-hint{text-align:center;font:italic 400 15px/1.35 var(--book-serif);margin:5px auto 0;color:#615246}
.history-tools{max-width:1060px;margin:26px auto 0;padding-top:12px;border-top:1px solid #bfae94;display:flex;align-items:flex-start;justify-content:space-between;gap:22px}
.history-mode,.history-sources summary{padding:8px 0;min-height:42px;background:transparent;border:0;font-size:13px}
.history-sources{max-width:min(100%,620px);text-align:right;margin-left:auto}
.history-sources summary{list-style:revert;display:list-item}
.history-sources li{padding:8px 0;font:400 14px/1.4 var(--sans);list-style:none}
.history-sources ul{padding:0;margin:0}.history-sources a{text-decoration:underline}.history-sources span{display:block;color:#635447;font-size:12px}
@media(min-width:721px) and (max-width:860px){
  .leaf-text{padding-inline:8%}.leaf-text h2{font-size:34px}
}
@media(max-width:720px){
  .history-inner{padding-inline:clamp(12px,4.5vw,28px);padding-bottom:24px}
  .history-inner>.crumb{padding-block:12px}
  .book-reader{padding-top:0}
  .book-stage{--book-h:clamp(475px,119vw,552px);width:min(100%,455px);padding:5px 7px 14px;overflow:clip}
  .bound-volume{width:100%;max-width:420px;transform:none!important}
  .case-left{display:none}.case-right{left:-2px;right:-2px;width:auto}
  .book-leaf{left:0}.book-leaves{perspective:1450px;perspective-origin:40% 47%}
  .cover-face .jacket-type strong{font-size:clamp(54px,13vw,73px)}.back-jacket .jacket-type strong{font-size:38px}
  .cover-face .jacket-type p{font-size:11px}.jacket-type small{font-size:17px}
  .compact-page{display:flex;flex-direction:column;height:100%;padding:7% 8% 7.5%;box-sizing:border-box;gap:clamp(11px,2vh,17px)}
  .compact-page .heritage-image{position:static;min-height:58px;flex:1;margin:0}
  .compact-page .heritage-image img{object-position:50% 46%}
  .compact-page .heritage-image figcaption{font-size:12px;line-height:1.15;margin-top:4px}
  .compact-page .history-copy{flex:none}
  .compact-page .history-period{font-size:11px;margin-bottom:6px}
  .compact-page h2{font-size:clamp(29px,7.6vw,36px);margin-bottom:9px}
  .compact-page .history-copy>p:not(.history-period){font-size:17px;line-height:1.23;margin-bottom:7px}
  .compact-page .history-copy>p:last-child{margin-bottom:0}
  .leaf-front .folio{bottom:2%;right:7%;font-size:11px}
  .book-controls{grid-template-columns:1fr auto 1fr}.book-position{font-size:15px;padding-inline:9px}
  .book-controls button{font-size:13px;padding-inline:3px;gap:6px}.book-hint{font-size:14px}
  .history-tools{margin-top:17px;gap:10px}.history-sources ul{text-align:left}
  .history-chapter{grid-template-columns:1fr;gap:20px;padding:26px 20px}
  .history-chapter figure img{max-height:260px;width:100%;object-fit:contain}
}
@media print{
  .history-desk{background:white}.history-inner{max-width:none;padding:0}
  .history-inner>.crumb,.book-reader,.history-tools{display:none!important}
  .book-mode .history-inner>h1{position:static!important;clip-path:none;height:auto;width:auto;margin:20px 0}
  .history-text[hidden]{display:block!important}.history-chapter{break-inside:avoid;background:white}
  .history-chapter figure img{max-height:160px}
}
/* Short desktop previews keep the text and both turning controls in the same view. */
@media(min-width:721px) and (max-height:620px){
  .book-mode .history-inner>.crumb{padding-block:6px}
  .book-reader{padding:0}
  .book-stage{--book-h:clamp(245px,calc(100svh - var(--head) - 98px),420px);padding-block:4px 10px}
  .bound-volume{width:min(100%,calc(var(--book-h)*2.57))}
  .jacket-type{top:16%}.jacket-type strong{font-size:clamp(39px,9vh,55px)}.jacket-type small{margin-top:8px}
  .jacket-type p{margin-bottom:12px}
  .leaf-text{padding:5% 8% 6.5%}
  .leaf-text .history-period{font-size:11px;margin-bottom:8px}
  .leaf-text h2{font-size:clamp(27px,6.2vh,38px);margin-bottom:10px}
  .leaf-text .history-copy>p:not(.history-period){font-size:clamp(15px,3.4vh,18px);line-height:1.18;margin-bottom:6px}
  .leaf-text .history-copy::after{margin-top:10px}
  .heritage-image{inset:6% 8% 8%}.heritage-image figcaption{font-size:12px;margin-top:5px}
  .book-controls{margin-top:0}.book-hint{margin-top:0}
}
