:root {
  --blafa-green: #22c55e;
  --blafa-green-light: #a6f5c2;
  --blafa-green-bright: #53d887;
  --blafa-green-ink: #0c1a12;
}

/* Replace the captured theme's accent gradients while retaining its animated gradient position. */
:where([style*="rgb(208, 178, 255)"][style*="rgb(232, 64, 13)"]) {
  background-image: radial-gradient(80.17% 109.2% at var(--gradient-x, 44.373%) var(--gradient-y, 35.1526%),
    var(--blafa-green-light) 0%, var(--blafa-green-bright) 42.83%, var(--blafa-green) 88.38%) !important;
}

:where([style*="rgb(255, 101, 53)"][style*="rgb(216, 152, 255)"]) {
  background-image: linear-gradient(135deg, var(--blafa-green) 0%,
    var(--blafa-green-bright) 50%, var(--blafa-green-light) 100%) !important;
  color: var(--blafa-green-ink) !important;
}

:where([style*="rgba(216, 152, 255, 0.35)"]) {
  background-image: linear-gradient(90deg, transparent,
    color-mix(in srgb, var(--blafa-green) 35%, transparent), transparent) !important;
}

.parity-banner { display: none !important; }

a[href="/backgrounds"],
a[href^="/backgrounds?"],
a[href="/studio"],
a[href*="//studio.motionsites.ai"],
[data-blafa-external-credit],
[data-blafa-removed] {
  display: none !important;
}

[data-blafa-blocked-navigation] { cursor: default; }

.blafa-card-label, .blafa-detail-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  max-width: calc(100% - 16px);
  padding: 4px 9px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 650;
  line-height: 1.25;
}

.blafa-card-label { position: absolute; z-index: 12; top: 8px; left: 8px; pointer-events: none; }
.blafa-detail-label { margin-inline-start: 7px; }
.blafa-free-label { color: var(--blafa-green-ink); background: var(--blafa-green-light); }
.blafa-locked-label { color: #fff; background: #202020; border: 1px solid #ffffff32; }

@media (max-width: 580px) {
  [data-blafa-free-card] h3 { white-space: normal; overflow-wrap: anywhere; }
}

.blafa-contact-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
  width: 100%;
  margin-block: 20px;
}

.blafa-contact-links a {
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--border, #363636);
  border-radius: 12px;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.blafa-contact-links a:focus-visible { outline: 2px solid var(--blafa-green); outline-offset: 3px; }
.blafa-contact-links a span { opacity: .8; font-size: .875em; }

.prompt-card-hover[data-blafa-animation]:hover,
.prompt-card-hover[data-blafa-card^="landing-"]:hover {
  transform: none;
}

.blafa-animation-frame {
  opacity: 0;
  pointer-events: none;
}

.blafa-animation-frame[data-ready] {
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .blafa-animation-frame[data-ready] { pointer-events: auto; }
}

@supports (transform: scale(calc(100px / 100px))) {
  .prompt-card-hover[data-blafa-animation] > :first-child {
    container-type: inline-size;
  }

  /* Use the thumbnail's capture viewport so fixed-size effects stay the same size on hover. */
  .blafa-animation-frame {
    width: 540px;
    height: 405px;
    transform-origin: top left;
    transform: scale(calc(100cqw / 540px));
  }
}
[data-blafa-packs] button:disabled { cursor: not-allowed; opacity: .65; }

/* Card proportions adapted from the MIT-licensed Libraries.dev Distortion Waves demo.
   License notice: blafa-distortion-waves.js. */
#pack-license {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(380px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow: auto;
  padding: 0;
  color: #fff;
  color-scheme: dark;
  background: #202020;
  border: 0;
  border-radius: 38px;
  font: 400 .875rem/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
}
#pack-license::backdrop { background: rgb(0 0 0 / 65%); }
body:has(#pack-license[open]) { overflow: hidden; }
#pack-license #license-wave {
  position: relative;
  isolation: isolate;
  display: grid;
  overflow: hidden;
  background: #202020;
  border-radius: inherit;
}
#pack-license #license-wave::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgb(235 235 235 / 10%);
  pointer-events: none;
  content: "";
}
#pack-license .pack-license-view {
  grid-area: 1 / 1;
  min-width: 0;
  min-height: 310px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 31px 21px 85px;
  background: #202020;
}
#pack-license .pack-license-heading { display: grid; justify-items: center; gap: 8px; text-align: center; }
#pack-license .pack-license-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: #353535;
  color: #f8f8f8;
}
#pack-license .pack-license-icon-confirmed { background: #244a33; color: #9ce1b3; }
#pack-license h2 { font-size: clamp(1.65rem, 6.5vw, 2rem); line-height: 1.2; font-weight: 600; letter-spacing: -.022em; }
#pack-license .pack-license-heading p { color: #b9b9b9; }
#pack-license [data-close-licence] {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
}
#pack-license [data-close-licence]:hover { background: #272727; }
#pack-license [hidden] { display: none; }
#pack-license #license-status { color: #bebebe; }
#pack-license #license-status:empty { display: none; }
#pack-license #license-status:not(:empty) { margin-top: -12px; }
#pack-license .pack-license-box {
  border: 1px solid rgb(235 235 235 / 10%);
  border-radius: 24px;
  background: #282828;
}
#pack-license label { display: grid; gap: 8px; padding: 11px 14px; color: #b9b9b9; }
#pack-license input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 8px 12px;
  background: #202020;
  color: #fff;
  font-size: 1rem;
  caret-color: var(--blafa-green);
  border: 1px solid #3a3a3a;
  border-radius: 12px;
}
#pack-license dl { padding: 1px 14px; }
#pack-license dl > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
#pack-license dl > div + div { border-top: 1px solid rgb(235 235 235 / 8%); }
#pack-license dt { color: #b9b9b9; }
#pack-license dd { font-weight: 500; text-align: right; }
#pack-license .pack-license-action {
  position: absolute;
  z-index: 2;
  inset: auto 21px 21px;
  transition: transform .28s cubic-bezier(.34, 1, .64, 1);
}
#pack-license .pack-license-action:active { transform: scale(.97); }
#pack-license .primary {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 48px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #f8f8f8;
  color: #0d0d0d;
  font-size: .9375rem;
  font-weight: 500;
  cursor: pointer;
}
#pack-license .primary[hidden] { display: none; }
#pack-license .primary:hover:not(:disabled) { background: #e4e4e4; }
#pack-license .primary:disabled { opacity: .65; cursor: not-allowed; }
#pack-license [data-wave-playing] .primary:disabled { opacity: 1; cursor: wait; }
#pack-license :focus-visible { outline: 2px solid var(--blafa-green); outline-offset: 3px; }
#pack-license .pack-license-feedback { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (min-width: 290px) {
  #pack-license [data-dw-layer="revealed"] h2,
  #pack-license dt { white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  #pack-license .pack-license-action { transition: none; }
  #pack-license .pack-license-action:active { transform: none; }
}
