@font-face {
  font-family: InterVariable;
  src: url("fonts/InterVariable.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --ink: #11100d;
  --shadow-rest: 0 8px 24px rgba(17, 16, 13, 0.08), 0 1px 3px rgba(17, 16, 13, 0.04);
  --shadow-hover: 0 16px 34px rgba(17, 16, 13, 0.12), 0 4px 12px rgba(17, 16, 13, 0.06);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  font-family: InterVariable, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

.spaces-index {
  width: 100%;
  min-height: 100svh;
  margin: 0;
  padding: 20px 18px;
  display: grid;
  place-items: center;
}

.spaces-grid {
  width: min(1200px, calc(100vw - 36px));
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.space-card {
  position: relative;
  display: block;
  height: clamp(230px, 38vh, 440px);
  border-radius: 14px;
  overflow: hidden;
  border: 0;
  text-decoration: none;
  box-shadow: var(--shadow-rest);
  transform: translateY(0) scale(1);
  transition: transform 360ms var(--ease), box-shadow 360ms var(--ease);
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .space-card,
  .space-card-media img {
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
}

.space-card:hover,
.space-card:focus-visible {
  transform: translateY(-2px) scale(1.006);
  box-shadow: var(--shadow-hover);
  outline: none;
}

.space-card.is-placeholder {
  cursor: default;
}

.space-card.is-placeholder:hover,
.space-card.is-placeholder:focus-visible {
  transform: none;
  box-shadow: var(--shadow-rest);
}

.space-card-media,
.space-card-media img {
  width: 100%;
  height: 100%;
}

.space-card-media {
  background: #ffffff;
}

.space-card-media img {
  object-fit: cover;
}

.space-card-label {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  margin: 0;
  color: #11100d;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: 0;
  text-shadow: 0 1px 10px rgba(255, 255, 255, 0.28);
}

.space-card-media.is-object-preview {
  position: relative;
  padding: 12px;
  background: #ffffff;
}

.space-preview-frame {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  justify-items: center;
  padding: 12px 12px 28px;
  border-radius: 10px;
}

.space-card-media.is-object-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 22%, rgba(255, 255, 255, 0.36), transparent 42%),
    radial-gradient(circle at 74% 74%, rgba(255, 255, 255, 0.24), transparent 40%);
}

.space-float-item {
  position: relative;
  width: min(100%, 78px);
  max-width: 78px;
  max-height: 78px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 7px 12px rgba(16, 14, 10, 0.13));
  animation: drift 6.8s ease-in-out infinite;
  will-change: transform;
  z-index: 1;
}

.float-1 {
  grid-column: 1;
  grid-row: 1;
  animation-delay: -1.2s;
}

.float-2 {
  grid-column: 2;
  grid-row: 1;
  animation-delay: -2.4s;
}

.float-3 {
  grid-column: 3;
  grid-row: 1;
  animation-delay: -0.4s;
}

.float-4 {
  grid-column: 4;
  grid-row: 1;
  animation-delay: -3.2s;
}

.float-5 {
  grid-column: 1;
  grid-row: 2;
  animation-delay: -4.8s;
}

.float-6 {
  grid-column: 2;
  grid-row: 2;
  animation-delay: -1.9s;
}

.float-7 {
  grid-column: 3;
  grid-row: 2;
  animation-delay: -2.8s;
}

.float-8 {
  grid-column: 4;
  grid-row: 2;
  animation-delay: -0.7s;
}

.float-9 {
  grid-column: 1;
  grid-row: 3;
  animation-delay: -3.7s;
}

.float-10 {
  grid-column: 2;
  grid-row: 3;
  animation-delay: -1.1s;
}

.float-11 {
  grid-column: 3;
  grid-row: 3;
  animation-delay: -2.1s;
}

.float-12 {
  grid-column: 4;
  grid-row: 3;
  animation-delay: -4.1s;
}

@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0) rotate(-1deg);
  }
  50% {
    transform: translate3d(0, -4px, 0) rotate(1deg);
  }
  100% {
    transform: translate3d(0, 0, 0) rotate(-1deg);
  }
}

@media (max-width: 800px) {
  .spaces-index {
    padding: 12px;
    place-items: center;
  }

  .spaces-grid {
    width: min(680px, calc(100vw - 24px));
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 20px;
  }

  .space-card {
    height: min(32svh, 320px);
    border-radius: 12px;
  }
}
