.side-projects-page {
  margin: 0;
  background: #1f2531;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: Lato, sans-serif;
}

.side-projects-page footer.footer {
  margin-top: auto;
  flex-shrink: 0;
}

.sp-main {
  max-width: none;
  margin: 0 12vw;
  padding: 0 0 120px;
  flex: 1 0 auto;
}

.sp-header {
  margin-bottom: 48px;
  text-align: center;
}

.sp-header h1 {
  margin: 0;
  padding-top: var(--page-content-top-pad, clamp(64px, calc(40px + 5vw), 112px));
  color: #fff;
  font-family: Montserrat, sans-serif;
  font-weight: 600;
  font-size: 32px;
  line-height: 1.2;
  opacity: 0;
  transform: translateY(10px);
  animation: spFadeIn 560ms ease-out 80ms forwards;
}

.sp-header-accent {
  color: #f9de8e;
}

.sp-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 18px;
  line-height: 1.5;
}

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

.sp-tile {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
  opacity: 0;
  transform: translateY(12px);
  animation: spFadeIn 560ms ease-out forwards;
}

.sp-tile:nth-child(1) {
  animation-delay: 180ms;
}

.sp-tile:nth-child(2) {
  animation-delay: 300ms;
}

@keyframes spFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sp-tile-disabled {
  cursor: default;
}

.sp-card {
  border-radius: 16px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sp-tile:not(.sp-tile-disabled):hover .sp-card {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.sp-card-img {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  aspect-ratio: 1010 / 620;
  display: grid;
  place-items: center;
  padding: 12px 16px;
}

.sp-card-text {
  margin-top: auto;
  padding: 14px 22px;
  min-height: 98px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 0 0 13px 13px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}

.sp-card-text h2 {
  margin: 0;
  color: #fff;
  font-family: Lato, sans-serif;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
}

.sp-card-text p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-family: Lato, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.4;
}

/* TriviaHost — purple / pink / yellow */
.sp-card-trivia {
  background: linear-gradient(135deg, #5C2D91 0%, #C84B9A 48%, #F0B429 100%);
}

.sp-card-img-trivia {
  padding: 12px 16px;
}

.sp-trivia-screens {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.sp-trivia-screen {
  position: absolute;
  display: block;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
  object-fit: cover;
  object-position: center top;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sp-trivia-screen-back {
  right: 8%;
  bottom: 10%;
  top: auto;
  width: 54%;
  z-index: 1;
}

.sp-trivia-screen-front {
  left: 8%;
  top: 10%;
  width: 54%;
  z-index: 2;
}

.sp-tile:not(.sp-tile-disabled):hover .sp-trivia-screen-front {
  transform: translate(-3px, -4px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}

.sp-tile:not(.sp-tile-disabled):hover .sp-trivia-screen-back {
  transform: translate(3px, 4px);
}

/* Webgem — blue / yellow */
.sp-card-webgem {
  position: relative;
  background: linear-gradient(135deg, #1A56A6 0%, #4A90E2 50%, #FBBF24 100%);
  overflow: hidden;
}

.sp-card-webgem::after {
  content: "";
  position: absolute;
  inset: -4px;
  background: rgba(0, 0, 0, 0.75);
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
}

.sp-webgem-visual {
  position: relative;
}

.sp-card-webgem .sp-webgem-shot {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  border-radius: 0;
  aspect-ratio: 1010 / 620;
  object-fit: cover;
  object-position: center top;
}

.sp-webgem-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.sp-lock-icon {
  width: 80px;
  height: 96px;
  color: rgba(255, 255, 255, 0.88);
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.4));
}

.sp-card-webgem .sp-card-heading-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}

.sp-card-webgem .sp-card-heading-row h2 {
  margin: 0;
}

.sp-construction {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 209, 116, 0.16);
  border: 1px solid rgba(255, 209, 116, 0.45);
  color: #ffd174;
  font-family: Lato, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.sp-card-webgem .sp-card-text {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding-top: 14px;
}

.sp-card-webgem .sp-card-text h2 {
  color: #fff;
}

.sp-card-webgem .sp-card-text p {
  color: rgba(255, 255, 255, 0.7);
  margin-top: 8px;
}

.sp-tile-disabled .sp-card-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 30, 0.18);
  pointer-events: none;
}

@media screen and (min-width: 1400px) {
  .sp-main {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media screen and (max-width: 991px) {
  .sp-main {
    margin: 0 60px;
    padding-top: 0;
    padding-bottom: 80px;
  }

  .sp-header h1 {
    font-size: 26px;
  }

  .sp-header p {
    font-size: 16px;
  }

  .sp-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .sp-card-text {
    min-height: auto;
    margin-top: auto;
    padding: 14px 14px 10px;
    border-radius: 0 0 13px 13px;
  }

  .sp-card-webgem .sp-card-text {
    margin-top: auto;
    padding: 14px 14px 10px;
  }

  .sp-card-text h2 {
    font-size: 20px;
  }
}

@media screen and (max-width: 600px) {
  .sp-main {
    margin: 0 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sp-header h1,
  .sp-tile {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .sp-card,
  .sp-tile:not(.sp-tile-disabled):hover .sp-card,
  .sp-trivia-screen,
  .sp-tile:not(.sp-tile-disabled):hover .sp-trivia-screen-front,
  .sp-tile:not(.sp-tile-disabled):hover .sp-trivia-screen-back {
    transition: none;
    transform: none;
    box-shadow: none;
  }

  .sp-trivia-screen-back,
  .sp-trivia-screen-front {
    transform: none;
  }
}
