:root {
  color-scheme: dark;
  font-family: Roboto, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: #05060a;
  color: #f8f8fa;
}

.drawer-shell {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
}

@keyframes drawer-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.drawer {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  flex: 0 0 60px;
  width: 60px;
  min-width: 60px;
  height: 100%;
  background-image: var(--drawer-image);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: auto 100%;
  overflow: hidden;
  cursor: pointer;
  transition: flex-basis 480ms cubic-bezier(0.22, 1, 0.36, 1), width 480ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 480ms cubic-bezier(0.22, 1, 0.36, 1), filter 240ms ease, opacity 240ms ease,
    background-size 240ms ease;
  animation: drawer-fade-in 420ms ease both;
  animation-delay: calc(var(--i, 0) * 10ms);
  isolation: isolate;
  background-clip: border-box;
  filter: grayscale(1);
}

.drawer.is-visited:not(.is-open) {
  filter: none;
}

.drawer.is-visited:not(.is-open)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(200, 0, 0, 0.45);
  pointer-events: none;
  z-index: 1;
}

.drawer-shell:has(.drawer.is-open) .drawer:not(.is-open)::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 2;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.drawer-shell:has(.drawer.is-open) .drawer:not(.is-open):hover::before {
  opacity: 0;
}

.drawer:hover:not(.is-open) {
  filter: grayscale(0);
}

.drawer-shell:not(:has(.drawer.is-open)) .drawer:hover:not(.is-open) {
  background-image: none;
  z-index: 1;
}

.drawer-shell:not(:has(.drawer.is-open)) .drawer:hover:not(.is-open) .drawer-spine {
  display: block;
}

.drawer-shell:not(:has(.drawer.is-open)) .drawer:hover:not(.is-open) .drawer-content {
  display: none;
}

.drawer.is-open {
  flex: 0 0 min(80vw, 960px);
  width: min(80vw, 960px);
  max-width: none;
  position: relative;
  z-index: 2;
  margin-left: 0;
  transform: translateX(0);
  background-image: none;
  background-color: #b0b0b0;
  filter: none;
}

.drawer.is-open::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 68px;
  z-index: 2;
  background-color: #b0b0b0;
  pointer-events: none;
}

.drawer:not(.is-open) {
  flex: 0 0 60px;
  width: 60px;
  min-width: 60px;
}

.drawer-label {
  display: none;
}

.drawer-spine {
  display: none;
  flex: 0 0 auto;
  height: 100%;
  width: auto;
  object-fit: contain;
}

.drawer.is-open .drawer-spine {
  display: block;
  max-width: 45%;
  opacity: 0.3;
  filter: grayscale(1);
  position: relative;
  z-index: 3;
}

.drawer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border: none;
  outline: none;
  background-color: #b0b0b0;
  color: #4d4d4d;
  font-size: 1.25rem;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 200ms ease, transform 200ms ease, color 150ms ease;
  pointer-events: none;
}

.drawer-close:focus,
.drawer-close:focus-visible {
  outline: none;
}

.drawer.is-open .drawer-close {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity 260ms ease 260ms, transform 260ms ease 260ms;
}

.drawer.is-open .drawer-close:hover {
  color: #f8f8fa;
}

.drawer-share {
  position: absolute;
  top: 16px;
  right: 58px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border: none;
  background-color: #b0b0b0;
  color: #4d4d4d;
  font-size: 1.25rem;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 200ms ease, transform 200ms ease, color 150ms ease;
  pointer-events: none;
}

.drawer.is-open .drawer-share {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity 260ms ease 300ms, transform 260ms ease 300ms;
}

.drawer.is-open .drawer-share:hover {
  color: #f8f8fa;
}

.drawer-content {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 16px;
  padding: 50px 50px 100px;
  overflow-y: auto;
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 260ms ease 0ms, transform 260ms ease 0ms;
  pointer-events: none;
}

.drawer:not(.is-open) .drawer-content {
  content-visibility: auto;
  contain-intrinsic-size: 60px 900px;
}

.drawer.is-open .drawer-content {
  content-visibility: visible;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  transition: opacity 320ms ease 220ms, transform 320ms cubic-bezier(0.22, 1, 0.36, 1) 220ms;
}

