/* Devvnex - page skeleton screens */
html.is-skel {
  overflow: hidden;
}
html.is-skel .page-wrapper {
  opacity: 0;
  visibility: hidden;
  /* failsafe if JS blocked */
  animation: vx-skel-fallback 0s 4.2s forwards;
}
@keyframes vx-skel-fallback {
  to {
    opacity: 1;
    visibility: visible;
  }
}
html.is-skel-done .page-wrapper {
  opacity: 1;
  visibility: visible;
  animation: none;
  transition: opacity 0.4s var(--ease-out, ease), visibility 0s;
}

.vx-skel {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.35s ease, visibility 0.35s;
}
html.is-skel-done .vx-skel {
  opacity: 0;
  visibility: hidden;
}
.vx-skel[hidden] {
  display: none !important;
}

.vx-skel__bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 2;
  animation: vx-skel-bar 1.1s var(--ease-out, ease) forwards;
}

.vx-skel__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(100% - 48px, var(--max-w-wide, 1440px));
  margin: 0 auto;
  padding: 22px 0;
}
.vx-skel__logo {
  width: min(180px, 42vw);
  height: 36px;
  border-radius: 2px;
}
.vx-skel__nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.vx-skel__pill {
  width: 64px;
  height: 12px;
  border-radius: 2px;
}
.vx-skel__sq {
  width: 40px;
  height: 40px;
  border-radius: 2px;
}
.vx-skel__cta {
  width: 88px;
  height: 14px;
  border-radius: 2px;
}

.vx-skel__body {
  flex: 1;
  width: min(100% - 48px, var(--max-w-wide, 1440px));
  margin: 0 auto;
  padding: clamp(40px, 8vh, 96px) 0 48px;
  display: grid;
  gap: 28px;
  align-content: start;
}

.vx-skel__eyebrow {
  width: 120px;
  height: 10px;
}
.vx-skel__title {
  width: min(520px, 88%);
  height: clamp(36px, 6vw, 56px);
}
.vx-skel__title--sm {
  width: min(360px, 70%);
  height: clamp(28px, 4.5vw, 44px);
}
.vx-skel__text {
  width: min(420px, 80%);
  height: 14px;
  margin-top: 4px;
}
.vx-skel__text--short {
  width: min(280px, 55%);
}

.vx-skel__actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.vx-skel__btn {
  width: 140px;
  height: 44px;
  border-radius: 2px;
}
.vx-skel__btn--ghost {
  width: 110px;
  opacity: 0.7;
}

.vx-skel__media {
  width: min(100%, 720px);
  aspect-ratio: 16 / 10;
  margin-top: 12px;
  border-radius: 2px;
}

.vx-skel__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}
.vx-skel__card {
  aspect-ratio: 4 / 5;
  border-radius: 2px;
}
.vx-skel__card--wide {
  grid-column: span 2;
  aspect-ratio: 16 / 9;
}

.vx-skel__rows {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}
.vx-skel__row {
  height: 72px;
  border-radius: 2px;
}

/* shimmer bone */
.vx-skel__bone {
  display: block;
  background: color-mix(in srgb, var(--bg-elevated) 88%, var(--text-muted));
  background-image: linear-gradient(
    105deg,
    transparent 32%,
    color-mix(in srgb, var(--accent) 14%, transparent) 48%,
    transparent 64%
  );
  background-size: 220% 100%;
  animation: vx-skel-shimmer 1.35s ease-in-out infinite;
  border: 1px solid var(--border);
}

@keyframes vx-skel-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@keyframes vx-skel-bar {
  0% { width: 0; }
  70% { width: 78%; }
  100% { width: 100%; }
}

@media (max-width: 768px) {
  .vx-skel__nav {
    width: min(100% - 32px, var(--max-w-wide, 1440px));
    padding: 16px 0;
  }
  .vx-skel__nav-right .vx-skel__pill,
  .vx-skel__nav-right .vx-skel__cta { display: none; }
  .vx-skel__body {
    width: min(100% - 32px, var(--max-w-wide, 1440px));
  }
  .vx-skel__grid {
    grid-template-columns: 1fr 1fr;
  }
  .vx-skel__card--wide {
    grid-column: span 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vx-skel__bone,
  .vx-skel__bar { animation: none; }
  .vx-skel__bar { width: 100%; }
  html.is-skel-done .page-wrapper,
  html.is-skel-done .vx-skel { transition: none; }
}
