:root {
  color-scheme: dark;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: #1d1e1d;
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.bento-container {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 24px;
  width: min(980px, 90vw);
  align-items: start;
  animation: pop-in 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.left-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.right-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  gap: 24px;
}

.bento-item {
  border-radius: 24px;
  overflow: hidden;
}

.bento-item img {
  width: 100%;
  height: auto;
  display: block;
}

.bento-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.section-four-trigger {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.right-grid .bento-item,
.right-grid .bento-link,
.right-grid img {
  height: 100%;
}

.right-grid img {
  object-fit: cover;
}

.section-two {
  height: auto;
}

.section-two img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.section-five img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hover-card {
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.hover-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.hover-card img {
  transition: transform 180ms ease;
}

.hover-card:hover img {
  transform: scale(1.02);
}

.section-one {
  grid-column: 1 / -1;
}

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

.downloads-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.downloads-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
}

.downloads-modal-panel {
  position: relative;
  z-index: 1;
  width: min(440px, calc(100vw - 2rem));
  margin: 10vh auto 0;
  border-radius: 16px;
  background: #242524;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1rem;
}

.downloads-modal-panel h2 {
  margin: 0 0 0.9rem;
  font-size: 1.1rem;
  color: #f6f7f6;
}

.downloads-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.downloads-actions a,
.downloads-disabled,
.downloads-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #2e302e;
  color: #f6f7f6;
  text-decoration: none;
  padding: 0.7rem 0.85rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.downloads-actions a:hover,
.downloads-close:hover {
  background: #383a38;
}

.downloads-disabled {
  background: #3f4140;
  color: #b7bbb7;
  border-color: rgba(255, 255, 255, 0.08);
  cursor: not-allowed;
}

.downloads-close {
  width: 100%;
  margin-top: 0.85rem;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 768px) {
  .bento-container {
    grid-template-columns: 1fr;
  }

  .left-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .section-one {
    grid-column: auto;
  }

  .section-two,
  .section-four {
    display: none;
  }

  .right-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: auto;
  }

  .right-grid .bento-item,
  .right-grid .bento-link,
  .right-grid img {
    height: auto;
  }

  .right-grid img {
    object-fit: contain;
  }

  .section-five img {
    width: 100%;
    height: auto;
  }
}
