/* Chimaerarium page */

:root {
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body.chimaerarium-page {
  font-family: var(--font-body);
  color: #000;
  background-color: var(--site-bg-base, #f2f2f2);
}

body.chimaerarium-lightbox-open {
  overflow: hidden;
}

body.chimaerarium-page .site-bg-effects,
body.workshop-page .site-bg-effects {
  z-index: 1;
}

.chimaerarium-header,
.chimaerarium-side-nav,
.chimaerarium-footer {
  position: relative;
  z-index: 10;
}

body.chimaerarium-page .chimaerarium-header,
body.workshop-page .chimaerarium-header,
body.manifesto-page .chimaerarium-header,
body.imprint-page .chimaerarium-header,
body.chimaerarium-page .site-home-layout__nav,
body.workshop-page .site-home-layout__nav,
body.manifesto-page .site-home-layout__nav,
body.imprint-page .site-home-layout__nav,
body.chimaerarium-page .chimaerarium-side-nav {
  z-index: 1000;
  pointer-events: auto;
  isolation: isolate;
}

/* Standalone pages share fixed top-right site nav (one line / mobile burger) */
body.chimaerarium-page .site-home-layout__nav,
body.manifesto-page .site-home-layout__nav,
body.imprint-page .site-home-layout__nav {
  position: fixed;
  top: 15px;
  right: 60px;
  z-index: 1000;
  margin: 0;
  align-self: auto;
}

/* Title mark is the home control — keep the whole hit target tappable */
body.chimaerarium-page .chimaerarium-header__link--mark-only,
body.workshop-page .chimaerarium-header__link--mark-only,
body.manifesto-page .chimaerarium-header__link--mark-only,
body.imprint-page .chimaerarium-header__link--mark-only {
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

body.chimaerarium-page .chimaerarium-header__link--mark-only .site-header-mark,
body.workshop-page .chimaerarium-header__link--mark-only .site-header-mark,
body.manifesto-page .chimaerarium-header__link--mark-only .site-header-mark,
body.imprint-page .chimaerarium-header__link--mark-only .site-header-mark {
  pointer-events: none;
}

.chimaerarium-header {
  position: fixed;
  top: 15px;
  left: 60px;
  width: 5rem;
  max-width: min(90vw, 5rem);
}

.chimaerarium-header__link {
  display: inline-block;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  color: inherit;
  text-decoration: none;
}

.chimaerarium-header__link:hover {
  text-decoration: underline;
}

.chimaerarium-header__link--mark-only {
  display: block;
  width: 5rem;
  max-width: 100%;
  line-height: 0;
}

.chimaerarium-header__link--mark-only:hover {
  text-decoration: none;
  opacity: 0.72;
}

body.chimaerarium-page .chimaerarium-header .site-header-mark,
body.workshop-page .chimaerarium-header .site-header-mark {
  display: block;
  width: 5rem;
  max-width: 100%;
  height: auto;
}

.chimaerarium-side-nav {
  position: fixed;
  top: 15px;
  right: 60px;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 0.35rem;
  text-align: right;
}

.chimaerarium-side-nav__label {
  font-family: var(--font-nav-default);
  font-size: var(--site-nav-font-size);
  font-weight: 400;
  font-style: normal;
  line-height: var(--site-nav-line-height);
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: text-decoration 0.15s ease;
}

.chimaerarium-side-nav__label--current {
  font-family: var(--font-nav-hover);
  font-style: italic;
  font-weight: 400;
}

.chimaerarium-side-nav__label:not(.chimaerarium-side-nav__label--current):hover,
.chimaerarium-side-nav__label:not(.chimaerarium-side-nav__label--current):focus-visible {
  font-family: var(--font-nav-hover);
  font-weight: 400;
  font-style: italic;
  text-decoration: underline;
}

.chimaerarium-main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.chimaerarium-layout {
  /* Match homepage left column width (site-home-layout.css) */
  --site-home-side-min: clamp(160px, 17vw, 19vw);
  --site-home-page-padding-x: clamp(1.25rem, 3vw, 3.75rem);

  display: grid;
  grid-template-columns: minmax(var(--site-home-side-min), 18fr) minmax(0, 82fr);
  column-gap: clamp(1.25rem, 2.5vw, 2.75rem);
  align-items: start;
  width: 100%;
  padding: clamp(6rem, 14vh, 10rem) var(--site-home-page-padding-x)
    clamp(4rem, 10vh, 7rem);
  box-sizing: border-box;
}

.chimaerarium-names {
  width: 100%;
  min-width: 0;
  position: sticky;
  top: clamp(5rem, 12vh, 8rem);
  align-self: start;
  overflow: visible;
}

.chimaerarium-copy__title {
  font-family: var(--font-title);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
}

.chimaerarium-names__text {
  margin: 0;
  font-family: var(--font-body);
  font-style: italic;
  font-size: clamp(0.72rem, 1.05vw, 0.82rem);
  line-height: 1.55;
  text-align: justify;
  hyphens: auto;
}

.chimaerarium-names__credits {
  margin-top: 1.1em;
}

@media (min-width: 901px) {
  /*
   * Left track = title width; images sit in the remaining space with
   * clearer separation from the credits (not tucked against them).
   */
  .chimaerarium-layout {
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: clamp(2.75rem, 5.5vw, 5.5rem);
  }

  .chimaerarium-names {
    width: min-content;
    max-width: none;
  }

  .chimaerarium-copy__title {
    white-space: nowrap;
  }

  .chimaerarium-grid {
    justify-self: center;
    width: 100%;
    max-width: min(100%, 58rem);
  }
}

.chimaerarium-names__text a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.chimaerarium-grid {
  min-width: 0;
  max-width: none;
  margin: 0;
  --grid-gap: clamp(1rem, 2.5vw, 1.75rem);
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(clamp(130px, calc((100% - 9 * var(--grid-gap)) / 10), 100%), 1fr)
  );
  gap: var(--grid-gap);
  align-content: start;
}

@keyframes chimaerarium-breathe {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(0, -8px, 0) scale(1.03);
  }
}

.chimaerarium-grid__item {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: default;
  animation: chimaerarium-breathe 4.5s ease-in-out infinite;
  animation-delay: var(--breathe-delay, 0s);
  will-change: transform;
  transition: opacity 0.35s ease;
}

.chimaerarium-grid:hover .chimaerarium-grid__item:not(:hover) {
  opacity: 0.45;
}

.chimaerarium-grid__item:hover {
  animation-play-state: paused;
  z-index: 2;
}

.chimaerarium-grid__item img {
  display: block;
  width: 100%;
  max-height: 220px;
  height: auto;
  object-fit: contain;
  object-position: center;
  transition: transform 0.25s ease-out;
  will-change: transform;
}

.chimaerarium-grid__item.is-pointer-active img {
  transition: transform 0.12s ease-out;
}

.chimaerarium-lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  cursor: default;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.chimaerarium-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.chimaerarium-lightbox__figure {
  margin: 0;
  max-width: min(92vw, 960px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  pointer-events: none;
}

.chimaerarium-lightbox__figure img {
  display: block;
  max-width: 100%;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  animation: chimaerarium-lightbox-in 0.35s ease-out;
}

.chimaerarium-lightbox__caption {
  display: none;
}

@keyframes chimaerarium-lightbox-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chimaerarium-grid__item {
    animation: none;
  }

  .chimaerarium-grid:hover .chimaerarium-grid__item:not(:hover) {
    opacity: 1;
  }

  .chimaerarium-grid__item img,
  .chimaerarium-lightbox__figure img {
    animation: none;
    transition: none;
  }
}

.chimaerarium-footer {
  position: fixed;
  right: 81px;
  bottom: 15px;
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: var(--site-nav-gap);
}

.chimaerarium-footer__link {
  flex: 0 0 auto;
  font-family: var(--font-nav-default);
  font-size: var(--site-nav-font-size);
  font-weight: 400;
  font-style: normal;
  line-height: var(--site-nav-line-height);
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: text-decoration 0.15s ease;
}

.chimaerarium-footer__link--underline {
  text-decoration: underline;
}

.chimaerarium-footer__link:hover,
.chimaerarium-footer__link:focus-visible {
  font-family: var(--font-nav-hover);
  font-weight: 400;
  font-style: italic;
  text-decoration: underline;
}

.chimaerarium-footer__link:first-child {
  margin-right: auto;
}

@media (min-width: 751px) and (max-width: 1000px) {
  .chimaerarium-header {
    left: 30.71875px;
  }

  .chimaerarium-side-nav,
  body.chimaerarium-page .site-home-layout__nav,
  body.manifesto-page .site-home-layout__nav,
  body.imprint-page .site-home-layout__nav {
    right: 30.71875px;
  }

  .chimaerarium-footer {
    right: 30.71875px;
  }
}

@media (max-width: 900px) {
  .chimaerarium-layout {
    display: flex;
    flex-direction: column;
    row-gap: clamp(1.25rem, 2.5vw, 2rem);
    --site-home-page-padding-x: 1rem;
    padding-top: clamp(5.5rem, 14vh, 8rem);
    overflow-x: clip;
  }

  /* Flatten so mobile can order: title → intro → grid → credits */
  .chimaerarium-names {
    display: contents;
  }

  .chimaerarium-copy__title {
    order: 1;
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: clamp(1.65rem, 8vw, 2.35rem);
    overflow-wrap: anywhere;
  }

  .chimaerarium-names__intro {
    order: 2;
  }

  .chimaerarium-grid {
    order: 3;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    --grid-gap: 0.55rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: hidden;
  }

  .chimaerarium-names__credits {
    order: 4;
    width: 100%;
    max-width: none;
    margin-top: 0;
  }

  .chimaerarium-names__text {
    font-size: 0.85rem;
    line-height: 1.55;
  }

  .chimaerarium-grid__item {
    animation-name: chimaerarium-breathe-mobile;
  }
}

@keyframes chimaerarium-breathe-mobile {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(0, -4px, 0) scale(1.015);
  }
}

