
:root {
  --primary:        #3f51b5;
  --primary-fg:     #ffffff;
  --accent:         #3f51b5;
  --ground:         #ffffff;
  --surface-sunk:   #f5f5f7;
  --text:           rgba(0, 0, 0, .87);
  --text-muted:     rgba(0, 0, 0, .54);
  --text-faint:     rgba(0, 0, 0, .38);
  --rule:           rgba(0, 0, 0, .12);
  --rule-fine:      rgba(0, 0, 0, .07);
  --note:           #448aff;
  --info:           #00b8d4;
  --info-bg:        rgba(0, 184, 212, .10);
  --sans: Roboto, 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Roboto Mono', ui-monospace, 'Cascadia Mono', Consolas, 'DejaVu Sans Mono', monospace;
  --measure: 44rem;
  --bar-h: 3rem;
  --shell-max: 66rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary:       #2a2f45;
    --primary-fg:    rgba(255, 255, 255, .95);
    --accent:        #7986cb;
    --ground:        #1f2129;
    --surface-sunk:  #262835;
    --text:          rgba(255, 255, 255, .87);
    --text-muted:    rgba(255, 255, 255, .58);
    --text-faint:    rgba(255, 255, 255, .40);
    --rule:          rgba(255, 255, 255, .14);
    --rule-fine:     rgba(255, 255, 255, .08);
    --info-bg:       rgba(0, 184, 212, .16);
  }
}

:root[data-theme="dark"] {
  --primary:       #2a2f45;
  --primary-fg:    rgba(255, 255, 255, .95);
  --accent:        #7986cb;
  --ground:        #1f2129;
  --surface-sunk:  #262835;
  --text:          rgba(255, 255, 255, .87);
  --text-muted:    rgba(255, 255, 255, .58);
  --text-faint:    rgba(255, 255, 255, .40);
  --rule:          rgba(255, 255, 255, .14);
  --rule-fine:     rgba(255, 255, 255, .08);
  --info-bg:       rgba(0, 184, 212, .16);
}

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.appbar, .appbar *, .gallerypage, .gallerypage *,
.lightbox, .lightbox *, .readernotice, .readernotice * { box-sizing: border-box; }


.appbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: .75rem;
  height: var(--bar-h);
  padding: 0 1rem;
  background: var(--primary);
  color: var(--primary-fg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .18);
  line-height: 1.4;
}
.appbar .mark {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: .005em;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.appbar .mark .glyph {
  flex: none;
  width: 1.4rem;
  height: 1.4rem;
  border: 2px solid currentColor;
  border-radius: 2px;
  position: relative;
}
.appbar .mark .glyph::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 3px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 4px 0 currentColor;
}
.appbar .spacer { flex: 1 1 auto; }

.appbar .rev {
  font-size: .92rem;
  opacity: .88;
  white-space: nowrap;
}
.appbar .rev .stamp { opacity: .68; font-weight: 400; }
@media (max-width: 30rem) {
  .appbar .rev { display: none; }
}

.themetoggle {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
}
.themetoggle:hover { background: rgba(255, 255, 255, .12); }
.themetoggle:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }


.gallerypage {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
  line-height: 1.7;
}
.gallerypage h1 {
  margin: 0 0 .5rem;
  font-size: clamp(1.85rem, 1.3rem + 2.2vw, 2.6rem);
  line-height: 1.2;
  font-weight: 300;
  letter-spacing: -.01em;
}
.gallerypage .standfirst {
  max-width: var(--measure);
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-muted);
}
.gallerypage h2 {
  margin: 3rem 0 .25rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule-fine);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.3;
}
.gallerypage a { color: var(--accent); text-decoration: none; }
.gallerypage a:hover { text-decoration: underline; }
.gallerypage a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.books {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 2rem 1.5rem;
  margin-top: 1.25rem;
}
.gallerypage a.book {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  color: var(--text);
  text-decoration: none;
}
.book .cover {
  --cover-h: 16rem;
  display: grid;
  place-items: center;
  height: var(--cover-h);
  padding: .75rem;
  overflow: hidden;
  background: var(--surface-sunk);
  border: 1px solid var(--rule);
  border-radius: 2px;
  transition: border-color .12s ease, transform .12s ease, box-shadow .12s ease;
}
.book:hover .cover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.book .cover img {
  display: block;
  max-width: 100%;
  max-height: calc(var(--cover-h) - 1.5rem - 2px);
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.book .title { margin-top: .4rem; font-weight: 500; line-height: 1.35; }
.book .meta { font-family: var(--mono); font-size: .78rem; color: var(--text-muted); }
.book .blurb { font-size: .88rem; line-height: 1.5; color: var(--text-muted); }
.book .credit { font-size: .75rem; color: var(--text-faint); }

.pictures {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 1.5rem;
  margin-top: 1.25rem;
  align-items: start;
}


.plate { margin: 0; }
.plateopen {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--surface-sunk);
  cursor: zoom-in;
  line-height: 0;
  transition: border-color .12s ease, transform .12s ease, box-shadow .12s ease;
}
.plateopen:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.plateopen:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.plateopen img { display: block; width: 100%; height: auto; }
.plate figcaption {
  margin-top: .45rem;
  font-size: .8rem;
  line-height: 1.4;
  color: var(--text-muted);
}


