:root{
  color-scheme:dark;
  --bg:#241014;
  --gold:#d6b577;
  --muted:#c0a4a7;
  --text:#f5ede4;
  --line:#ffffff16;
  font-family:Arial,Helvetica,sans-serif}

*{
  box-sizing:border-box}
body{
  margin:0;
  background:var(--bg);
  color:var(--text)}
button,a{
  -webkit-tap-highlight-color:transparent}
button{
  font:inherit;
  color:inherit;
  cursor:pointer}
button:disabled{
  opacity:.3;
  cursor:default}
button:focus-visible,a:focus-visible{
  outline:2px solid var(--gold);
  outline-offset:5px}
svg{
  width:20px;
  height:20px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.5;
  stroke-linecap:round;
  stroke-linejoin:round;
  flex-shrink:0}

.viewer{
  height:100dvh;
  min-height:440px;
  /* Reserve footer space so hosting chrome never obscures navigation or detail controls. */
  padding-bottom:56px;
  display:flex;
  flex-direction:column;
  background:radial-gradient(ellipse at 50% 42%,#842b3c55,transparent 65%),var(--bg);
  overflow:hidden}

.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:21px 32px;
  border-bottom:1px solid var(--line);
  flex-shrink:0}

.brand{
  min-width:0;
  display:flex;
  align-items:center;
  gap:14px;
  text-decoration:none;
  color:inherit}
.monogram{
  display:grid;
  place-items:center;
  border:1px solid #d6b57775;
  width:42px;
  height:42px;
  font:italic 30px Georgia,serif;
  color:var(--gold)}
.brand h1{
  margin:0;
  display:block;
  font:22px Georgia,'Times New Roman',serif;
  letter-spacing:.2px}
.eyebrow{
  display:block;
  font-size:9px;
  letter-spacing:2.2px;
  color:var(--gold);
  margin-bottom:7px}
.header-actions{
  flex-shrink:0;
  display:flex;
  align-items:center;
  gap:20px}

.text-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  background:transparent;
  border:0;
  padding:10px 5px;
  font-size:12px;
  color:var(--gold);
  white-space:nowrap}
.text-button:hover{
  color:#f4dbab}
.icon-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  background:transparent;
  border:1px solid var(--line);
  border-radius:50%;
  color:var(--gold)}
.icon-button:hover{
  background:#ffffff0a}

.stage{
  min-height:0;
  flex:1;
  display:flex;
  flex-direction:column;
  padding:14px 26px 0}
.stage-note{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:16px;
  font-size:9px;
  letter-spacing:2.2px;
  color:var(--muted);
  padding:3px 0 13px;
  flex-shrink:0}
.fine-line{
  width:38px;
  height:1px;
  background:#d6b57740}
.book-area{
  position:relative;
  flex:1;
  min-height:0;
  width:100%;
  margin:auto;
  max-width:1250px}
#book{
  width:100%;
  height:100%;
  position:absolute;
  inset:0;
  visibility:hidden}
.book-ready #book{
  visibility:visible}
.photo-page{
  background:#f3ecd9;
  overflow:hidden}
.photo-page img{
  display:block;
  width:100%;
  height:100%;
  object-fit:contain;
  object-position:center;
  user-select:none;
  -webkit-user-drag:none;
  image-rendering:auto}
.photo-page:not(.loaded)::after{
  content:'Loading photograph…';
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  font-size:12px;
  color:var(--gold);
  pointer-events:none}
.photo-page.error::after{
  content:'Photo could not load. Use View detail to retry.';
  padding:24px;
  text-align:center}
.stf__parent{
  background:transparent!important}
.stf__item{
  box-shadow:none!important}
.loading{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  color:var(--gold);
  font:18px Georgia,serif}
.loading-ring{
  width:28px;
  height:28px;
  border:1px solid #d6b57730;
  border-top-color:var(--gold);
  border-radius:50%;
  animation:spin 1s linear infinite}
.loading.error .loading-ring{
  display:none}
.book-ready .loading{
  display:none}
@keyframes spin{
  to{
  transform:rotate(360deg)}
}
.turn-hint{
  margin:11px 0 14px;
  text-align:center;
  font-size:10px;
  letter-spacing:.25px;
  color:var(--muted);
  flex-shrink:0}

.controls{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  padding:15px 32px 20px;
  border-top:1px solid var(--line);
  flex-shrink:0}
.controls-side{
  flex:1;
  display:flex}
.controls-side.end{
  justify-content:flex-end}
.page-navigation{
  display:flex;
  gap:20px;
  align-items:center}
.arrow-button{
  display:grid;
  place-items:center;
  width:40px;
  height:40px;
  border:1px solid #d6b57755;
  border-radius:50%;
  background:transparent;
  color:var(--gold)}
