:root {
  --blue: #17477b;
  --ink: #15191d;
  --muted: #5d6670;
  --line: #d5d9dd;
  --nav: #edf0f2;
  --nav-hover: #e1e7eb;
  --white: #ffffff;
  --sans: "Segoe UI", Arial, Helvetica, sans-serif;
  --content-width: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 1rem; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; }

.skip-link {
  position: fixed;
  top: .5rem;
  left: .5rem;
  z-index: 100;
  padding: .7rem 1rem;
  color: #fff;
  background: var(--blue);
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.page-shell {
  width: min(calc(100% - 2.5rem), var(--content-width));
  margin: 0 auto;
  padding: 1rem 0 1.2rem;
}

.site-header {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 3.6rem;
  align-items: center;
  min-height: 105px;
}

.brand { width: 270px; display: block; }
.brand img { width: 100%; height: auto; }
.identity { color: var(--blue); }
.identity h1, .identity p { margin: 0; }
.identity h1 { font-size: clamp(1.55rem, 2.4vw, 2rem); line-height: 1.05; font-weight: 700; }
.identity p { font-size: clamp(1.1rem, 2vw, 1.45rem); line-height: 1.1; }
.menu-button { display: none; }

.page-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 3.6rem;
  align-items: start;
}

.sidebar { min-width: 0; }
.profile { margin-top: 1.05rem; font-size: .9rem; }

.profile > img {
  width: 142px;
  height: 214px;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(100%);
}

.profile > div { display: grid; justify-items: start; gap: .15rem; margin-top: .55rem; }
.profile strong { line-height: 1.28; }
.profile a { text-underline-offset: .18em; }

.side-nav {
  display: grid;
  margin-top: 1.8rem;
  border: 1px solid #e3e6e8;
}

.side-nav a {
  min-height: 54px;
  display: flex;
  align-items: center;
  padding: .75rem 1.2rem;
  border-bottom: 1px solid var(--white);
  background: var(--nav);
  font-size: 1rem;
  line-height: 1.35;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}

.side-nav a:last-child { border-bottom: 0; }
.side-nav a:hover, .side-nav a:focus-visible, .side-nav a[aria-current="page"] { color: var(--blue); background: var(--nav-hover); }

.main-content {
  min-width: 0;
  padding-top: 1.05rem;
  border-top: 1px solid var(--line);
}

.positioning {
  margin: 0 0 1.25rem;
  color: var(--blue);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.45;
}

.updates h2 {
  margin: 0 0 .7rem;
  color: var(--blue);
  font-size: 1.12rem;
  line-height: 1.25;
}

.updates p { margin: 0 0 1.15rem; font-size: 1rem; line-height: 1.55; }
.updates a { text-decoration-style: dotted; text-underline-offset: .2em; }
.updates a:hover, .updates a:focus-visible { color: var(--blue); text-decoration-style: solid; }

.books {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  align-items: start;
  margin-top: 2rem;
}

.book {
  height: 382px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
}

.book img {
  width: auto;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
  border: 1px solid #3e454b;
  box-shadow: 0 4px 14px rgba(31, 43, 54, .08);
  transition: box-shadow .18s ease, transform .18s ease;
}

.book:hover img, .book:focus-visible img { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(31, 43, 54, .14); }

.home-contact {
  margin: 1.25rem 0 0;
  font-size: .95rem;
}

.home-contact a { color: var(--blue); text-underline-offset: .2em; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding-top: .8rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8rem;
}

.site-footer p { margin: 0; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .35rem 1rem; }
.site-footer a { text-underline-offset: .2em; }
:focus-visible { outline: 3px solid #e1ad3d; outline-offset: 3px; }

.gallery-note {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: .92rem;
}

.page-heading {
  margin: 0 0 1rem;
  color: var(--blue);
  font-size: 1.45rem;
  line-height: 1.2;
}

.section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0 0 1.25rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--line);
}

.section-tabs a {
  padding: .38rem .7rem;
  border: 1px solid var(--line);
  background: #f7f8f9;
  font-size: .9rem;
  text-decoration: none;
}

.section-tabs a:hover,
.section-tabs a:focus-visible,
.section-tabs a[aria-current="page"] {
  color: var(--blue);
  background: var(--nav-hover);
  border-color: #bbc7d0;
}

.prose {
  min-width: 0;
  overflow-wrap: anywhere;
}