.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  gap: .75rem;
  padding: 3.25rem 1.25rem 1.5rem;
  background: rgba(0, 0, 0, .88);
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .6);
}
.lightbox figure { display: contents; }
.lightbox figcaption {
  max-width: 44rem;
  color: rgba(255, 255, 255, .8);
  font-size: .82rem;
  line-height: 1.45;
  text-align: center;
}
.lightboxclose {
  position: absolute;
  top: .75rem;
  right: 1rem;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.lightboxclose:hover { background: rgba(255, 255, 255, .22); }
.lightboxclose:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }


.pagefoot {
  margin-top: 3.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
  font-size: .85rem;
  line-height: 1.65;
  color: var(--text-muted);
}
.pagefoot strong { color: var(--text); font-weight: 500; }
.pagefoot .contact {
  margin: 0 0 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--note);
  font-size: .95rem;
}
.pagefoot .contact b { color: var(--text); }
.pagefoot .contact a { font-family: var(--mono); font-size: .92em; }
.adm {
  margin: 1.5rem 0;
  padding: .85rem 1rem;
  border-left: 4px solid var(--info);
  border-radius: 2px;
  background: var(--info-bg);
  font-size: .95rem;
}
.adm > :first-child { margin-top: 0; }
.adm > :last-child { margin-bottom: 0; }
.pagefoot .adm { color: var(--text); margin-top: 0; }
.pagefoot .notice {
  display: block;
  margin-bottom: .35rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}
.pagefoot .colophon { margin-top: 1.25rem; color: var(--text-faint); font-size: .8rem; }


body.reader { overflow: hidden; }
.readerbar .booktitle {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: .88;
}
.readerbar .barlink {
  flex: none;
  color: inherit;
  font-size: .85rem;
  opacity: .9;
  text-decoration: none;
  white-space: nowrap;
}
.readerbar .barlink:hover { opacity: 1; text-decoration: underline; }
.readerbar .barlink:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.readerwrap {
  position: fixed;
  top: var(--bar-h);
  left: 0;
  right: 0;
  bottom: 0;
}
#BookReader { width: 100%; height: 100%; }
body.reader.BRfullscreenActive .readerwrap { z-index: 20; }
body.reader.BRfullscreenActive .readerbar { visibility: hidden; }
.readernotice {
  max-width: var(--measure);
  margin: 4rem auto;
  padding: 0 1.25rem;
  line-height: 1.7;
}
.readernotice h1 { font-weight: 300; font-size: 2rem; margin: 0 0 .5rem; }
.readernotice a { color: var(--accent); }

@media (max-width: 40rem) {
  .readerbar .sitename, .readerbar .viewer, .readerbar .credit { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .plateopen, .book .cover { transition: none; }
  .plateopen:hover, .book:hover .cover { transform: none; }
}


:root {
  --primary:        #ffffff;
  --primary-fg:     #202122;
  --primary-hover:  #eaecf0;
  --accent:         #3366cc;
  --visited:        #6b4ba1;
  --ground:         #ffffff;
  --surface-sunk:   #f8f9fa;
  --text:           #202122;
  --text-muted:     #54595d;
  --text-faint:     #72777d;
  --rule:           #a2a9b1;
  --rule-fine:      #c8ccd1;
  --head-cell:      #eaecf0;
  --note:           #3366cc;
  --info:           #3366cc;
  --info-bg:        #f8f9fa;
  --serif: Georgia, 'Times New Roman', serif;
  --measure: 54rem;
  --shell-max: 72rem;
  --bar-h: 3.5rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary:       #101418;
    --primary-fg:    #eaecf0;
    --primary-hover: #27292d;
    --accent:        #88a3e8;
    --visited:       #a799cd;
    --ground:        #101418;
    --surface-sunk:  #202122;
    --text:          #eaecf0;
    --text-muted:    #c8ccd1;
    --text-faint:    #a2a9b1;
    --rule:          #54595d;
    --rule-fine:     #404244;
    --head-cell:     #27292d;
    --note:          #88a3e8;
    --info:          #88a3e8;
    --info-bg:       #202122;
  }
}
:root[data-theme="dark"] {
  --primary:       #101418;
  --primary-fg:    #eaecf0;
  --primary-hover: #27292d;
  --accent:        #88a3e8;
  --visited:       #a799cd;
  --ground:        #101418;
  --surface-sunk:  #202122;
  --text:          #eaecf0;
  --text-muted:    #c8ccd1;
  --text-faint:    #a2a9b1;
  --rule:          #54595d;
  --rule-fine:     #404244;
  --head-cell:     #27292d;
  --note:          #88a3e8;
  --info:          #88a3e8;
  --info-bg:       #202122;
}

