/* Sentient Spaces — Piece Popup
   Kiln Dark tokens: ground #07080a, panel #0b0d10, ink #e8e4dc, celadon #9fd8c3, hairline #262c34.
   Radius 0 everywhere, per the design system. */

.sspp-card { cursor: pointer; }
.sspp-card:hover { background: rgba(159, 216, 195, 0.028); }

/* ---- hover peek, anchored to the card ---- */

.sspp-peek {
  position: absolute;
  z-index: 9998;
  max-width: calc(100vw - 24px);
  padding: 12px;
  background: #0b0d10;
  border: 1px solid #2c333b;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.68);
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
  animation: sspp-peek 0.18s ease-out both;
}

.sspp-peek__frame {
  min-height: 90px;
  background-size: cover;
  background-position: center;
}

.sspp-peek__eyebrow,
.sspp-peek__line,
.sspp-peek__hint {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
}

.sspp-peek__eyebrow {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #6d7480;
}

.sspp-peek__title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 23px;
  font-weight: 300;
  line-height: 1.14;
  color: #e8e4dc;
}

.sspp-peek__line {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #8b919b;
}

.sspp-peek__hint {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #9fd8c3;
  border-top: 1px solid #171b21;
  padding-top: 9px;
}

.sspp-peek__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ---- centre-screen band ---- */

.sspp-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sspp-modal[hidden] { display: none; }

.sspp-scrim {
  position: absolute;
  inset: 0;
  background: rgba(7, 8, 10, 0.68);
  animation: sspp-fade 0.26s ease-out both;
}

.sspp-band {
  position: relative;
  width: min(var(--sspp-band-w, 1440px), var(--sspp-band-vw, 96vw));
  height: min(var(--sspp-band-max, 900px), 90vh);
  background: #0b0d10;
  border: 1px solid #262c34;
  box-shadow: 0 40px 96px rgba(0, 0, 0, 0.62);
  display: flex;
  flex-direction: column;
  animation: sspp-rise 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.sspp-head,
.sspp-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 28px;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
}

.sspp-head { border-bottom: 1px solid #171b21; }

.sspp-foot {
  padding: 13px 28px;
  border-top: 1px solid #171b21;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #5d646e;
}

.sspp-eyebrow {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #6d7480;
}

.sspp-nav { display: flex; align-items: center; gap: 8px; }

.sspp-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid #262c34;
  color: #a8aeb8;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

.sspp-btn:hover { border-color: #4a5058; color: #e8e4dc; }
.sspp-btn--close { margin-left: 6px; font-size: 11px; }
.sspp-btn--close:hover { border-color: #2f4a42; color: #9fd8c3; }

.sspp-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 30px 28px 34px;
  display: grid;
  grid-template-columns: var(--sspp-photo, 56fr) var(--sspp-text, 44fr);
  gap: 32px;
  align-items: start;
}

/* The photograph stays put while the words scroll past it. */
.sspp-gallery {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sspp-lead {
  position: relative;
  height: min(560px, calc(min(var(--sspp-band-max, 900px), 90vh) - 210px));
  min-height: 200px;
  background-size: cover;
  background-position: center;
}

.sspp-lead__label {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(232, 228, 220, 0.55);
}

.sspp-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }

.sspp-thumb {
  flex: 0 0 auto;
  width: 84px;
  height: 62px;
  padding: 0;
  border: 1px solid #262c34;
  background-size: cover;
  background-position: center;
  opacity: 0.5;
  cursor: pointer;
}

.sspp-thumb:hover { opacity: 1; }
.sspp-thumb[aria-current='true'] { opacity: 1; border-color: #9fd8c3; }

.sspp-text { display: flex; flex-direction: column; gap: 22px; }

.sspp-titles { display: flex; flex-direction: column; gap: 11px; }

.sspp-title {
  margin: 0;
  font-family: 'Newsreader', Georgia, serif;
  font-size: 31px;
  font-weight: 200;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: #e8e4dc;
}

.sspp-line {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #9fd8c3;
}

.sspp-prose { display: flex; flex-direction: column; gap: 14px; }

.sspp-prose p {
  margin: 0;
  font-family: 'Newsreader', Georgia, serif;
  font-size: 16px;
  line-height: 1.62;
  color: #c3c8d0;
  text-wrap: pretty;
}

.sspp-prose p + p { color: #8b919b; }

.sspp-record { display: flex; flex-direction: column; gap: 10px; }

.sspp-record__label {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #6d7480;
}

.sspp-record__rows {
  display: flex;
  flex-direction: column;
  border-top: 1px solid #262c34;
}

.sspp-record__row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid #14181d;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.6;
}

.sspp-record__row dt { margin: 0; color: #6d7480; }
.sspp-record__row dd { margin: 0; color: #dcd8d0; }
.sspp-record__row dd a { color: #9fd8c3; text-decoration: none; border-bottom: 1px solid #2f4a42; }
.sspp-record__row dd a:hover { border-bottom-color: #9fd8c3; }

.sspp-lead[data-zoomable] { cursor: zoom-in; }

.sspp-lead[data-zoomable]::after {
  content: 'Enlarge';
  position: absolute;
  top: 10px;
  right: 12px;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #e8e4dc;
  background: rgba(7, 8, 10, 0.62);
  border: 1px solid rgba(232, 228, 220, 0.22);
  padding: 5px 8px;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.sspp-lead[data-zoomable]:hover::after { opacity: 1; }

.sspp-zoom {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(7, 8, 10, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px;
  cursor: zoom-out;
  animation: sspp-fade 0.2s ease-out both;
}

.sspp-zoom[hidden] { display: none; }

.sspp-zoom__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.sspp-zoom__label {
  position: absolute;
  left: 28px;
  right: 96px;
  bottom: 18px;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(232, 228, 220, 0.6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sspp-zoom__close {
  position: absolute;
  top: 18px;
  right: 22px;
  cursor: pointer;
}
html.sspp-locked { overflow: hidden; }

@keyframes sspp-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes sspp-peek { from { opacity: 0; transform: translateY(5px) } to { opacity: 1; transform: none } }
@keyframes sspp-rise { from { opacity: 0; transform: translateY(16px) scale(0.985) } to { opacity: 1; transform: none } }

@media (max-width: 900px) {
  .sspp-band { width: 100vw; height: min(var(--sspp-band-max, 900px), 92vh); border-left: 0; border-right: 0; }
  .sspp-zoom { padding: 18px; }
  .sspp-zoom__label { left: 18px; right: 76px; }
  .sspp-body { grid-template-columns: 1fr; gap: 22px; padding: 22px 20px 28px; }
  .sspp-gallery { position: static; }
  .sspp-lead { height: 240px; }
  .sspp-title { font-size: 27px; }
  .sspp-head, .sspp-foot { padding-left: 22px; padding-right: 22px; }
  .sspp-foot span:last-child { display: none; }
  .sspp-peek { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sspp-scrim, .sspp-band, .sspp-peek, .sspp-zoom { animation: none; }
}