.prose p { margin: 0 0 .9rem; }
.prose ul, .prose ol { margin: 0 0 1rem; padding-left: 1.35rem; }
.prose li { margin-bottom: .45rem; }
.prose li::after { content: ""; display: block; clear: both; }
.prose a { text-decoration-style: dotted; text-underline-offset: .2em; }
.prose a:hover, .prose a:focus-visible { color: var(--blue); text-decoration-style: solid; }
.prose .unavailable-link { color: var(--muted); text-decoration: none; cursor: help; }
.prose .retired-link { color: var(--muted); border-bottom: 1px dotted #9da5ac; }
.prose .intro-text { color: var(--muted); }
.cookie-declaration { min-height: 2rem; margin: 1rem 0; }
.cookie-settings {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: .2em;
  cursor: pointer;
}
.prose h2, .prose h3 { margin: 1.35rem 0 .55rem; color: var(--blue); line-height: 1.25; }
.prose h2 { font-size: 1.2rem; }
.prose h3 { font-size: 1.05rem; }
.prose hr { height: 1px; margin: 1.25rem 0; border: 0; background: var(--line); }
.prose font { font-family: inherit; font-size: inherit; }
.prose img[align="right"],
.prose img[style*="float: right"] {
  float: right;
  width: auto;
  max-width: 110px;
  height: auto;
  margin: .15rem 0 .7rem 1rem;
}

.prose script { display: none; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
}

.photo-tile {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f4f5f6;
  cursor: zoom-in;
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .2s ease, filter .2s ease;
}

.photo-tile:hover img,
.photo-tile:focus-visible img {
  transform: scale(1.025);
  filter: contrast(1.03);
}

.lightbox {
  width: min(94vw, 1040px);
  height: min(92vh, 820px);
  margin: auto;
  padding: 2.75rem 3.75rem 2rem;
  overflow: hidden;
  border: 0;
  background: #101417;
  color: #fff;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .38);
}

.lightbox::backdrop { background: rgba(11, 16, 20, .82); }

.lightbox figure {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: .6rem;
  margin: 0;
}

.lightbox figure img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.lightbox figcaption {
  min-height: 1.5rem;
  text-align: center;
  color: #d6dde1;
  font-size: .85rem;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .35);
  color: #fff;
  background: rgba(16, 20, 23, .72);
  cursor: pointer;
}

.lightbox-close {
  top: .7rem;
  right: .7rem;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.55rem;
}

.lightbox-nav {
  top: 50%;
  width: 2.6rem;
  height: 3.6rem;
  transform: translateY(-50%);
  font-size: 2rem;
}

.lightbox-prev { left: .55rem; }
.lightbox-next { right: .55rem; }

@media (max-width: 900px) {
  .site-header, .page-grid { grid-template-columns: 230px minmax(0, 1fr); gap: 2rem; }
  .brand { width: 225px; }
  .books { gap: 1rem; }
  .book { height: 340px; }
}

@media (max-width: 680px) {
  .page-shell { position: relative; width: min(calc(100% - 1.5rem), var(--content-width)); padding-top: .7rem; }
  .site-header {
    position: relative;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    min-height: 72px;
    padding-bottom: .7rem;
    border-bottom: 1px solid var(--line);
  }

  .brand { width: min(210px, 62vw); }
  .identity { display: none; }
  .menu-button {
    position: relative;
    z-index: 40;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .55rem .75rem;
    border: 1px solid var(--line);
    color: var(--ink);
    background: var(--white);
    font: 600 .9rem/1 var(--sans);
    cursor: pointer;
  }

  .page-grid { display: flex; flex-direction: column; gap: 0; }
  .sidebar { display: contents; }
  .profile {
    order: 1;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: .85rem;
    align-items: center;
    margin: 1rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
  }

  .profile > img { width: 76px; height: 106px; }
  .profile > div { margin: 0; }
  .side-nav { display: none; }
  .side-nav.is-open {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    z-index: 30;
    width: min(84vw, 320px);
    display: flex;
    flex-direction: column;
    gap: .25rem;
    margin: 0;
    padding: 5rem .75rem 1rem;
    overflow-y: auto;
    border: 0;
    border-left: 1px solid var(--line);
    background: var(--white);
    box-shadow: -12px 0 28px rgba(26, 39, 52, .18);
  }
  .side-nav a {
    min-height: 48px;
    padding: .55rem .75rem;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: var(--white);
    font-size: .94rem;
  }
  .side-nav a:last-child { border-bottom: 0; }
  .side-nav a:hover,
  .side-nav a:focus-visible,
  .side-nav a[aria-current="page"] { color: var(--blue); background: #f5f8fa; }
  body.menu-open { overflow: hidden; }
  body.menu-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(15, 24, 32, .24);
  }
  body.menu-open .menu-button {
    position: fixed;
    top: .85rem;
    right: .75rem;
  }
  .main-content { order: 2; padding-top: 1rem; border-top: 0; }
  .updates p { margin-bottom: .85rem; font-size: 1rem; line-height: 1.48; }
  .books { gap: .75rem; margin-top: 1.15rem; }
  .book { height: min(58vw, 280px); }
  .gallery-content { padding-top: 1rem; }
  .content-page { padding-top: 1rem; }
  .page-heading { font-size: 1.3rem; }
  .section-tabs { gap: .3rem; margin-bottom: 1rem; }
  .section-tabs a { flex: 1 1 auto; text-align: center; }
  .prose ul, .prose ol { padding-left: 1.2rem; }
  .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; }
  .lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; padding: 3.5rem 2.8rem 1.2rem; }
  .site-footer { align-items: flex-start; flex-direction: column; gap: .35rem; margin-top: 1rem; }
  .site-footer nav { width: 100%; gap: .35rem .8rem; }
}

@media (max-width: 390px) {
  .book { height: 225px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}

@media print {
  .menu-button, .side-nav { display: none; }
  .page-shell { width: 100%; }
  .site-header, .page-grid { grid-template-columns: 230px 1fr; gap: 2rem; }
}
