/* ── Detail view ────────────────────────────────────────────── */
/*
 * Opening a project or an event does not open a panel — the universe dims and
 * the record of that place surfaces in front of it. No card, no frame.
 */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
}

.overlay__backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, rgba(6, 4, 16, 0.97), rgba(2, 1, 6, 0.995));
  opacity: 0;
  transition: opacity var(--speed) ease;
}

.overlay.is-open .overlay__backdrop {
  opacity: 1;
}

.overlay__panel {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translate3d(0, 0, -260px);
  transition: opacity var(--speed) ease, transform var(--speed-slow) var(--ease-out);
}

.overlay.is-open .overlay__panel {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.overlay__close {
  position: fixed;
  top: clamp(1rem, 3vh, 2rem);
  right: clamp(1rem, 4vw, 3rem);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  transition: color var(--speed-fast) ease;
}

.overlay__close:hover {
  color: var(--text-strong);
}

.overlay__close-mark {
  font-size: 1.2rem;
  line-height: 1;
}

.overlay__scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 136, 255, 0.35) transparent;
}

.overlay__scroll::-webkit-scrollbar {
  width: 6px;
}

.overlay__scroll::-webkit-scrollbar-thumb {
  background: rgba(168, 136, 255, 0.3);
}

/* ── The record ─────────────────────────────────────────────── */
.doc {
  width: min(920px, 88vw);
  margin: 0 auto;
  padding: clamp(4.5rem, 12vh, 8rem) 0 clamp(5rem, 14vh, 9rem);
}

.doc__name {
  font-family: var(--font-title);
  font-weight: 400;
  color: var(--title-ink);
  text-shadow: none;
  margin: 0.9rem 0 1.4rem;
  font-size: clamp(1.9rem, 4.6vw, 3.4rem);
  line-height: 1.04;
}

.doc__lead {
  max-width: 62ch;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: var(--text-muted);
}

.doc__inline {
  margin-top: 1.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.doc__inline--accent {
  color: var(--violet-pale);
}

.doc__facts {
  margin-top: clamp(2rem, 5vh, 3rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--gap-md);
  padding-top: var(--gap-md);
  border-top: 1px solid var(--hairline);
}

.doc__facts dt,
.doc__stack dt,
.doc__points dt {
  font-size: 0.63rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.5rem;
}

.doc__facts dd,
.doc__stack dd {
  font-size: 0.9rem;
  color: var(--text);
}

.doc__links {
  margin-top: var(--gap-md);
  display: flex;
  flex-wrap: wrap;
  gap: 1.6rem;
}

.doc__artifacts {
  margin: clamp(2.5rem, 7vh, 4.5rem) 0;
}

.doc__body {
  display: grid;
  gap: clamp(2.5rem, 7vh, 4.5rem);
}

.doc__title {
  margin: 0.6rem 0 1rem;
  font-size: clamp(1.15rem, 2vw, 1.6rem);
  font-weight: 600;
}

.doc__intro {
  max-width: 66ch;
  color: var(--text-muted);
}

.doc__note {
  margin-top: var(--gap-md);
  padding-left: 1.1rem;
  border-left: 1px solid var(--hairline-strong);
  font-size: 0.86rem;
  color: var(--text-faint);
  max-width: 60ch;
}

.doc__points {
  margin-top: var(--gap-lg);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--gap-lg) clamp(1.5rem, 4vw, 3rem);
}

.doc__points dt {
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
  margin-bottom: 0.55rem;
}

.doc__points dd {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.doc__chain {
  margin-top: var(--gap-md);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--text);
}

.doc__chain span + span::before {
  content: "→";
  margin-right: 0.9rem;
  color: var(--violet);
}

.doc__stack {
  margin-top: var(--gap-md);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--gap-lg) clamp(1.5rem, 4vw, 3rem);
}

.doc__list {
  margin-top: var(--gap-md);
  display: grid;
  gap: 0.55rem;
  color: var(--text-muted);
}

.doc__list li::before {
  content: "—";
  margin-right: 0.8rem;
  color: var(--violet);
}

/* ── Artifacts: images floating past the camera ─────────────── */
.artifacts {
  position: relative;
  overflow: hidden;
  padding: 2.5rem 0;
  perspective: 900px;
  cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.artifacts.is-dragging {
  cursor: grabbing;
}

.artifacts__track {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  width: max-content;
  transform-style: preserve-3d;
  will-change: transform;
}

.artifact {
  position: relative;
  display: block;
  width: clamp(220px, 26vw, 380px);
  transform: translate3d(0, var(--lift), var(--depth)) rotateY(var(--lean));
  transform-style: preserve-3d;
  transition: transform var(--speed-slow) var(--ease-out), filter var(--speed) ease;
  filter: brightness(0.78) saturate(0.8);
  animation: artifact-arrive 1.1s var(--ease-out) backwards;
  animation-delay: var(--enter-delay);
}

@keyframes artifact-arrive {
  from {
    opacity: 0;
    transform: translate3d(90px, var(--lift), -900px) rotateY(var(--lean));
  }
}

.artifact img {
  width: 100%;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.9);
  user-select: none;
}