/*
  Content block template
  -----------------------
  Drop any of these inside a .drawer-content:

  Text:
    <div class="content-card">
      <h2>Title</h2>
      <p>Copy goes here.</p>
    </div>

  Photo (add "is-full" to span the whole open drawer):
    <div class="content-card is-full">
      <img class="content-media" src="photo.jpg" alt="" />
    </div>

  Video (add "is-full" to span the whole open drawer):
    <div class="content-card is-full">
      <video class="content-media" src="clip.mp4" controls></video>
    </div>

  Sound:
    <div class="content-card">
      <h2>Title</h2>
      <audio src="track.mp3" controls></audio>
    </div>

  PDF (renders as a page-flip digital book, lazily on drawer open):
    <div class="content-card is-full">
      <div class="pdf-book-wrap">
        <div class="pdf-book" data-src="document.pdf"></div>
        <button type="button" class="pdf-fullscreen" aria-label="Fullscreen">&#9974;</button>
      </div>
    </div>

  Blocks can be mixed and stacked inside the same drawer.
*/

.content-card {
  width: 100%;
  max-width: 420px;
  padding: 1rem;
  background: none;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  margin-left: auto;
  transform: translateX(12px);
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1) 220ms;
}

.drawer.is-open .content-card {
  transform: translateX(0);
}

.content-card:has(> p) {
  padding-right: 50px;
}

.content-card.is-full {
  max-width: none;
  margin-left: 0;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  display: flex;
  justify-content: center;
}

.content-card p {
  margin: 0 0 1em;
  line-height: 1.5;
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 1px;
  color: #4d4d4d;
}

.content-card p.is-description {
  margin-top: 3em;
}

.content-card p.credits {
  text-align: right;
}

.content-card p .tag-line {
  display: block;
  margin-bottom: 1em;
  color: #999999;
  text-transform: uppercase;
}

.content-card p a {
  color: #000000;
  text-decoration: none;
}

.content-card p a:hover {
  color: #4d4d4d;
}

.content-card audio {
  width: 100%;
  margin-top: 0.5rem;
}

.audio-player {
  display: flex;
  align-items: center;
  gap: 12px;
}

.audio-toggle {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: none;
  color: #f8f8fa;
  font-size: 0.7rem;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 150ms ease;
}

.audio-toggle:hover {
  opacity: 0.6;
}

.audio-scrub {
  flex: 1 1 auto;
  height: 28px;
  cursor: pointer;
  position: relative;
}

.audio-scrub::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(248, 248, 250, 0.3);
  transform: translateY(-50%);
}

.audio-scrub-fill {
  position: absolute;
  left: 0;
  top: 50%;
  height: 1px;
  width: 0%;
  background: #f8f8fa;
  transform: translateY(-50%);
}

.audio-time {
  flex: 0 0 auto;
  font-size: 10px;
  letter-spacing: 1px;
  color: #f8f8fa;
  font-variant-numeric: tabular-nums;
}

.content-media {
  display: block;
  width: 100%;
  border-radius: 0;
  object-fit: cover;
}

.content-card.is-full .content-media {
  width: 100%;
  height: auto;
}

.video-embed {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

.pdf-book-wrap {
  position: relative;
  width: 100%;
  max-height: 70vh;
  aspect-ratio: var(--pdf-aspect, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
}

.pdf-book-wrap:fullscreen {
  height: 100%;
  background: #111;
}

.pdf-book {
  width: 100%;
  height: 100%;
}

.pdf-book-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  letter-spacing: 1px;
  color: rgba(248, 248, 250, 0.6);
  pointer-events: none;
}

.pdf-book-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(248, 248, 250, 0.25);
  border-top-color: rgba(248, 248, 250, 0.75);
  animation: pdf-book-spin 800ms linear infinite;
}

.pdf-book-progress {
  font-size: 0.6rem;
  letter-spacing: 0.5px;
  color: #4d4d4d;
  font-variant-numeric: tabular-nums;
}

@keyframes pdf-book-spin {
  to {
    transform: rotate(360deg);
  }
}

.pdf-embed,
.image-embed {
  position: relative;
}

.pdf-embed {
  width: 100%;
  height: 70vh;
}

.pdf-embed:fullscreen {
  height: 100%;
}

.pdf-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.image-embed:fullscreen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

.image-embed:fullscreen .content-media {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  touch-action: none;
  user-select: none;
  transition: transform 150ms ease;
}

.image-embed:fullscreen .content-media.is-zoomed {
  cursor: grab;
  transition: none;
}

.image-embed:fullscreen .content-media.is-zoomed.is-panning {
  cursor: grabbing;
}

.pdf-fullscreen {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #f8f8fa;
  font-size: 0.9rem;
  line-height: 1;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 150ms ease;
}

.pdf-fullscreen:hover {
  opacity: 0.6;
}

/* CSS fallback for browsers without the Fullscreen API on non-video
   elements (iOS Safari), toggled via .is-fake-fullscreen in script.js. */
.pdf-embed.is-fake-fullscreen,
.pdf-book-wrap.is-fake-fullscreen,
.image-embed.is-fake-fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background: #000;
}

.pdf-book-wrap.is-fake-fullscreen {
  background: #111;
}