@media (max-width: 750px) {
  .chimaerarium-header {
    left: 12.384px;
    top: 6px;
    width: 4.25rem;
    max-width: min(28vw, 4.25rem);
  }

  body.chimaerarium-page .chimaerarium-header .site-header-mark,
  body.chimaerarium-page .chimaerarium-header__link--mark-only,
  body.manifesto-page .chimaerarium-header .site-header-mark,
  body.manifesto-page .chimaerarium-header__link--mark-only,
  body.imprint-page .chimaerarium-header .site-header-mark,
  body.imprint-page .chimaerarium-header__link--mark-only {
    width: 4.25rem;
    max-width: 100%;
  }

  /* Legacy side-nav: hide when burger chrome is present */
  .chimaerarium-side-nav {
    display: none;
  }

  body.chimaerarium-page .site-home-layout__nav,
  body.manifesto-page .site-home-layout__nav,
  body.imprint-page .site-home-layout__nav {
    left: auto;
    right: 12.384px;
    top: 8px;
    width: auto;
    max-width: none;
    justify-content: flex-end;
    align-items: center;
    gap: 0;
    overflow: visible;
  }

  body.chimaerarium-page .site-home-layout__nav-toggle,
  body.manifesto-page .site-home-layout__nav-toggle,
  body.imprint-page .site-home-layout__nav-toggle {
    display: inline-flex;
  }

  /* Panel chrome lives in site-home-layout.css (full-page typographic overlay) */

  .chimaerarium-side-nav__label {
    font-size: clamp(0.72rem, 3.2vw, 0.82rem);
    white-space: normal;
    text-align: right;
    line-height: 1.2;
    max-width: 100%;
    padding: 0.25rem 0;
    min-height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
  }

  .chimaerarium-grid__item {
    overflow: hidden;
  }

  .chimaerarium-grid__item img {
    max-width: 100%;
  }

  body.chimaerarium-page {
    overflow-x: clip;
  }

  .chimaerarium-footer {
    position: static;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.65rem 0.95rem;
    padding: 0 12.384px 1.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .chimaerarium-footer__link {
    font-size: clamp(0.75rem, 3.4vw, 0.875rem);
    padding: 0.35rem 0;
    min-height: 2.5rem;
    display: inline-flex;
    align-items: center;
  }

  .chimaerarium-footer__link:first-child {
    margin-right: 0;
    flex-basis: 100%;
  }

  .chimaerarium-layout {
    padding-left: 12.384px;
    padding-right: 12.384px;
  }
}

@media (max-width: 480px) {
  .chimaerarium-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    --grid-gap: 0.4rem;
  }
}
