* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(120deg, #030b25 0%, #0b3d91 60%, #02163c 100%);
  color: #0b1f4d;
  min-height: 100vh;
  padding: 40px 20px;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 18px 48px rgba(4, 11, 34, 0.35);
  overflow: hidden;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 24px 20px;
  background: linear-gradient(135deg, rgba(11, 61, 145, 0.08), rgba(252, 61, 33, 0.08));
  --heading-size: clamp(2rem, 2.8vw, 2.6rem);
}

h1 {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: var(--heading-size);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #0b3d91;
}

.logo {
  width: 140px;
  max-width: 35vw;
  height: auto;
}

.logo-worm {
  margin-right: 15px;
}

.logo-meatball {
  width: auto;
  height: calc(var(--heading-size) * 0.75);
  max-width: none;
  margin-left: 15px;
}

.filters {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  justify-content: center;
  margin: 24px 24px 24px;
}

button {
  font-family: inherit;
  font-weight: 600;
  color: #ffffff;
  padding: 14px 20px;
  border: none;
  border-radius: 999px;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #0b3d91, #0f5bd3);
  box-shadow: 0 12px 24px rgba(11, 61, 145, 0.4);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(11, 61, 145, 0.45);
  background: linear-gradient(135deg, #0f5bd3, #0b3d91);
}

button:focus-visible {
  outline: 3px solid #fc3d21;
  outline-offset: 4px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  box-shadow: none;
}

@media (min-width: 700px) {
  .filters {
    flex-direction: row;
    align-items: center;
  }
}

.space-fact {
  margin: 0 24px 16px;
  padding: 18px 24px;
  background: linear-gradient(135deg, rgba(11, 61, 145, 0.12), rgba(252, 61, 33, 0.12));
  border-left: 6px solid #fc3d21;
  border-radius: 14px;
}

.space-fact__heading {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0b3d91;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.space-fact__text {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #13214a;
}

.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 0 24px 36px;
  justify-content: center;
}

.gallery-item {
  flex: 1 1 100%;
  min-width: 280px;
  max-width: 360px;
  background: #f7f9ff;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(7, 21, 61, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.gallery-item:hover,
.gallery-item:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 18px 36px rgba(7, 21, 61, 0.24);
}

.gallery-item:focus-visible {
  outline: 4px solid #fc3d21;
  outline-offset: 4px;
}

.gallery-media {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(11, 61, 145, 0.08);
  aspect-ratio: 16 / 9;
  background: #040b29;
}

.gallery-media img,
.gallery-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery-item:hover .gallery-media img,
.gallery-item:hover .gallery-media video,
.gallery-item:focus-within .gallery-media img,
.gallery-item:focus-within .gallery-media video {
  transform: scale(1.3);
}

.gallery-media.is-video {
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  background: rgba(11, 61, 145, 0.18);
  color: #0b3d91;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.video-icon {
  font-size: 2rem;
  line-height: 1;
}

.media-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: #fc3d21;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  box-shadow: 0 6px 12px rgba(252, 61, 33, 0.35);
}

.gallery-details {
  padding: 18px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gallery-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0b1f4d;
  line-height: 1.4;
}

.gallery-date {
  font-size: 0.9rem;
  font-weight: 500;
  color: #4f5e85;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (min-width: 1024px) {
  .gallery-item {
    flex: 0 1 calc(33.333% - 24px);
  }
}

.loader-message,
.empty-message,
.error-message {
  flex: 1 1 100%;
  padding: 60px 24px;
  text-align: center;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, rgba(11, 61, 145, 0.9), rgba(15, 91, 211, 0.9));
  color: #ffffff;
  box-shadow: 0 12px 28px rgba(11, 61, 145, 0.3);
}

.empty-message {
  background: linear-gradient(135deg, rgba(4, 17, 54, 0.9), rgba(10, 40, 118, 0.9));
}

.error-message {
  background: linear-gradient(135deg, rgba(252, 61, 33, 0.9), rgba(188, 18, 12, 0.9));
  box-shadow: 0 18px 36px rgba(252, 61, 33, 0.25);
}

.placeholder {
  flex: 1 1 100%;
  text-align: center;
  padding: 60px 20px;
  color: #445483;
}

.placeholder-icon {
  font-size: 50px;
  margin-bottom: 20px;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1000;
}

.modal.open {
  opacity: 1;
  visibility: visible;
}

.modal.hidden {
  pointer-events: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 10, 37, 0.75);
}

.modal-window {
  position: relative;
  background: #ffffff;
  border-radius: 18px;
  max-width: 960px;
  width: min(960px, 94vw);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 60px rgba(2, 10, 38, 0.5);
  z-index: 1;
}

.modal-media {
  background: #000814;
}

.modal-media img,
.modal-media iframe,
.modal-media video {
  width: 100%;
  display: block;
  border: 0;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.modal-info {
  padding: 28px 32px 36px;
  color: #15224c;
}

.modal-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #0b3d91;
  margin-bottom: 8px;
}

.modal-date {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #445483;
  margin-bottom: 16px;
}

.modal-text {
  font-size: 1rem;
  line-height: 1.7;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  color: #ffffff;
  background: #fc3d21;
  font-size: 1.6rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(252, 61, 33, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-close:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(252, 61, 33, 0.4);
}

.modal-close:focus-visible {
  outline: 3px solid #0b3d91;
  outline-offset: 4px;
}

.modal-link-wrapper {
  padding: 24px;
  text-align: center;
}

.modal-link-wrapper a {
  color: #0b3d91;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid rgba(11, 61, 145, 0.4);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.modal-link-wrapper a:hover {
  color: #fc3d21;
  border-color: rgba(252, 61, 33, 0.6);
}

body.modal-open {
  overflow: hidden;
}