.pdf-embed.is-fake-fullscreen iframe {
  width: 100%;
  height: 100%;
}

.image-embed.is-fake-fullscreen {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.image-embed.is-fake-fullscreen .content-media {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  touch-action: none;
  user-select: none;
  transition: transform 150ms ease;
}

.image-embed.is-fake-fullscreen .content-media.is-zoomed {
  cursor: grab;
  transition: none;
}

.image-embed.is-fake-fullscreen .content-media.is-zoomed.is-panning {
  cursor: grabbing;
}

.info-shell {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: #0c0d10;
  transition: background-color 500ms ease;
}

.info-shell.is-idle:not(.is-open) {
  background-color: transparent;
}

.info-shell.is-idle:not(.is-open):hover {
  background-color: #0c0d10;
}

.info-bar {
  background: red;
}

.info-bar {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  gap: 10px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 500ms ease, transform 500ms ease;
}

.info-shell.is-idle .info-bar {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.info-shell.is-idle:hover .info-bar {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.info-tab {
  flex: 0 0 auto;
  padding: 10px;
  border: none;
  background: none;
  color: #f8f8fa;
  font-family: inherit;
  font-size: 6px;
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 3px;
  cursor: pointer;
  transition: background 150ms ease;
}

.info-tab:hover {
  background: none;
  color: #000000;
  font-weight: 400;
}

.info-tab.is-active {
  background: none;
  color: #000000;
  font-weight: 400;
}

.info-panel {
  position: relative;
  max-height: 0;
  overflow: hidden;
  transition: max-height 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.info-shell.is-open .info-panel {
  max-height: 100vh;
  max-height: 100dvh;
}

.info-panel-content {
  max-height: 100vh;
  max-height: 100dvh;
  overflow-y: auto;
  padding-top: 50px;
  padding-left: 50px;
  padding-right: 50px;
  padding-bottom: 50px;
}

.info-content {
  display: none;
  max-width: 400px;
}

.info-content.is-active {
  display: block;
}

.info-content h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.2rem;
}

.info-content p {
  margin: 0 0 1em;
  line-height: 1.5;
  font-size: 11px;
  letter-spacing: 1px;
  color: #cccccc;
}

.info-content p.year-heading {
  margin-top: 2em;
}

.info-content p a {
  color: #cccccc;
  text-decoration: none;
}

.info-content p a:hover {
  opacity: 0.6;
}

.info-close {
  position: absolute;
  top: 50px;
  right: 50px;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: #f8f8fa;
  font-size: 1.25rem;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, color 150ms ease;
}

.info-shell.is-open .info-close {
  opacity: 1;
  pointer-events: auto;
}

.info-close:hover {
  color: #999;
}

@media (max-width: 820px) {
  /* The desktop open-drawer layout puts the spine image beside the
     content column, which leaves too little width to stay readable on
     a phone. On mobile, drop the spine and let content use the full
     width instead; the DOM already puts text before media blocks, so
     no reordering is needed, just room to read them. */
  .drawer.is-open {
    flex-basis: 100vw;
    width: 100vw;
    max-width: none;
  }

  .drawer.is-open .drawer-spine {
    display: none;
  }

  .drawer.is-open .drawer-content {
    padding: 50px 20px 100px;
  }

  .drawer.is-open .content-card:has(> p) {
    padding-right: 20px;
  }

  .drawer.is-open .pdf-book-wrap {
    max-height: 45vh;
  }

  .drawer.is-open .pdf-embed {
    height: 45vh;
  }

  /* Solo-image entries get a fullscreen/zoom button on desktop; on
     mobile the browser's own pinch-zoom already covers that need, and
     the button's fixed-position fullscreen overlay fights with mobile
     Safari's chrome, so it's disabled here rather than adapted. */
  .image-embed .pdf-fullscreen {
    display: none;
  }
}

@media (max-width: 820px) {
  .info-bar {
    height: 32px;
    background: #000000;
    justify-content: flex-end;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 4px;
  }

  .info-tab {
    font-size: 0.65rem;
    letter-spacing: 0.08rem;
    padding: 10px 8px;
    white-space: nowrap;
    color: #f8f8fa;
  }

  .info-tab:hover,
  .info-tab.is-active {
    color: #c80000;
  }

  /* .info-shell (bar + panel) sizes to its content and is anchored to
     bottom:0, so if the panel alone is 100dvh, the bar's height pushes
     the whole shell to overflow above the viewport, throwing off
     anything positioned relative to it (like .info-close's top). Cap
     the panel to leave room for the bar so the shell matches the
     viewport exactly. */
  .info-shell.is-open .info-panel {
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
  }

  .info-panel-content {
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
  }
}