.artifact:hover,
.artifact:focus-visible {
  transform: translate3d(0, var(--lift), 60px) rotateY(0deg);
  filter: brightness(1) saturate(1);
}

.artifact__caption {
  position: absolute;
  left: 0;
  bottom: -1.6rem;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  opacity: 0;
  transition: opacity var(--speed) ease;
}

.artifact:hover .artifact__caption,
.artifact:focus-visible .artifact__caption {
  opacity: 1;
}

.artifacts--static {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  cursor: auto;
}

.artifacts--static .artifacts__track {
  transform: none !important;
}

.artifacts--static .artifact {
  transform: none;
  animation: none;
  filter: none;
  scroll-snap-align: center;
}

.artifacts__placeholder {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ── Fullscreen photograph ──────────────────────────────────── */
/*
 * The viewer takes the viewport. The image is centred in it and contained by
 * it; the bar, the caption and the arrows float *over* the image rather than
 * taking layout rows away from it, which is what used to push it down the
 * screen. The universe stays faintly visible behind.
 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 2, 9, 0.86);
  backdrop-filter: blur(7px) brightness(0.62);
  opacity: 0;
  transition: opacity var(--speed) ease;
}

.lightbox.is-open .lightbox__backdrop {
  opacity: 1;
}

/*
 * Centred in the viewport on both axes, at every image ratio. Centring uses
 * the `translate` property rather than `transform`, which leaves `transform`
 * free for the flight from the floating photograph — the two compose instead
 * of overwriting each other.
 */
.lightbox__figure {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(52vw, 820px);
  height: min(52vh, 620px);
  margin: 0;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  transform-origin: center center;
  opacity: 0;
  transition:
    transform 0.62s var(--ease-out),
    opacity 0.42s ease;
  will-change: transform, opacity;
}

.lightbox.is-open .lightbox__figure {
  opacity: 1;
}

.lightbox__figure img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  /* Rounded, so the photograph reads as an object rather than a cut-out. */
  border-radius: 30px;
  box-shadow:
    0 50px 120px -60px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(196, 178, 255, 0.14),
    0 0 70px -20px rgba(140, 108, 230, 0.35);
}

/*
 * The frame: four corner marks and a point of light at each, as though the
 * photograph were being held open by the universe rather than sitting in a
 * card. Drawn on the figure, so it tracks the image at any aspect ratio.
 */
.lightbox__figure::before,
.lightbox__figure::after {
  content: "";
  position: absolute;
  width: clamp(26px, 3vw, 44px);
  height: clamp(26px, 3vw, 44px);
  border: 1px solid rgba(201, 182, 255, 0.4);
  border-radius: 30px 0 0 0;
  opacity: 0;
  transition: opacity 0.7s ease 0.25s;
  pointer-events: none;
}

.lightbox__figure::before {
  top: -14px;
  left: -14px;
  border-right: 0;
  border-bottom: 0;
}

.lightbox__figure::after {
  right: -14px;
  bottom: -14px;
  border-left: 0;
  border-top: 0;
  border-radius: 0 0 30px 0;
}

.lightbox.is-open .lightbox__figure::before,
.lightbox.is-open .lightbox__figure::after {
  opacity: 1;
}

.lightbox__figure.is-swapped img {
  animation: lightbox-swap var(--speed) var(--ease-out);
}

@keyframes lightbox-swap {
  from {
    opacity: 0;
  }
}

.lightbox__bar {
  position: absolute;
  top: clamp(1rem, 3vh, 2rem);
  left: clamp(1rem, 4vw, 3rem);
  right: clamp(1rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-md);
  opacity: 0;
  transition: opacity var(--speed) ease;
}

.lightbox.is-open .lightbox__bar,
.lightbox.is-open .lightbox__caption {
  opacity: 1;
}

.lightbox__counter,
.lightbox__close {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  transition: color var(--speed-fast) ease;
}

.lightbox__close:hover {
  color: var(--text-strong);
}

.lightbox__caption {
  position: absolute;
  left: 50%;
  bottom: clamp(1rem, 4vh, 2.4rem);
  transform: translateX(-50%);
  max-width: min(70ch, 88vw);
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity var(--speed) ease;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  display: none;
  place-items: center;
  color: var(--text-faint);
  font-size: 1.3rem;
  transition: color var(--speed-fast) ease;
}

.lightbox.has-nav .lightbox__nav {
  display: grid;
}

.lightbox__nav:hover {
  color: var(--text-strong);
}

.lightbox__nav--prev {
  left: clamp(0.5rem, 2vw, 2rem);
}

.lightbox__nav--next {
  right: clamp(0.5rem, 2vw, 2rem);
}