body { line-height: 1.6; -webkit-font-smoothing: auto; }


.appbar {
  background: var(--ground);
  color: var(--text);
  box-shadow: none;
  border-bottom: 1px solid var(--rule);
}
.appbar .mark {
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: 0;
}
.appbar .mark .glyph {
  border: 0;
  border-radius: 0;
  width: 1.75rem;
  height: 1.75rem;
  image-rendering: pixelated;
}
.appbar .mark .glyph::after { display: none; }
.appbar .rev { color: var(--text-muted); opacity: 1; font-size: .85rem; }
.appbar .rev .stamp { opacity: 1; color: var(--text-faint); }
.themetoggle:hover { background: var(--primary-hover); }
.readerbar .barlink { color: var(--accent); opacity: 1; }


.gallerypage { padding: 1.5rem 1.25rem 3rem; line-height: 1.6; }
.gallerypage a { color: var(--accent); }
.gallerypage a:visited { color: var(--visited); }
.gallerypage h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.85rem;
  line-height: 1.3;
  letter-spacing: 0;
  margin: 0 0 1rem;
  padding-bottom: .15rem;
  border-bottom: 1px solid var(--rule);
}
.gallerypage .standfirst {
  font-size: 1rem;
  color: var(--text);
  margin: 0 0 1rem;
}
.gallerypage h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.3;
  margin: 1.75rem 0 .6rem;
  padding: 0 0 .15rem;
  border-top: 0;
  border-bottom: 1px solid var(--rule);
}
.gallerypage h3 { font-family: var(--sans); font-weight: 700; }


.book .cover {
  border: 1px solid var(--rule-fine);
  border-radius: 0;
  background: var(--surface-sunk);
  padding: 3px;
  box-shadow: none;
}
.book:hover .cover { border-color: var(--rule); transform: none; box-shadow: none; }
.gallerypage a.book, .gallerypage a.book:visited { color: var(--text); }
.gallerypage a.book .title { color: var(--accent); }
.plateopen {
  border: 1px solid var(--rule-fine);
  border-radius: 0;
  background: var(--surface-sunk);
  padding: 3px;
}
.plateopen:hover { border-color: var(--rule); transform: none; box-shadow: none; }


.adm {
  border: 1px solid var(--rule);
  border-left: 6px solid var(--note);
  border-radius: 0;
  background: var(--info-bg);
}


.pagefoot { margin-top: 2.5rem; padding-top: 1rem; }
.pagefoot .contact { border-bottom: 1px solid var(--rule-fine); }
.pagefoot .colophon { color: var(--text-muted); }


.galleryshell {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 0 2.5rem;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.galleryshell .gallerypage { max-width: none; margin: 0; padding-left: 0; padding-right: 0; }
.gallerynav {
  position: sticky;
  top: var(--bar-h);
  align-self: start;
  max-height: calc(100vh - var(--bar-h));
  overflow-y: auto;
  padding: 1.5rem 0 1rem;
  font-size: .875rem;
}
.gallerynav .navtitle {
  display: block;
  padding: 0 0 .4rem .5rem;
  margin: 0 0 .4rem;
  border-bottom: 1px solid var(--rule-fine);
  font-weight: 700;
  color: var(--text);
}
.gallerynav ul { list-style: none; margin: 0; padding: 0; }
.gallerynav a {
  display: block;
  padding: .2rem .5rem;
  color: var(--accent);
  text-decoration: none;
  line-height: 1.4;
}
.gallerynav a:hover { text-decoration: underline; }
.gallerynav a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
[id] { scroll-margin-top: calc(var(--bar-h) + 1rem); }

@media (max-width: 62rem) {
  .galleryshell { grid-template-columns: minmax(0, 1fr); padding: 0; }
  .galleryshell .gallerypage { padding-left: 1.25rem; padding-right: 1.25rem; }
  .gallerynav { display: none; }
}