.arrow-button:hover:not(:disabled){
  background:#d6b57712}
.counter{
  min-width:150px;
  text-align:center}
.counter strong{
  display:block;
  font:17px Georgia,serif;
  font-weight:normal}
.counter span{
  display:block;
  font-size:9px;
  color:var(--muted);
  letter-spacing:.6px;
  margin-top:5px}
.toast{
  position:fixed;
  bottom:105px;
  left:50%;
  transform:translateX(-50%);
  background:#f3e7d5;
  color:#461821;
  padding:13px 20px;
  max-width:90vw;
  border-radius:5px;
  font-size:13px;
  z-index:1000;
  box-shadow:0 6px 30px #0005}
.toast[hidden]{
  display:none}

dialog{
  color:var(--text);
  background:#31181e;
  border:1px solid #d6b57733}
dialog::backdrop{
  background:#000b;
  backdrop-filter:blur(4px)}
.page-drawer{
  position:fixed;
  margin:0 0 0 auto;
  inset:0;
  width:min(400px,100%);
  height:100dvh;
  max-height:100dvh;
  max-width:100%;
  padding:25px;
  overflow:auto}
.drawer-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px}
.drawer-header h2{
  font:27px Georgia,serif;
  margin:0}
.drawer-caption{
  color:var(--muted);
  font-size:12px;
  margin:20px 0}
.page-list{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:9px}
.page-list button{
  background:#ffffff04;
  border:1px solid var(--line);
  border-radius:4px;
  min-height:52px;
  color:#dec9a5;
  font-size:13px}
.page-list button.active{
  border-color:var(--gold);
  background:#d6b57713}
.page-list button.cover{
  grid-column:span 4;
  font:17px Georgia,serif}
.page-list button:hover{
  background:#ffffff0b}

.detail-dialog{
  width:min(1200px,96vw);
  height:94dvh;
  max-height:94dvh;
  padding:0;
  overflow:hidden}
.detail-dialog[open]{
  display:flex;
  flex-direction:column}
.detail-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:13px 20px;
  gap:12px;
  border-bottom:1px solid var(--line)}
.detail-header h2{
  font:19px Georgia,serif;
  margin:0}
.detail-header>div{
  display:flex;
  align-items:center;
  gap:15px}
.detail-tabs{
  display:flex;
  gap:10px;
  justify-content:center;
  padding:8px}
.detail-tabs:empty{
  display:none}
.detail-tabs button{
  font-size:11px;
  border:1px solid var(--line);
  background:transparent;
  padding:7px 15px;
  border-radius:20px}
.detail-tabs button.active{
  border-color:var(--gold);
  color:var(--gold)}
.detail-image-area{
  flex:1;
  min-height:0;
  overflow:auto;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:10px}
.detail-image-area img{
  width:100%;
  height:100%;
  object-fit:contain;
  max-width:100%;
  max-height:100%}
.detail-image-area.actual{
  display:block}
.detail-image-area.actual img{
  width:auto;
  height:auto;
  max-width:none;
  max-height:none}
.detail-note{
  color:var(--muted);
  font-size:10px;
  text-align:center;
  margin:10px 0 14px}

@media(max-width:650px){
  .header{
  padding:15px 16px}
.brand{
  gap:10px}
.brand h1{
  font-size:17px}
.monogram{
  width:34px;
  height:34px;
  font-size:25px}
.eyebrow{
  font-size:8px;
  letter-spacing:1.5px;
  margin-bottom:5px}
.header-actions{
  gap:10px}
.header-actions .text-button{
  font-size:11px}
.stage{
  padding:12px 10px 0}
.stage-note{
  font-size:8px;
  letter-spacing:1.1px;
  gap:10px}
.fine-line{
  width:22px}
.controls{
  padding:13px 14px 18px;
  gap:6px}
.page-navigation{
  gap:9px}
.counter{
  min-width:110px}
.counter strong{
  font-size:15px}
.counter span{
  font-size:8px}
.arrow-button{
  width:34px;
  height:34px}
.controls-side .text-button{
  font-size:10px;
  flex-direction:column;
  gap:4px}
.controls-side .text-button svg{
  width:17px;
  height:17px}
.turn-hint{
  font-size:9px;
  margin:10px 0 12px}
.detail-header{
  padding:10px}
.detail-header>div{
  gap:8px}
.detail-header h2{
  font-size:16px}
}

@media(max-width:380px){
  .brand h1{
  font-size:15px}
.header-actions{
  gap:5px}
.monogram{
  display:none}
.counter{
  min-width:92px}
.page-navigation{
  gap:6px}
.header{
  padding:13px}
}

@media(max-height:550px){
  .viewer{
  min-height:320px}
.header{
  padding:8px 20px}
.monogram{
  width:28px;
  height:28px;
  font-size:22px}
.brand h1{
  font-size:17px}
.eyebrow{
  font-size:7px;
  margin-bottom:3px}
.stage{
  padding-top:7px}
.stage-note{
  padding-bottom:7px}
.controls{
  padding:8px 20px}
.turn-hint{
  margin:7px 0;
  font-size:9px}
}

@media(prefers-reduced-motion:reduce){
  .loading-ring{
  animation:none}
}


.noscript-note{
  padding:20px;
  text-align:center}
.noscript-note a{
  color:var(--gold)}

@media(max-width:650px){
  .header{
  gap:10px}
.brand .eyebrow{
  font-size:7px;
  letter-spacing:1px;
  line-height:1.4}
.brand h1{
  line-height:1.2}
.header-actions{
  gap:8px}
}

@media(max-width:480px){
  .monogram{
  display:none}
.brand h1{
  font-size:17px}
.brand .eyebrow{
  max-width:210px}
}

@media(max-width:380px){
  .brand h1{
  font-size:15px}
.brand .eyebrow{
  font-size:6px;
  letter-spacing:.8px;
  max-width:175px}
.header-actions{
  gap:5px}
.header{
  gap:8px}
}
