/* Home only */

html, body { width: 100%; }

.page {
  position: fixed; inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.page-home .nav {
  opacity: 0;
  animation: fadeDown .8s var(--expo) .05s forwards;
}

.scene {
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1400px;
  perspective-origin: 50% 50%;
  overflow: visible;
  touch-action: none;
  opacity: 0;
  animation: fadeIn .9s var(--expo) .3s forwards;
}

.carousel-wrap {
  position: relative;
  width: 0; height: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

.card {
  position: absolute;
  overflow: hidden;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 1px solid var(--divider-strong);
  padding: 0.5rem;
  background: var(--bg);
}
[data-theme="dark"] .card:hover,
[data-theme="dark"] .card.active {
  border-color: rgba(255, 255, 255, 0.12);
}

.card-link-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
}
.card-bg img,
.card-bg video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  user-select: none;
  pointer-events: none;
  image-rendering: -webkit-optimize-contrast;
  transform: translateZ(0);
}
.card-bg { position: absolute; inset: 0.5rem; }

.card[data-client="YCharts"] .card-bg img,
.card[data-client="Well"] .card-bg img {
  object-fit: contain;
  background: var(--card);
  padding: 1.5rem;
  box-sizing: border-box;
}

.card-bg--stack {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.75rem;
  background: var(--card);
  box-sizing: border-box;
}
.card-bg--stack img {
  position: relative;
  inset: auto;
  flex: 1 1 0;
  width: 0;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.card-bg--duo {
  display: flex;
  padding: 0.75rem;
  gap: 8px;
  background: var(--card);
  box-sizing: border-box;
}
.card-bg--duo video {
  position: relative;
  inset: auto;
  flex: 1 1 0;
  width: 0;
  height: 100%;
  object-fit: contain;
  background: var(--card);
}

.page-home .footer {
  border-top: 1px solid var(--divider-strong);
  opacity: 0;
  animation: fadeUp .8s var(--expo) .6s forwards;
}

@media (max-width: 768px) {
  .page-home .nav { display: none; }
  .page-home .footer { display: none; }
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: .3; }
}

@media (prefers-reduced-motion: reduce) {
  .page-home * { animation: none !important; transition: none !important; }
  .page-home .nav, .page-home .scene, .page-home .footer { opacity: 1 !important; }
}
